| linf.feature.labels | R Documentation |
Builds unique display labels from stable feature IDs and taxonomy strings.
This is useful when dCST computation should operate on stable internal feature
identifiers (for example asv_4) while reports and figures should use
human-readable labels such as L. iners 4.
Underscores in taxonomy strings are converted to spaces before abbreviation
and aliasing. If multiple features share the same display taxon, an index can
be appended either from the global feature ID (for example asv_4 -> 4) or
by within-taxon order.
linf.feature.labels(
feature.ids,
taxonomy,
abbreviations = NULL,
aliases = NULL,
duplicate.index = c("global", "within_taxon", "none"),
fallback.to.id = TRUE
)
feature.ids |
Character vector of stable feature identifiers. |
taxonomy |
Character vector of taxonomy strings, same length as
|
abbreviations |
Optional named character vector mapping genus tokens to
display abbreviations, for example |
aliases |
Optional named character vector mapping full taxonomy strings
to alternate labels, for example |
duplicate.index |
One of |
fallback.to.id |
Logical. If |
Character vector of unique display labels.
ids <- c("asv_1", "asv_4", "asv_5", "asv_6")
tax <- c(
"Lactobacillus iners",
"Lactobacillus iners",
"Megasphaera lornae",
"Ca_Lachnocurva_vaginae"
)
abbr <- c(
Lactobacillus = "L.",
Gardnerella = "Gard.",
Megasphaera = "Mega."
)
aliases <- c(
"Ca. Lachnocurva vaginae" = "BVAB1",
"Ca_Lachnocurva_vaginae" = "BVAB1"
)
linf.feature.labels(ids, tax, abbreviations = abbr, aliases = aliases)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.