knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
version <- as.vector(read.dcf('DESCRIPTION')[, 'Version']) version <- gsub('-', '.', version)
The goal of yatah is to manage taxonomy when lineages are described with strings and ranks separated with special patterns like |*__
or ;*__
.
For instance, the well-known Escherichia coli could be coded as k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Enterobacteriales|f__Enterobacteriaceae|g__Escherichia|s__Escherichia_coli
.
You can install the released version of yatah from CRAN with:
install.packages("yatah")
And the development version from GitHub with:
# install.packages("remotes") remotes::install_github("abichat/yatah")
library(yatah)
yatah handles 8 different ranks:
all_ranks
A lineage is composed of a succession of clades separated by special characters indicating the current rank.
lineages <- c( "k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Coriobacteriales", "k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales", "k__Bacteria|p__Bacteroidetes|c__Flavobacteriia|o__Flavobacteriales", "k__Bacteria|p__Firmicutes|c__Bacilli|o__Bacillales", "k__Bacteria|p__Firmicutes|c__Bacilli|o__Lactobacillales", "k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales", "k__Bacteria|p__Proteobacteria|c__Epsilonproteobacteria|o__Campylobacterales", "k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Enterobacteriales", "k__Bacteria|p__Proteobacteria|c__Gammaproteobacteria|o__Pseudomonadales" )
yatah offers functions to verify if lineages meet a desired property, to extract information, or to compute summary objects.
is_rank()
and is_at_least_rank()
check if the lineages are of the desired rank.is_rank(lineages, rank = "order") is_at_least_rank(lineages, rank = "species")
is_clade()
checks if the lineages belong to the desired clade.is_clade(lineages, clade = "Proteobacteria", rank = "phylum")
get_clade()
extracts the clade of the desired rank.get_clade(lineages, rank = "class")
get_last_clade()
extracts the last clade of the lineages.get_last_clade(lineages)
get_all_clades()
extracts all clades of the lineages.get_all_clades(lineages, simplify = TRUE)
taxtable()
computes the taxonomic table corresponding to the lineages.table <- taxtable(lineages) table
taxtree()
computes the taxonomic tree (format phylo
) from a taxonomic table. tree <- taxtree(table) tree plot(tree, show.node.label = TRUE)
If you want to change the default separator from |
to, e.g., ;
, use options(yatah_sep = ";")
. Reset it with options(yatah_sep = "\\|")
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.