phenotype_susceptibility: Evaluate antibiotic susceptibility based on phenotype

phenotype_susceptibilityR Documentation

Evaluate antibiotic susceptibility based on phenotype

Description

This is the main engine for determining antibiotic susceptibility based on a database of phenotypes for various taxa. To run this function, you'll need the database as well as a vector that specifies the susceptibility for each value of the phenotype.

Usage

phenotype_susceptibility(
  lineage,
  phenotype,
  susceptibility,
  db = taxon_phenotypes
)

Arguments

lineage

A character vector of taxonomic assignments or lineages

phenotype

The name of the column in db that contains the phenotype of interest

susceptibility

A character vector specifying the susceptibility for different values of the phenotype. The names should correspond to elements in the column specified with phenotype. The values should be either "susceptible" or "resistant"

db

A data frame with columns named "taxon", "rank", and the column name specified in phenotype

Details

This function operates much like antibiotic_susceptibility, except that it pulls phenotype values from the database instead of susceptibility information. To subsequently determine susceptibility from phenotype, this function uses the named vector provided in the susceptibility argument.

As a reminder, 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.

Value

A vector of assigned susceptibility values, which should be either "susceptible", "resistant", or NA

Examples

phenotype_susceptibility(
  c("Bacteroidetes", "Firmicutes", "Firmicutes; Negativicutes"),
  "gram_stain",
  c("Gram-positive" = "susceptible", "Gram-negative" = "resistant"))

tuv292/abx_idx documentation built on Jan. 12, 2023, 12:48 a.m.