Convert MetaPhlAn profile to phyloseq object
Source:R/metaphlan_to_phyloseq.R
metaphlan_to_phyloseq.Rd
This function converts a MetaPhlAn profile to a phyloseq object when given the file path or a pre-loaded table.
Usage
metaphlan_to_phyloseq(
mtphlan_profile,
taxa_lvl = NULL,
metadata = NULL,
sample_column = NULL,
use_taxa_names = FALSE,
merged_profiles = TRUE
)
Arguments
- mtphlan_profile
The MetaPhlAn profile to be converted. It can be either a file path or a data frame of MetaPhlAn profile(s).
- taxa_lvl
Optional taxonomic level to filter the profile to. Valid options are 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species' or 't' (SGB). First letter abbreviations are also accepted.
- metadata
Optional metadata for the samples. If provided, it should be a data frame.
- sample_column
Character
string. The column in the metadata containing the sample names. Should match column names of the MetaPhlAn profile.- use_taxa_names
Logical
indicating whether to use taxonomic names instead of OTUs in the resulting phyloseq object. Default isFALSE
.- merged_profiles
Logical
; ifTRUE
(the default) the file to be loaded is assumed to be multiple merged MetaPhlAn profiles.