View source: R/convertFromPhyloseq.R
convertFromPhyloseq | R Documentation |
TreeSummarizedExperiment
object from a phyloseq objectCreate a TreeSummarizedExperiment
object from a phyloseq object
Create a phyloseq object from a TreeSummarizedExperiment
object
convertFromPhyloseq(x)
convertToPhyloseq(x, ...)
## S4 method for signature 'SummarizedExperiment'
convertToPhyloseq(x, assay.type = "counts", assay_name = NULL, ...)
## S4 method for signature 'TreeSummarizedExperiment'
convertToPhyloseq(x, tree.name = tree_name, tree_name = "phylo", ...)
x |
a
|
... |
Additional arguments. Not used currently. |
assay.type |
|
assay_name |
Deprecated. Use |
tree.name |
|
tree_name |
Deprecated. Use |
convertFromPhyloseq
converts phyloseq
objects into
TreeSummarizedExperiment
objects.
All data stored in a phyloseq
object is transferred.
convertToPhyloseq
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.
convertFromPhyloseq
returns an object of class
TreeSummarizedExperiment
convertToPhyloseq
returns an object of class
phyloseq
Leo Lahti and Tuomas Borman. Contact: microbiome.github.io
### Coerce a phyloseq object to a TreeSE object
if (requireNamespace("phyloseq")) {
data(GlobalPatterns, package="phyloseq")
convertFromPhyloseq(GlobalPatterns)
data(enterotype, package="phyloseq")
convertFromPhyloseq(enterotype)
data(esophagus, package="phyloseq")
convertFromPhyloseq(esophagus)
}
### Coerce a TreeSE object to a phyloseq object
# Get tse object
data(GlobalPatterns)
tse <- GlobalPatterns
# Create a phyloseq object from it
phy <- convertToPhyloseq(tse)
phy
# 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 <- convertToPhyloseq(tse, assay.type = "relabundance")
phy2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.