mirror of https://github.com/msberends/AMR.git
fix `reference_df` endless loop
This commit is contained in:
parent
1d9ee39cc7
commit
2d97cca6d9
|
@ -1,6 +1,6 @@
|
|||
Package: AMR
|
||||
Version: 2.0.0.9025
|
||||
Date: 2023-06-22
|
||||
Version: 2.0.0.9026
|
||||
Date: 2023-06-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
|
||||
|
|
3
NEWS.md
3
NEWS.md
|
@ -1,4 +1,4 @@
|
|||
# AMR 2.0.0.9025
|
||||
# AMR 2.0.0.9026
|
||||
|
||||
## New
|
||||
* Clinical breakpoints and intrinsic resistance of EUCAST 2023 and CLSI 2023 have been added for `as.sir()`. EUCAST 2023 (v13.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for `eucast_rules()` to apply EUCAST Expert Rules.
|
||||
|
@ -22,6 +22,7 @@
|
|||
* Fix for using the `keep_synonyms` argument when using MO codes as input
|
||||
* Fix for using the `minimum_matching_score` argument
|
||||
* Updated the code table in `microorganisms.codes`
|
||||
* Fixed an endless loop if using `reference_df` in `as.mo()`
|
||||
|
||||
|
||||
# AMR 2.0.0
|
||||
|
|
2
R/mo.R
2
R/mo.R
|
@ -1217,7 +1217,7 @@ repair_reference_df <- function(reference_df) {
|
|||
reference_df[, "mo"] <- as.character(reference_df[, "mo", drop = TRUE])
|
||||
|
||||
# some MO codes might be old
|
||||
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE])
|
||||
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE], reference_df = NULL)
|
||||
reference_df
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
63cc9e5166dc50c7b474bb809557c392
|
||||
2d19b559a6c4b6f26449271ed1e37ea8
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -547,6 +547,7 @@
|
|||
"B_ACNTB_AVST" "Acinetobacter avistercoris" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "avistercoris" "" "species" "likely facultative anaerobe" "GBIF" "11605583" "3223263" 1.5 ""
|
||||
"B_ACNTB_BART" "Acinetobacter baretiae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "baretiae" "" "species" "Alvarez-Perez et al., 2021" "likely facultative anaerobe" "LPSN" "19553" "515021" "11852261" "3223263" 1.5 ""
|
||||
"B_ACNTB_BMNN" "Acinetobacter baumannii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "baumannii" "" "species" "Bouvet et al., 1986" "aerobe" "LPSN" "772610" "515021" "3223274" "3223263" 1 "91288006,715174007,737526007,447891000124105,715353004"
|
||||
"B_ACNTB_BMNN-C" "Acinetobacter baumannii complex" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "baumannii complex" "" "species group" "aerobe" "manually added" "515021" "3223263" 1 ""
|
||||
"B_ACNTB_BYLY" "Acinetobacter baylyi" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "baylyi" "" "species" "Carr et al., 2003" "aerobe" "LPSN" "772611" "515021" "3223268" "3223263" 1 "423974000"
|
||||
"B_ACNTB_BJRN" "Acinetobacter beijerinckii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "beijerinckii" "" "species" "Nemec et al., 2009" "aerobe" "LPSN" "787668" "515021" "8317472" "3223263" 1 "771547006"
|
||||
"B_ACNTB_BERZN" "Acinetobacter berezinae" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae" "Acinetobacter" "berezinae" "" "species" "Alexandr et al., 2009" "aerobe" "GBIF" "9467748" "3223263" "7798724" 1 ""
|
||||
|
@ -8476,6 +8477,7 @@
|
|||
"B_BRKHL_CATD" "Burkholderia catudaia" "synonym" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "catudaia" "" "species" "Peeters et al., 2016" "aerobe" "LPSN" "794437" "515281" "796021" "9576146" "3219916" 1.5 ""
|
||||
"B_BRKHL_CNCP" "Burkholderia cenocepacia" "accepted" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "cenocepacia" "" "species" "Vandamme et al., 2003" "aerobe" "LPSN" "774276" "515281" "10898083" "3219916" 1 "416941006"
|
||||
"B_BRKHL_CEPC" "Burkholderia cepacia" "accepted" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "cepacia" "" "species" "Yabuuchi et al., 1993" "aerobe" "LPSN" "774277" "515281" "10900882" "3219916" 1 "113669008"
|
||||
"B_BRKHL_CEPC-C" "Burkholderia cepacia complex" "accepted" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "cepacia complex" "" "species group" "aerobe" "manually added" "515281" "3219916" 1 ""
|
||||
"B_BRKHL_CHOC" "Burkholderia choica" "synonym" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "choica" "" "species" "Vandamme et al., 2013" "aerobe" "LPSN" "791329" "515281" "794372" 1.5 ""
|
||||
"B_BRKHL_CCVN" "Burkholderia cocovenenans" "synonym" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "cocovenenans" "" "species" "Gillis et al., 1995" "aerobe" "LPSN" "7156" "515281" "774282" "3219917" "3219916" "3219971" 1 ""
|
||||
"B_BRKHL_CNCT" "Burkholderia concitans" "synonym" "Bacteria" "Pseudomonadota" "Betaproteobacteria" "Burkholderiales" "Burkholderiaceae" "Burkholderia" "concitans" "" "species" "Peeters et al., 2016" "aerobe" "LPSN" "794438" "515281" "796022" "9429304" "3219916" 1.5 ""
|
||||
|
@ -9058,6 +9060,7 @@
|
|||
"F_CANDD_ALBC" "Candida albicans" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "" "species" "Berkhout" "GBIF" "2599597" "2518121" 1.5 "53326005,243448008,714313009"
|
||||
"F_CANDD_ALBC_ALBC" "Candida albicans albicans" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "albicans" "subspecies" "GBIF" "11228679" "2599597" "2599597" 1.5 ""
|
||||
"F_CANDD_ALBC_CLSS" "Candida albicans claussenii" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "claussenii" "subspecies" "Lodder et al." "GBIF" "11281986" "2599597" "2599597" 1.5 ""
|
||||
"F_CANDD_ALBC-C" "Candida albicans complex" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans complex" "" "species group" "manually added" "2518121" 1.5 ""
|
||||
"F_CANDD_ALBC_MTLN" "Candida albicans metalondinensis" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "metalondinensis" "subspecies" "Castell et al." "GBIF" "11270252" "2599597" "2599597" 1.5 ""
|
||||
"F_CANDD_ALBC_NNLQ" "Candida albicans non-liquefaciens" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "non-liquefaciens" "subspecies" "Sasak" "GBIF" "11323433" "2599597" "2599597" 1.5 ""
|
||||
"F_CANDD_ALBC_STLL" "Candida albicans stellatoidea" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "albicans" "stellatoidea" "subspecies" "Jones et al." "GBIF" "11340449" "2599597" "2599597" 1.5 ""
|
||||
|
@ -9216,6 +9219,7 @@
|
|||
"F_CANDD_FNSS" "Candida gifuensis" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "gifuensis" "" "species" "Tanig" "GBIF" "5495793" "2518121" "2599597" 1.5 ""
|
||||
"F_CANDD_GGNT" "Candida gigantensis" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "gigantensis" "" "species" "Suh et al." "GBIF" "3480169" "2518121" 1.5 ""
|
||||
"F_CANDD_GLBR" "Candida glabrata" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "glabrata" "" "species" "Mey et al." "GBIF" "2599530" "2518121" 1.5 "444877006,782948004"
|
||||
"F_CANDD_GLBR-C" "Candida glabrata complex" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "glabrata complex" "" "species group" "manually added" "2518121" 1.5 ""
|
||||
"F_CANDD_BRTS" "Candida glabratus" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "glabratus" "" "species" "Anderson" "GBIF" "7407691" "2518121" "2599530" 1.5 ""
|
||||
"F_CANDD_GLBS" "Candida glaebosa" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "glaebosa" "" "species" "Komag et al." "GBIF" "3480310" "2518121" 1.5 ""
|
||||
"F_CANDD_LBSM" "Candida globosum" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "globosum" "" "species" "Zach" "GBIF" "3480508" "2518121" "2599539" 1.5 ""
|
||||
|
@ -9390,6 +9394,7 @@
|
|||
"F_CANDD_PRPL" "Candida parapolymorpha" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapolymorpha" "" "species" "Suh et al." "GBIF" "8157046" "2518121" 1.5 ""
|
||||
"F_CANDD_PRPSL" "Candida parapsilopsis" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilopsis" "" "species" "Ashford" "GBIF" "2599545" "2518121" "2599539" 1.5 ""
|
||||
"F_CANDD_PRPS" "Candida parapsilosis" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilosis" "" "species" "Langeron et al." "GBIF" "2599539" "2518121" 1.5 "61302002"
|
||||
"F_CANDD_PRPS-C" "Candida parapsilosis complex" "accepted" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilosis complex" "" "species group" "manually added" "2518121" 1.5 ""
|
||||
"F_CANDD_PRPS_HOKK" "Candida parapsilosis hokkaii" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilosis" "hokkaii" "subspecies" "Goto et al." "GBIF" "3480002" "2599539" "3479947" 1.5 ""
|
||||
"F_CANDD_PRPS_INTR" "Candida parapsilosis intermedia" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilosis" "intermedia" "subspecies" "Kreger-van Rij et al." "GBIF" "3480258" "2599539" "3479947" 1.5 ""
|
||||
"F_CANDD_PRPS_PRPS" "Candida parapsilosis parapsilosis" "synonym" "Fungi" "Ascomycota" "Saccharomycetes" "Saccharomycetales" "Debaryomycetaceae" "Candida" "parapsilosis" "parapsilosis" "subspecies" "GBIF" "11331780" "2599539" "2599539" 1.5 ""
|
||||
|
@ -11190,6 +11195,7 @@
|
|||
"B_CTRBC" "Citrobacter" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "" "" "genus" "Werkman et al., 1932" "facultative anaerobe" "LPSN" "515376" "482" "11150190" "11158430" 1 "1089501000112101,75972000"
|
||||
"B_CTRBC_AMLNT" "Citrobacter amalonatica" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "amalonatica" "" "species" "Young et al., 1971" "aerobe" "GBIF" "5427576" "11150190" "3221795" 1 ""
|
||||
"B_CTRBC_AMLN" "Citrobacter amalonaticus" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "amalonaticus" "" "species" "Brenner et al., 1982" "aerobe" "LPSN" "774743" "515376" "3221795" "11150190" 1 "1089101000112105,55744003"
|
||||
"B_CTRBC_AMLN-C" "Citrobacter amalonaticus complex" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "amalonaticus complex" "" "species group" "aerobe" "manually added" "515376" "11150190" 1 ""
|
||||
"B_CTRBC_BTTR" "Citrobacter bitternis" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "bitternis" "" "species" "Ko et al., 2015" "likely facultative anaerobe" "GBIF" "11113073" "11150190" 1.5 ""
|
||||
"B_CTRBC_BRAK" "Citrobacter braakii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "braakii" "" "species" "Brenner et al., 1993" "aerobe" "LPSN" "774744" "515376" "3221791" "11150190" 1 "1089301000112107,114262000"
|
||||
"B_CTRBC_CRON" "Citrobacter cronae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Citrobacter" "cronae" "" "species" "Oberhettinger et al., 2020" "likely facultative anaerobe" "LPSN" "7473" "515376" "11248376" "11150190" "3221797" 1 ""
|
||||
|
@ -16134,6 +16140,7 @@
|
|||
"B_ENTRBC_CHND" "Enterobacter chuandaensis" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "chuandaensis" "" "species" "Wu et al., 2019" "facultative anaerobe" "LPSN" "800158" "515587" "10745032" "11204930" 1.5 ""
|
||||
"B_ENTRBC_CLOC" "Enterobacter cloacae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "cloacae" "" "species" "Hormaeche et al., 1960" "aerobe" "LPSN" "775933" "515587" "11234351" "11204930" 1 "714007005,737529000,14385002,721910001,714317005"
|
||||
"B_ENTRBC_CLOC_CLOC" "Enterobacter cloacae cloacae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "cloacae" "cloacae" "subspecies" "Hoffmann et al., 2005" "LPSN" "775934" "775933" "7234533" "11234351" 1 ""
|
||||
"B_ENTRBC_CLOC-C" "Enterobacter cloacae complex" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "cloacae complex" "" "species group" "aerobe" "manually added" "515587" "11204930" 1 ""
|
||||
"B_ENTRBC_CLOC_DSSL" "Enterobacter cloacae dissolvens" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "cloacae" "dissolvens" "subspecies" "Hoffmann et al., 2005" "aerobe" "LPSN" "775935" "775933" "3221982" "11234351" 1 ""
|
||||
"B_ENTRBC_COWN" "Enterobacter cowanii" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "cowanii" "" "species" "Inoue et al., 2001" "aerobe" "LPSN" "775936" "515587" "791223" 1 ""
|
||||
"B_ENTRBC_DSSL" "Enterobacter dissolvens" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Enterobacter" "dissolvens" "" "species" "Brenner et al., 1988" "aerobe" "LPSN" "775937" "515587" "775935" "3221983" "11204930" "3221982" 1.5 ""
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
@ -27,7 +27,7 @@
|
|||
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
# This script runs in under a minute and renews all guidelines of CLSI and EUCAST!
|
||||
# This script runs in 20-30 minutes and renews all guidelines of CLSI and EUCAST!
|
||||
# Run it with source("data-raw/reproduction_of_clinical_breakpoints.R")
|
||||
|
||||
library(dplyr)
|
||||
|
@ -39,40 +39,55 @@ devtools::load_all()
|
|||
# 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)
|
||||
|
||||
|
||||
# MICROORGANISMS WHONET CODES ----
|
||||
# READ DATA ----
|
||||
|
||||
whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
# remove old taxonomic names
|
||||
filter(TAXONOMIC_STATUS == "C") %>%
|
||||
transmute(ORGANISM_CODE = tolower(WHONET_ORG_CODE), ORGANISM) %>%
|
||||
mutate(
|
||||
# what's wrong here? all these are only in the table on subspecies level (where species == subspecies), not on species level
|
||||
ORGANISM = if_else(ORGANISM_CODE == "sau", "Staphylococcus aureus", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "pam", "Pasteurella multocida", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "kpn", "Klebsiella pneumoniae", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "caj", "Campylobacter jejuni", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "mmo", "Morganella morganii", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "sap", "Staphylococcus saprophyticus", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "fne", "Fusobacterium necrophorum", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "fnu", "Fusobacterium nucleatum", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "sdy", "Streptococcus dysgalactiae", ORGANISM),
|
||||
ORGANISM = if_else(ORGANISM_CODE == "axy", "Achromobacter xylosoxidans", ORGANISM),
|
||||
# and this one was called Issatchenkia orientalis, but it should be:
|
||||
ORGANISM = if_else(ORGANISM_CODE == "ckr", "Candida krusei", ORGANISM)
|
||||
)
|
||||
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) %>%
|
||||
filter(GUIDELINES %in% c("CLSI", "EUCAST"))
|
||||
|
||||
whonet_antibiotics <- read_tsv("data-raw/WHONET/Resources/Antibiotics.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
arrange(WHONET_ABX_CODE) %>%
|
||||
distinct(WHONET_ABX_CODE, .keep_all = TRUE)
|
||||
|
||||
# MICROORGANISMS WHONET CODES ----
|
||||
|
||||
# add some general codes
|
||||
whonet_organisms <- whonet_organisms %>%
|
||||
bind_rows(data.frame(
|
||||
ORGANISM_CODE = c("ebc", "cof"),
|
||||
ORGANISM = c("Enterobacterales", "Campylobacter")
|
||||
))
|
||||
select(ORGANISM_CODE, ORGANISM, SPECIES_GROUP, GBIF_TAXON_ID) %>%
|
||||
mutate(
|
||||
# this one was called Issatchenkia orientalis, but it should be:
|
||||
ORGANISM = if_else(ORGANISM_CODE == "ckr", "Candida krusei", ORGANISM)
|
||||
) %>%
|
||||
# try to match on GBIF identifier
|
||||
left_join(microorganisms %>% distinct(mo, gbif, status) %>% filter(!is.na(gbif)), by = c("GBIF_TAXON_ID" = "gbif")) %>%
|
||||
# remove duplicates
|
||||
arrange(ORGANISM_CODE, GBIF_TAXON_ID, status) %>%
|
||||
distinct(ORGANISM_CODE, .keep_all = TRUE) %>%
|
||||
# add Enterobacterales, which is a subkingdom code in their data
|
||||
bind_rows(data.frame(ORGANISM_CODE = "ebc", ORGANISM = "Enterobacterales", mo = as.mo("Enterobacterales"))) %>%
|
||||
arrange(ORGANISM)
|
||||
|
||||
# check non-existing species groups in the microorganisms table
|
||||
complexes <- whonet_organisms %>%
|
||||
filter(ORGANISM %like% " (group|complex)$" & toupper(SPECIES_GROUP) == toupper(ORGANISM_CODE)) %>%
|
||||
mutate(mo = as.mo(ORGANISM, minimum_matching_score = 0.6, keep_synonyms = TRUE)) %>%
|
||||
mutate(mo_new = paste0(mo, "-C"))
|
||||
complexes[which(!complexes$mo_new %in% AMR::microorganisms$mo), ]
|
||||
|
||||
|
||||
## Add new WHO codes to microorganisms.codes ----
|
||||
|
||||
matched <- whonet_organisms %>% filter(!is.na(mo))
|
||||
unmatched <- whonet_organisms %>% filter(is.na(mo))
|
||||
|
||||
whonet_organisms.bak <- whonet_organisms
|
||||
# generate the mo codes and add their names
|
||||
whonet_organisms <- whonet_organisms.bak %>%
|
||||
mutate(mo = as.mo(gsub("(sero[a-z]*| complex| nontypable| non[-][a-zA-Z]+|var[.]| not .*|sp[.],.*|, .*variant.*|, .*toxin.*|, microaer.*| beta-haem[.])", "", ORGANISM),
|
||||
message("Getting MO codes for WHONET input...")
|
||||
unmatched <- unmatched %>%
|
||||
mutate(mo = as.mo(gsub("(sero[a-z]*| complex| group| nontypable| non[-][a-zA-Z]+|var[.]| not .*|sp[.],.*|, .*variant.*|, .*toxin.*|, microaer.*| beta-haem[.])", "", ORGANISM),
|
||||
minimum_matching_score = 0.6,
|
||||
keep_synonyms = TRUE,
|
||||
language = "en"),
|
||||
|
@ -84,19 +99,48 @@ whonet_organisms <- whonet_organisms.bak %>%
|
|||
keep_synonyms = TRUE,
|
||||
language = "en"))
|
||||
# check if coercion at least resembles the first part (genus)
|
||||
new_mo_codes <- whonet_organisms %>%
|
||||
unmatched <- unmatched %>%
|
||||
mutate(
|
||||
first_part = sapply(ORGANISM, function(x) strsplit(gsub("[^a-zA-Z _-]+", "", x), " ")[[1]][1], USE.NAMES = FALSE),
|
||||
keep = mo_name %like_case% first_part | ORGANISM %like% "Gram " | ORGANISM == "Other" | ORGANISM %like% "anaerobic") %>%
|
||||
filter(keep == TRUE) %>%
|
||||
transmute(code = toupper(ORGANISM_CODE),
|
||||
mo = mo)
|
||||
filter(keep == TRUE)
|
||||
|
||||
organisms <- matched %>% transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo) %>%
|
||||
bind_rows(unmatched %>% transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo)) %>%
|
||||
mutate(name = mo_name(mo, keep_synonyms = TRUE)) %>%
|
||||
# remove the species groups themselves, we'll look the species within these groups later
|
||||
filter(is.na(group) | code != group) %>%
|
||||
arrange(code)
|
||||
|
||||
# some subspecies exist, while their upper species do not, add them as the species level:
|
||||
subspp <- organisms %>%
|
||||
filter(mo_species(mo, keep_synonyms = TRUE) == mo_subspecies(mo, keep_synonyms = TRUE) &
|
||||
mo_species(mo, keep_synonyms = TRUE) != "" &
|
||||
mo_genus(mo, keep_synonyms = TRUE) != "Salmonella") %>%
|
||||
mutate(mo = as.mo(paste(mo_genus(mo, keep_synonyms = TRUE),
|
||||
mo_species(mo, keep_synonyms = TRUE)),
|
||||
keep_synonyms = TRUE),
|
||||
name = mo_name(mo, keep_synonyms = TRUE))
|
||||
organisms <- organisms %>%
|
||||
filter(!code %in% subspp$code) %>%
|
||||
bind_rows(subspp) %>%
|
||||
arrange(code)
|
||||
|
||||
organism_groups <- organisms %>%
|
||||
filter(!is.na(group)) %>%
|
||||
arrange(group, name)
|
||||
saveRDS(organism_groups, "data-raw/organism_groups.rds", version = 2)
|
||||
|
||||
#---
|
||||
# AT THIS POINT, `organisms` is clean and all entries have an mo code
|
||||
#---
|
||||
|
||||
# update microorganisms.codes with the latest WHONET codes
|
||||
microorganisms.codes2 <- microorganisms.codes %>%
|
||||
# remove all old WHONET codes, whether we (in the end) keep them or not
|
||||
filter(!toupper(code) %in% toupper(new_mo_codes$code)) %>%
|
||||
filter(!toupper(code) %in% toupper(organisms$code) | toupper(code) %in% complexes$SPECIES_GROUP) %>%
|
||||
# and add the new ones
|
||||
bind_rows(new_mo_codes) %>%
|
||||
bind_rows(organisms %>% filter(code != group) %>% select(code, mo)) %>%
|
||||
arrange(code)
|
||||
# new codes:
|
||||
microorganisms.codes2$code[which(!microorganisms.codes2$code %in% microorganisms.codes$code)]
|
||||
|
@ -104,31 +148,31 @@ mo_name(microorganisms.codes2$mo[which(!microorganisms.codes2$code %in% microorg
|
|||
microorganisms.codes <- microorganisms.codes2
|
||||
|
||||
# Run this part to update ASIARS-Net:
|
||||
# start
|
||||
asiarsnet <- read_tsv("data-raw/WHONET/Codes/ASIARS_Net_Organisms_ForwardLookup.txt")
|
||||
asiarsnet <- asiarsnet %>%
|
||||
mutate(WHONET_Code = toupper(WHONET_Code)) %>%
|
||||
left_join(whonet_organisms %>% mutate(WHONET_Code = toupper(ORGANISM_CODE))) %>%
|
||||
mutate(
|
||||
mo1 = as.mo(ORGANISM_CODE),
|
||||
mo2 = as.mo(ORGANISM)
|
||||
) %>%
|
||||
mutate(mo = if_else(mo2 == "UNKNOWN" | is.na(mo2), mo1, mo2)) %>%
|
||||
filter(!is.na(mo))
|
||||
insert1 <- asiarsnet %>% transmute(code = WHONET_Code, mo)
|
||||
insert2 <- asiarsnet %>% transmute(code = as.character(ASIARS_Net_Code), mo)
|
||||
# these will be updated
|
||||
bind_rows(insert1, insert2) %>%
|
||||
rename(mo_new = mo) %>%
|
||||
left_join(microorganisms.codes) %>%
|
||||
filter(mo != mo_new)
|
||||
microorganisms.codes <- microorganisms.codes %>%
|
||||
filter(!code %in% c(insert1$code, insert2$code)) %>%
|
||||
bind_rows(insert1, insert2) %>%
|
||||
arrange(code)
|
||||
# end
|
||||
# # start
|
||||
# asiarsnet <- read_tsv("data-raw/WHONET/Codes/ASIARS_Net_Organisms_ForwardLookup.txt")
|
||||
# asiarsnet <- asiarsnet %>%
|
||||
# mutate(WHONET_Code = toupper(WHONET_Code)) %>%
|
||||
# left_join(whonet_organisms %>% mutate(WHONET_Code = toupper(ORGANISM_CODE))) %>%
|
||||
# mutate(
|
||||
# mo1 = as.mo(ORGANISM_CODE),
|
||||
# mo2 = as.mo(ORGANISM)
|
||||
# ) %>%
|
||||
# mutate(mo = if_else(mo2 == "UNKNOWN" | is.na(mo2), mo1, mo2)) %>%
|
||||
# filter(!is.na(mo))
|
||||
# insert1 <- asiarsnet %>% transmute(code = WHONET_Code, mo)
|
||||
# insert2 <- asiarsnet %>% transmute(code = as.character(ASIARS_Net_Code), mo)
|
||||
# # these will be updated
|
||||
# bind_rows(insert1, insert2) %>%
|
||||
# rename(mo_new = mo) %>%
|
||||
# left_join(microorganisms.codes) %>%
|
||||
# filter(mo != mo_new)
|
||||
# microorganisms.codes <- microorganisms.codes %>%
|
||||
# filter(!code %in% c(insert1$code, insert2$code)) %>%
|
||||
# bind_rows(insert1, insert2) %>%
|
||||
# arrange(code)
|
||||
# # end
|
||||
|
||||
# save to package
|
||||
## Save to package ----
|
||||
usethis::use_data(microorganisms.codes, overwrite = TRUE, compress = "xz", version = 2)
|
||||
rm(microorganisms.codes)
|
||||
devtools::load_all()
|
||||
|
@ -137,11 +181,11 @@ devtools::load_all()
|
|||
# BREAKPOINTS ----
|
||||
|
||||
# now that we have the right MO codes, get the breakpoints and convert them
|
||||
whonet_breakpoints <- read_tsv("data-raw/WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
filter(BREAKPOINT_TYPE == "Human", GUIDELINES %in% c("CLSI", "EUCAST"))
|
||||
whonet_antibiotics <- read_tsv("data-raw/WHONET/Resources/Antibiotics.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
arrange(WHONET_ABX_CODE) %>%
|
||||
distinct(WHONET_ABX_CODE, .keep_all = TRUE)
|
||||
|
||||
whonet_breakpoints %>%
|
||||
count(GUIDELINES, BREAKPOINT_TYPE) %>%
|
||||
pivot_wider(names_from = BREAKPOINT_TYPE, values_from = n) %>%
|
||||
janitor::adorn_totals(where = c("row", "col"))
|
||||
|
||||
breakpoints <- whonet_breakpoints %>%
|
||||
mutate(code = toupper(ORGANISM_CODE)) %>%
|
||||
|
@ -151,13 +195,14 @@ breakpoints <- whonet_breakpoints %>%
|
|||
mo = rep(as.mo("UNKNOWN"), 2))))
|
||||
# these ones lack an MO name, they cannot be used:
|
||||
unknown <- breakpoints %>%
|
||||
filter(is.na(mo)) %>%
|
||||
filter(is.na(mo) & !ORGANISM_CODE %in% organism_groups$group) %>%
|
||||
pull(code) %>%
|
||||
unique()
|
||||
breakpoints %>%
|
||||
filter(code %in% unknown)
|
||||
filter(code %in% unknown) %>%
|
||||
count(GUIDELINES, YEAR, ORGANISM_CODE, BREAKPOINT_TYPE, sort = TRUE)
|
||||
breakpoints <- breakpoints %>%
|
||||
filter(!is.na(mo))
|
||||
filter(!is.na(mo) | ORGANISM_CODE %in% organism_groups$group)
|
||||
|
||||
# and these ones have unknown antibiotics according to WHONET itself:
|
||||
breakpoints %>%
|
||||
|
@ -168,21 +213,48 @@ breakpoints %>%
|
|||
filter(!WHONET_ABX_CODE %in% whonet_antibiotics$WHONET_ABX_CODE) %>%
|
||||
pull(WHONET_ABX_CODE) %>%
|
||||
unique()
|
||||
# we cannot use them
|
||||
# breakpoints <- breakpoints %>%
|
||||
# filter(WHONET_ABX_CODE %in% whonet_antibiotics$WHONET_ABX_CODE)
|
||||
# now check with our own antibiotics
|
||||
breakpoints %>%
|
||||
filter(!toupper(WHONET_ABX_CODE) %in% antibiotics$ab) %>%
|
||||
pull(WHONET_ABX_CODE) %>%
|
||||
unique()
|
||||
# they are at the moment all old codes that have right replacements in `antibiotics`, so we can use as.ab()
|
||||
|
||||
|
||||
|
||||
## Extend species groups ----
|
||||
message("Extending breakpoints table on species groups...")
|
||||
# get the species groups, they must be converted to rules per-species and added
|
||||
breakpoints.bak <- breakpoints
|
||||
spp_groups <- breakpoints %>% filter(ORGANISM_CODE_TYPE == "SPECIES_GROUP")
|
||||
p <- progress_ticker(nrow(spp_groups))
|
||||
for (i in seq_len(nrow(spp_groups))) {
|
||||
p$tick()
|
||||
mos <- organism_groups %>% filter(group == spp_groups[i, "ORGANISM_CODE", drop = TRUE]) %>% pull(mo)
|
||||
for (m in mos) {
|
||||
breakpoints <- breakpoints %>%
|
||||
bind_rows(spp_groups %>%
|
||||
slice(i) %>%
|
||||
mutate(mo = m))
|
||||
}
|
||||
}
|
||||
close(p)
|
||||
|
||||
# extend all group A and B streptococci
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
bind_rows(breakpoints_new %>%
|
||||
filter(mo == as.mo("Streptococcus Group A")) %>%
|
||||
mutate(mo = as.mo("Streptococcus pyogenes"))) %>%
|
||||
bind_rows(breakpoints_new %>%
|
||||
filter(mo == as.mo("Streptococcus Group B")) %>%
|
||||
mutate(mo = as.mo("Streptococcus agalactiae")))
|
||||
# remove duplicates again for CoNS/CoPS/GBS and arrange
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
mutate(mo = as.mo(mo, keep_synonyms = TRUE)) %>%
|
||||
distinct(guideline, ab, mo, method, site, .keep_all = TRUE) %>%
|
||||
arrange(desc(guideline), ab, mo, method)
|
||||
|
||||
## Build new breakpoints table ----
|
||||
|
||||
breakpoints_new <- breakpoints %>%
|
||||
# only last available 10 years
|
||||
# filter(YEAR > max(YEAR) - 10) %>%
|
||||
filter(!is.na(WHONET_ABX_CODE)) %>%
|
||||
transmute(
|
||||
guideline = paste(GUIDELINES, YEAR),
|
||||
type = ifelse(BREAKPOINT_TYPE == "ECOFF", "ECOFF", tolower(BREAKPOINT_TYPE)),
|
||||
method = TEST_METHOD,
|
||||
site = SITE_OF_INFECTION,
|
||||
mo,
|
||||
|
@ -196,10 +268,10 @@ breakpoints_new <- breakpoints %>%
|
|||
TRUE ~ 6
|
||||
),
|
||||
ab = as.ab(WHONET_ABX_CODE),
|
||||
ref_tbl = REFERENCE_TABLE,
|
||||
ref_tbl = ifelse(type == "ECOFF" & is.na(REFERENCE_TABLE), "ECOFF", REFERENCE_TABLE),
|
||||
disk_dose = POTENCY,
|
||||
breakpoint_S = S,
|
||||
breakpoint_R = R,
|
||||
breakpoint_S = ifelse(type == "ECOFF" & is.na(S) & !is.na(ECV_ECOFF), ECV_ECOFF, S),
|
||||
breakpoint_R = ifelse(type == "ECOFF" & is.na(R) & !is.na(ECV_ECOFF), ECV_ECOFF, R),
|
||||
uti = ifelse(is.na(site), FALSE, gsub(".*(UTI|urinary|urine).*", "UTI", site) == "UTI")
|
||||
) %>%
|
||||
# Greek symbols and EM dash symbols are not allowed by CRAN, so replace them with ASCII:
|
||||
|
@ -213,7 +285,7 @@ breakpoints_new <- breakpoints %>%
|
|||
|
||||
# check the strange duplicates
|
||||
breakpoints_new %>%
|
||||
mutate(id = paste(guideline, ab, mo, method, site)) %>%
|
||||
mutate(id = paste(guideline, type, ab, mo, method, site)) %>%
|
||||
filter(id %in% .$id[which(duplicated(id))])
|
||||
# remove duplicates
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
|
@ -272,74 +344,7 @@ clinical_breakpoints %>% filter(guideline == "EUCAST 2022", ab == "AMC", mo == "
|
|||
dim(breakpoints_new)
|
||||
dim(clinical_breakpoints)
|
||||
|
||||
# ECOFFs ----
|
||||
|
||||
# ECOFF = Epidemiological Cut-Off
|
||||
whonet_ecoff <- read_tsv("data-raw/WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
filter(BREAKPOINT_TYPE == "ECOFF", GUIDELINES %in% c("CLSI", "EUCAST"))
|
||||
|
||||
ecoff <- whonet_ecoff %>%
|
||||
filter(!ORGANISM_CODE %in% c("clu", "BFX", "PFX", "kma", "cdh")) %>%
|
||||
transmute(guideline = paste(GUIDELINES, YEAR),
|
||||
mo = as.mo(ORGANISM_CODE, keep_synonyms = TRUE),
|
||||
ab = as.ab(WHONET_ABX_CODE),
|
||||
method = TEST_METHOD,
|
||||
ecoff = as.double(ECV_ECOFF)) %>%
|
||||
filter(!is.na(ecoff)) %>%
|
||||
distinct()
|
||||
|
||||
# join to breakpoints
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
bind_rows(breakpoints_new %>%
|
||||
right_join(ecoff, by = c("guideline", "mo", "ab", "method"))) %>%
|
||||
mutate(ref_tbl = ifelse(is.na(ref_tbl), "ECOFF", ref_tbl)) %>%
|
||||
distinct(guideline, ab, mo, method, site, .keep_all = TRUE) %>%
|
||||
arrange(desc(guideline), ab, mo, method) %>%
|
||||
mutate(rank_index = case_when(
|
||||
is.na(mo_rank(mo, keep_synonyms = TRUE)) ~ 6, # for UNKNOWN, B_GRAMN, B_ANAER, B_ANAER-NEG, etc.
|
||||
mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species" ~ 2,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "genus" ~ 3,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "family" ~ 4,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,
|
||||
TRUE ~ 6
|
||||
)) %>%
|
||||
mutate(uti = ifelse(is.na(uti), FALSE, uti)) %>%
|
||||
relocate(ecoff, .after = breakpoint_R)
|
||||
|
||||
breakpoints_new.bak <- mutate(uti = ifelse(is.na(uti), FALSE, uti), .after = ecoff)
|
||||
|
||||
# EXTEND CoNS/CoPS/GAS/GBS ----
|
||||
|
||||
# extend all coagulase-postive/-negative staphylococci
|
||||
CoNS <- breakpoints_new %>% filter(mo == as.mo("CoNS"))
|
||||
for (m in MO_CONS[mo_subspecies(MO_CONS, keep_synonyms = TRUE) == ""]) {
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
bind_rows(CoNS %>%
|
||||
mutate(mo = m))
|
||||
}
|
||||
CoPS <- breakpoints_new %>% filter(mo == as.mo("CoPS"))
|
||||
for (m in MO_COPS[mo_subspecies(MO_COPS, keep_synonyms = TRUE) == ""]) {
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
bind_rows(CoPS %>%
|
||||
mutate(mo = m))
|
||||
}
|
||||
# do the same for group A and B streptococci
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
bind_rows(breakpoints_new %>%
|
||||
filter(mo == as.mo("Streptococcus Group A")) %>%
|
||||
mutate(mo = as.mo("Streptococcus pyogenes"))) %>%
|
||||
bind_rows(breakpoints_new %>%
|
||||
filter(mo == as.mo("Streptococcus Group B")) %>%
|
||||
mutate(mo = as.mo("Streptococcus agalactiae")))
|
||||
# remove duplicates again for CoNS/CoPS/GBS and arrange
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
mutate(mo = as.mo(mo, keep_synonyms = TRUE)) %>%
|
||||
distinct(guideline, ab, mo, method, site, .keep_all = TRUE) %>%
|
||||
arrange(desc(guideline), ab, mo, method)
|
||||
|
||||
|
||||
# Save to package ----
|
||||
# SAVE TO PACKAGE ----
|
||||
|
||||
clinical_breakpoints <- breakpoints_new
|
||||
usethis::use_data(clinical_breakpoints, overwrite = TRUE, compress = "xz", version = 2)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# CITE AS #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||
|
|
|
@ -43,7 +43,7 @@ is_sir_eligible(x, threshold = 0.05)
|
|||
reference_data = AMR::clinical_breakpoints,
|
||||
include_screening = getOption("AMR_include_screening", FALSE),
|
||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||
ecoff = getOption("AMR_ecoff", FALSE),
|
||||
breakpoint_type = getOption("AMR_breakpoint_type", FALSE),
|
||||
...
|
||||
)
|
||||
|
||||
|
@ -57,7 +57,7 @@ is_sir_eligible(x, threshold = 0.05)
|
|||
reference_data = AMR::clinical_breakpoints,
|
||||
include_screening = getOption("AMR_include_screening", FALSE),
|
||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||
ecoff = getOption("AMR_ecoff", FALSE),
|
||||
breakpoint_type = getOption("AMR_breakpoint_type", FALSE),
|
||||
...
|
||||
)
|
||||
|
||||
|
@ -72,7 +72,7 @@ is_sir_eligible(x, threshold = 0.05)
|
|||
reference_data = AMR::clinical_breakpoints,
|
||||
include_screening = getOption("AMR_include_screening", FALSE),
|
||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||
ecoff = getOption("AMR_ecoff", FALSE)
|
||||
breakpoint_type = getOption("AMR_breakpoint_type", FALSE)
|
||||
)
|
||||
|
||||
sir_interpretation_history(clean = FALSE)
|
||||
|
@ -102,7 +102,7 @@ sir_interpretation_history(clean = FALSE)
|
|||
|
||||
\item{include_PKPD}{a \link{logical} to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is \code{TRUE}. Can also be set with the \link[=AMR-options]{package option} \code{\link[=AMR-options]{AMR_include_PKPD}}.}
|
||||
|
||||
\item{ecoff}{a \link{logical} to indicate that ECOFF (Epidemiological Cut-Off) values must be used \strong{instead} of other clinical breakpoints - the default is \code{FALSE}. Can also be set with the \link[=AMR-options]{package option} \code{\link[=AMR-options]{AMR_ecoff}}.}
|
||||
\item{breakpoint_type}{the type of breakpoints to use, either "". ECOFF stands for Epidemiological Cut-Off values. The default is \code{"human"}, which can also be set with the \link[=AMR-options]{package option} \code{\link[=AMR-options]{AMR_breakpoint_type}}.}
|
||||
|
||||
\item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
|
||||
|
||||
|
@ -114,6 +114,8 @@ Ordered \link{factor} with new class \code{sir}
|
|||
\description{
|
||||
Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing SIR values. This transforms the input to a new class \code{\link{sir}}, which is an ordered \link{factor} with levels \verb{S < I < R}.
|
||||
|
||||
Currently available \strong{breakpoint guidelines} are EUCAST 2011-2023 and CLSI 2011-2023, and available \strong{breakpoint types} are "".
|
||||
|
||||
All breakpoints used for interpretation are publicly available in the \link{clinical_breakpoints} data set.
|
||||
}
|
||||
\details{
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
\docType{data}
|
||||
\name{microorganisms}
|
||||
\alias{microorganisms}
|
||||
\title{Data Set with 52 151 Microorganisms}
|
||||
\title{Data Set with 52 158 Microorganisms}
|
||||
\format{
|
||||
A \link[tibble:tibble]{tibble} with 52 151 observations and 23 variables:
|
||||
A \link[tibble:tibble]{tibble} with 52 158 observations and 23 variables:
|
||||
\itemize{
|
||||
\item \code{mo}\cr ID of microorganism as used by this package
|
||||
\item \code{fullname}\cr Full name, like \code{"Escherichia coli"}. For the taxonomic ranks genus, species and subspecies, this is the 'pasted' text of genus, species, and subspecies. For all taxonomic ranks higher than genus, this is the name of the taxon.
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
\docType{data}
|
||||
\name{microorganisms.codes}
|
||||
\alias{microorganisms.codes}
|
||||
\title{Data Set with 4 942 Common Microorganism Codes}
|
||||
\title{Data Set with 4 946 Common Microorganism Codes}
|
||||
\format{
|
||||
A \link[tibble:tibble]{tibble} with 4 942 observations and 2 variables:
|
||||
A \link[tibble:tibble]{tibble} with 4 946 observations and 2 variables:
|
||||
\itemize{
|
||||
\item \code{code}\cr Commonly used code of a microorganism
|
||||
\item \code{mo}\cr ID of the microorganism in the \link{microorganisms} data set
|
||||
|
|
Loading…
Reference in New Issue