R/makephyloseqFromTreeSummarizedExperiment.R
makePhyloseqFromTreeSE.Rd
This function creates a phyloseq object from a TreeSummarizedExperiment
object. By using assay.type
, it is possible to specify which table
from assay
is added to the phyloseq object.
makePhyloseqFromTreeSE(x, ...)
# S4 method for SummarizedExperiment
makePhyloseqFromTreeSE(x, assay.type = "counts", assay_name = NULL, ...)
# S4 method for TreeSummarizedExperiment
makePhyloseqFromTreeSE(x, tree.name = tree_name, tree_name = "phylo", ...)
makePhyloseqFromTreeSummarizedExperiment(x, ...)
# S4 method for ANY
makePhyloseqFromTreeSummarizedExperiment(x, ...)
a TreeSummarizedExperiment
object
additional arguments
A single character value for selecting the
assay
to be
included in the phyloseq object that is created.
(By default: assay.type = "counts"
)
a single character
value for specifying which
assay to use for calculation.
(Please use assay.type
instead. At some point assay_name
will be disabled.)
a single character
value for specifying which
tree will be included in the phyloseq object that is created,
(By default: tree.name = "phylo"
)
Deprecated. Use tree.name
instead.
An object of class Phyloseq
object.
makePhyloseqFromTreeSE
is used for creating a
phyloseq object from TreeSummarizedExperiment object.
# Get tse object
data(GlobalPatterns)
tse <- GlobalPatterns
# Create a phyloseq object from it
phy <- makePhyloseqFromTreeSE(tse)
phy
#> phyloseq-class experiment-level object
#> otu_table() OTU Table: [ 19216 taxa and 26 samples ]
#> sample_data() Sample Data: [ 26 samples by 7 sample variables ]
#> tax_table() Taxonomy Table: [ 19216 taxa by 7 taxonomic ranks ]
#> phy_tree() Phylogenetic Tree: [ 19216 tips and 19215 internal nodes ]
# By default the chosen table is counts, but if there are other tables,
# they can be chosen with assay.type.
# Counts relative abundances table
tse <- transformAssay(tse, method = "relabundance")
phy2 <- makePhyloseqFromTreeSE(tse, assay.type = "relabundance")
phy2
#> phyloseq-class experiment-level object
#> otu_table() OTU Table: [ 19216 taxa and 26 samples ]
#> sample_data() Sample Data: [ 26 samples by 7 sample variables ]
#> tax_table() Taxonomy Table: [ 19216 taxa by 7 taxonomic ranks ]
#> phy_tree() Phylogenetic Tree: [ 19216 tips and 19215 internal nodes ]