trim_common: Trim lineages until the shallowest common rank.

View source: R/trim.R

trim_commonR Documentation

Trim lineages until the shallowest common rank.

Description

Trim lineages until the shallowest common rank.

Usage

trim_common(lineage, remove_void = TRUE, only_tail = TRUE)

Arguments

lineage

string. Vector of lineages.

remove_void

Should void ranks be removed? Default to TRUE.

only_tail

Logical to be passed to trim_void(). Used only if remove_void is set to TRUE.

Value

The trimmed lineages, with same depth.

Examples

lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes"
lineage3 <- "k__Bacteria|p__|c__Clostridia"
trim_common(c(lineage1, lineage2, lineage3), remove_void = FALSE)
trim_common(c(lineage1, lineage2, lineage3), only_tail = FALSE)

abichat/yatah documentation built on April 14, 2024, 7:25 a.m.