View source: R/taxonomy_to_qiime.R
taxonomy_to_qiime | R Documentation |
This function merges multiple columns with taxonomic ranks into a single string formatted in QIIME style.
taxonomy_to_qiime(x, dropNA = TRUE, add_OTUID = TRUE, custom_tax_ranks = NULL)
x |
data.frame or phyloseq with |
dropNA |
Logical; if TRUE, missing tax ranks will be removed |
add_OTUID |
Logical; if TRUE, OTU name will be added to the first column of the resulting table |
custom_tax_ranks |
Data frame with two columns, taxonomic ranks (with the same names as columns in x) and the corresponding single letter abbreviations |
If 'add_OTUID = T' and x is data.frame, the function will take OTU names from rownames of a data frame.
character vector (if 'add_OTUID = FALSE') or data.frame with taxonomy annotations.
# Load data
data("GlobalPatterns")
# Subset data
GP <- metagMisc::phyloseq_filter_top_taxa(GlobalPatterns, n = 20)
# Prepare taxonomy in QIIME-style (result = data frame with 2 columns)
qtax <- taxonomy_to_qiime(GP)
head(qtax)
# Vector with OTU taxonomy
qvec <- taxonomy_to_qiime(GP, add_OTUID = FALSE)
head(qvec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.