From d366949f1b891b120ecbb2f887d95364fc419328 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Mon, 13 Oct 2025 22:12:48 +0200 Subject: [PATCH] (v3.0.1.9002) replace WHONET directives with their GitHub repo --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- .../reproduction_of_clinical_breakpoints.R | 18 ++++++++++-------- .../reproduction_of_microorganisms.groups.R | 19 ++++++++++--------- pkgdown/extra.js | 2 +- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 51e6f27e0..93d8aa36b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 3.0.1.9001 -Date: 2025-09-30 +Version: 3.0.1.9002 +Date: 2025-10-13 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 c56588afb..616dfcddc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 3.0.1.9001 +# AMR 3.0.1.9002 ### Changed * Fixed a bug in `antibiogram()` for when no antimicrobials are set diff --git a/data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R b/data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R index c13cbb132..aef38fb6f 100644 --- a/data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R +++ b/data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R @@ -35,24 +35,26 @@ library(readr) library(tidyr) devtools::load_all() -# Install the WHONET software on Windows (http://www.whonet.org/software.html), -# and copy the folder C:\WHONET\Resources to the data-raw/WHONET/ folder -# (for ASIARS-Net update, also copy C:\WHONET\Codes to the data-raw/WHONET/ folder) - # BE SURE TO RUN data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R FIRST TO GET THE GROUPS! # READ DATA ---- -whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) |> +# files are retrieved from https://github.com/AClark-WHONET/AMRIE + +github_repo <- "https://raw.github.com/AClark-WHONET/AMRIE/main/Interpretation%20Engine/Resources" +file_organisms <- file.path(github_repo, "Organisms.txt") +file_breakpoints <- file.path(github_repo, "Breakpoints.txt") +file_antibiotics <- file.path(github_repo, "Antibiotics.txt") + +whonet_organisms <- read_tsv(file_organisms, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |> # remove old taxonomic names filter(TAXONOMIC_STATUS == "C") |> mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE)) -whonet_breakpoints <- read_tsv("data-raw/WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"), - show_col_types = FALSE, guess_max = Inf) |> +whonet_breakpoints <- read_tsv(file_breakpoints, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |> filter(GUIDELINES %in% c("CLSI", "EUCAST")) -whonet_antibiotics <- read_tsv("data-raw/WHONET/Resources/Antibiotics.txt", na = c("", "NA", "-"), show_col_types = FALSE) |> +whonet_antibiotics <- read_tsv(file_antibiotics, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |> arrange(WHONET_ABX_CODE) |> distinct(WHONET_ABX_CODE, .keep_all = TRUE) diff --git a/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R b/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R index 1506c8ec1..7463b6b6a 100644 --- a/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R +++ b/data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R @@ -27,7 +27,7 @@ # how to conduct AMR data analysis: https://amr-for-r.org # # ==================================================================== # -# This data set is being used in the clinical_breakpoints data set, and thus by as.sir(). +# This data set is being referenced from in the clinical_breakpoints data set, and also by as.sir(). # It prevents the breakpoints table from being extremely long for species that are part of a species group. # Also used by eucast_rules() to expand group names. @@ -36,10 +36,6 @@ library(readr) library(tidyr) devtools::load_all() -# Install the WHONET software on Windows (http://www.whonet.org/software.html), -# and copy the folder C:\WHONET\Resources to the data-raw/WHONET/ folder - - # 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 @@ -48,9 +44,14 @@ devtools::load_all() # READ DATA ---- -whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>% +# files are retrieved from https://github.com/AClark-WHONET/AMRIE + +github_repo <- "https://raw.github.com/AClark-WHONET/AMRIE/main/Interpretation%20Engine/Resources" +file_organisms <- file.path(github_repo, "Organisms.txt") + +whonet_organisms <- read_tsv(file_organisms, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |> # remove old taxonomic names - filter(TAXONOMIC_STATUS == "C") %>% + filter(TAXONOMIC_STATUS == "C") |> mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE)) whonet_organisms <- whonet_organisms %>% @@ -87,7 +88,7 @@ microorganisms.groups <- whonet_organisms %>% mo = ifelse(is.na(mo), as.character(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) + # 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)) %>% filter(mo_group != as.mo("CoPS")) %>% @@ -153,7 +154,7 @@ microorganisms.groups <- whonet_organisms %>% filter(mo_group != "B_YERSN_PSDT-C") %>% bind_rows(tibble(mo_group = as.mo("B_YERSN_PSDT-C"), mo = paste("Yersinia", c("pseudotuberculosis", "pestis", "similis", "wautersii")) %>% as.mo(keep_synonyms = TRUE))) %>% - # RGM are Rapidly-grwoing Mycobacteria, see https://pubmed.ncbi.nlm.nih.gov/28084211/ + # RGM are Rapidly-growing Mycobacteria, see https://pubmed.ncbi.nlm.nih.gov/28084211/ filter(mo_group != "B_MYCBC_RGM") %>% bind_rows(tibble(mo_group = as.mo("B_MYCBC_RGM"), mo = paste("Mycobacterium", c( "abscessus abscessus", "abscessus bolletii", "abscessus massiliense", "agri", "aichiense", "algericum", "alvei", "anyangense", "arabiense", "aromaticivorans", "aubagnense", "aubagnense", "aurum", "austroafricanum", "bacteremicum", "boenickei", "bourgelatii", "brisbanense", "brumae", "canariasense", "celeriflavum", "chelonae", "chitae", "chlorophenolicum", "chubuense", "confluentis", "cosmeticum", "crocinum", "diernhoferi", "duvalii", "elephantis", "fallax", "flavescens", "fluoranthenivorans", "fortuitum", "franklinii", "frederiksbergense", "gadium", "gilvum", "goodii", "hassiacum", "hippocampi", "hodleri", "holsaticum", "houstonense", "immunogenum", "insubricum", "iranicum", "komossense", "litorale", "llatzerense", "madagascariense", "mageritense", "monacense", "moriokaense", "mucogenicum", "mucogenicum", "murale", "neoaurum", "neworleansense", "novocastrense", "obuense", "pallens", "parafortuitum", "peregrinum", "phlei", "phocaicum", "phocaicum", "porcinum", "poriferae", "psychrotolerans", "pyrenivorans", "rhodesiae", "rufum", "rutilum", "salmoniphilum", "sediminis", "senegalense", "septicum", "setense", "smegmatis", "sphagni", "thermoresistibile", "tokaiense", "vaccae", "vanbaalenii", "wolinskyi")) %>% as.mo(keep_synonyms = TRUE))) diff --git a/pkgdown/extra.js b/pkgdown/extra.js index a827c3a86..5774d8bcd 100644 --- a/pkgdown/extra.js +++ b/pkgdown/extra.js @@ -145,7 +145,7 @@ $(function () { x = x.replace("Kathryn", "Prof. Kathryn"); x = x.replace("Larisse", "Dr. Larisse"); x = x.replace("Matthijs", "Dr. Matthijs"); - x = x.replace("Natacha", "Dr. Natacha"); + x = x.replace("Natacha", "Prof. Natacha"); x = x.replace("Peter", "Dr. Peter"); x = x.replace("Rogier", "Dr. Rogier"); x = x.replace("Sofia", "Dr. Sofia");