Extract all clades present in the lineages
Arguments
- lineage
string. Vector of lineages.
- simplify
logical. Should the output be a vector or a dataframe?
Details
If a clade correspond to different ranks (e.g. Actinobacteria
is both a phylum and a clade), it will be displayed only one time when
simplify
is set to TRUE
. It is also the case for different
clades with same name and same rank when simplify
is set to
FALSE
.
Examples
lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes|c__Clostridia"
lineage3 <- "k__Bacteria|p__Actinobacteria|c__Actinobacteria"
get_all_clades(c(lineage1, lineage2, lineage3))
#> [1] "Actinobacteria" "Bacteria" "Clostridia" "Firmicutes"
#> [5] "Verrucomicrobia" "Verrucomicrobiae"
get_all_clades(c(lineage1, lineage2, lineage3), simplify = FALSE)
#> clade rank
#> 6 Actinobacteria phylum
#> 7 Actinobacteria class
#> 1 Bacteria kingdom
#> 5 Clostridia class
#> 4 Firmicutes phylum
#> 2 Verrucomicrobia phylum
#> 3 Verrucomicrobiae class