mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 04:20:53 +01:00
Update taxonomy of microorganisms (2026-10) (#312)
* Update taxonomy of microorganisms (2026-10) Rebuild of the microorganisms data set from COL 2026-04-18 XR, LPSN and BacDive of October 2026 and MycoBank of January 2026, with v3.0.1 as the previous data set: 111,103 records (v3.0.1: 78,679), 0 changed MO codes of existing names, 522 released codes retired (275 to be reviewed). Script fixes (data-raw/_reproduction_scripts/reproduction_of_microorganisms.R): - previous data set from the last release; COL read as COL Data Package (NameUsage.tsv) - keep COL records without authors (a filter on NA dropped them, e.g. Balamuthia mandrillaris) - genus homonyms: unclassified MycoBank entries are not authoritative; the released domain of a genus wins if a source supports it (e.g. Moorella, Serpula, Pirella stay Bacteria) - protect current names of relevant species instead of whole current genera (data set tripled) - current names and synonyms only within the same domain and for known names (Brugia -> Lycoperdon) - MycoBank names in Latin script only; old records outside their source's scope become manually added - Graphium butterflies of v3.0.1 are not carried over, re-added or restored - restore released taxa by name and rank; retire older cross-domain homonyms for review - fill empty families from COL and a commented override list (Ascaris, Balamuthia) - add Brugia malayi and B. timori; remove Salmonella species synonyms that are serovars - BacDive: a minority of facultative strain records no longer decides (C. difficile) - translate codes of other data sets with the development version; review unmatched codes - scope decisions: COL XR names only if relevant or released; Protozoa follow the Fungi rules Also: all checkpoints (data-raw/taxonomy*.rds), updated data sets, Bartlett et al. list, accessed dates in TAXONOMY_VERSION, NEWS, two staphylococci added to CoNS, tests updated for real taxonomic changes, known defects file removed (all solved), and the findings report with all review files in data-raw/taxonomy_review/2026-10/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy review report: note on the .dta export and the single commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix as.mo() for Salmonella serovars written with the species; add S. xeri to CoNS - "Salmonella enterica (subsp. enterica) serovar Typhi" returned S. bongori, and "S. enterica Typhimurium" S. enterica diarizonae; "Paratyphi A/B/C" became serogroups - Staphylococcus xeri and S. parequorum confirmed as coagulase-negative Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy build: remove lichens (decision of 5 October 2026) Fungi in the lichen-forming classes and the order Verrucariales are removed unless their genus is clinically relevant, with the synonyms that point to them (4,155 records); released lichens are restored. microorganisms now has 107,126 records (Fungi 45,739); all tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy review decisions: microsporidia in Fungi, accepted names, missing protozoa - all microsporidia in the Fungi (1,394 names of v3.0.1 from P_ to F_, old codes translated by name) - Enterocytozoon bieneusi and Encephalitozoon cuniculi as accepted names (accepted_name_override) - Balantidium and Isospora added to MO_RELEVANT_GENERA; Cystoisospora belli as synonym of Isospora belli - synonym cycles decided: Capillidium and Scolecobasidium are the current genera - removed the stale data-raw/taxonomy_lpsn0.rds - microorganisms now has 107,253 records; all tests pass Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy review report: all items reviewed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Rule matching by accepted taxon; Erysipelatoclostridium as synonym of Thomasclavelia - interpretive_rules(): species named in a rule (literal names, genus_species/fullname) now also match all other names of the same accepted taxon, e.g. 'Clostridium ramosum' for Thomasclavelia ramosa; not for genera or regex rules - Erysipelatoclostridium and its species are synonyms of Thomasclavelia (accepted_name_override); E. merdavium is retired by decision of 6 October 2026, and the build removes taxa retired by a human decision - microorganisms patched with the same logic as the build script (no full rebuild): 107,252 records - intrinsic_resistant regenerated with the new taxonomy and rule matching: 308,646 rows - clinical_breakpoints: EUCAST workbook rows merged again, 24 EUCAST 2026 rows moved from C. ramosum to T. ramosa Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy: correct records for names listed twice, no synonyms without a current name, strict data tests - one record per name keeps the accepted record (e.g. Eggerthella lenta, Gordonia amarae, Anisakis simplex and Enterobius vermicularis were synonyms without a current name), links to dropped records are moved - LPSN lookup reads the taxonomic status and correct name; validly published synonyms are no longer 'accepted' - synonyms without a current name: linked via LPSN or removed, released codes retired (3,668); records with kept children become 'unknown'; the M. tuberculosis complex is protected (decisions of 7 October 2026) - subspecies codes reserved, current names of synonyms kept when pruning, missing parent records added or moved, higher taxonomy harmonised, shared identifiers resolved per domain and rank, pointers and parent links cleaned - data sets refer only to current names (except intrinsic_resistant); group members only from current names; internal CoNS/CoPS/streptococcal lists keep a synonym only with its current name - intrinsic_resistant, clinical_breakpoints (EUCAST workbooks) and microorganisms.groups regenerated - 28 new tests in test-data.R; devtools::test(): 1,581 expectations, 0 failures - open decisions listed in data-raw/taxonomy_review/2026-10/REPORT.md, section 6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy: protect WHO priority genera, follow LPSN for the M. tuberculosis complex, place protist groups in one domain - all taxa of the genera in MO_WHO_PRIORITY_GENERA are protected, also names that are not validly published (replaces the hard-coded M. tuberculosis complex; keeps e.g. Klebsiella quasivariicola, M. canettii, M. orygis) - LPSN is followed for the M. tuberculosis complex: M. bovis, M. africanum, M. caprae, M. microti and M. pinnipedii are heterotypic synonyms of M. tuberculosis (Riojas et al. 2018); a test enforces this - labyrinthulids in the Chromista (Aplanochytrium), Dictydiaethalium in the Protozoa (genus_domain_move), and the rank suffix also between domains ('Acantharia {class}' next to the fungal genus Acantharia) - devtools::test(): 1,582 expectations, 0 failures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy build no longer depends on the previous build - intrinsic_resistant is no input of the microorganisms build anymore (it is computed from it); the genera named in the interpretive rules are read from the rules instead - the previous data set no longer makes genera relevant; Debaryomyces added to MO_RELEVANT_GENERA - new run_after_microorganisms_build.R recreates microorganisms.groups, the EUCAST breakpoints and intrinsic_resistant in the right order, and the build runs it at its end - reproduction_of_intrinsic_resistant.R uses devtools::load_all() instead of the installed package - effect: 24 never released, not relevant COL records less; devtools::test(): 1,582 expectations, 0 failures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Taxonomy review report: summary updated to the second round Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MO code retirements: mark the 265 reviewed retirements as reviewed The Graphium and v2.x Protozoa retirements were reviewed and accepted on 6 October 2026 (see the taxonomy review report, section 5); 'NEEDS REVIEW' is replaced by 'reviewed by Matthijs S. Berends on 2026-10-06'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4aafe9a676
commit
0ca43df459
148 files changed
+146598
-67161
No files matched your search
@@ -27,7 +27,9 @@
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
library(AMR)
|
||||
# the package in this repository, so that the newest microorganisms data set is used (an installed version of the
|
||||
# package may be older)
|
||||
devtools::load_all()
|
||||
library(dplyr)
|
||||
int_resis <- data.frame(mo = microorganisms$mo, stringsAsFactors = FALSE)
|
||||
for (i in seq_len(nrow(antimicrobials))) {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -36,6 +36,13 @@ library(readr)
|
||||
library(tidyr)
|
||||
devtools::load_all()
|
||||
|
||||
# group members that are selected from the microorganisms data set (by genus, code or the internal lists below) are
|
||||
# only taken from the current names: a synonym record would otherwise bring in another organism once it is replaced
|
||||
# by its current name, e.g. 'Haemophilus vaginalis' (Gardnerella vaginalis) in HACEK, or 'Staphylococcus roterodami'
|
||||
# (Staphylococcus aureus) in CoPS (decision by Matthijs S. Berends, 7 October 2026: only current names)
|
||||
mo_current_only <- microorganisms %>% filter(status != "synonym")
|
||||
current_only <- function(mo) mo[as.character(mo) %in% as.character(mo_current_only$mo)]
|
||||
|
||||
# BACTERIAL COMPLEXES
|
||||
# find all bacterial complex in the NCBI Taxonomy Browser here:
|
||||
# https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Undef&id=2&lvl=6&lin=f&keep=1&srchmode=1&unlock
|
||||
@@ -90,69 +97,73 @@ microorganisms.groups <- whonet_organisms %>%
|
||||
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
|
||||
# (as <mo>, so that the rows below can be bound to it)
|
||||
mo = as.mo(
|
||||
ifelse(is.na(mo),
|
||||
as.character(as.mo(ORGANISM, keep_synonyms = TRUE, minimum_matching_score = 0)),
|
||||
mo
|
||||
),
|
||||
keep_synonyms = TRUE
|
||||
)
|
||||
) %>%
|
||||
# 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)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoNS"), mo = current_only(MO_CONS))) %>%
|
||||
filter(mo_group != as.mo("CoPS")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoPS"), mo = MO_COPS)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoPS"), mo = current_only(MO_COPS))) %>%
|
||||
# at least all our Lancefield-grouped streptococci must be in the beta-haemolytic group:
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Beta-haemolytic streptococcus"),
|
||||
mo = c(
|
||||
MO_LANCEFIELD,
|
||||
microorganisms %>% filter(fullname %like% "^Streptococcus Group") %>% pull(mo)
|
||||
current_only(MO_LANCEFIELD),
|
||||
mo_current_only %>% filter(fullname %like% "^Streptococcus Group") %>% pull(mo)
|
||||
)
|
||||
)) %>%
|
||||
# and per Streptococcus group as well:
|
||||
# group A - S. pyogenes
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group A"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_PYGN(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_PYGN(_|$)")]
|
||||
)) %>%
|
||||
# group B - S. agalactiae
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group B"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_AGLC(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_AGLC(_|$)")]
|
||||
)) %>%
|
||||
# group C - all subspecies within S. dysgalactiae and S. equi (such as S. equi zooepidemicus)
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group C"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|EQUI)(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_(DYSG|EQUI)(_|$)")]
|
||||
)) %>%
|
||||
# group F - Milleri group == S. anginosus group, which incl. S. anginosus, S. constellatus, S. intermedius
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group F"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(ANGN|CNST|INTR)(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_(ANGN|CNST|INTR)(_|$)")]
|
||||
)) %>%
|
||||
# group G - S. dysgalactiae and S. canis (though dysgalactiae is also group C and will be matched there)
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|CANS)(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_(DYSG|CANS)(_|$)")]
|
||||
)) %>%
|
||||
# group H - S. sanguinis
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group H"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SNGN(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_SNGN(_|$)")]
|
||||
)) %>%
|
||||
# group K - S. salivarius, incl. S. salivarius salivariuss and S. salivarius thermophilus
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group K"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SLVR(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_SLVR(_|$)")]
|
||||
)) %>%
|
||||
# group L - only S. dysgalactiae
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group L"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_DYSG(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_DYSG(_|$)")]
|
||||
)) %>%
|
||||
# and for EUCAST: Strep group A, B, C, G
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group A, B, C, G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(PYGN|AGLC|DYSG|EQUI|CANS|GRPA|GRPB|GRPC|GRPG)(_|$)")]
|
||||
mo = mo_current_only$mo[which(mo_current_only$mo %like% "^B_STRPT_(PYGN|AGLC|DYSG|EQUI|CANS|GRPA|GRPB|GRPC|GRPG)(_|$)")]
|
||||
)) %>%
|
||||
# HACEK is:
|
||||
# - Haemophilus species
|
||||
@@ -163,11 +174,11 @@ microorganisms.groups <- whonet_organisms %>%
|
||||
# - and previously Actinobacillus actinomycetemcomitans
|
||||
# see https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3656887/
|
||||
filter(mo_group != as.mo("HACEK")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Haemophilus") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Aggregatibacter") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = mo_current_only %>% filter(genus == "Haemophilus") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = mo_current_only %>% filter(genus == "Aggregatibacter") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Cardiobacterium hominis", keep_synonyms = TRUE))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Eikenella corrodens", keep_synonyms = TRUE))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Kingella") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = mo_current_only %>% filter(genus == "Kingella") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Actinobacillus actinomycetemcomitans", keep_synonyms = TRUE))) %>%
|
||||
# Citrobacter freundii complex in the NCBI Taxonomy Browser:
|
||||
# https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=1344959
|
||||
@@ -203,13 +214,24 @@ for (group in unique(microorganisms.groups$mo_group)) {
|
||||
pull(mo) %>%
|
||||
paste0(collapse = "|") %>%
|
||||
paste0("^(", ., ")")
|
||||
mos <- microorganisms %>%
|
||||
mos <- mo_current_only %>%
|
||||
filter(mo %like% spp & rank == "subspecies") %>%
|
||||
pull(mo)
|
||||
# add them
|
||||
microorganisms.groups <- microorganisms.groups %>% bind_rows(tibble(mo_group = as.mo(group), mo = mos))
|
||||
}
|
||||
|
||||
# only current names (decision by Matthijs S. Berends, 7 October 2026): WHONET and the lists above can contain outdated
|
||||
# names, these are replaced by their current name (duplicates are removed below)
|
||||
microorganisms.groups <- microorganisms.groups %>%
|
||||
mutate(
|
||||
mo_group = synonym_mo_to_accepted_mo(as.character(mo_group), fill_in_accepted = TRUE),
|
||||
mo = synonym_mo_to_accepted_mo(as.character(mo), fill_in_accepted = TRUE)
|
||||
)
|
||||
if (anyNA(microorganisms.groups$mo) || anyNA(microorganisms.groups$mo_group)) {
|
||||
stop("microorganisms.groups contains codes that are not in the microorganisms data set", call. = FALSE)
|
||||
}
|
||||
|
||||
# add full names, arrange and clean
|
||||
microorganisms.groups <- microorganisms.groups %>%
|
||||
mutate(
|
||||
|
||||
@@ -189,7 +189,11 @@ explained or fixed:
|
||||
|
||||
Also verify the most used organisms in the package's own data sets: every `mo` in
|
||||
`clinical_breakpoints`, `intrinsic_resistant`, `microorganisms.groups`, `microorganisms.codes` and
|
||||
`example_isolates` must exist in the new `microorganisms` (`anyNA()` checks at the end of the script).
|
||||
`example_isolates` must exist in the new `microorganisms`, and refer to a current name (except
|
||||
`intrinsic_resistant`, which lists synonyms on purpose); `tests/testthat/test-data.R` checks this.
|
||||
`microorganisms.groups`, the EUCAST breakpoints in `clinical_breakpoints` and `intrinsic_resistant` are recreated
|
||||
from the new data set by `run_after_microorganisms_build.R`, which the script runs at its end. `intrinsic_resistant`
|
||||
is never an input of the build, as it is computed from the `microorganisms` data set itself.
|
||||
|
||||
### 3c. Comparison with the previous release
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# ==================================================================== #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, et al. (2022). #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data. #
|
||||
# Journal of Statistical Software, 104(3), 1-31. #
|
||||
# https://doi.org/10.18637/jss.v104.i03 #
|
||||
# #
|
||||
# Developed at the University of Groningen and the University Medical #
|
||||
# Center Groningen in the Netherlands, in collaboration with many #
|
||||
# colleagues from around the world, see our website. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
# Recreates the data sets that are computed from the microorganisms data set, in the right order. Run this after every
|
||||
# rebuild of the microorganisms data set (run_microorganisms_build.R), from the root of the repository:
|
||||
# Rscript data-raw/_reproduction_scripts/run_after_microorganisms_build.R
|
||||
#
|
||||
# 1. microorganisms.groups: its members are taken from the current names in the new data set
|
||||
# 2. clinical_breakpoints: the human EUCAST breakpoints are parsed again from the EUCAST workbooks, as their organisms
|
||||
# are resolved against the new data set (the WHONET-based rows are kept, with their rank_index updated)
|
||||
# 3. intrinsic_resistant: computed from all codes of the new data set and the interpretive rules, which use the
|
||||
# species groups of step 1 (so this must be last); it is never an input of the microorganisms build itself
|
||||
|
||||
if (!file.exists("data-raw/_reproduction_scripts/run_after_microorganisms_build.R")) {
|
||||
stop("Run this from the root of the AMR repository", call. = FALSE)
|
||||
}
|
||||
step <- function(name, file) {
|
||||
message("\n=== ", name, " ===")
|
||||
started <- Sys.time()
|
||||
exit <- system2("Rscript", file)
|
||||
if (exit != 0) {
|
||||
stop(name, " failed (exit code ", exit, ")", call. = FALSE)
|
||||
}
|
||||
message(name, " done in ", round(difftime(Sys.time(), started, units = "mins"), 1), " minutes")
|
||||
}
|
||||
|
||||
# 1. species groups
|
||||
step("microorganisms.groups", "data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R")
|
||||
|
||||
# 2. EUCAST breakpoints, merged into clinical_breakpoints (as at the end of reproduction_of_clinical_breakpoints.R)
|
||||
merge_script <- tempfile(fileext = ".R")
|
||||
writeLines(c(
|
||||
'devtools::load_all()',
|
||||
'library(dplyr, warn.conflicts = FALSE)',
|
||||
'source("data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints_eucast.R")',
|
||||
'# the rank of an organism can have changed with the new data set',
|
||||
'breakpoints_now <- clinical_breakpoints %>%',
|
||||
' mutate(rank_index = case_when(',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) == "species" ~ 2,',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) == "species group" ~ 2.5,',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) == "genus" ~ 3,',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) == "family" ~ 4,',
|
||||
' mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,',
|
||||
' mo != "UNKNOWN" ~ 6,',
|
||||
' TRUE ~ 7',
|
||||
' ) + if_else(is.na(breakpoint_S) & is.na(breakpoint_R) & guideline %like% "EUCAST", 0.1, 0))',
|
||||
'clinical_breakpoints <- merge_eucast_breakpoints(breakpoints_now, breakpoints_eucast, eucast_coverage)',
|
||||
'usethis::use_data(clinical_breakpoints, overwrite = TRUE, compress = "xz", version = 2)'
|
||||
), merge_script)
|
||||
step("clinical_breakpoints (EUCAST)", merge_script)
|
||||
|
||||
# 3. intrinsic resistance
|
||||
step("intrinsic_resistant", "data-raw/_reproduction_scripts/reproduction_of_intrinsic_resistant.R")
|
||||
|
||||
message("\nAll data sets that depend on the microorganisms data set are recreated. Run the unit tests next.")
|
||||
Reference in new issue
Block a user