reannotate_tax: reannotate_tax

View source: R/reannotate_tax.R

reannotate_taxR Documentation

reannotate_tax

Description

Reannotate taxonomy

Reannotates taxonomy table so that "unclassfied" assignments include higher level classifications. This helps preserve the biological meaning of an unclassfied genus (as it could be classfied at the Family level).

Usage

reannotate_tax(taxonomy)

Arguments

taxonomy

taxonomy table. Must have c('Kingdom','Phylum','Class','Order','Family','Genus','Species') as columns. unclassified entries are denoted as NA

Value

updated taxonomy table with "unclassified" prepended with higher level classifications

Examples

data(asv_example)
# adding Kingdom column; removing sequence column because don't need asv IDs in this example
old_tax <- tax_example
colnames(old_tax)[1] <- 'Kingdom'
old_tax$Kingdom <- 'Bacteria'
knitr::kable(head(old_tax))

new_tax <- reannotate_tax(old_tax)
knitr::kable(head(new_tax))

OxfordCMS/OCMSutility documentation built on Feb. 27, 2025, 8:19 p.m.