Commit cacaad79 authored by Andreas Tille's avatar Andreas Tille

New upstream version 1.24.2+dfsg

parent 7e91b664
Package: phyloseq
Version: 1.24.0
Date: 2017-11-04
Version: 1.24.2
Date: 2018-07-15
Title: Handling and analysis of high-throughput microbiome census data
Description: phyloseq provides a set of classes and tools
to facilitate the import, storage, analysis, and
......@@ -15,7 +15,7 @@ Imports: ade4 (>= 1.7.4), ape (>= 5.0), Biobase (>= 2.36.2),
2.40.0), cluster (>= 2.0.4), data.table (>= 1.10.4), foreach
(>= 1.4.3), ggplot2 (>= 2.1.0), igraph (>= 1.0.1), methods (>=
3.3.0), multtest (>= 2.28.0), plyr (>= 1.8.3), reshape2 (>=
1.4.1), scales (>= 0.4.0), vegan (>= 2.4)
1.4.1), scales (>= 0.4.0), vegan (>= 2.5)
Depends: R (>= 3.3.0)
Suggests: BiocStyle (>= 2.4), DESeq2 (>= 1.16.1), genefilter (>= 1.58),
knitr (>= 1.16), metagenomeSeq (>= 1.14), rmarkdown (>= 1.6),
......@@ -37,5 +37,10 @@ Collate: 'allClasses.R' 'allPackage.R' 'allData.R' 'as-methods.R'
'deprecated_functions.R' 'extend_DESeq2.R' 'phylo-class.R'
'extend_metagenomeSeq.R'
RoxygenNote: 6.0.1
git_url: https://git.bioconductor.org/packages/phyloseq
git_branch: RELEASE_3_7
git_last_commit: 829992f
git_last_commit_date: 2018-07-15
Date/Publication: 2018-07-15
NeedsCompilation: no
Packaged: 2018-04-30 23:30:05 UTC; biocbuild
Packaged: 2018-07-15 23:30:27 UTC; biocbuild
......@@ -317,7 +317,7 @@ tip_glom = function(physeq, h=0.2, hcfun=agnes, ...){
#' Agglomerate taxa of the same type.
#'
#' This method merges species that have the same taxonomy at a certain
#' taxaonomic rank.
#' taxonomic rank.
#' Its approach is analogous to \code{\link{tip_glom}}, but uses categorical data
#' instead of a tree. In principal, other categorical data known for all taxa
#' could also be used in place of taxonomy,
......
No preview for this file type
......@@ -165,13 +165,23 @@ p <- ggplot(mdf, aes(Phylum, value, color=Phylum)) +
plot_bar(GP, x="human", fill="SampleType", facet_grid= ~ Phylum)
## ----GPdpcoa01-------------------------------------------------------------
# Perform ordination
GP.dpcoa <- ordinate(GP, "DPCoA")
pdpcoa <- plot_ordination(GP, GP.dpcoa, type="biplot",
color="SampleType", shape="Phylum")
shape.fac <- pdpcoa$data[, deparse(pdpcoa$mapping$shape)]
# Generate default ordination bi-plot
pdpcoa <-
plot_ordination(
physeq = GP,
ordination = GP.dpcoa,
type="biplot",
color="SampleType",
shape="Phylum")
# Adjust the shape scale manually
# to make taxa hollow and samples filled (advanced)
shape.fac <- pdpcoa$data$Phylum
man.shapes <- c(19, 21:25)
names(man.shapes) <- c("Samples", levels(shape.fac)[levels(shape.fac)!="Samples"])
p2dpcoa <- pdpcoa + scale_shape_manual(values=man.shapes)
p2dpcoa
## ----GPdpcoa02-------------------------------------------------------------
# Show just Samples or just Taxa
......
......@@ -7,6 +7,8 @@ output:
toc: yes
toc_depth: 2
number_sections: true
editor_options:
chunk_output_type: console
---
<!--
%% \VignetteEngine{knitr::rmarkdown}
......@@ -418,13 +420,23 @@ In this figure we've used the `threshold` parameter to omit all but phyla accoun
Here is a quick example illustrating the use of Double Principal Coordinate Analysis (DPCoA~\cite{Pavoine2004523), using the using the `ordinate()` function in phyloseq, as well as the "biplot" option for `plot_ordination(). For a description that includes an applied example using the "enterotype" dataset and comparison with UniFrac/PCoA, see Fukuyama et al~\cite{fukuyama2012com.
```{r GPdpcoa01}
# Perform ordination
GP.dpcoa <- ordinate(GP, "DPCoA")
pdpcoa <- plot_ordination(GP, GP.dpcoa, type="biplot",
color="SampleType", shape="Phylum")
shape.fac <- pdpcoa$data[, deparse(pdpcoa$mapping$shape)]
# Generate default ordination bi-plot
pdpcoa <-
plot_ordination(
physeq = GP,
ordination = GP.dpcoa,
type="biplot",
color="SampleType",
shape="Phylum")
# Adjust the shape scale manually
# to make taxa hollow and samples filled (advanced)
shape.fac <- pdpcoa$data$Phylum
man.shapes <- c(19, 21:25)
names(man.shapes) <- c("Samples", levels(shape.fac)[levels(shape.fac)!="Samples"])
p2dpcoa <- pdpcoa + scale_shape_manual(values=man.shapes)
p2dpcoa
```
A biplot representation of a Double Principal Coordinate Analysis (DPCoA), on a simplified version of the "Global Patterns" dataset with only the most abundant 200 OTUs included.
......
......@@ -48,15 +48,15 @@ test_that("all 4 plot_ordination type options result in valid ggplot2 object", {
GP <- merge_phyloseq(GP.otu, GP.tr)
# Print. Don't want the render directive to have an error,
# even while the ggplot object is created.
expect_that(print(plot_ordination(GP, GP.ord, "samples")), is_a("list"))
expect_that(print(plot_ordination(GP, GP.ord, "species")), is_a("list"))
expect_that(print(plot_ordination(GP, GP.ord, "split")), is_a("list"))
expect_that(print(plot_ordination(GP, GP.ord, "biplot")), is_a("list"))
expect_is(print(plot_ordination(GP, GP.ord, "samples")), "gg")
expect_is(print(plot_ordination(GP, GP.ord, "species")), "gg")
expect_is(print(plot_ordination(GP, GP.ord, "split")), "gg")
expect_is(print(plot_ordination(GP, GP.ord, "biplot")), "gg")
# Don't print. Test that result is ggplot-class
expect_that(plot_ordination(GP, GP.ord, "samples"), is_a("ggplot"))
expect_that(plot_ordination(GP, GP.ord, "species"), is_a("ggplot"))
expect_that(plot_ordination(GP, GP.ord, "split"), is_a("ggplot"))
expect_that(plot_ordination(GP, GP.ord, "biplot"), is_a("ggplot"))
expect_is(plot_ordination(GP, GP.ord, "samples"), "ggplot")
expect_is(plot_ordination(GP, GP.ord, "species"), "ggplot")
expect_is(plot_ordination(GP, GP.ord, "split"), "ggplot")
expect_is(plot_ordination(GP, GP.ord, "biplot"), "ggplot")
})
test_that("plot_ordination: The justDF=TRUE option returns a data.frame", {
......@@ -80,10 +80,10 @@ test_that("plot_ordination: When variables are present or not, color SampleType"
expect_is(p2, "ggplot")
expect_is(p3, "ggplot")
expect_is(p4, "ggplot")
expect_is(print(p1), "list")
expect_is(print(p2), "list")
expect_is(print(p3), "list")
expect_is(print(p4), "list")
expect_is(print(p1), "gg")
expect_is(print(p2), "gg")
expect_is(print(p3), "gg")
expect_is(print(p4), "gg")
})
......@@ -102,10 +102,10 @@ test_that("plot_ordination: When variables are present or not, shape SamplyType"
expect_is(p2, "ggplot")
expect_is(p3, "ggplot")
expect_is(p4, "ggplot")
expect_is(print(p1), "list")
expect_is(print(p2), "list")
expect_is(print(p3), "list")
expect_is(print(p4), "list")
expect_is(print(p1), "gg")
expect_is(print(p2), "gg")
expect_is(print(p3), "gg")
expect_is(print(p4), "gg")
})
test_that("plot_ordination: When variables are present or not, label SamplyType", {
......@@ -118,10 +118,10 @@ test_that("plot_ordination: When variables are present or not, label SamplyType"
expect_is(p2, "ggplot")
expect_is(p3, "ggplot")
expect_is(p4, "ggplot")
expect_is(print(p1), "list")
expect_is(print(p2), "list")
expect_is(print(p3), "list")
expect_is(print(p4), "list")
expect_is(print(p1), "gg")
expect_is(print(p2), "gg")
expect_is(print(p3), "gg")
expect_is(print(p4), "gg")
})
test_that("plot_ordination: Continuous variables still mapped, uses added dummy variable", {
......@@ -135,9 +135,9 @@ test_that("plot_ordination: Continuous variables still mapped, uses added dummy
expect_error(print(p2))
# A `label` can be mapped to continuous var. It is coerced to char and printed.
expect_is(p3 <- plot_ordination(GP, GP.ord, "samples", label="OMEGA3_FA_CONC"), "ggplot")
expect_that(print(p1), is_a("list"))
#expect_that(print(p2), is_a("list"))
expect_that(print(p3), is_a("list"))
expect_that(print(p1), is_a("gg"))
#expect_that(print(p2), is_a("gg"))
expect_that(print(p3), is_a("gg"))
})
test_that("plot_ordination: Some additional formats and warnings.", {
......@@ -162,18 +162,18 @@ test_that("plot_ordination: Some additional formats and warnings.", {
label="X.SampleID", color="SampleType", title="p8"), "ggplot")
expect_is(p9 <- plot_ordination(GP, GP.ord.cca, type=" sPlit __ ",
label="Phylum", color="SampleType", title="p8"), "ggplot")
expect_that(print(p1), is_a("list"))
expect_that(print(p2), is_a("list"))
expect_that(print(p3), is_a("list"))
expect_that(print(p4), is_a("list"))
expect_that(print(p5), is_a("list"))
expect_that(print(p6), is_a("list"))
expect_that(print(p7), is_a("list"))
expect_that(print(p7b), is_a("list"))
expect_that(print(p7c), is_a("list"))
expect_that(print(p7d), is_a("list"))
expect_that(print(p8), is_a("list"))
expect_that(print(p9), is_a("list"))
expect_that(print(p1), is_a("gg"))
expect_that(print(p2), is_a("gg"))
expect_that(print(p3), is_a("gg"))
expect_that(print(p4), is_a("gg"))
expect_that(print(p5), is_a("gg"))
expect_that(print(p6), is_a("gg"))
expect_that(print(p7), is_a("gg"))
expect_that(print(p7b), is_a("gg"))
expect_that(print(p7c), is_a("gg"))
expect_that(print(p7d), is_a("gg"))
expect_that(print(p8), is_a("gg"))
expect_that(print(p9), is_a("gg"))
# A few more related to new `wascores` support as default backup coordinates
xnames = tapply(taxa_sums(GlobalPatterns), tax_table(GlobalPatterns)[, "Phylum"], sum)
xnames <- names(sort(xnames, decreasing = TRUE))[1:5]
......@@ -185,23 +185,23 @@ test_that("plot_ordination: Some additional formats and warnings.", {
z1 = ordinate(GP, method = "CAP", "bray", ~SampleType)
# Try a bunch more with splits and biplots
expect_is(p11 <- plot_ordination(GP, x, type = "biplot", color="Phylum"), "ggplot")
expect_is(print(p11), "list")
expect_is(print(p11), "gg")
expect_is(p12 <- plot_ordination(GP, x, type = "biplot", color="SampleType", shape="Phylum"), "ggplot")
expect_is(print(p12), "list")
expect_is(print(p12), "gg")
expect_is(p13 <- plot_ordination(GP, x, type = "split", color="SampleType", shape="Phylum"), "ggplot")
expect_is(print(p13), "list")
expect_is(print(p13), "gg")
expect_is(p14 <- plot_ordination(GP, x, type = "split", color="Phylum"), "ggplot")
expect_is(print(p14), "list")
expect_is(print(p14), "gg")
expect_is(p15 <- plot_ordination(GP, y, type = "biplot", color="Phylum"), "ggplot")
expect_is(print(p15), "list")
expect_is(print(p15), "gg")
expect_is(p16 <- plot_ordination(GP, y, type = "species", color="Phylum"), "ggplot")
expect_is(print(p16), "list")
expect_is(print(p16), "gg")
expect_is(p17 <- plot_ordination(GP, z, type = "biplot", color="Phylum"), "ggplot")
expect_is(print(p17), "list")
expect_is(print(p17), "gg")
expect_is(p18 <- plot_ordination(GP, z, type = "biplot", color="SampleType", shape="Phylum"), "ggplot")
expect_is(print(p18), "list")
expect_is(print(p18), "gg")
expect_is(p19 <- plot_ordination(GP, z1, type = "biplot", color="Phylum"), "ggplot")
expect_is(print(p19), "list")
expect_is(print(p19), "gg")
})
test_that("plot_ordination: CAP method", {
......@@ -239,15 +239,15 @@ test_that("plot_ordination: CAP method", {
color="SampleType", title="p8"), "ggplot")
expect_is(p9 <- plot_ordination(GP, GP.ord.cap, type=" sPlit __ ", label="Phylum",
color="SampleType", title="p8"), "ggplot")
expect_that(print(p4), is_a("list"))
expect_that(print(p5), is_a("list"))
expect_that(print(p6), is_a("list"))
expect_that(print(p7), is_a("list"))
expect_that(print(p7b), is_a("list"))
expect_that(print(p7c), is_a("list"))
expect_that(print(p7d), is_a("list"))
expect_that(print(p8), is_a("list"))
expect_that(print(p9), is_a("list"))
expect_that(print(p4), is_a("gg"))
expect_that(print(p5), is_a("gg"))
expect_that(print(p6), is_a("gg"))
expect_that(print(p7), is_a("gg"))
expect_that(print(p7b), is_a("gg"))
expect_that(print(p7c), is_a("gg"))
expect_that(print(p7d), is_a("gg"))
expect_that(print(p8), is_a("gg"))
expect_that(print(p9), is_a("gg"))
})
# Constrained CCA / RDA
......@@ -276,15 +276,15 @@ test_that("plot_ordination: CCA, RDA method", {
color="SampleType", title="p8"), "ggplot")
expect_is(p9 <- plot_ordination(GP, GP.ord.cca, type=" sPlit __ ", label="Phylum",
color="SampleType", title="p8"), "ggplot")
expect_that(print(p4), is_a("list"))
expect_that(print(p5), is_a("list"))
expect_that(print(p6), is_a("list"))
expect_that(print(p7), is_a("list"))
expect_that(print(p7b), is_a("list"))
expect_that(print(p7c), is_a("list"))
expect_that(print(p7d), is_a("list"))
expect_that(print(p8), is_a("list"))
expect_that(print(p9), is_a("list"))
expect_that(print(p4), is_a("gg"))
expect_that(print(p5), is_a("gg"))
expect_that(print(p6), is_a("gg"))
expect_that(print(p7), is_a("gg"))
expect_that(print(p7b), is_a("gg"))
expect_that(print(p7c), is_a("gg"))
expect_that(print(p7d), is_a("gg"))
expect_that(print(p8), is_a("gg"))
expect_that(print(p9), is_a("gg"))
# Repeat test-plotting RDA
expect_is(p4 <- plot_ordination(GP, GP.ord.rda, type="TaXa",
color="Phylum", title="p4"), "ggplot")
......@@ -304,15 +304,15 @@ test_that("plot_ordination: CCA, RDA method", {
color="SampleType", title="p8"), "ggplot")
expect_is(p9 <- plot_ordination(GP, GP.ord.rda, type=" sPlit __ ", label="Phylum",
color="SampleType", title="p8"), "ggplot")
expect_that(print(p4), is_a("list"))
expect_that(print(p5), is_a("list"))
expect_that(print(p6), is_a("list"))
expect_that(print(p7), is_a("list"))
expect_that(print(p7b), is_a("list"))
expect_that(print(p7c), is_a("list"))
expect_that(print(p7d), is_a("list"))
expect_that(print(p8), is_a("list"))
expect_that(print(p9), is_a("list"))
expect_that(print(p4), is_a("gg"))
expect_that(print(p5), is_a("gg"))
expect_that(print(p6), is_a("gg"))
expect_that(print(p7), is_a("gg"))
expect_that(print(p7b), is_a("gg"))
expect_that(print(p7c), is_a("gg"))
expect_that(print(p7d), is_a("gg"))
expect_that(print(p8), is_a("gg"))
expect_that(print(p9), is_a("gg"))
})
################################################################################
# Other plot function tests...
......@@ -481,10 +481,10 @@ test_that("psmelt correctly handles phyloseq data with NULL components, and OTU
expect_is(pT <- plot_tree(GPT, shape="Kingdom"), "ggplot")
expect_is(pTr <- plot_tree(GPTr), "ggplot")
expect_is(pN <- plot_bar(GPN), "ggplot")
expect_is((prPS<-print(pS)), "list")
expect_is((prPT<-print(pT)), "list")
expect_is((prPTr<-print(pTr)), "list")
expect_is((prPN<-print(pN)), "list")
expect_is((prPS<-print(pS)), "gg")
expect_is((prPT<-print(pT)), "gg")
expect_is((prPTr<-print(pTr)), "gg")
expect_is((prPN<-print(pN)), "gg")
})
test_that("psmelt doesn't break when the number of taxa is 1", {
data(GlobalPatterns)
......
......@@ -7,6 +7,8 @@ output:
toc: yes
toc_depth: 2
number_sections: true
editor_options:
chunk_output_type: console
---
<!--
%% \VignetteEngine{knitr::rmarkdown}
......@@ -418,13 +420,23 @@ In this figure we've used the `threshold` parameter to omit all but phyla accoun
Here is a quick example illustrating the use of Double Principal Coordinate Analysis (DPCoA~\cite{Pavoine2004523), using the using the `ordinate()` function in phyloseq, as well as the "biplot" option for `plot_ordination(). For a description that includes an applied example using the "enterotype" dataset and comparison with UniFrac/PCoA, see Fukuyama et al~\cite{fukuyama2012com.
```{r GPdpcoa01}
# Perform ordination
GP.dpcoa <- ordinate(GP, "DPCoA")
pdpcoa <- plot_ordination(GP, GP.dpcoa, type="biplot",
color="SampleType", shape="Phylum")
shape.fac <- pdpcoa$data[, deparse(pdpcoa$mapping$shape)]
# Generate default ordination bi-plot
pdpcoa <-
plot_ordination(
physeq = GP,
ordination = GP.dpcoa,
type="biplot",
color="SampleType",
shape="Phylum")
# Adjust the shape scale manually
# to make taxa hollow and samples filled (advanced)
shape.fac <- pdpcoa$data$Phylum
man.shapes <- c(19, 21:25)
names(man.shapes) <- c("Samples", levels(shape.fac)[levels(shape.fac)!="Samples"])
p2dpcoa <- pdpcoa + scale_shape_manual(values=man.shapes)
p2dpcoa
```
A biplot representation of a Double Principal Coordinate Analysis (DPCoA), on a simplified version of the "Global Patterns" dataset with only the most abundant 200 OTUs included.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment