1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-31 00:16:08 +02:00

Reproduce clinical breakpoints from latest WHONET/AMRIE data

- Ran reproduction_of_microorganisms.groups.R and reproduction_of_clinical_breakpoints.R
  against the latest WHONET/AMRIE source (includes EUCAST 2026, CLSI 2025)
- Updated data/clinical_breakpoints.rda, microorganisms.codes.rda, microorganisms.groups.rda,
  and data-raw/organisms.rds
- Fixed reproduction_of_microorganisms.groups.R: replaced base ifelse() with dplyr::if_else()
  to preserve the <mo> S3 class; base ifelse() strips class attributes, causing
  bind_rows() to fail with strict vctrs type checking in dplyr >= 1.1.0
- Added data-raw/_run_reproduction.R: non-interactive wrapper that overrides View(),
  sets UTF-8 locale, and sources both scripts in the correct order

https://claude.ai/code/session_01S5vMqfsiJb59RN2Gyz1tDY
This commit is contained in:
Claude
2026-03-26 06:01:17 +00:00
parent 9c95aa455c
commit 6912c9deee
8 changed files with 34 additions and 6 deletions

View File

@@ -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)) %>%