Import Metaphlan results to TreeSummarizedExperiment

Arguments

file

a single character value defining the file path of the Metaphlan file. The file must be in merged Metaphlan format.

colData

a DataFrame-like object that includes sample names in rownames, or a single character value defining the file path of the sample metadata file. The file must be in tsv format (default: colData = NULL).

sample_meta

a DataFrame-like object that includes sample names in rownames, or a single character value defining the file path of the sample metadata file. The file must be in tsv format (default: sample_meta = NULL).

phy_tree

a single character value defining the file path of the phylogenetic tree. (default: phy_tree = NULL).

...

additional arguments:

  • assay.type: A single character value for naming assay (default: assay.type = "counts")

  • assay_name: 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.)

  • removeTaxaPrefixes: TRUE or FALSE: Should taxonomic prefixes be removed? (default: removeTaxaPrefixes = FALSE)

  • remove.suffix: TRUE or FALSE: Should suffixes of sample names be removed? Metaphlan pipeline adds suffixes to sample names. Suffixes are formed from file names. By selecting remove.suffix = TRUE, you can remove pattern from end of sample names that is shared by all. (default: remove.suffix = FALSE)

Value

A TreeSummarizedExperiment

object

Details

Import Metaphlan (versions 2, 3 and 4 supported) results. Input must be in merged Metaphlan format. (See the Metaphlan documentation and merge_metaphlan_tables method.) Data is imported so that data at the lowest rank is imported as a TreeSummarizedExperiment object. Data at higher rank is imported as a SummarizedExperiment objects which are stored to altExp of TreeSummarizedExperiment object.

Currently Metaphlan versions 2, 3, and 4 are supported.

References

Beghini F, McIver LJ, Blanco-Míguez A, Dubois L, Asnicar F, Maharjan S, Mailyan A, Manghi P, Scholz M, Thomas AM, Valles-Colomer M, Weingart G, Zhang Y, Zolfo M, Huttenhower C, Franzosa EA, & Segata N (2021) Integrating taxonomic, functional, and strain-level profiling of diverse microbial communities with bioBakery 3. eLife. 10:e65088. doi: 10.7554/eLife.65088

Author

Leo Lahti and Tuomas Borman. Contact: microbiome.github.io

Examples

# (Data is from tutorial
# https://github.com/biobakery/biobakery/wiki/metaphlan3#merge-outputs)

# File path
file_path <- system.file("extdata", "merged_abundance_table.txt", package = "mia")
# Import data
tse <- loadFromMetaphlan(file_path)
#> TAXONOMY_RANKS set to: 'Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus', 'Species', 'clade_name', 'NCBI_tax_id'
# Data at the lowest rank
tse
#> class: TreeSummarizedExperiment 
#> dim: 16 6 
#> metadata(0):
#> assays(1): counts
#> rownames(16): s__Corynebacterium_matruchotii s__Rothia_dentocariosa ...
#>   s__Haemophilus_haemolyticus s__Moraxella_nonliquefaciens
#> rowData names(9): Kingdom Phylum ... clade_name NCBI_tax_id
#> colnames(6): SRS014494-Posterior_fornix_profile
#>   SRS014476-Supragingival_plaque_profile ...
#>   SRS014464-Anterior_nares_profile SRS014459-Stool_profile
#> colData names(0):
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(6): Kingdom Phylum ... Family Genus
#> rowLinks: NULL
#> rowTree: NULL
#> colLinks: NULL
#> colTree: NULL
# Data at higher rank is stored in altExp
altExps(tse)
#> List of length 6
#> names(6): Kingdom Phylum Class Order Family Genus
# Higher rank data is in SE format, for example, Phylum rank
altExp(tse, "Phylum")
#> class: TreeSummarizedExperiment 
#> dim: 4 6 
#> metadata(0):
#> assays(1): counts
#> rownames(4): p__Actinobacteria p__Bacteroidetes p__Firmicutes
#>   p__Proteobacteria
#> rowData names(9): Kingdom Phylum ... clade_name NCBI_tax_id
#> colnames(6): SRS014494-Posterior_fornix_profile
#>   SRS014476-Supragingival_plaque_profile ...
#>   SRS014464-Anterior_nares_profile SRS014459-Stool_profile
#> colData names(0):
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):
#> rowLinks: NULL
#> rowTree: NULL
#> colLinks: NULL
#> colTree: NULL