diff --git a/DESCRIPTION b/DESCRIPTION index 970478e7a..afb40af2d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 3.0.1.9059 +Version: 3.0.1.9060 Date: 2026-06-23 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index ad070401e..4271c997b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 3.0.1.9059 +# AMR 3.0.1.9060 Planned as v3.1.0, end of June 2026. diff --git a/R/aa_globals.R b/R/aa_globals.R index 1ba28e171..e035468f4 100755 --- a/R/aa_globals.R +++ b/R/aa_globals.R @@ -227,6 +227,7 @@ globalVariables(c( "reference.rule", "reference.rule_group", "reference.version", + "regimen", "rule.provider", "rowid", "rule_group", diff --git a/R/antibiogram.R b/R/antibiogram.R index 034b30dd2..49bb406bf 100755 --- a/R/antibiogram.R +++ b/R/antibiogram.R @@ -27,12 +27,14 @@ # how to conduct AMR data analysis: https://amr-for-r.org # # ==================================================================== # -#' Generate Traditional, Combination, Syndromic, or WISCA Antibiograms +#' Generate Antibiograms (WISCA, Traditional, Combination, or Syndromic) #' #' @description -#' Create detailed antibiograms with options for traditional, combination, syndromic, and Bayesian WISCA methods. +#' Generate antibiograms from antimicrobial susceptibility data, with support for traditional, combination, syndromic, and WISCA (Weighted-Incidence Syndromic Combination Antibiogram) methods. #' -#' Adhering to previously described approaches (see *Source*) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki *et al.*, these functions provide flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. +#' **For empirical therapy guidance, WISCA is the recommended approach.** When initiating empirical treatment, the causative pathogen is unknown, and the clinically relevant question is: *"what is the probability that this regimen will cover whatever pathogen turns out to cause the infection?"* WISCA answers that question directly by weighting susceptibility by pathogen incidence within a syndrome and providing credible intervals via Bayesian Monte Carlo simulation. Traditional antibiograms remain appropriate for tracking resistance per species for surveillance purposes. See the section *Explaining WISCA* on this page and the [WISCA vignette](https://amr-for-r.org/articles/WISCA.html) for details. +#' +#' All antibiogram types adhere to previously described approaches (see *Source*), and the WISCA method implements the Bayesian decision model by Bielicki *et al.* (2016, \doi{10.1093/jac/dkv397}). Output formats include plots and tables, ideal for integration with R Markdown and Quarto reports. #' @param x A [data.frame] containing at least a column with microorganisms and columns with antimicrobial results (class 'sir', see [as.sir()]). #' @param antimicrobials A vector specifying the antimicrobials containing SIR values to include in the antibiogram (see *Examples*). Will be evaluated using [guess_ab_col()]. This can be: #' - Any antimicrobial name or code that could match (see [guess_ab_col()]) to any column in `x` @@ -51,7 +53,7 @@ #' @param mo_transform A character to transform microorganism input - must be `"name"`, `"shortname"` (default), `"gramstain"`, or one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, documentation = TRUE)`. Can also be `NULL` to not transform the input or `NA` to consider all microorganisms 'unknown'. #' @param ab_transform A character to transform antimicrobial input - must be one of the column names of the [antimicrobials] data set (defaults to `"name"`): `r vector_or(colnames(antimicrobials), sort = FALSE, documentation = TRUE)`. Can also be `NULL` to not transform the input. #' @param syndromic_group A column name of `x`, or values calculated to split rows of `x`, e.g. by using [ifelse()] or [`case_when()`][dplyr::case_when()]. See *Examples*. -#' @param add_total_n *(deprecated in favour of `formatting_type`)* A [logical] to indicate whether `n_tested` available numbers per pathogen should be added to the table (default is `TRUE`). This will add the lowest and highest number of available isolates per antimicrobial (e.g, if for *E. coli* 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when `wisca = TRUE`; in that case, use [retrieve_wisca_parameters()] to get the parameters used for WISCA. +#' @param add_total_n *(deprecated in favour of `formatting_type`)* A [logical] to indicate whether `n_tested` available numbers per pathogen should be added to the table (default is `TRUE`). This will add the lowest and highest number of available isolates per antimicrobial (e.g., if for *E. coli* 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when `wisca = TRUE`; in that case, use [retrieve_wisca_parameters()] to get the parameters used for WISCA. #' @param only_all_tested (for combination antibiograms): a [logical] to indicate that isolates must be tested for all antimicrobials, see *Details*. #' @param digits Number of digits to use for rounding the antimicrobial coverage, defaults to 1 for WISCA and 0 otherwise. #' @param formatting_type Numeric value (1-22 for WISCA, 1-12 for non-WISCA) indicating how the 'cells' of the antibiogram table should be formatted. See *Details* > *Formatting Type* for a list of options. @@ -110,67 +112,15 @@ #' #' Set `digits` (defaults to `0`) to alter the rounding of the susceptibility percentages. #' -#' ### Antibiogram Types +#' ### When to Use WISCA vs. Traditional Antibiograms #' -#' There are various antibiogram types, as summarised by Klinker *et al.* (2021, \doi{10.1177/20499361211011373}), and they are all supported by [antibiogram()]. +#' There are various antibiogram types, as summarised by Klinker *et al.* (2021, \doi{10.1177/20499361211011373}), and they are all supported by [antibiogram()]: traditional, combination, syndromic, and WISCA. #' -#' For clinical coverage estimations, **use WISCA whenever possible**, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki *et al.* (2020, \doi{10.1001/jamanetworkopen.2019.21124}). See the section *Explaining WISCA* on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome. +#' **If your goal is to guide empirical therapy, use WISCA.** Traditional antibiograms fragment susceptibility information by species, but at the point of prescribing, the clinician does not know which species is causing the infection. WISCA shifts the unit of analysis from the isolate to the patient: it estimates the probability that a regimen will cover the infection, given the local distribution of causative pathogens. It evaluates combination regimens, weights by pathogen incidence, and provides credible intervals that honestly communicate uncertainty. Hebert *et al.* (2012) demonstrated this concretely for the first time: ciprofloxacin showed 84% susceptibility against *E. coli* in the traditional antibiogram, but WISCA coverage was only 62% for UTI and 37% for abdominal infections, because other species (including intrinsically resistant enterococci) contribute substantially to these syndromes. Note that WISCA is pathogen-agnostic: the outcome is not stratified by species, but by syndrome. #' -#' 1. **Traditional Antibiogram** +#' **Traditional, combination, and syndromic antibiograms remain appropriate for AMR surveillance**, i.e., tracking resistance trends per species over time. They are the right tool when the question is *"how resistant is species X to drug Y in our setting?"* rather than *"what regimen best covers this syndrome?"*. #' -#' Case example: Susceptibility of *Pseudomonas aeruginosa* to piperacillin/tazobactam (TZP) -#' -#' Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = "TZP") -#' ``` -#' -#' 2. **Combination Antibiogram** -#' -#' Case example: Additional susceptibility of *Pseudomonas aeruginosa* to TZP + tobramycin versus TZP alone -#' -#' Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) -#' ``` -#' -#' 3. **Syndromic Antibiogram** -#' -#' Case example: Susceptibility of *Pseudomonas aeruginosa* to TZP among respiratory specimens (obtained among ICU patients only) -#' -#' Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = penicillins(), -#' syndromic_group = "ward") -#' ``` -#' -#' 4. **Weighted-Incidence Syndromic Combination Antibiogram (WISCA)** -#' -#' WISCA can be applied to any antibiogram, see the section *Explaining WISCA* on this page for more information. -#' -#' Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), -#' wisca = TRUE) -#' -#' # this is equal to: -#' wisca(your_data, -#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) -#' ``` -#' -#' WISCA uses a sophisticated Bayesian decision model to combine both local and pooled antimicrobial resistance data. This approach not only evaluates local patterns but can also draw on multi-centre data sets to improve regimen accuracy, even in low-incidence infections like paediatric bloodstream infections (BSIs). -#' -#' **Prior Distributions** -#' -#' When `wisca = TRUE` or when using `wisca()`, pathogen incidence is modelled with a non-informative \eqn{Dirichlet(1, 1, \ldots, 1)} prior. Susceptibility proportions use the Jeffreys prior, \eqn{\beta(0.5, 0.5)}, except for bug-drug combinations with known intrinsic resistance, which use a strongly informative \eqn{\beta(1, 9999)} prior that forces near-zero susceptibility regardless of observed data (Bielicki *et al.*, 2016). Intrinsic resistance is determined using the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES[1]))`. +#' All four types are demonstrated in the *Examples* section below. #' #' ### Grouped tibbles #' @@ -185,55 +135,6 @@ #' wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) #' ``` #' -#' ### Stepped Approach for Clinical Insight -#' -#' In clinical practice, antimicrobial coverage decisions evolve as more microbiological data becomes available. This theoretical stepped approach ensures empirical coverage can continuously assessed to improve patient outcomes: -#' -#' 1. **Initial Empirical Therapy (Admission / Pre-Culture Data)** -#' -#' At admission, no pathogen information is available. -#' -#' - Action: broad-spectrum coverage is based on local resistance patterns and syndromic antibiograms. Using the pathogen-agnostic yet incidence-weighted WISCA is preferred. -#' - Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = selected_regimens, -#' mo_transform = NA) # all pathogens set to `NA` -#' -#' # preferred: use WISCA -#' wisca(your_data, -#' antimicrobials = selected_regimens) -#' ``` -#' -#' 2. **Refinement with Gram Stain Results** -#' -#' When a blood culture becomes positive, the Gram stain provides an initial and crucial first stratification (Gram-positive vs. Gram-negative). -#' -#' - Action: narrow coverage based on Gram stain-specific resistance patterns. -#' - Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = selected_regimens, -#' mo_transform = "gramstain") # all pathogens set to Gram-pos/Gram-neg -#' ``` -#' -#' 3. **Definitive Therapy Based on Species Identification** -#' -#' After cultivation of the pathogen, full pathogen identification allows precise targeting of therapy. -#' -#' - Action: adjust treatment to pathogen-specific antibiograms, minimizing resistance risks. -#' - Code example: -#' -#' ```r -#' antibiogram(your_data, -#' antimicrobials = selected_regimens, -#' mo_transform = "shortname") # all pathogens set to 'G. species', e.g., E. coli -#' ``` -#' -#' By structuring antibiograms around this stepped approach, clinicians can make data-driven adjustments at each stage, ensuring optimal empirical and targeted therapy while reducing unnecessary broad-spectrum antimicrobial use. -#' #' ### Inclusion in Combination Antibiograms #' #' Note that for combination antibiograms, it is important to realise that susceptibility can be calculated in two ways, which can be set with the `only_all_tested` argument (default is `FALSE`). See this example for two antimicrobials, Drug A and Drug B, about how [antibiogram()] works to calculate the %SI: @@ -267,16 +168,21 @@ #' #' @section Explaining WISCA: #' -#' WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability of empirical coverage for combination regimens. +#' WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability that an empirical antimicrobial regimen will provide adequate coverage for a given infection syndrome, before the causative pathogen has been identified. #' -#' It weights susceptibility by pathogen prevalence within a clinical syndrome and provides credible intervals around the expected coverage. +#' It does so by combining two quantities: the relative incidence of each pathogen within the syndrome (modelled as a Dirichlet distribution) and the susceptibility of each pathogen to the regimen (modelled as Beta distributions). These are combined via Monte Carlo simulation to produce a coverage estimate with a credible interval. #' -#' For more background, interpretation, and examples, see [the WISCA vignette](https://amr-for-r.org/articles/WISCA.html). +#' **Prior distributions:** Pathogen incidence uses a non-informative \eqn{Dirichlet(1, 1, \ldots, 1)} prior. Susceptibility proportions use the Jeffreys prior, \eqn{\beta(0.5, 0.5)}, except for pathogen-drug combinations with known intrinsic resistance, which use a strongly informative \eqn{\beta(1, 9999)} prior that forces near-zero susceptibility regardless of observed data. Intrinsic resistance is determined using the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES[1]))`. +#' +#' **Interpreting the output:** Overlapping credible intervals between regimens indicate no significant difference in coverage; if a narrower-spectrum regimen overlaps with a broader one, the narrower-spectrum option may be preferred on stewardship grounds. Non-overlapping intervals indicate a clinically meaningful difference. For small sample sizes, consider pooling data from multiple sites to improve precision, provided pathogen distributions are sufficiently similar (Bielicki *et al.*, 2016). +#' +#' For the full mathematical derivation and worked examples, see the [WISCA vignette](https://amr-for-r.org/articles/WISCA.html). #' @references -#' * Bielicki JA *et al.* (2016). **Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data** *Journal of Antimicrobial Chemotherapy* 71(3); \doi{10.1093/jac/dkv397} -#' * Bielicki JA *et al.* (2020). **Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries** *JAMA Netw Open.* 3(2):e1921124; \doi{10.1001/jamanetworkopen.2019.21124} -#' * Klinker KP *et al.* (2021). **Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms**. *Therapeutic Advances in Infectious Disease*, May 5;8:20499361211011373; \doi{10.1177/20499361211011373} -#' * Barbieri E *et al.* (2021). **Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach** *Antimicrobial Resistance & Infection Control* May 1;10(1):74; \doi{10.1186/s13756-021-00939-2} +#' * Hebert C *et al.* (2012). **Demonstration of the weighted-incidence syndromic combination antibiogram: an empiric prescribing decision aid.** *Infection Control & Hospital Epidemiology* 33(4):381-388; \doi{10.1086/664768} +#' * Bielicki JA *et al.* (2016). **Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data.** *Journal of Antimicrobial Chemotherapy* 71(3):794-802; \doi{10.1093/jac/dkv397} +#' * Cook A *et al.* (2022). **Improving empiric antibiotic prescribing in pediatric bloodstream infections: a potential application of weighted-incidence syndromic combination antibiograms (WISCA).** *Expert Review of Anti-infective Therapy* 20(3):445-456; \doi{10.1080/14787210.2021.1967145} +#' * Klinker KP *et al.* (2021). **Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms.** *Therapeutic Advances in Infectious Disease*, May 5;8:20499361211011373; \doi{10.1177/20499361211011373} +#' * Barbieri E *et al.* (2021). **Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach.** *Antimicrobial Resistance & Infection Control* May 1;10(1):74; \doi{10.1186/s13756-021-00939-2} #' * **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. . #' @author Implementation: Dr. Larisse Bolton and Dr. Matthijs Berends #' @rdname antibiogram @@ -288,7 +194,39 @@ #' example_isolates #' #' \donttest{ -#' # Traditional antibiogram ---------------------------------------------- +#' # WISCA antibiogram (recommended for empirical therapy) ----------------- +#' +#' # basic WISCA: empirical coverage per regimen, weighted by pathogen +#' # incidence, with 95% credible intervals +#' wisca(example_isolates, +#' antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN") +#' ) +#' +#' # equivalent using antibiogram(): +#' antibiogram(example_isolates, +#' antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN"), +#' wisca = TRUE +#' ) +#' +#' # stratified by syndrome or clinical group +#' wisca(example_isolates, +#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), +#' syndromic_group = "ward" +#' ) +#' +#' # stratified using grouped tibbles (e.g. by age and gender) +#' if (requireNamespace("dplyr")) { +#' library(dplyr) +#' example_isolates %>% +#' top_n_microorganisms(n = 10) %>% +#' group_by( +#' age_group = age_groups(age, c(25, 50, 75)), +#' gender) %>% +#' wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) +#' } +#' +#' +#' # Traditional antibiogram (for AMR surveillance) ------------------------ #' #' antibiogram(example_isolates, #' antimicrobials = c(aminoglycosides(), carbapenems()) @@ -300,16 +238,9 @@ #' mo_transform = "gramstain" #' ) #' -#' antibiogram(example_isolates, -#' antimicrobials = carbapenems(), -#' ab_transform = "name", -#' mo_transform = "name" -#' ) #' +#' # Combination antibiogram (for AMR surveillance) ------------------------ #' -#' # Combined antibiogram ------------------------------------------------- -#' -#' # combined antimicrobials yield higher empiric coverage #' antibiogram(example_isolates, #' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), #' mo_transform = "gramstain" @@ -330,19 +261,16 @@ #' ) #' #' -#' # Syndromic antibiogram ------------------------------------------------ +#' # Syndromic antibiogram (for AMR surveillance) -------------------------- #' -#' # the data set could contain a filter for e.g. respiratory specimens #' antibiogram(example_isolates, #' antimicrobials = c(aminoglycosides(), carbapenems()), #' syndromic_group = "ward" #' ) #' -#' # now define a data set with only E. coli -#' ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] -#' #' # with a custom language, though this will be determined automatically #' # (i.e., this table will be in Spanish on Spanish systems) +#' ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] #' antibiogram(ex1, #' antimicrobials = aminoglycosides(), #' ab_transform = "name", @@ -353,22 +281,11 @@ #' ) #' #' -#' # WISCA antibiogram ---------------------------------------------------- -#' -#' # WISCA are not stratified by species, but rather on syndromes -#' antibiogram(example_isolates, -#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), -#' syndromic_group = "ward", -#' wisca = TRUE -#' ) -#' -#' #' # Print the output for R Markdown / Quarto ----------------------------- #' -#' ureido <- antibiogram(example_isolates, +#' ureido <- wisca(example_isolates, #' antimicrobials = ureidopenicillins(), -#' syndromic_group = "ward", -#' wisca = TRUE +#' syndromic_group = "ward" #' ) #' #' # in an Rmd file, you would just need to return `ureido` in a chunk, @@ -384,9 +301,8 @@ #' antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"), #' mo_transform = "gramstain" #' ) -#' ab2 <- antibiogram(example_isolates, +#' ab2 <- wisca(example_isolates, #' antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"), -#' mo_transform = "gramstain", #' syndromic_group = "ward" #' ) #' @@ -418,7 +334,6 @@ wisca <- function(x, info = interactive(), parallel = FALSE, ...) { - stop_ifnot(is.null(mo_transform), "{.arg mo_transform} must not be set if creating a WISCA; the incidence of the different species are already modelled into WISCA and cannot be taken separately.", call = FALSE) antibiogram( x = x, antimicrobials = antimicrobials, @@ -499,7 +414,7 @@ antibiogram.default <- function(x, meet_criteria(wisca, allow_class = "logical", has_length = 1) if (wisca) { if (!is.null(mo_transform) && !missing(mo_transform)) { - warning_("WISCA must be based on the species level as WISCA parameters are based on this. For that reason, {.arg mo_transform} will be ignored.") + stop_("{.arg mo_transform} cannot be used when creating a WISCA. WISCA already integrates pathogen incidence into the coverage estimate, so the output is inherently pathogen-agnostic. To stratify results, use {.arg syndromic_group} instead.") } mo_transform <- function(x) suppressMessages(suppressWarnings(as.mo(x, keep_synonyms = TRUE, language = NULL, info = FALSE))) } @@ -543,10 +458,14 @@ antibiogram.default <- function(x, attr(x, "antibiogram_groups") <- syndromic_group } else if (!is.null(syndromic_group) && length(syndromic_group) == 1) { x$`.syndromic_group` <- syndromic_group - } else { + } else if (NCOL(syndromic_group) > 1) { stop_("{.arg syndromic_group} should be a 1-dimensional computed value, or 1 or more column names of {.arg x}.") + } else { + x$`.syndromic_group` <- syndromic_group + } + if (any(x$`.syndromic_group` %in% c(NA, ""))) { + x$`.syndromic_group`[x$`.syndromic_group` %in% c(NA, "")] <- paste0("(", translate_AMR("unknown", language = language), ")") } - x$`.syndromic_group`[is.na(x$`.syndromic_group`) | x$`.syndromic_group` == ""] <- paste0("(", translate_AMR("unknown", language = language), ")") has_syndromic_group <- TRUE } else { has_syndromic_group <- FALSE @@ -1365,14 +1284,25 @@ retrieve_wisca_parameters <- function(wisca_model, ...) { # this prevents the requirement for putting the dependency in Imports: #' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::tbl_sum, antibiogram) tbl_sum.antibiogram <- function(x, ...) { - dims <- paste(format(NROW(x), big.mark = ","), AMR_env$cross_icon, format(NCOL(x), big.mark = ",")) - names(dims) <- "An Antibiogram" + dims <- NextMethod() if (isTRUE(attributes(x)$wisca)) { - dims <- c(dims, Type = paste0("WISCA with ", attributes(x)$conf_interval * 100, "% CI, ", attributes(x)$simulations, " simulations")) - } else if (isTRUE(attributes(x)$formatting_type >= 13)) { - dims <- c(dims, Type = paste0("Non-WISCA with ", attributes(x)$conf_interval * 100, "% CI")) + dims <- c(dims, + Type = "Weighted-Incidence Syndromic Combination Antibiogram (WISCA)", + "Cred. interval" = paste0(attributes(x)$conf_interval * 100, "%"), + Simulations = paste0(attributes(x)$simulations, " per stratum") + ) } else { - dims <- c(dims, Type = paste0("Non-WISCA without CI")) + type <- ifelse(any(attributes(x)$long_numeric$ab %like% "/", na.rm = TRUE), + "Combination Antibiogram", + ifelse(colnames(attributes(x)$long_numeric)[1] == "syndromic_group", + "Syndromic Antibiogram", + "Traditional Antibiogram" + ) + ) + dims <- c(dims, Type = type) + if (isTRUE(attributes(x)$formatting_type >= 13)) { + dims <- c(dims, "Conf. interval" = paste0(attributes(x)$conf_interval * 100, "%")) + } } dims } @@ -1384,15 +1314,17 @@ tbl_format_footer.antibiogram <- function(x, ...) { if (NROW(x) == 0) { return(footer) } - wisca_text <- ifelse(isTRUE(attributes(x)$wisca), - paste0("\n# ", font_bold("Be aware"), " that in a WISCA, overlapping CIs indicate non-inferiority."), - "" - ) - c(footer, font_subtle(paste0( - "# Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,\n", - "# or use it directly in R Markdown or Quarto, see ", word_wrap("?antibiogram"), ".", - wisca_text - ))) + if (isTRUE(attributes(x)$wisca)) { + c( + footer, + font_subtle(format_inline_("# Use {.fn ggplot2::autoplot} or base R {.fn plot} to create a plot of this antibiogram,\n# and use {.help [{.fn wisca_plot}](AMR::antibiogram)} to assess the simulation outcomes.\n# Or, use it directly in R Markdown or Quarto, see {.help [{.fn antibiogram}](AMR::antibiogram)}.")) + ) + } else { + c( + footer, + font_subtle(format_inline_("# Use {.fn ggplot2::autoplot} or base R {.fn plot} to create a plot of this antibiogram,\n# or use it directly in R Markdown or Quarto, see {.help [{.fn antibiogram}](AMR::antibiogram)}.")) + ) + } } #' @export diff --git a/R/mo_property.R b/R/mo_property.R index 74836bce4..f16fa7ee5 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -46,7 +46,7 @@ #' #' The short name ([mo_shortname()]) returns the first character of the genus and the full species, such as `"E. coli"`, for species and subspecies. Exceptions are abbreviations of staphylococci (such as *"CoNS"*, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as *"GBS"*, Group B Streptococci). Please bear in mind that e.g. *E. coli* could mean *Escherichia coli* (kingdom of Bacteria) as well as *Entamoeba coli* (kingdom of Protozoa). Returning to the full name will be done using [as.mo()] internally, giving priority to bacteria and human pathogens, i.e. `"E. coli"` will always be considered *Escherichia coli*. As a result, `mo_fullname(mo_shortname("Entamoeba coli"))` returns `"Escherichia coli"`. #' -#' Following the formal introduction of the new kingdom rank into prokaryotic nomenclature by G"{o}ker and Oren (2024, \doi{10.1099/ijsem.0.006242}), [mo_kingdom()] and [mo_domain()] return different results for bacteria and archaea: [mo_kingdom()] returns the new formal kingdom (e.g. "Pseudomonadati", "Bacillati"), while [mo_domain()] returns the new domain (e.g. "Bacteria", "Archaea"). For non-prokaryotic organisms, both functions return identical results. +#' Following the formal introduction of the new kingdom rank into prokaryotic nomenclature in 2024 (\doi{10.1099/ijsem.0.006242}), [mo_kingdom()] and [mo_domain()] return different results for bacteria and archaea: [mo_kingdom()] returns the new formal kingdom (e.g. "Pseudomonadati", "Bacillati"), while [mo_domain()] returns the new domain (e.g. "Bacteria", "Archaea"). For non-prokaryotic organisms, both functions return identical results. #' #' Determination of human pathogenicity ([mo_pathogenicity()]) is strongly based on Bartlett *et al.* (2022, \doi{10.1099/mic.0.001269}). This function returns a [factor] with the levels *Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*. #' diff --git a/README.Rmd b/README.Rmd index 79bcbd685..a210d396d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -22,7 +22,7 @@ Overview: * Provides an **all-in-one solution** for antimicrobial resistance (AMR) data analysis in a One Health approach * Peer-reviewed, used in over 175 countries, available in `r length(AMR:::LANGUAGES_SUPPORTED)` languages -* Generates **antibiograms** - traditional, combined, syndromic, and even WISCA +* Generates **antibiograms** - WISCA for empiric coverage estimates, or traditional/syndromic for AMR surveillance * Provides the **full microbiological taxonomy** of `r AMR:::format_included_data_number(AMR::microorganisms)` distinct species and extensive info of `r AMR:::format_included_data_number(NROW(AMR::antimicrobials) + NROW(AMR::antivirals))` antimicrobial drugs * Applies **CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`** and **EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`** clinical and veterinary breakpoints, and ECOFFs, for MIC and disk zone interpretation * Corrects for duplicate isolates, **calculates** and **predicts** AMR per antimicrobial class diff --git a/README.md b/README.md index f40a4d6dd..afdddd1e3 100755 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Overview: - Provides an **all-in-one solution** for antimicrobial resistance (AMR) data analysis in a One Health approach - Peer-reviewed, used in over 175 countries, available in 28 languages -- Generates **antibiograms** - traditional, combined, syndromic, and - even WISCA +- Generates **antibiograms** - WISCA for empiric coverage estimates, or + traditional/syndromic for AMR surveillance - Provides the **full microbiological taxonomy** of ~97 000 distinct species and extensive info of ~620 antimicrobial drugs - Applies **CLSI 2011-2026** and **EUCAST 2011-2026** clinical and diff --git a/index.Rmd b/index.Rmd index 12e467a2b..6c0f797b0 100644 --- a/index.Rmd +++ b/index.Rmd @@ -18,7 +18,7 @@ AMR:::reset_all_thrown_messages() * Provides an **all-in-one solution** for antimicrobial resistance (AMR) data analysis in a One Health approach * Peer-reviewed, used in over 175 countries, available in `r length(AMR:::LANGUAGES_SUPPORTED)` languages -* Generates **antibiograms** - traditional, combined, syndromic, and even WISCA +* Generates **antibiograms** - WISCA for empiric coverage estimates, or traditional/syndromic for AMR surveillance * Provides the **full microbiological taxonomy** of `r AMR:::format_included_data_number(AMR::microorganisms)` distinct species and extensive info of `r AMR:::format_included_data_number(NROW(AMR::antimicrobials) + NROW(AMR::antivirals))` antimicrobial drugs * Applies **CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`** and **EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`** clinical and veterinary breakpoints, and ECOFFs, for MIC and disk zone interpretation * Corrects for duplicate isolates, **calculates** and **predicts** AMR per antimicrobial class diff --git a/index.md b/index.md index c020ad69f..e44453b30 100644 --- a/index.md +++ b/index.md @@ -6,8 +6,8 @@ - Provides an **all-in-one solution** for antimicrobial resistance (AMR) data analysis in a One Health approach - Peer-reviewed, used in over 175 countries, available in 28 languages -- Generates **antibiograms** - traditional, combined, syndromic, and - even WISCA +- Generates **antibiograms** - WISCA for empiric coverage estimates, or + traditional/syndromic for AMR surveillance - Provides the **full microbiological taxonomy** of ~97 000 distinct species and extensive info of ~620 antimicrobial drugs - Applies **CLSI 2011-2026** and **EUCAST 2011-2026** clinical and diff --git a/man/antibiogram.Rd b/man/antibiogram.Rd index 94332425f..195a66962 100644 --- a/man/antibiogram.Rd +++ b/man/antibiogram.Rd @@ -8,7 +8,7 @@ \alias{autoplot.antibiogram} \alias{wisca_plot} \alias{knit_print.antibiogram} -\title{Generate Traditional, Combination, Syndromic, or WISCA Antibiograms} +\title{Generate Antibiograms (WISCA, Traditional, Combination, or Syndromic)} \usage{ wisca( x, @@ -141,7 +141,7 @@ wisca_plot( \item{mo_transform}{A character to transform microorganism input - must be \code{"name"}, \code{"shortname"} (default), \code{"gramstain"}, or one of the column names of the \link{microorganisms} data set: \code{"mo"}, \code{"fullname"}, \code{"status"}, \code{"domain"}, \code{"kingdom"}, \code{"phylum"}, \code{"class"}, \code{"order"}, \code{"family"}, \code{"genus"}, \code{"species"}, \code{"subspecies"}, \code{"rank"}, \code{"ref"}, \code{"oxygen_tolerance"}, \code{"morphology"}, \code{"source"}, \code{"lpsn"}, \code{"lpsn_parent"}, \code{"lpsn_renamed_to"}, \code{"mycobank"}, \code{"mycobank_parent"}, \code{"mycobank_renamed_to"}, \code{"gbif"}, \code{"gbif_parent"}, \code{"gbif_renamed_to"}, \code{"prevalence"}, or \code{"snomed"}. Can also be \code{NULL} to not transform the input or \code{NA} to consider all microorganisms 'unknown'.} -\item{add_total_n}{\emph{(deprecated in favour of \code{formatting_type})} A \link{logical} to indicate whether \code{n_tested} available numbers per pathogen should be added to the table (default is \code{TRUE}). This will add the lowest and highest number of available isolates per antimicrobial (e.g, if for \emph{E. coli} 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when \code{wisca = TRUE}; in that case, use \code{\link[=retrieve_wisca_parameters]{retrieve_wisca_parameters()}} to get the parameters used for WISCA.} +\item{add_total_n}{\emph{(deprecated in favour of \code{formatting_type})} A \link{logical} to indicate whether \code{n_tested} available numbers per pathogen should be added to the table (default is \code{TRUE}). This will add the lowest and highest number of available isolates per antimicrobial (e.g., if for \emph{E. coli} 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when \code{wisca = TRUE}; in that case, use \code{\link[=retrieve_wisca_parameters]{retrieve_wisca_parameters()}} to get the parameters used for WISCA.} \item{minimum}{The minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see \emph{Source}.} @@ -170,9 +170,11 @@ Set \code{simulations}, \code{conf_interval}, and \code{interval_side} to adjust \item{na}{Character to use for showing \code{NA} values.} } \description{ -Create detailed antibiograms with options for traditional, combination, syndromic, and Bayesian WISCA methods. +Generate antibiograms from antimicrobial susceptibility data, with support for traditional, combination, syndromic, and WISCA (Weighted-Incidence Syndromic Combination Antibiogram) methods. -Adhering to previously described approaches (see \emph{Source}) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki \emph{et al.}, these functions provide flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. +\strong{For empirical therapy guidance, WISCA is the recommended approach.} When initiating empirical treatment, the causative pathogen is unknown, and the clinically relevant question is: \emph{"what is the probability that this regimen will cover whatever pathogen turns out to cause the infection?"} WISCA answers that question directly by weighting susceptibility by pathogen incidence within a syndrome and providing credible intervals via Bayesian Monte Carlo simulation. Traditional antibiograms remain appropriate for tracking resistance per species for surveillance purposes. See the section \emph{Explaining WISCA} on this page and the \href{https://amr-for-r.org/articles/WISCA.html}{WISCA vignette} for details. + +All antibiogram types adhere to previously described approaches (see \emph{Source}), and the WISCA method implements the Bayesian decision model by Bielicki \emph{et al.} (2016, \doi{10.1093/jac/dkv397}). Output formats include plots and tables, ideal for integration with R Markdown and Quarto reports. } \details{ These functions return a table with values between 0 and 100 for \emph{susceptibility}, not resistance. @@ -215,61 +217,15 @@ The default can be set globally with the package option \code{\link[=AMR-options Set \code{digits} (defaults to \code{0}) to alter the rounding of the susceptibility percentages. } -\subsection{Antibiogram Types}{ +\subsection{When to Use WISCA vs. Traditional Antibiograms}{ -There are various antibiogram types, as summarised by Klinker \emph{et al.} (2021, \doi{10.1177/20499361211011373}), and they are all supported by \code{\link[=antibiogram]{antibiogram()}}. +There are various antibiogram types, as summarised by Klinker \emph{et al.} (2021, \doi{10.1177/20499361211011373}), and they are all supported by \code{\link[=antibiogram]{antibiogram()}}: traditional, combination, syndromic, and WISCA. -For clinical coverage estimations, \strong{use WISCA whenever possible}, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki \emph{et al.} (2020, \doi{10.1001/jamanetworkopen.2019.21124}). See the section \emph{Explaining WISCA} on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome. -\enumerate{ -\item \strong{Traditional Antibiogram} +\strong{If your goal is to guide empirical therapy, use WISCA.} Traditional antibiograms fragment susceptibility information by species, but at the point of prescribing, the clinician does not know which species is causing the infection. WISCA shifts the unit of analysis from the isolate to the patient: it estimates the probability that a regimen will cover the infection, given the local distribution of causative pathogens. It evaluates combination regimens, weights by pathogen incidence, and provides credible intervals that honestly communicate uncertainty. Hebert \emph{et al.} (2012) demonstrated this concretely for the first time: ciprofloxacin showed 84\% susceptibility against \emph{E. coli} in the traditional antibiogram, but WISCA coverage was only 62\% for UTI and 37\% for abdominal infections, because other species (including intrinsically resistant enterococci) contribute substantially to these syndromes. Note that WISCA is pathogen-agnostic: the outcome is not stratified by species, but by syndrome. -Case example: Susceptibility of \emph{Pseudomonas aeruginosa} to piperacillin/tazobactam (TZP) +\strong{Traditional, combination, and syndromic antibiograms remain appropriate for AMR surveillance}, i.e., tracking resistance trends per species over time. They are the right tool when the question is \emph{"how resistant is species X to drug Y in our setting?"} rather than \emph{"what regimen best covers this syndrome?"}. -Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = "TZP") -}\if{html}{\out{
}} -\item \strong{Combination Antibiogram} - -Case example: Additional susceptibility of \emph{Pseudomonas aeruginosa} to TZP + tobramycin versus TZP alone - -Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) -}\if{html}{\out{
}} -\item \strong{Syndromic Antibiogram} - -Case example: Susceptibility of \emph{Pseudomonas aeruginosa} to TZP among respiratory specimens (obtained among ICU patients only) - -Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = penicillins(), - syndromic_group = "ward") -}\if{html}{\out{
}} -\item \strong{Weighted-Incidence Syndromic Combination Antibiogram (WISCA)} - -WISCA can be applied to any antibiogram, see the section \emph{Explaining WISCA} on this page for more information. - -Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), - wisca = TRUE) - -# this is equal to: -wisca(your_data, - antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) -}\if{html}{\out{
}} - -WISCA uses a sophisticated Bayesian decision model to combine both local and pooled antimicrobial resistance data. This approach not only evaluates local patterns but can also draw on multi-centre data sets to improve regimen accuracy, even in low-incidence infections like paediatric bloodstream infections (BSIs). - -\strong{Prior Distributions} - -When \code{wisca = TRUE} or when using \code{wisca()}, pathogen incidence is modelled with a non-informative \eqn{Dirichlet(1, 1, \ldots, 1)} prior. Susceptibility proportions use the Jeffreys prior, \eqn{\beta(0.5, 0.5)}, except for bug-drug combinations with known intrinsic resistance, which use a strongly informative \eqn{\beta(1, 9999)} prior that forces near-zero susceptibility regardless of observed data (Bielicki \emph{et al.}, 2016). Intrinsic resistance is determined using the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/bacteria/important-additional-information/expert-rules/}{'EUCAST Expected Resistant Phenotypes' v1.2} (2023). -} +All four types are demonstrated in the \emph{Examples} section below. } \subsection{Grouped tibbles}{ @@ -285,55 +241,6 @@ your_data \%>\% }\if{html}{\out{}} } -\subsection{Stepped Approach for Clinical Insight}{ - -In clinical practice, antimicrobial coverage decisions evolve as more microbiological data becomes available. This theoretical stepped approach ensures empirical coverage can continuously assessed to improve patient outcomes: -\enumerate{ -\item \strong{Initial Empirical Therapy (Admission / Pre-Culture Data)} - -At admission, no pathogen information is available. -\itemize{ -\item Action: broad-spectrum coverage is based on local resistance patterns and syndromic antibiograms. Using the pathogen-agnostic yet incidence-weighted WISCA is preferred. -\item Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = selected_regimens, - mo_transform = NA) # all pathogens set to `NA` - -# preferred: use WISCA -wisca(your_data, - antimicrobials = selected_regimens) -}\if{html}{\out{
}} -} -\item \strong{Refinement with Gram Stain Results} - -When a blood culture becomes positive, the Gram stain provides an initial and crucial first stratification (Gram-positive vs. Gram-negative). -\itemize{ -\item Action: narrow coverage based on Gram stain-specific resistance patterns. -\item Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = selected_regimens, - mo_transform = "gramstain") # all pathogens set to Gram-pos/Gram-neg -}\if{html}{\out{
}} -} -\item \strong{Definitive Therapy Based on Species Identification} - -After cultivation of the pathogen, full pathogen identification allows precise targeting of therapy. -\itemize{ -\item Action: adjust treatment to pathogen-specific antibiograms, minimizing resistance risks. -\item Code example: - -\if{html}{\out{
}}\preformatted{antibiogram(your_data, - antimicrobials = selected_regimens, - mo_transform = "shortname") # all pathogens set to 'G. species', e.g., E. coli -}\if{html}{\out{
}} -} -} - -By structuring antibiograms around this stepped approach, clinicians can make data-driven adjustments at each stage, ensuring optimal empirical and targeted therapy while reducing unnecessary broad-spectrum antimicrobial use. -} - \subsection{Inclusion in Combination Antibiograms}{ Note that for combination antibiograms, it is important to realise that susceptibility can be calculated in two ways, which can be set with the \code{only_all_tested} argument (default is \code{FALSE}). See this example for two antimicrobials, Drug A and Drug B, about how \code{\link[=antibiogram]{antibiogram()}} works to calculate the \%SI: @@ -369,11 +276,15 @@ You can also use functions from specific 'table reporting' packages to transform \section{Explaining WISCA}{ -WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability of empirical coverage for combination regimens. +WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability that an empirical antimicrobial regimen will provide adequate coverage for a given infection syndrome, before the causative pathogen has been identified. -It weights susceptibility by pathogen prevalence within a clinical syndrome and provides credible intervals around the expected coverage. +It does so by combining two quantities: the relative incidence of each pathogen within the syndrome (modelled as a Dirichlet distribution) and the susceptibility of each pathogen to the regimen (modelled as Beta distributions). These are combined via Monte Carlo simulation to produce a coverage estimate with a credible interval. -For more background, interpretation, and examples, see \href{https://amr-for-r.org/articles/WISCA.html}{the WISCA vignette}. +\strong{Prior distributions:} Pathogen incidence uses a non-informative \eqn{Dirichlet(1, 1, \ldots, 1)} prior. Susceptibility proportions use the Jeffreys prior, \eqn{\beta(0.5, 0.5)}, except for pathogen-drug combinations with known intrinsic resistance, which use a strongly informative \eqn{\beta(1, 9999)} prior that forces near-zero susceptibility regardless of observed data. Intrinsic resistance is determined using the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/bacteria/important-additional-information/expert-rules/}{'EUCAST Expected Resistant Phenotypes' v1.2} (2023). + +\strong{Interpreting the output:} Overlapping credible intervals between regimens indicate no significant difference in coverage; if a narrower-spectrum regimen overlaps with a broader one, the narrower-spectrum option may be preferred on stewardship grounds. Non-overlapping intervals indicate a clinically meaningful difference. For small sample sizes, consider pooling data from multiple sites to improve precision, provided pathogen distributions are sufficiently similar (Bielicki \emph{et al.}, 2016). + +For the full mathematical derivation and worked examples, see the \href{https://amr-for-r.org/articles/WISCA.html}{WISCA vignette}. } \examples{ @@ -382,7 +293,39 @@ For more background, interpretation, and examples, see \href{https://amr-for-r.o example_isolates \donttest{ -# Traditional antibiogram ---------------------------------------------- +# WISCA antibiogram (recommended for empirical therapy) ----------------- + +# basic WISCA: empirical coverage per regimen, weighted by pathogen +# incidence, with 95\% credible intervals +wisca(example_isolates, + antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN") +) + +# equivalent using antibiogram(): +antibiogram(example_isolates, + antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN"), + wisca = TRUE +) + +# stratified by syndrome or clinical group +wisca(example_isolates, + antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), + syndromic_group = "ward" +) + +# stratified using grouped tibbles (e.g. by age and gender) +if (requireNamespace("dplyr")) { + library(dplyr) + example_isolates \%>\% + top_n_microorganisms(n = 10) \%>\% + group_by( + age_group = age_groups(age, c(25, 50, 75)), + gender) \%>\% + wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN")) +} + + +# Traditional antibiogram (for AMR surveillance) ------------------------ antibiogram(example_isolates, antimicrobials = c(aminoglycosides(), carbapenems()) @@ -394,16 +337,9 @@ antibiogram(example_isolates, mo_transform = "gramstain" ) -antibiogram(example_isolates, - antimicrobials = carbapenems(), - ab_transform = "name", - mo_transform = "name" -) +# Combination antibiogram (for AMR surveillance) ------------------------ -# Combined antibiogram ------------------------------------------------- - -# combined antimicrobials yield higher empiric coverage antibiogram(example_isolates, antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), mo_transform = "gramstain" @@ -424,19 +360,16 @@ antibiogram(example_isolates, ) -# Syndromic antibiogram ------------------------------------------------ +# Syndromic antibiogram (for AMR surveillance) -------------------------- -# the data set could contain a filter for e.g. respiratory specimens antibiogram(example_isolates, antimicrobials = c(aminoglycosides(), carbapenems()), syndromic_group = "ward" ) -# now define a data set with only E. coli -ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] - # with a custom language, though this will be determined automatically # (i.e., this table will be in Spanish on Spanish systems) +ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] antibiogram(ex1, antimicrobials = aminoglycosides(), ab_transform = "name", @@ -447,22 +380,11 @@ antibiogram(ex1, ) -# WISCA antibiogram ---------------------------------------------------- - -# WISCA are not stratified by species, but rather on syndromes -antibiogram(example_isolates, - antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), - syndromic_group = "ward", - wisca = TRUE -) - - # Print the output for R Markdown / Quarto ----------------------------- -ureido <- antibiogram(example_isolates, +ureido <- wisca(example_isolates, antimicrobials = ureidopenicillins(), - syndromic_group = "ward", - wisca = TRUE + syndromic_group = "ward" ) # in an Rmd file, you would just need to return `ureido` in a chunk, @@ -478,9 +400,8 @@ ab1 <- antibiogram(example_isolates, antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"), mo_transform = "gramstain" ) -ab2 <- antibiogram(example_isolates, +ab2 <- wisca(example_isolates, antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"), - mo_transform = "gramstain", syndromic_group = "ward" ) @@ -497,10 +418,11 @@ plot(ab2) } \references{ \itemize{ -\item Bielicki JA \emph{et al.} (2016). \strong{Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data} \emph{Journal of Antimicrobial Chemotherapy} 71(3); \doi{10.1093/jac/dkv397} -\item Bielicki JA \emph{et al.} (2020). \strong{Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries} \emph{JAMA Netw Open.} 3(2):e1921124; \doi{10.1001/jamanetworkopen.2019.21124} -\item Klinker KP \emph{et al.} (2021). \strong{Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms}. \emph{Therapeutic Advances in Infectious Disease}, May 5;8:20499361211011373; \doi{10.1177/20499361211011373} -\item Barbieri E \emph{et al.} (2021). \strong{Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach} \emph{Antimicrobial Resistance & Infection Control} May 1;10(1):74; \doi{10.1186/s13756-021-00939-2} +\item Hebert C \emph{et al.} (2012). \strong{Demonstration of the weighted-incidence syndromic combination antibiogram: an empiric prescribing decision aid.} \emph{Infection Control & Hospital Epidemiology} 33(4):381-388; \doi{10.1086/664768} +\item Bielicki JA \emph{et al.} (2016). \strong{Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data.} \emph{Journal of Antimicrobial Chemotherapy} 71(3):794-802; \doi{10.1093/jac/dkv397} +\item Cook A \emph{et al.} (2022). \strong{Improving empiric antibiotic prescribing in pediatric bloodstream infections: a potential application of weighted-incidence syndromic combination antibiograms (WISCA).} \emph{Expert Review of Anti-infective Therapy} 20(3):445-456; \doi{10.1080/14787210.2021.1967145} +\item Klinker KP \emph{et al.} (2021). \strong{Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms.} \emph{Therapeutic Advances in Infectious Disease}, May 5;8:20499361211011373; \doi{10.1177/20499361211011373} +\item Barbieri E \emph{et al.} (2021). \strong{Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach.} \emph{Antimicrobial Resistance & Infection Control} May 1;10(1):74; \doi{10.1186/s13756-021-00939-2} \item \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition}, 2022, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. } } diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 06ad58161..adebf117e 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -351,7 +351,7 @@ All functions will, at default, \strong{not} keep old taxonomic properties, as s The short name (\code{\link[=mo_shortname]{mo_shortname()}}) returns the first character of the genus and the full species, such as \code{"E. coli"}, for species and subspecies. Exceptions are abbreviations of staphylococci (such as \emph{"CoNS"}, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as \emph{"GBS"}, Group B Streptococci). Please bear in mind that e.g. \emph{E. coli} could mean \emph{Escherichia coli} (kingdom of Bacteria) as well as \emph{Entamoeba coli} (kingdom of Protozoa). Returning to the full name will be done using \code{\link[=as.mo]{as.mo()}} internally, giving priority to bacteria and human pathogens, i.e. \code{"E. coli"} will always be considered \emph{Escherichia coli}. As a result, \code{mo_fullname(mo_shortname("Entamoeba coli"))} returns \code{"Escherichia coli"}. -Following the formal introduction of the new kingdom rank into prokaryotic nomenclature by G"{o}ker and Oren (2024, \doi{10.1099/ijsem.0.006242}), \code{\link[=mo_kingdom]{mo_kingdom()}} and \code{\link[=mo_domain]{mo_domain()}} return different results for bacteria and archaea: \code{\link[=mo_kingdom]{mo_kingdom()}} returns the new formal kingdom (e.g. "Pseudomonadati", "Bacillati"), while \code{\link[=mo_domain]{mo_domain()}} returns the new domain (e.g. "Bacteria", "Archaea"). For non-prokaryotic organisms, both functions return identical results. +Following the formal introduction of the new kingdom rank into prokaryotic nomenclature in 2024 (\doi{10.1099/ijsem.0.006242}), \code{\link[=mo_kingdom]{mo_kingdom()}} and \code{\link[=mo_domain]{mo_domain()}} return different results for bacteria and archaea: \code{\link[=mo_kingdom]{mo_kingdom()}} returns the new formal kingdom (e.g. "Pseudomonadati", "Bacillati"), while \code{\link[=mo_domain]{mo_domain()}} returns the new domain (e.g. "Bacteria", "Archaea"). For non-prokaryotic organisms, both functions return identical results. Determination of human pathogenicity (\code{\link[=mo_pathogenicity]{mo_pathogenicity()}}) is strongly based on Bartlett \emph{et al.} (2022, \doi{10.1099/mic.0.001269}). This function returns a \link{factor} with the levels \emph{Pathogenic}, \emph{Potentially pathogenic}, \emph{Non-pathogenic}, and \emph{Unknown}.