trim_rank {yatah} | R Documentation |
Trim lineages until a specified rank
Description
Trim lineages until a specified rank
Usage
trim_rank(lineage, rank = yatah::all_ranks, same = TRUE)
Arguments
lineage |
string. Vector of lineages. |
rank |
string. One of |
same |
logical. Does the lineage have the same depth? Default to |
Details
Returns NA
if a lineage is not as deep as the specified rank.
Value
The trimmed lineages. Depth could be different among them.
Examples
lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes|c__Clostridia"
trim_rank(c(lineage1, lineage2), rank = "phylum")
trim_rank(c(lineage1, lineage2), rank = "genus")
[Package yatah version 1.0.0 Index]