Commit 47aabbd5 authored by Andreas Tille's avatar Andreas Tille

New upstream version 1.22.3

parent 2cdbfe71
# Adapted from sample .travis.yml for R projects
language: r
bioc_required: true
warnings_are_errors: true
sudo: required
env:
global:
- CRAN: http://cran.rstudio.com
notifications:
email:
on_success: change
on_failure: change
Package: phyloseq Package: phyloseq
Version: 1.20.0 Version: 1.22.3
Date: 2016-12-29 Date: 2017-11-04
Title: Handling and analysis of high-throughput microbiome census data Title: Handling and analysis of high-throughput microbiome census data
Description: phyloseq provides a set of classes and tools Description: phyloseq provides a set of classes and tools
to facilitate the import, storage, analysis, and to facilitate the import, storage, analysis, and
...@@ -10,16 +10,16 @@ Author: Paul J. McMurdie <joey711@gmail.com>, ...@@ -10,16 +10,16 @@ Author: Paul J. McMurdie <joey711@gmail.com>,
Susan Holmes <susan@stat.stanford.edu>, with Susan Holmes <susan@stat.stanford.edu>, with
contributions from Gregory Jordan and Scott Chamberlain contributions from Gregory Jordan and Scott Chamberlain
License: AGPL-3 License: AGPL-3
Imports: BiocGenerics (>= 0.18.0), ade4 (>= 1.7.4), ape (>= 3.4), Imports: ade4 (>= 1.7.4), ape (>= 5.0), Biobase (>= 2.36.2),
biomformat (>= 1.0.0), Biostrings (>= 2.40.0), cluster (>= BiocGenerics (>= 0.22.0), biomformat (>= 1.0.0), Biostrings (>=
2.0.4), data.table (>= 1.9.6), foreach (>= 1.4.3), ggplot2 (>= 2.40.0), cluster (>= 2.0.4), data.table (>= 1.10.4), foreach
2.1.0), igraph (>= 1.0.1), methods (>= 3.3.0), multtest (>= (>= 1.4.3), ggplot2 (>= 2.1.0), igraph (>= 1.0.1), methods (>=
2.28.0), plyr (>= 1.8.3), reshape2 (>= 1.4.1), scales (>= 3.3.0), multtest (>= 2.28.0), plyr (>= 1.8.3), reshape2 (>=
0.4.0), vegan (>= 2.3.5), Biobase 1.4.1), scales (>= 0.4.0), vegan (>= 2.4)
Depends: R (>= 3.3.0) Depends: R (>= 3.4.0)
Suggests: BiocStyle (>= 2.0.0), DESeq2 (>= 1.12.0), genefilter (>= Suggests: BiocStyle (>= 2.4), DESeq2 (>= 1.16.1), genefilter (>= 1.58),
1.54), testthat (>= 1.0.2), knitr (>= 1.13), metagenomeSeq (>= knitr (>= 1.16), metagenomeSeq (>= 1.14), rmarkdown (>= 1.6),
1.14), rmarkdown (>= 0.9.6) testthat (>= 1.0.2)
VignetteBuilder: knitr VignetteBuilder: knitr
Enhances: doParallel (>= 1.0.10) Enhances: doParallel (>= 1.0.10)
biocViews: Sequencing, Microbiome, Metagenomics, Clustering, biocViews: Sequencing, Microbiome, Metagenomics, Clustering,
...@@ -36,6 +36,6 @@ Collate: 'allClasses.R' 'allPackage.R' 'allData.R' 'as-methods.R' ...@@ -36,6 +36,6 @@ Collate: 'allClasses.R' 'allPackage.R' 'allData.R' 'as-methods.R'
'network-methods.R' 'distance-methods.R' 'network-methods.R' 'distance-methods.R'
'deprecated_functions.R' 'extend_DESeq2.R' 'phylo-class.R' 'deprecated_functions.R' 'extend_DESeq2.R' 'phylo-class.R'
'extend_metagenomeSeq.R' 'extend_metagenomeSeq.R'
RoxygenNote: 5.0.1 RoxygenNote: 6.0.1
NeedsCompilation: no NeedsCompilation: no
Packaged: 2017-04-24 23:14:31 UTC; biocbuild Packaged: 2017-11-06 00:01:50 UTC; biocbuild
...@@ -177,6 +177,8 @@ importFrom(ape,drop.tip) ...@@ -177,6 +177,8 @@ importFrom(ape,drop.tip)
importFrom(ape,is.rooted) importFrom(ape,is.rooted)
importFrom(ape,ladderize) importFrom(ape,ladderize)
importFrom(ape,node.depth) importFrom(ape,node.depth)
importFrom(ape,node.depth.edgelength)
importFrom(ape,node.height)
importFrom(ape,pcoa) importFrom(ape,pcoa)
importFrom(ape,prop.part) importFrom(ape,prop.part)
importFrom(ape,read.nexus) importFrom(ape,read.nexus)
......
...@@ -559,6 +559,7 @@ setMethod("UniFrac", "phyloseq", function(physeq, weighted=FALSE, normalized=TRU ...@@ -559,6 +559,7 @@ setMethod("UniFrac", "phyloseq", function(physeq, weighted=FALSE, normalized=TRU
#' @importFrom ape prop.part #' @importFrom ape prop.part
#' @importFrom ape reorder.phylo #' @importFrom ape reorder.phylo
#' @importFrom ape node.depth #' @importFrom ape node.depth
#' @importFrom ape node.depth.edgelength
#' @keywords internal #' @keywords internal
#' @import foreach #' @import foreach
fastUniFrac <- function(physeq, weighted=FALSE, normalized=TRUE, parallel=FALSE){ fastUniFrac <- function(physeq, weighted=FALSE, normalized=TRUE, parallel=FALSE){
...@@ -631,11 +632,7 @@ fastUniFrac <- function(physeq, weighted=FALSE, normalized=TRUE, parallel=FALSE) ...@@ -631,11 +632,7 @@ fastUniFrac <- function(physeq, weighted=FALSE, normalized=TRUE, parallel=FALSE)
z = reorder.phylo(tree, order="postorder") z = reorder.phylo(tree, order="postorder")
# Call phyloseq-internal function that in-turn calls ape's internal # Call phyloseq-internal function that in-turn calls ape's internal
# horizontal position function, in C, using the re-ordered phylo object, `z` # horizontal position function, in C, using the re-ordered phylo object, `z`
tipAges = ape_node_depth_edge_length(Ntip = length(tree$tip.label), tipAges = node.depth.edgelength(tree)
Nnode = tree$Nnode,
edge = z$edge,
Nedge = nrow(tree$edge)[1],
edge.length = z$edge.length)
# Keep only the tips, and add the tip labels in case `z` order differs from `tree` # Keep only the tips, and add the tip labels in case `z` order differs from `tree`
tipAges <- tipAges[1:length(tree$tip.label)] tipAges <- tipAges[1:length(tree$tip.label)]
names(tipAges) <- z$tip.label names(tipAges) <- z$tip.label
......
...@@ -15,12 +15,3 @@ setMethod("fix_phylo", "phylo", function(tree){ ...@@ -15,12 +15,3 @@ setMethod("fix_phylo", "phylo", function(tree){
return(tree) return(tree)
}) })
################################################################################ ################################################################################
# Define horizontal position / node-ages by depth to root
# For instance, `xx` in `plot_tree` and `tipAges` in `fastUniFrac`
#' @keywords internal
ape_node_depth_edge_length <- function(Ntip, Nnode, edge, Nedge, edge.length){
.C(ape:::node_depth_edgelength, PACKAGE="ape", as.integer(Ntip),
as.integer(Nnode), as.integer(edge[, 1]),
as.integer(edge[, 2]), as.integer(Nedge),
as.double(edge.length), double(Ntip + Nnode))[[7]]
}
\ No newline at end of file
...@@ -1130,7 +1130,7 @@ plot_ordination = function(physeq, ordination, type="samples", axes=1:2, ...@@ -1130,7 +1130,7 @@ plot_ordination = function(physeq, ordination, type="samples", axes=1:2,
} }
# Add text labels to points # Add text labels to points
if( !is.null(label) ){ if( !is.null(label) ){
label_map <- aes_string(x=x, y=y, label=label, na.rm=TRUE) label_map <- aes_string(x=x, y=y, label=label)
p = p + geom_text(label_map, data=rm.na.phyloseq(DF, label), p = p + geom_text(label_map, data=rm.na.phyloseq(DF, label),
size=2, vjust=1.5, na.rm=TRUE) size=2, vjust=1.5, na.rm=TRUE)
} }
...@@ -1695,6 +1695,8 @@ plot_bar = function(physeq, x="Sample", y="Abundance", fill=NULL, ...@@ -1695,6 +1695,8 @@ plot_bar = function(physeq, x="Sample", y="Abundance", fill=NULL,
#' #'
#' @importFrom ape ladderize #' @importFrom ape ladderize
#' @importFrom ape reorder.phylo #' @importFrom ape reorder.phylo
#' @importFrom ape node.depth.edgelength
#' @importFrom ape node.height
#' #'
#' @importFrom data.table data.table #' @importFrom data.table data.table
#' @importFrom data.table setkey #' @importFrom data.table setkey
...@@ -1740,29 +1742,13 @@ tree_layout = function(phy, ladderize=FALSE){ ...@@ -1740,29 +1742,13 @@ tree_layout = function(phy, ladderize=FALSE){
# Descending order of left-hand side of edge (the ancestor to the node) # Descending order of left-hand side of edge (the ancestor to the node)
z = reorder.phylo(phy, order="postorder") z = reorder.phylo(phy, order="postorder")
# Initialize some characteristics of the tree. # Initialize some characteristics of the tree.
Nedge = nrow(phy$edge)[1]
Nnode = phy$Nnode
Ntip = length(phy$tip.label) Ntip = length(phy$tip.label)
ROOT = Ntip + 1 ROOT = Ntip + 1
TIPS = phy$edge[(phy$edge[, 2] <= Ntip), 2]
NODES = (ROOT):(Ntip + Nnode)
nodelabels = phy$node.label nodelabels = phy$node.label
# Call phyloseq-internal function that in-turn calls ape's internal # Horizontal positions
# horizontal position function, in C, using the re-ordered phylo object. xx = node.depth.edgelength(phy)
xx = ape_node_depth_edge_length(Ntip, Nnode, z$edge, Nedge, z$edge.length) # vertical positions
# Initialize `yy`, before passing to ape internal function in C. yy = node.height(phy = phy, clado.style = FALSE)
yy <- numeric(Ntip + Nnode)
yy[TIPS] <- 1:Ntip
# Define the ape_node_height wrapping function
ape_node_height <- function(Ntip, Nnode, edge, Nedge, yy){
.C(ape:::node_height, PACKAGE="ape",
as.integer(Ntip), as.integer(Nnode),
as.integer(edge[, 1]), as.integer(edge[, 2]),
as.integer(Nedge), as.double(yy))[[6]]
}
# The call in ape
#yy <- .nodeHeight(Ntip, Nnode, z$edge, Nedge, yy)
yy <- ape_node_height(Ntip, Nnode, z$edge, Nedge, yy)
# Initialize an edge data.table # Initialize an edge data.table
# Don't set key, order matters # Don't set key, order matters
edgeDT = data.table(phy$edge, edge.length=phy$edge.length, OTU=NA_character_) edgeDT = data.table(phy$edge, edge.length=phy$edge.length, OTU=NA_character_)
......
No preview for this file type
## ---- warning=FALSE, message=FALSE--------------------------------------- ## ---- warning=FALSE, message=FALSE-----------------------------------------
library("phyloseq"); packageVersion("phyloseq") library("phyloseq"); packageVersion("phyloseq")
library("ggplot2"); packageVersion("ggplot2") library("ggplot2"); packageVersion("ggplot2")
theme_set(theme_bw()) theme_set(theme_bw())
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data(esophagus) data(esophagus)
plot_tree(esophagus) plot_tree(esophagus)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
p1 = plot_tree(esophagus, color = "Sample") p1 = plot_tree(esophagus, color = "Sample")
p1 p1
p1 + p1 +
...@@ -16,7 +16,7 @@ p1 + ...@@ -16,7 +16,7 @@ p1 +
color = "orange", color = "orange",
label = "my annotation") label = "my annotation")
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data("esophagus") data("esophagus")
mdf = psmelt(esophagus) mdf = psmelt(esophagus)
# Simple bar plot. See plot_bar() for more. # Simple bar plot. See plot_bar() for more.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# vignette("phyloseq_analysis") # vignette("phyloseq_analysis")
## ----load-packages, message=FALSE, warning=FALSE------------------------- ## ----load-packages, message=FALSE, warning=FALSE---------------------------
library("phyloseq") library("phyloseq")
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# myOTU1 <- import_RDP_cluster("path/to/my/filename.clust") # myOTU1 <- import_RDP_cluster("path/to/my/filename.clust")
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# data(GlobalPatterns) # data(GlobalPatterns)
# data(esophagus) # data(esophagus)
# data(enterotype) # data(enterotype)
# data(soilrep) # data(soilrep)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data(GlobalPatterns) data(GlobalPatterns)
GlobalPatterns GlobalPatterns
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# otu1 <- otu_table(raw_abundance_matrix, taxa_are_rows=FALSE) # otu1 <- otu_table(raw_abundance_matrix, taxa_are_rows=FALSE)
# sam1 <- sample_data(raw_sample_data.frame) # sam1 <- sample_data(raw_sample_data.frame)
# tax1 <- tax_table(raw_taxonomy_matrix) # tax1 <- tax_table(raw_taxonomy_matrix)
# tre1 <- read_tree(my_tree_file) # tre1 <- read_tree(my_tree_file)
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# ex1b <- phyloseq(my_otu_table, my_sample_data, my_taxonomyTable, my_tree) # ex1b <- phyloseq(my_otu_table, my_sample_data, my_taxonomyTable, my_tree)
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# ex1c <- phyloseq(my_otu_table, my_sample_data) # ex1c <- phyloseq(my_otu_table, my_sample_data)
## ----echo=FALSE---------------------------------------------------------- ## ----echo=FALSE------------------------------------------------------------
topN <- 20 topN <- 20
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data(GlobalPatterns) data(GlobalPatterns)
most_abundant_taxa <- sort(taxa_sums(GlobalPatterns), TRUE)[1:topN] most_abundant_taxa <- sort(taxa_sums(GlobalPatterns), TRUE)[1:topN]
ex2 <- prune_taxa(names(most_abundant_taxa), GlobalPatterns) ex2 <- prune_taxa(names(most_abundant_taxa), GlobalPatterns)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
topFamilies <- tax_table(ex2)[, "Family"] topFamilies <- tax_table(ex2)[, "Family"]
as(topFamilies, "vector") as(topFamilies, "vector")
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# testOTU <- otu_table(matrix(sample(1:50, 25, replace=TRUE), 5, 5), taxa_are_rows=FALSE) # testOTU <- otu_table(matrix(sample(1:50, 25, replace=TRUE), 5, 5), taxa_are_rows=FALSE)
# f1<- filterfun_sample(topk(2)) # f1<- filterfun_sample(topk(2))
# wh1 <- genefilter_sample(testOTU, f1, A=2) # wh1 <- genefilter_sample(testOTU, f1, A=2)
...@@ -49,24 +49,24 @@ as(topFamilies, "vector") ...@@ -49,24 +49,24 @@ as(topFamilies, "vector")
# prune_taxa(wh1, testOTU) # prune_taxa(wh1, testOTU)
# prune_taxa(wh2, testOTU) # prune_taxa(wh2, testOTU)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data(GlobalPatterns) data(GlobalPatterns)
f1<- filterfun_sample(topp(0.1)) f1<- filterfun_sample(topp(0.1))
wh1 <- genefilter_sample(GlobalPatterns, f1, A=(1/2*nsamples(GlobalPatterns))) wh1 <- genefilter_sample(GlobalPatterns, f1, A=(1/2*nsamples(GlobalPatterns)))
sum(wh1) sum(wh1)
ex2 <- prune_taxa(wh1, GlobalPatterns) ex2 <- prune_taxa(wh1, GlobalPatterns)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
print(ex2) print(ex2)
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# data(GlobalPatterns) # data(GlobalPatterns)
# f1<- filterfun_sample(topf(0.9)) # f1<- filterfun_sample(topf(0.9))
# wh1 <- genefilter_sample(GlobalPatterns, f1, A=(1/3*nsamples(GlobalPatterns))) # wh1 <- genefilter_sample(GlobalPatterns, f1, A=(1/3*nsamples(GlobalPatterns)))
# sum(wh1) # sum(wh1)
# prune_taxa(wh1, GlobalPatterns) # prune_taxa(wh1, GlobalPatterns)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
data("enterotype") data("enterotype")
library("genefilter") library("genefilter")
flist<- filterfun(kOverA(5, 2e-05)) flist<- filterfun(kOverA(5, 2e-05))
...@@ -76,35 +76,35 @@ identical(ent.trim, prune_taxa(ent.logi, enterotype)) ...@@ -76,35 +76,35 @@ identical(ent.trim, prune_taxa(ent.logi, enterotype))
identical(sum(ent.logi), ntaxa(ent.trim)) identical(sum(ent.logi), ntaxa(ent.trim))
filter_taxa(enterotype, flist, TRUE) filter_taxa(enterotype, flist, TRUE)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
ex3 <- subset_samples(GlobalPatterns, SampleType%in%c("Freshwater", "Ocean", "Freshwater (creek)")) ex3 <- subset_samples(GlobalPatterns, SampleType%in%c("Freshwater", "Ocean", "Freshwater (creek)"))
ex3 ex3
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
subset(sample_data(GlobalPatterns), SampleType%in%c("Freshwater", "Ocean", "Freshwater (creek)")) subset(sample_data(GlobalPatterns), SampleType%in%c("Freshwater", "Ocean", "Freshwater (creek)"))
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
ex4 <- subset_taxa(GlobalPatterns, Phylum=="Firmicutes") ex4 <- subset_taxa(GlobalPatterns, Phylum=="Firmicutes")
ex4 ex4
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
randomSpecies100 <- sample(taxa_names(GlobalPatterns), 100, replace=FALSE) randomSpecies100 <- sample(taxa_names(GlobalPatterns), 100, replace=FALSE)
ex5 <- prune_taxa(randomSpecies100, GlobalPatterns) ex5 <- prune_taxa(randomSpecies100, GlobalPatterns)
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# data(GlobalPatterns) # data(GlobalPatterns)
# ex2 <- transform_sample_counts(GlobalPatterns, I) # ex2 <- transform_sample_counts(GlobalPatterns, I)
## ------------------------------------------------------------------------ ## --------------------------------------------------------------------------
ex4<- transform_sample_counts(GlobalPatterns, threshrankfun(500)) ex4<- transform_sample_counts(GlobalPatterns, threshrankfun(500))
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# ex6 <- tax_glom(GlobalPatterns, taxlevel="Genus") # ex6 <- tax_glom(GlobalPatterns, taxlevel="Genus")
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# ex7 <- tip_glom(GlobalPatterns, speciationMinLength = 0.05) # ex7 <- tip_glom(GlobalPatterns, speciationMinLength = 0.05)
## ---- eval=FALSE--------------------------------------------------------- ## ---- eval=FALSE-----------------------------------------------------------
# install.packages("doParallel") # install.packages("doParallel")
# install.packages("doMC") # install.packages("doMC")
# install.packages("doSNOW") # install.packages("doSNOW")
......
This diff is collapsed.
## ----load-phyloseq, message=FALSE, warning=FALSE------------------------- ## ----load-phyloseq, message=FALSE, warning=FALSE---------------------------
library("phyloseq"); packageVersion("phyloseq") library("phyloseq"); packageVersion("phyloseq")
## ----filepath------------------------------------------------------------ ## ----filepath--------------------------------------------------------------
filepath = system.file("extdata", "study_1457_split_library_seqs_and_mapping.zip", package="phyloseq") filepath = system.file("extdata", "study_1457_split_library_seqs_and_mapping.zip", package="phyloseq")
kostic = microbio_me_qiime(filepath) kostic = microbio_me_qiime(filepath)
## ----example-path-local, eval=FALSE-------------------------------------- ## ----example-path-local, eval=FALSE----------------------------------------
# filepath = "~/Downloads/study_1457_split_library_seqs_and_mapping.zip" # filepath = "~/Downloads/study_1457_split_library_seqs_and_mapping.zip"
# kostic = microbio_me_qiime(filepath) # kostic = microbio_me_qiime(filepath)
## ----example-path-remote, eval=FALSE------------------------------------- ## ----example-path-remote, eval=FALSE---------------------------------------
# kostic = microbio_me_qiime(1457) # kostic = microbio_me_qiime(1457)
## ----show-variables------------------------------------------------------ ## ----show-variables--------------------------------------------------------
kostic kostic
head(sample_data(kostic)$DIAGNOSIS, 10) head(sample_data(kostic)$DIAGNOSIS, 10)
## ----deseq2, message=FALSE, warning=FALSE-------------------------------- ## ----deseq2, message=FALSE, warning=FALSE----------------------------------
library("DESeq2"); packageVersion("DESeq2") library("DESeq2"); packageVersion("DESeq2")
## ----rm-bad-samples------------------------------------------------------ ## ----rm-bad-samples--------------------------------------------------------
kostic <- subset_samples(kostic, DIAGNOSIS != "None") kostic <- subset_samples(kostic, DIAGNOSIS != "None")
kostic <- prune_samples(sample_sums(kostic) > 500, kostic) kostic <- prune_samples(sample_sums(kostic) > 500, kostic)
kostic kostic
## ----run-deseq2---------------------------------------------------------- ## ----run-deseq2------------------------------------------------------------
diagdds = phyloseq_to_deseq2(kostic, ~ DIAGNOSIS) diagdds = phyloseq_to_deseq2(kostic, ~ DIAGNOSIS)
# calculate geometric means prior to estimate size factors # calculate geometric means prior to estimate size factors
gm_mean = function(x, na.rm=TRUE){ gm_mean = function(x, na.rm=TRUE){
...@@ -34,7 +34,7 @@ geoMeans = apply(counts(diagdds), 1, gm_mean) ...@@ -34,7 +34,7 @@ geoMeans = apply(counts(diagdds), 1, gm_mean)
diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans) diagdds = estimateSizeFactors(diagdds, geoMeans = geoMeans)
diagdds = DESeq(diagdds, fitType="local") diagdds = DESeq(diagdds, fitType="local")
## ----grab-results-process-table------------------------------------------ ## ----grab-results-process-table--------------------------------------------
res = results(diagdds) res = results(diagdds)
res = res[order(res$padj, na.last=NA), ] res = res[order(res$padj, na.last=NA), ]
alpha = 0.01 alpha = 0.01
...@@ -42,11 +42,11 @@ sigtab = res[(res$padj < alpha), ] ...@@ -42,11 +42,11 @@ sigtab = res[(res$padj < alpha), ]
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(kostic)[rownames(sigtab), ], "matrix")) sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(kostic)[rownames(sigtab), ], "matrix"))
head(sigtab) head(sigtab)
## ----table-prelim-------------------------------------------------------- ## ----table-prelim----------------------------------------------------------
posigtab = sigtab[sigtab[, "log2FoldChange"] > 0, ] posigtab = sigtab[sigtab[, "log2FoldChange"] > 0, ]
posigtab = posigtab[, c("baseMean", "log2FoldChange", "lfcSE", "padj", "Phylum", "Class", "Family", "Genus")] posigtab = posigtab[, c("baseMean", "log2FoldChange", "lfcSE", "padj", "Phylum", "Class", "Family", "Genus")]
## ----make-markdown-table, echo=FALSE, results='asis'--------------------- ## ----make-markdown-table, echo=FALSE, results='asis'-----------------------
# Make a markdown table # Make a markdown table
posigtab = data.frame(OTU=rownames(posigtab), posigtab) posigtab = data.frame(OTU=rownames(posigtab), posigtab)
cat(paste(colnames(posigtab), collapse=" | "), fill=TRUE) cat(paste(colnames(posigtab), collapse=" | "), fill=TRUE)
...@@ -55,7 +55,7 @@ dummy = apply(posigtab, 1, function(x){ ...@@ -55,7 +55,7 @@ dummy = apply(posigtab, 1, function(x){
cat(paste(x, collapse=" | "), fill=TRUE) cat(paste(x, collapse=" | "), fill=TRUE)
}) })
## ----bar-plot------------------------------------------------------------ ## ----bar-plot--------------------------------------------------------------
library("ggplot2") library("ggplot2")
theme_set(theme_bw()) theme_set(theme_bw())
sigtabgen = subset(sigtab, !is.na(Genus)) sigtabgen = subset(sigtab, !is.na(Genus))
......
This diff is collapsed.
...@@ -19,14 +19,14 @@ should return an object without error.} ...@@ -19,14 +19,14 @@ should return an object without error.}
and return a new \code{dist}ance object that is Euclidean. and return a new \code{dist}ance object that is Euclidean.
If testing a distance object, try \code{\link[ade4]{is.euclid}}. If testing a distance object, try \code{\link[ade4]{is.euclid}}.
In most real-life, real-data applications, the phylogenetic tree
will not provide a Euclidean distance matrix, and so a correction Although the distance matrix should always be Euclidean, for numerical
will be needed. reasons it will sometimes appear non-Euclidean and a correction method must
Two recommended correction methods are be applied. Two recommended correction methods are
\code{\link[ade4]{cailliez}} and \code{\link[ade4]{lingoes}}. \code{\link[ade4]{cailliez}} and \code{\link[ade4]{lingoes}}.
The default is \code{cailliez}, The default is \code{cailliez},
but not for any particularly special reason. If the patristic but not for any particularly special reason. If the
distance matrix turns out to be Euclidian, no correction will be distance matrix is Euclidian, no correction will be
performed, regardless of the value of the \code{correction} argument.} performed, regardless of the value of the \code{correction} argument.}
\item{scannf}{(Optional). Logical. Default is \code{FALSE}. This \item{scannf}{(Optional). Logical. Default is \code{FALSE}. This
...@@ -48,13 +48,13 @@ phylogenetic (\code{\link[ape]{phylo}}) components of a ...@@ -48,13 +48,13 @@ phylogenetic (\code{\link[ape]{phylo}}) components of a
to perform a to perform a
Double Principle Coordinate Analysis (DPCoA), relying heavily on Double Principle Coordinate Analysis (DPCoA), relying heavily on
the underlying (and more general) function, \code{\link[ade4]{dpcoa}}. the underlying (and more general) function, \code{\link[ade4]{dpcoa}}.
The distance object ultimately provided as the cophenetic/patristic The distance object ultimately provided is the square root of the
(\code{\link[ape]{cophenetic.phylo}}) distance between the species. cophenetic/patristic (\code{\link[ape]{cophenetic.phylo}}) distance
} between the species, which is always Euclidean.
\details{
In most real-life, real-data applications, the phylogenetic tree Although this distance is Euclidean, for numerical reasons it
will not provide a Euclidean distance matrix, and so a correction will sometimes look non-Euclidean, and a correction will be performed.
will be performed, if needed. See \code{correction} argument. See \code{correction} argument.
} }
\examples{ \examples{
# # # # # # Esophagus # # # # # # Esophagus
...@@ -75,10 +75,6 @@ GP <- prune_taxa(keepTaxa, GlobalPatterns) ...@@ -75,10 +75,6 @@ GP <- prune_taxa(keepTaxa, GlobalPatterns)
GP.dpcoa <- DPCoA(GP) GP.dpcoa <- DPCoA(GP)
plot_ordination(GP, GP.dpcoa, color="SampleType") plot_ordination(GP, GP.dpcoa, color="SampleType")
} }
\author{
Julia Fukuyama \email{julia.fukuyama@gmail.com}.
Adapted for phyloseq by Paul J. McMurdie.
}
\references{ \references{
Pavoine, S., Dufour, A.B. and Chessel, D. (2004) Pavoine, S., Dufour, A.B. and Chessel, D. (2004)
From dissimilarities among species to dissimilarities among communities: From dissimilarities among species to dissimilarities among communities:
...@@ -88,4 +84,7 @@ Journal of Theoretical Biology, 228, 523-537. ...@@ -88,4 +84,7 @@ Journal of Theoretical Biology, 228, 523-537.
\seealso{ \seealso{
\code{\link[ade4]{dpcoa}} \code{\link[ade4]{dpcoa}}
} }
\author{
Julia Fukuyama \email{julia.fukuyama@gmail.com}.
Adapted for phyloseq by Paul J. McMurdie.
}
...@@ -39,10 +39,6 @@ the analysis of the \code{\link{enterotype}} dataset. ...@@ -39,10 +39,6 @@ the analysis of the \code{\link{enterotype}} dataset.
# p <- plot_ordination(enterotype, ent.PCoA, color="Enterotype", shape="SeqTech") # p <- plot_ordination(enterotype, ent.PCoA, color="Enterotype", shape="SeqTech")
# (p <- p + geom_point(size=5, alpha=0.5)) # (p <- p + geom_point(size=5, alpha=0.5))
} }
\author{
Susan Holmes \email{susan@stat.stanford.edu}.
Adapted for phyloseq by Paul J. McMurdie.
}
\references{ \references{
Jensen-Shannon Divergence and Hilbert space embedding. Jensen-Shannon Divergence and Hilbert space embedding.
Bent Fuglede and Flemming Topsoe University of Copenhagen, Bent Fuglede and Flemming Topsoe University of Copenhagen,
...@@ -56,5 +52,8 @@ Department of Mathematics ...@@ -56,5 +52,8 @@ Department of Mathematics
\url{http://en.wikipedia.org/wiki/Jensen-Shannon_divergence} \url{http://en.wikipedia.org/wiki/Jensen-Shannon_divergence}
} }
\author{
Susan Holmes \email{susan@stat.stanford.edu}.
Adapted for phyloseq by Paul J. McMurdie.
}
\keyword{internal} \keyword{internal}
...@@ -171,4 +171,3 @@ communities.'' Appl Environ Microbiol. 2005 71 (12):8228-35. ...@@ -171,4 +171,3 @@ communities.'' Appl Environ Microbiol. 2005 71 (12):8228-35.
\code{unifrac} in the picante package. \code{unifrac} in the picante package.
} }
...@@ -46,4 +46,3 @@ be set to \code{TRUE} if an error is desired. ...@@ -46,4 +46,3 @@ be set to \code{TRUE} if an error is desired.
\seealso{ \seealso{
\code{\link{getslots.phyloseq}}, \code{\link{merge_phyloseq}} \code{\link{getslots.phyloseq}}, \code{\link{merge_phyloseq}}
} }
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
% Please edit documentation in R/assignment-methods.R % Please edit documentation in R/assignment-methods.R
\docType{methods} \docType{methods}
\name{otu_table<-} \name{otu_table<-}
\alias{assign-otu_table}
\alias{otu_table<-} \alias{otu_table<-}
\alias{otu_table<-,otu_table,otu_table-method} \alias{assign-otu_table}
\alias{otu_table<-,phyloseq,otu_table-method} \alias{otu_table<-,phyloseq,otu_table-method}
\alias{otu_table<-,otu_table,otu_table-method}
\alias{otu_table<-,phyloseq,phyloseq-method} \alias{otu_table<-,phyloseq,phyloseq-method}
\title{Assign a new OTU Table to \code{x}} \title{Assign a new OTU Table to \code{x}}
\usage{ \usage{
...@@ -43,4 +43,3 @@ Assign a new OTU Table to \code{x} ...@@ -43,4 +43,3 @@ Assign a new OTU Table to \code{x}
# otu_table(ex2c) <- ex2b # otu_table(ex2c) <- ex2b
# identical(ex2a, ex2c) # identical(ex2a, ex2c)
}