taxa_map | R Documentation |
Map OTUs names to taxa names at a given rank.
taxa_map(
biom,
rank = NULL,
taxa = Inf,
unc = "singly",
lineage = FALSE,
other = FALSE
)
biom |
An rbiom object, such as from |
rank |
When |
taxa |
Which taxa to display. An integer value will show the top n
most abundant taxa. A value 0 <= n < 1 will show any taxa with that
mean abundance or greater (e.g. |
unc |
How to handle unclassified, uncultured, and similarly ambiguous taxa names. Options are:
Abbreviations are allowed. Default: |
lineage |
Include all ranks in the name of the taxa. For instance,
setting to |
other |
Sum all non-itemized taxa into an "Other" taxa. When
|
A tibble data.frame when rank=NULL
, or a character vector named
with the OTU names.
pull.rbiom()
library(rbiom)
library(dplyr, warn.conflicts = FALSE)
# In $taxonomy, .otu is the first column (like a row identifier) -----
hmp50$taxonomy %>% head(4)
# In taxa_map, .otu is the last column (most precise rank) -----------
taxa_map(hmp50) %>% head(4)
# Generate an OTU to Genus mapping -----------------------------------
taxa_map(hmp50, "Genus") %>% head(4)
# Sometimes taxonomic names are incomplete ----------------------------
otus <- c('GemAsacc', 'GcbBacte', 'Unc58411')
taxa_map(hmp50, unc = "asis") %>% filter(.otu %in% otus) %>% select(Phylum:.otu)
# rbiom can replace them with unique placeholders ---------------------
taxa_map(hmp50, unc = "singly") %>% filter(.otu %in% otus) %>% select(Class:.otu)
# Or collapse them into groups ----------------------------------------
taxa_map(hmp50, unc = "grouped") %>% filter(.otu %in% otus) %>% select(Class:Genus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.