add_unique_lineages: Add columns with unique lineages to phyloseq 'tax_table()'

Description Usage Arguments Value

View source: R/modify_phyloseq_functions.r

Description

This function modifies the phyloseq object in order to enable Machine learning analysis on specified taxonomy ranks. phyloseq provides the 'tax_glom()' function which allows to combine an 'otu_table' at e.g. the Genus or Family level. However, not annotated taxa ('NA' or 'unclassified') at a given level will either be dropped or combined to e.g. one large Genus called 'unclassified. But an unannotated taxa might still be important for classification. This function keeps such information by incorporating the full unique lineage for each existing taxonomic rank by concatenating all higher level annotations. The function than interleaves those newly generated columns with the existing tax_table() so the positioning is what tax_glom() requires.

Usage

1
add_unique_lineages(phyloseq_object)

Arguments

phyloseq_object

The phyloseq object with the 'tax_table()' to be modified. This function assumes that ranks are hierarchically ordered, starting with the highest taxonomic rank (e.g. Kingdom) as first column.

Value

The phyloseq object with a modified 'tax_table()'


RJ333/phyloseq2ML documentation built on June 2, 2020, 9:25 p.m.