antibiotic_susceptibility | R Documentation |
This is the main engine for determining antibiotic susceptibility based on a database of antibiotic-specific annotations for various taxa.
antibiotic_susceptibility(
lineage,
antibiotic,
db = whatbacteria::taxon_susceptibility
)
lineage |
A character vector of taxonomic assignments or lineages |
antibiotic |
The name of the antibiotic or antibiotic class in |
db |
A data frame with columns named "taxon", "rank", "antibiotic", and "value" |
To determine susceptibility, the database is first filtered to include only rows relevant to the antibiotic of interest. Then, the filtered database is split into ranks. The susceptibility values are determined for each rank by matching taxa from the rank-specific database to the vector of lineages. If a lineage matches to multiple taxa of different ranks, the value of the taxon with the lowest rank is selected.
The taxonomic ranks, in order from highest to lowest, are Kingdom, Phylum, Class, Order, Family, Genus, and Species. The ranks in the database must be capitalized, exactly as they are written here.
A vector of assigned susceptibility values, which should be either
"susceptible", "resistant", or NA
antibiotic_susceptibility(
c("Enterococcus faecalis", "Lactobacillus", "Lactobacillus delbrueckii"),
"vancomycin")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.