diff --git a/DESCRIPTION b/DESCRIPTION index 650f939fc..49ec9f2d0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 3.0.1.9040 -Date: 2026-03-24 +Version: 3.0.1.9041 +Date: 2026-03-26 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index e43d0f943..a2cd91cda 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 3.0.1.9040 +# AMR 3.0.1.9041 ### New * Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes` @@ -31,6 +31,7 @@ * Fixed SIR and MIC coercion of combined values, e.g. `as.sir("<= 0.002; S") ` or `as.mic("S; 0.002")` (#252) ### Updates +* Reproduced `clinical_breakpoints`, `microorganisms.codes`, and `microorganisms.groups` from the latest WHONET/AMRIE source data (EUCAST 2026 and CLSI 2025 included); fixed `reproduction_of_microorganisms.groups.R` to use `dplyr::if_else()` instead of base `ifelse()` to preserve the `` class in `bind_rows()` * Extensive `cli` integration for better message handling and clickable links in messages and warnings (#191, #265) * `mdro()` now infers resistance for a _missing_ base drug column from an _available_ corresponding drug+inhibitor combination showing resistance (e.g., piperacillin is absent but required, while piperacillin/tazobactam available and resistant). Can be set with the new argument `infer_from_combinations`, which defaults to `TRUE` (#209). Note that this can yield a higher MDRO detection (which is a good thing as it has become more reliable). * `susceptibility()` and `resistance()` gained the argument `guideline`, which defaults to EUCAST, for interpreting the 'I' category correctly. diff --git a/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R b/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R index 7463b6b6a..1f52d20ac 100644 --- a/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R +++ b/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R @@ -85,9 +85,9 @@ microorganisms.groups <- whonet_organisms %>% "Mycobacterium canetti")) %>% filter(!is.na(SPECIES_GROUP), SPECIES_GROUP != ORGANISM_CODE) %>% transmute(mo_group = as.mo(SPECIES_GROUP), - mo = ifelse(is.na(mo), - as.character(as.mo(ORGANISM, keep_synonyms = TRUE, minimum_matching_score = 0)), - mo)) %>% + mo = if_else(is.na(mo), + as.mo(ORGANISM, keep_synonyms = TRUE, minimum_matching_score = 0), + mo)) %>% # add our own CoNS and CoPS, WHONET does not strictly follow Becker et al. (2014, 2019, 2020) filter(mo_group != as.mo("CoNS")) %>% bind_rows(tibble(mo_group = as.mo("CoNS"), mo = MO_CONS)) %>% diff --git a/data-raw/_run_reproduction.R b/data-raw/_run_reproduction.R new file mode 100644 index 000000000..8d7fd9acc --- /dev/null +++ b/data-raw/_run_reproduction.R @@ -0,0 +1,27 @@ +# Wrapper to run clinical breakpoints reproduction non-interactively +# Set UTF-8 locale so gsub() can handle Unicode patterns +Sys.setlocale("LC_CTYPE", "C.utf8") +Sys.setlocale("LC_ALL", "C.utf8") + +# Overrides View() to just print a summary instead +View <- function(x, title = NULL) { + if (is.data.frame(x) || is.matrix(x)) { + cat("=== View() called:", if (!is.null(title)) title else deparse(substitute(x)), "===\n") + cat("Dimensions:", nrow(x), "rows x", ncol(x), "cols\n") + print(head(x, 10)) + cat("...\n\n") + } else { + print(x) + } + invisible(x) +} + +setwd("/home/user/AMR") + +cat("=== Step 1: Running reproduction_of_microorganisms.groups.R ===\n") +source("data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R") + +cat("\n=== Step 2: Running reproduction_of_clinical_breakpoints.R ===\n") +source("data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R") + +cat("\n=== Done! ===\n") diff --git a/data-raw/organisms.rds b/data-raw/organisms.rds index 7514174e6..317815e22 100644 Binary files a/data-raw/organisms.rds and b/data-raw/organisms.rds differ diff --git a/data/clinical_breakpoints.rda b/data/clinical_breakpoints.rda index ce51e9e92..8833bb4eb 100644 Binary files a/data/clinical_breakpoints.rda and b/data/clinical_breakpoints.rda differ diff --git a/data/microorganisms.codes.rda b/data/microorganisms.codes.rda index f3d0ec099..f2f19bba0 100644 Binary files a/data/microorganisms.codes.rda and b/data/microorganisms.codes.rda differ diff --git a/data/microorganisms.groups.rda b/data/microorganisms.groups.rda index ca46be429..a356b43c4 100644 Binary files a/data/microorganisms.groups.rda and b/data/microorganisms.groups.rda differ