metaphlan_to_phyloseq: Create a phyloseq object from Metaphlan profiles

View source: R/metaphlan_to_phyloseq.R

metaphlan_to_phyloseqR Documentation

Create a phyloseq object from Metaphlan profiles

Description

Given the profiles' location, or a pre-loaded table, the function creates a taxonomic table and creates a phyloseq object. if metadata and phylogenetic tree are available, it will try to include those

Usage

metaphlan_to_phyloseq(
  mpa,
  metadata = NULL,
  version = 4,
  verbose = TRUE,
  tax_lvl = "Species"
)

Arguments

mpa

Either a character vector containing the path to the text table to read, or the already-read object

metadata

If in possession, add metadata to the phyloseq object. make sure the name and order of samples is correct for the mpa columns and metadata rows

version

the metaphlan version, by default, version 4 is taken (to date it is the latest - Apr 2022). Versions below 3 are not supported

verbose

logical, whether you want to see which samples did not match between the otu and metadata tables

tax_lvl

character, with the taxonomic level (eg. Phylum, Class, ..., Genus, Species) that you want to have in the phyloseq

Value

A phyloseq object

Examples

data("metaphlanData")

meta_physeq <- metaphlan_to_phyloseq <- function(metaphlanData,
metadata = NULL,
phyloTree = NULL,
version = 4)


g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.