trim_void: Trim void ranks in lineages

View source: R/trim.R

trim_voidR Documentation

Trim void ranks in lineages

Description

Trim void ranks in lineages

Usage

trim_void(lineage, same = TRUE, only_tail = FALSE)

Arguments

lineage

string. Vector of lineages.

same

logical. Does the lineage have the same depth? Default to TRUE.

only_tail

Logical. If FALSE (default), void ranks amid lineages and subranks are removed. If TRUE, only final void ranks are removed.

Details

If there is a void rank amid a lineage, deeper ranks will be removed. See the example with lineage3.

Value

The trimmed lineages. Depth could be different among them.

Examples

lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae|o__|f__"
lineage2 <- "k__Bacteria|p__Firmicutes|c__"
lineage3 <- "k__Bacteria|p__|c__Verrucomicrobiae|o__|f__"
trim_void(c(lineage1, lineage2, lineage3), same = FALSE)
trim_void(c(lineage1, lineage2, lineage3), same = FALSE, only_tail = TRUE)

yatah documentation built on Nov. 13, 2022, 1:07 a.m.