Commit bab08608 authored by Andreas Tille's avatar Andreas Tille

New upstream version 1.19.1

parent 41ef25b2
Package: phyloseq
Version: 1.19.1
Date: 2016-12-29
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
graphical display of microbiome census data.
Maintainer: Paul J. McMurdie <joey711@gmail.com>
Author: Paul J. McMurdie <joey711@gmail.com>,
Susan Holmes <susan@stat.stanford.edu>, with
contributions from Gregory Jordan and Scott Chamberlain
License: AGPL-3
Imports: BiocGenerics (>= 0.18.0), ade4 (>= 1.7.4), ape (>= 3.4),
biomformat (>= 1.0.0), Biostrings (>= 2.40.0), cluster (>=
2.0.4), data.table (>= 1.9.6), 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.3.5), Biobase
Depends: R (>= 3.3.0)
Suggests: BiocStyle (>= 2.0.0), DESeq2 (>= 1.12.0), genefilter (>=
1.54), testthat (>= 1.0.2), knitr (>= 1.13), metagenomeSeq (>=
1.14), rmarkdown (>= 0.9.6)
VignetteBuilder: knitr
Enhances: doParallel (>= 1.0.10)
biocViews: Sequencing, Microbiome, Metagenomics, Clustering,
Classification, MultipleComparison, GeneticVariability
URL: http://dx.plos.org/10.1371/journal.pone.0061217
BugReports: https://github.com/joey711/phyloseq/issues
Collate: 'allClasses.R' 'allPackage.R' 'allData.R' 'as-methods.R'
'show-methods.R' 'plot-methods.R' 'extract-methods.R'
'almostAllAccessors.R' 'otuTable-class.R' 'phyloseq-class.R'
'taxonomyTable-class.R' 'IO-methods.R' 'merge-methods.R'
'multtest-wrapper.R' 'ordination-methods.R'
'transform_filter-methods.R' 'validity-methods.R'
'assignment-methods.R' 'sampleData-class.R' 'extend_vegan.R'
'network-methods.R' 'distance-methods.R'
'deprecated_functions.R' 'extend_DESeq2.R' 'phylo-class.R'
'extend_metagenomeSeq.R'
RoxygenNote: 5.0.1
NeedsCompilation: no
Packaged: 2016-12-30 00:05:28 UTC; biocbuild
# Generated by roxygen2: do not edit by hand
export("otuTable<-")
export("otu_table<-")
export("phy_tree<-")
export("sam_data<-")
export("sampleData<-")
export("sample_data<-")
export("sample_names<-")
export("speciesAreRows<-")
export("taxTab<-")
export("tax_table<-")
export("taxa_are_rows<-")
export("taxa_names<-")
export("tre<-")
export(DPCoA)
export(UniFrac)
export(access)
export(build_tax_table)
export(distance)
export(distanceMethodList)
export(estimate_richness)
export(export_env_file)
export(export_mothur_dist)
export(filter_taxa)
export(filterfunSample)
export(filterfun_sample)
export(gapstat_ord)
export(genefilterSample)
export(genefilter_sample)
export(getSamples)
export(getSpecies)
export(getTaxa)
export(getVariable)
export(get_sample)
export(get_taxa)
export(get_taxa_unique)
export(get_variable)
export(getslots.phyloseq)
export(import)
export(import_RDP_cluster)
export(import_RDP_otu)
export(import_biom)
export(import_env_file)
export(import_mothur)
export(import_mothur_dist)
export(import_pyrotagger_tab)
export(import_qiime)
export(import_qiime_otu_tax)
export(import_qiime_sampleData)
export(import_qiime_sample_data)
export(import_uparse)
export(import_usearch_uc)
export(make_network)
export(merge_phyloseq)
export(merge_phyloseq_pair)
export(merge_samples)
export(merge_species)
export(merge_taxa)
export(microbio_me_qiime)
export(mt)
export(nodeplotblank)
export(nodeplotboot)
export(nodeplotdefault)
export(nsamples)
export(nspecies)
export(ntaxa)
export(ordinate)
export(otuTable)
export(otu_table)
export(parse_taxonomy_default)
export(parse_taxonomy_greengenes)
export(parse_taxonomy_qiime)
export(phy_tree)
export(phyloseq)
export(phyloseq_to_deseq2)
export(phyloseq_to_metagenomeSeq)
export(plot_bar)
export(plot_clusgap)
export(plot_heatmap)
export(plot_net)
export(plot_network)
export(plot_ordination)
export(plot_phyloseq)
export(plot_richness)
export(plot_richness_estimates)
export(plot_scree)
export(plot_taxa_bar)
export(plot_tree)
export(prune_samples)
export(prune_species)
export(prune_taxa)
export(psmelt)
export(rank.names)
export(rank_names)
export(rarefy_even_depth)
export(read_tree)
export(read_tree_greengenes)
export(refseq)
export(rm_outlierf)
export(samData)
export(sam_data)
export(sample.names)
export(sample.variables)
export(sampleData)
export(sampleNames)
export(sampleSums)
export(sample_data)
export(sample_names)
export(sample_sums)
export(sample_variables)
export(show_mothur_cutoffs)
export(show_mothur_list_cutoffs)
export(species.names)
export(speciesAreRows)
export(speciesSums)
export(speciesarerows)
export(subset_ord_plot)
export(subset_samples)
export(subset_species)
export(subset_taxa)
export(t)
export(taxTab)
export(tax_glom)
export(tax_table)
export(taxa_are_rows)
export(taxa_names)
export(taxa_sums)
export(taxaplot)
export(taxglom)
export(taxtab)
export(threshrank)
export(threshrankfun)
export(tip_glom)
export(tipglom)
export(topf)
export(topk)
export(topp)
export(transformSampleCounts)
export(transform_sample_counts)
export(tre)
export(tree_layout)
exportClasses(dist)
exportClasses(otu_table)
exportClasses(phylo)
exportClasses(phyloseq)
exportClasses(sample_data)
exportClasses(taxonomyTable)
exportMethods("[")
exportMethods(show)
import(BiocGenerics)
import(foreach)
import(methods)
import(reshape2)
importClassesFrom(Biostrings,AAStringSet)
importClassesFrom(Biostrings,BStringSet)
importClassesFrom(Biostrings,DNAStringSet)
importClassesFrom(Biostrings,IlluminaQuality)
importClassesFrom(Biostrings,PhredQuality)
importClassesFrom(Biostrings,QualityScaledAAStringSet)
importClassesFrom(Biostrings,QualityScaledBStringSet)
importClassesFrom(Biostrings,QualityScaledDNAStringSet)
importClassesFrom(Biostrings,QualityScaledRNAStringSet)
importClassesFrom(Biostrings,QualityScaledXStringSet)
importClassesFrom(Biostrings,RNAStringSet)
importClassesFrom(Biostrings,SolexaQuality)
importClassesFrom(Biostrings,XStringQuality)
importClassesFrom(Biostrings,XStringSet)
importFrom(Biobase,AnnotatedDataFrame)
importFrom(Biostrings,readDNAStringSet)
importFrom(ade4,cailliez)
importFrom(ade4,dpcoa)
importFrom(ade4,is.euclid)
importFrom(ape,consensus)
importFrom(ape,cophenetic.phylo)
importFrom(ape,drop.tip)
importFrom(ape,is.rooted)
importFrom(ape,ladderize)
importFrom(ape,node.depth)
importFrom(ape,pcoa)
importFrom(ape,prop.part)
importFrom(ape,read.nexus)
importFrom(ape,read.tree)
importFrom(ape,reorder.phylo)
importFrom(ape,root)
importFrom(ape,write.nexus)
importFrom(biomformat,biom_data)
importFrom(biomformat,observation_metadata)
importFrom(biomformat,read_biom)
importFrom(biomformat,sample_metadata)
importFrom(cluster,agnes)
importFrom(cluster,clusGap)
importFrom(cluster,pam)
importFrom(data.table,copy)
importFrom(data.table,data.table)
importFrom(data.table,fread)
importFrom(data.table,setkey)
importFrom(data.table,setkeyv)
importFrom(data.table,setnames)
importFrom(ggplot2,aes)
importFrom(ggplot2,aes_string)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_text)
importFrom(ggplot2,facet_grid)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_bar)
importFrom(ggplot2,geom_errorbar)
importFrom(ggplot2,geom_line)
importFrom(ggplot2,geom_path)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,geom_raster)
importFrom(ggplot2,geom_segment)
importFrom(ggplot2,geom_text)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggtitle)
importFrom(ggplot2,scale_alpha)
importFrom(ggplot2,scale_fill_gradient)
importFrom(ggplot2,scale_size)
importFrom(ggplot2,scale_size_continuous)
importFrom(ggplot2,scale_size_manual)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggplot2,scale_x_discrete)
importFrom(ggplot2,scale_y_discrete)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(ggplot2,update_labels)
importFrom(ggplot2,xlab)
importFrom(ggplot2,ylab)
importFrom(igraph,V)
importFrom(igraph,degree)
importFrom(igraph,delete.vertices)
importFrom(igraph,get.edgelist)
importFrom(igraph,get.vertex.attribute)
importFrom(igraph,graph.adjacency)
importFrom(igraph,graph.data.frame)
importFrom(igraph,layout.auto)
importFrom(igraph,layout.circle)
importFrom(igraph,layout.fruchterman.reingold)
importFrom(igraph,layout.fruchterman.reingold.grid)
importFrom(igraph,layout.graphopt)
importFrom(igraph,layout.kamada.kawai)
importFrom(igraph,layout.lgl)
importFrom(igraph,layout.random)
importFrom(igraph,layout.reingold.tilford)
importFrom(igraph,layout.sphere)
importFrom(igraph,layout.spring)
importFrom(igraph,layout.svd)
importFrom(igraph,vcount)
importFrom(multtest,mt.maxT)
importFrom(multtest,mt.minP)
importFrom(plyr,ddply)
importFrom(plyr,is.discrete)
importFrom(plyr,ldply)
importFrom(plyr,llply)
importFrom(scales,log_trans)
importFrom(stats,p.adjust)
importFrom(stats,p.adjust.methods)
importFrom(vegan,betadiver)
importFrom(vegan,capscale)
importFrom(vegan,cca)
importFrom(vegan,decorana)
importFrom(vegan,decostand)
importFrom(vegan,designdist)
importFrom(vegan,diversity)
importFrom(vegan,estimateR)
importFrom(vegan,fisher.alpha)
importFrom(vegan,metaMDS)
importFrom(vegan,rda)
importFrom(vegan,scores)
importFrom(vegan,vegdist)
importFrom(vegan,wascores)
importFrom(vegan,wisconsin)
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
###############################################
#' Handling and analysis of high-throughput phylogenetic sequence data.
#'
#' There are already several ecology and phylogenetic packages available in R,
#' including the adephylo, vegan, ade4, picante, ape, phangorn, phylobase, and OTUbase packages.
#' These can already take advantage of many of the powerful statistical and graphics tools
#' available in R. However, prior to \emph{phyloseq} a user must devise their own methods
#' for parsing the output of their favorite OTU clustering application, and, as a consequence,
#' there is also no standard within Bioconductor (or R generally) for storing or sharing the
#' suite of related data objects that describe a phylogenetic sequencing project.
#' The phyloseq package seeks to address these issues by providing a related set of S4 classes
#' that internally manage the handling tasks associated with organizing, linking, storing,
#' and analyzing phylogenetic sequencing data. \emph{phyloseq} additionally provides some
#' convenience wrappers for input from common clustering applications, common analysis pipelines,
#' and native implementation of methods that are not available in other R packages.
#'
#' @import methods
#' @name phyloseq-package
#' @author Paul J. McMurdie II \email{mcmurdie@@stanford.edu}
#' @references \url{www.stanford.edu/~mcmurdie}
#' @docType package
#' @keywords package
NA
###############################################
This diff is collapsed.
################################################################################
# coercion methods
################################################################################
setAs("phyloseq", "matrix", function(from){
from@.Data
})
setAs("phyloseq", "otu_table", function(from){
otu_table(from)
})
setAs("phyloseq", "otu_table", function(from){
otu_table(from)
})
################################################################################
setAs("data.frame", "sample_data", function(from){
new("sample_data", from)
})
setAs("sample_data", "data.frame", function(from){
data.frame(from)
})
setAs("phyloseq", "sample_data", function(from){
sample_data(from)
})
################################################################################
setAs("taxonomyTable", "matrix", function(from){
from@.Data
})
setAs("phyloseq", "taxonomyTable", function(from){
tax_table(from)
})
################################################################################
setAs("phyloseq", "phylo", function(from){
phy_tree(from)
})
################################################################################
This diff is collapsed.
################################################################################
#' Depcrecated functions in the phyloseq package.
#'
#' These will be migrated to \code{"defunct"} status in the next release,
#' and removed completely in the release after that.
#' These functions are provided for compatibility with older version of
#' the phyloseq package. They may eventually be completely
#' removed.
#'
#' @usage deprecated_phyloseq_function(x, value, ...)
#' @rdname phyloseq-deprecated
#' @name phyloseq-deprecated
#' @param x For assignment operators, the object that will undergo a replacement
#' (object inside parenthesis).
#' @param value For assignment operators, the value to replace with
#' (the right side of the assignment).
#' @param ... For functions other than assignment operators,
#' parameters to be passed to the modern version of the function (see table).
#' @docType package
#' @export plot_taxa_bar taxaplot taxtab taxTab sampleData samData sam_data speciesSums sampleSums nspecies species.names sampleNames sample.names getSamples getSpecies rank.names getTaxa sample.variables getVariable merge_species otuTable speciesarerows speciesAreRows plot_richness_estimates import_qiime_sampleData filterfunSample genefilterSample prune_species subset_species tipglom taxglom tre show_mothur_list_cutoffs sam_data<- sampleData<- tre<- speciesAreRows<- otuTable<- taxTab<-
#' @aliases deprecated_phyloseq_function plot_taxa_bar taxaplot taxtab taxTab sampleData samData sam_data speciesSums sampleSums nspecies species.names sampleNames sample.names getSamples getSpecies rank.names getTaxa sample.variables getVariable merge_species otuTable speciesarerows speciesAreRows plot_richness_estimates import_qiime_sampleData filterfunSample genefilterSample prune_species subset_species tipglom taxglom tre show_mothur_list_cutoffs sam_data<- sampleData<- tre<- speciesAreRows<- otuTable<- taxTab<-
#' @details
#' \tabular{rl}{
#' \code{plot_taxa_bar} \tab now a synonym for \code{\link{plot_bar}}\cr
#' \code{taxaplot} \tab now a synonym for \code{\link{plot_bar}}\cr
#' \code{taxtab} \tab now a synonym for \code{\link{tax_table}}\cr
#' \code{taxTab} \tab now a synonym for \code{\link{tax_table}}\cr
#' \code{sampleData} \tab now a synonym for \code{\link{sample_data}}\cr
#' \code{samData} \tab now a synonym for \code{\link{sample_data}}\cr
#' \code{sam_data} \tab now a synonym for \code{\link{sample_data}}\cr
#' \code{speciesSums} \tab now a synonym for \code{\link{taxa_sums}}\cr
#' \code{sampleSums} \tab now a synonym for \code{\link{sample_sums}}\cr
#' \code{nspecies} \tab now a synonym for \code{\link{ntaxa}}\cr
#' \code{species.names} \tab now a synonym for \code{\link{taxa_names}}\cr
#' \code{sampleNames} \tab now a synonym for \code{\link{sample_names}}\cr
#' \code{sample.names} \tab now a synonym for \code{\link{sample_names}}\cr
#' \code{getSamples} \tab now a synonym for \code{\link{get_sample}}\cr
#' \code{getSpecies} \tab now a synonym for \code{\link{get_taxa}}\cr
#' \code{rank.names} \tab now a synonym for \code{\link{rank_names}}\cr
#' \code{getTaxa} \tab now a synonym for \code{\link{get_taxa_unique}}\cr
#' \code{sample.variables} \tab now a synonym for \code{\link{sample_variables}}\cr
#' \code{getVariable} \tab now a synonym for \code{\link{get_variable}}\cr
#' \code{merge_species} \tab now a synonym for \code{\link{merge_taxa}}\cr
#' \code{otuTable} \tab now a synonym for \code{\link{otu_table}}\cr
#' \code{speciesarerows} \tab now a synonym for \code{\link{taxa_are_rows}}\cr
#' \code{speciesAreRows} \tab now a synonym for \code{\link{taxa_are_rows}}\cr
#' \code{plot_richness_estimates} \tab now a synonym for \code{\link{plot_richness}}\cr
#' \code{import_qiime_sampleData} \tab now a synonym for \code{\link{import_qiime_sample_data}}\cr
#' \code{filterfunSample} \tab now a synonym for \code{\link{filterfun_sample}}\cr
#' \code{genefilterSample} \tab now a synonym for \code{\link{genefilter_sample}}\cr
#' \code{prune_species} \tab now a synonym for \code{\link{prune_taxa}}\cr
#' \code{subset_species} \tab now a synonym for \code{\link{subset_taxa}}\cr
#' \code{tipglom} \tab now a synonym for \code{\link{tip_glom}}\cr
#' \code{taxglom} \tab now a synonym for \code{\link{tax_glom}}\cr
#' \code{tre} \tab now a synonym for \code{\link{phy_tree}}\cr
#' \code{show_mothur_list_cutoffs} \tab now a synonym for \code{\link{show_mothur_cutoffs}}\cr
#' \code{sam_data<-} \tab now a synonym for \code{\link{sample_data<-}}\cr
#' \code{sampleData<-} \tab now a synonym for \code{\link{sample_data<-}}\cr
#' \code{tre<-} \tab now a synonym for \code{\link{phy_tree<-}}\cr
#' \code{speciesAreRows<-} \tab now a synonym for \code{\link{taxa_are_rows<-}}\cr
#' \code{otuTable<-} \tab now a synonym for \code{\link{otu_table<-}}\cr
#' \code{taxTab<-} \tab now a synonym for \code{\link{tax_table<-}}\cr
#' }
#'
deprecated_phyloseq_function <- function(x, value, ...){return(NULL)}
plot_taxa_bar <- function(...){.Deprecated("plot_bar", package="phyloseq");return(plot_bar(...))}
taxaplot <- function(...){.Deprecated("plot_bar", package="phyloseq");return(plot_bar(...))}
taxtab <- function(...){.Deprecated("tax_table", package="phyloseq");return(tax_table(...))}
taxTab <- function(...){.Deprecated("tax_table", package="phyloseq");return(tax_table(...))}
sampleData <- function(...){.Deprecated("sample_data", package="phyloseq");return(sample_data(...))}
samData <- function(...){.Deprecated("sample_data", package="phyloseq");return(sample_data(...))}
sam_data <- function(...){.Deprecated("sample_data", package="phyloseq");return(sample_data(...))}
speciesSums <- function(...){.Deprecated("taxa_sums", package="phyloseq");return(taxa_sums(...))}
sampleSums <- function(...){.Deprecated("sample_sums", package="phyloseq");return(sample_sums(...))}
nspecies <- function(...){.Deprecated("ntaxa", package="phyloseq");return(ntaxa(...))}
species.names <- function(...){.Deprecated("taxa_names", package="phyloseq");return(taxa_names(...))}
sampleNames <- function(...){.Deprecated("sample_names", package="phyloseq");return(sample_names(...))}
sample.names <- function(...){.Deprecated("sample_names", package="phyloseq");return(sample_names(...))}
getSamples <- function(...){.Deprecated("get_sample", package="phyloseq");return(get_sample(...))}
getSpecies <- function(...){.Deprecated("get_taxa", package="phyloseq");return(get_taxa(...))}
rank.names <- function(...){.Deprecated("rank_names", package="phyloseq");return(rank_names(...))}
getTaxa <- function(...){.Deprecated("get_taxa_unique", package="phyloseq");return(get_taxa_unique(...))}
sample.variables <- function(...){.Deprecated("sample_variables", package="phyloseq");return(sample_variables(...))}
getVariable <- function(...){.Deprecated("get_variable", package="phyloseq");return(get_variable(...))}
merge_species <- function(...){.Deprecated("merge_taxa", package="phyloseq");return(merge_taxa(...))}
otuTable <- function(...){.Deprecated("otu_table", package="phyloseq");return(otu_table(...))}
speciesarerows <- function(...){.Deprecated("taxa_are_rows", package="phyloseq");return(taxa_are_rows(...))}
speciesAreRows <- function(...){.Deprecated("taxa_are_rows", package="phyloseq");return(taxa_are_rows(...))}
plot_richness_estimates <- function(...){.Deprecated("plot_richness", package="phyloseq");return(plot_richness(...))}
import_qiime_sampleData <- function(...){.Deprecated("import_qiime_sample_data", package="phyloseq");return(import_qiime_sample_data(...))}
filterfunSample <- function(...){.Deprecated("filterfun_sample", package="phyloseq");return(filterfun_sample(...))}
genefilterSample <- function(...){.Deprecated("genefilter_sample", package="phyloseq");return(genefilter_sample(...))}
prune_species <- function(...){.Deprecated("prune_taxa", package="phyloseq");return(prune_taxa(...))}
subset_species <- function(...){.Deprecated("subset_taxa", package="phyloseq");return(subset_taxa(...))}
tipglom <- function(...){.Deprecated("tip_glom", package="phyloseq");return(tip_glom(...))}
taxglom <- function(...){.Deprecated("tax_glom", package="phyloseq");return(tax_glom(...))}
tre <- function(...){.Deprecated("phy_tree", package="phyloseq");return(phy_tree(...))}
show_mothur_list_cutoffs <- function(...){.Deprecated("show_mothur_cutoffs", package="phyloseq");return(show_mothur_cutoffs(...))}
originalUniFrac <- function(...){.Deprecated("fastUniFrac", package="phyloseq");return(fastUniFrac(...))}
"sam_data<-" <- function(x, value){
.Deprecated("sample_data<-", package="phyloseq")
sample_data(x) <- value
return(x)
}
"sampleData<-" <- function(x, value){
.Deprecated("sample_data<-", package="phyloseq")
sample_data(x) <- value
return(x)
}
"tre<-" <- function(x, value){
.Deprecated("phy_tree<-", package="phyloseq")
phy_tree(x) <- value
return(x)
}
"speciesAreRows<-" <- function(x, value){
.Deprecated("taxa_are_rows<-", package="phyloseq")
taxa_are_rows(x) <- value
return(x)
}
"otuTable<-" <- function(x, value){
.Deprecated("otu_table<-", package="phyloseq")
otu_table(x) <- value
return(x)
}
"taxTab<-" <- function(x, value){
.Deprecated("tax_table<-", package="phyloseq")
tax_table(x) <- value
return(x)
}
################################################################################
This diff is collapsed.
################################################################################
#' Convert phyloseq data to DESeq2 dds object
#'
#' No testing is performed by this function. The phyloseq data is converted
#' to the relevant \code{\link[DESeq2]{DESeqDataSet}} object, which can then be
#' tested in the negative binomial generalized linear model framework
#' of the \code{\link[DESeq2]{DESeq}} function in DESeq2 package.
#' See the
#' \href{http://joey711.github.io/phyloseq-extensions}{phyloseq-extensions}
#' tutorials for more details.
#'
#' @param physeq (Required). \code{\link{phyloseq-class}}.
#' Must have a \code{\link{sample_data}} component.
#'
#' @param design (Required). A \code{\link{formula}} which specifies the design of the experiment,
#' taking the form \code{formula(~ x + y + z)}. That is, a formula with right-hand side only.
#' By default, the functions in this package and DESeq2
#' will use the last variable in the formula (e.g. \code{z})
#' for presenting results (fold changes, etc.) and plotting.
#' When considering your specification of experimental design, you will want to
#' re-order the levels so that the \code{NULL} set is first.
#' For example, the following line of code would ensure that Enterotype 1 is used as the
#' reference sample class in tests by setting it to the first of the factor levels
#' using the \code{\link{relevel}} function:
#'
#' \code{sample_data(entill)$Enterotype <- relevel(sample_data(entill)$Enterotype, "1")}
#'
#' @param ... (Optional). Additional named arguments passed to \code{\link[DESeq2]{DESeqDataSetFromMatrix}}.
#' Most users will not need to pass any additional arguments here.
#' Most testing-related options should be provided in
#' a following call to \code{\link[DESeq2]{DESeq}}.
#'
#' @return A \code{\link[DESeq2]{DESeqDataSet}} object.
#'
#' @seealso
#'
#' \code{vignette("phyloseq-mixture-models")}
#'
#' The
#' \href{http://joey711.github.io/phyloseq-extensions}{phyloseq-extensions}
#' tutorials.
#'
#' \code{\link[DESeq2]{DESeq}}
#'
#' \code{\link[DESeq2]{results}}
#'
#' \code{\link[DESeq2]{DESeqDataSetFromMatrix}}
#'
#' @export
#'
#' @examples
#' # Check out the vignette phyloseq-mixture-models for more details.
#' # vignette("phyloseq-mixture-models")
#' data(soilrep)
#' phyloseq_to_deseq2(soilrep, ~warmed)
phyloseq_to_deseq2 = function(physeq, design, ...){
# Need to add check here for missing sample_data
if( is.null(sample_data(physeq, FALSE)) ){
stop("There must be sample_data present, for specifying experimental design. See ?phyloseq_to_deseq2")
}
# Enforce orientation. Samples are columns
if( !taxa_are_rows(physeq) ){ physeq <- t(physeq)}
# Coerce count data to vanilla matrix of integers
countData = round(as(otu_table(physeq), "matrix"), digits=0)
colData = data.frame(sample_data(physeq))
# Create the DESeq data set, dds.
if(requireNamespace("DESeq2")){
dds <- DESeq2::DESeqDataSetFromMatrix(countData, colData, design, ...)
return(dds)
}
}
################################################################################
################################################################################
#' Convert phyloseq data to MetagenomeSeq MRexperiment object
#'
#' No testing is performed by this function. The phyloseq data is converted
#' to the relevant \code{\link[metagenomeSeq]{MRexperiment-class}} object, which can then be
#' tested in the zero-inflated mixture model framework
#' (e.g. \code{\link[metagenomeSeq]{fitZig}})
#' in the metagenomeSeq package.
#' See the
#' \href{http://joey711.github.io/phyloseq-extensions}{phyloseq-extensions}
#' tutorials for more details.
#'
#' @param physeq (Required). \code{\link{phyloseq-class}}.
#' @param ... (Optional). Additional named arguments passed
#' to \code{\link[metagenomeSeq]{newMRexperiment}}.
#' Most users will not need to pass any additional arguments here.
#'
#' @return A \code{\link[metagenomeSeq]{MRexperiment-class}} object.
#'
#' @seealso
#'
#' \code{\link[metagenomeSeq]{fitTimeSeries}}
#' \code{\link[metagenomeSeq]{fitLogNormal}}
#' \code{\link[metagenomeSeq]{fitZig}}
#' \code{\link[metagenomeSeq]{MRtable}}
#' \code{\link[metagenomeSeq]{MRfulltable}}
#'
#' @export
#' @importFrom Biobase AnnotatedDataFrame
#'
#' @examples
#' # Check out the vignette metagenomeSeq for more details.
#' # vignette("metagenomeSeq")
#' data(soilrep)
#' phyloseq_to_metagenomeSeq(soilrep)
phyloseq_to_metagenomeSeq = function(physeq, ...){
# Enforce orientation. Samples are columns
if( !taxa_are_rows(physeq) ){ physeq <- t(physeq)}
# Coerce count data to vanilla matrix of integers
countData = round(as(otu_table(physeq), "matrix"), digits=0)
# Create sample annotation if possible
if(!is.null(sample_data(physeq,FALSE))){
ADF = AnnotatedDataFrame(data.frame(sample_data(physeq)))
} else {
ADF = NULL
}
# Create taxa annotation if possible
if(!is.null(tax_table(physeq,FALSE))){
TDF = AnnotatedDataFrame(data.frame(OTUname = taxa_names(physeq),
data.frame(tax_table(physeq)),row.names = taxa_names(physeq)))
} else {
TDF = AnnotatedDataFrame(data.frame(OTUname = taxa_names(physeq),
row.names = taxa_names(physeq)))
}
# Create MRexperiment
if(requireNamespace("metagenomeSeq")){
mrobj = metagenomeSeq::newMRexperiment(counts = countData, phenoData = ADF,