diff --git a/DESCRIPTION b/DESCRIPTION index 88dec1411..273cf953a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.9.0.9008 -Date: 2020-01-05 +Version: 0.9.0.9009 +Date: 2020-01-08 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), @@ -63,5 +63,5 @@ BugReports: https://gitlab.com/msberends/AMR/issues License: GPL-2 | file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.0.1 +RoxygenNote: 7.0.2 Roxygen: list(markdown = TRUE) diff --git a/NEWS.md b/NEWS.md index 220143239..ba66451ff 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,15 @@ -# AMR 0.9.0.9008 -## Last updated: 05-Jan-2020 +# AMR 0.9.0.9009 +## Last updated: 08-Jan-2020 ### Changes * Speed improvement for `as.mo()` (and consequently all `mo_*` functions that use `as.mo()` internally), especially for the *G. species* format (G for genus), like *E. coli* and *K penumoniae* * Input values for `as.disk()` limited to a maximum of 50 millimeters * Added a lifecycle state to every function, following [the lifecycle circle of the `tidyverse`](https://www.tidyverse.org/lifecycle) +* For in `as.ab()`: support for drugs starting with "co-" like co-amoxiclav, co-trimoxazole, co-trimazine and co-trimazole (thanks to Peter Dutey) +* Changes to the `antibiotics` data set (thanks to Peter Dutey): + * Added more synonyms to colistin, imipenem and piperacillin/tazobactam + * Moved synonyms Rifinah and Rimactazid from rifampicin (`RIF`) to rifampicin/isoniazid (`RFI`). Please note that [the combination rifampicin/isoniazid has no DDDs defined](https://www.whocc.no/atc_ddd_index/?code=J04AM02&showdescription=no), so e.g. `ab_ddd("Rimactazid")` will now return `NA`. + * Moved synonyms Bactrimel and Cotrimazole from sulfamethoxazole (`SMX`) to trimethoprim/sulfamethoxazole (`SXT`) ### Other * Add a `CITATION` file diff --git a/R/ab.R b/R/ab.R index 6ebd8f39d..84b0929c4 100755 --- a/R/ab.R +++ b/R/ab.R @@ -43,7 +43,7 @@ #' @inheritSection AMR Read more on our website! #' @export #' @examples -#' # These examples all return "ERY", the ID of Erythromycin: +#' # these examples all return "ERY", the ID of erythromycin: #' as.ab("J01FA01") #' as.ab("J 01 FA 01") #' as.ab("Erythromycin") @@ -54,8 +54,14 @@ #' as.ab("eritromicine") # spelled wrong, yet works #' as.ab("Erythrocin") # trade name #' as.ab("Romycin") # trade name +#' +#' # spelling from different languages and dyslexia are no problem +#' ab_atc("ceftriaxon") +#' ab_atc("cephtriaxone") +#' ab_atc("cephthriaxone") +#' ab_atc("seephthriaaksone") #' -#' # Use ab_* functions to get a specific properties (see ?ab_property); +#' # use ab_* functions to get a specific properties (see ?ab_property); #' # they use as.ab() internally: #' ab_name("J01FA01") # "Erythromycin" #' ab_name("eryt") # "Erythromycin" @@ -87,6 +93,10 @@ as.ab <- function(x, ...) { # spaces around non-characters must be removed: amox + clav -> amox/clav x_bak_clean <- gsub("(.*[a-zA-Z0-9]) ([^a-zA-Z0-9].*)", "\\1\\2", x_bak_clean) x_bak_clean <- gsub("(.*[^a-zA-Z0-9]) ([a-zA-Z0-9].*)", "\\1\\2", x_bak_clean) + # remove hyphen after a starting "co" + x_bak_clean <- gsub("^co-", "co", x_bak_clean, ignore.case = TRUE) + # replace text 'and' with a slash + x_bak_clean <- gsub(" and ", "/", x_bak_clean, ignore.case = TRUE) x <- unique(x_bak_clean) x_new <- rep(NA_character_, length(x)) diff --git a/R/ab_property.R b/R/ab_property.R index d74046098..a077b6656 100644 --- a/R/ab_property.R +++ b/R/ab_property.R @@ -72,6 +72,12 @@ #' ab_name("floxapen") # "Flucloxacillin" #' ab_name(21319) # "Flucloxacillin" (using CID) #' ab_name("J01CF05") # "Flucloxacillin" (using ATC) +#' +#' # spelling from different languages and dyslexia are no problem +#' ab_atc("ceftriaxon") +#' ab_atc("cephtriaxone") +#' ab_atc("cephthriaxone") +#' ab_atc("seephthriaaksone") ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) { x <- translate_AMR(ab_validate(x = x, property = "name", ...), language = language) if (tolower == TRUE) { diff --git a/_pkgdown.yml b/_pkgdown.yml index 7cd77235b..13e0b9104 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -148,6 +148,7 @@ reference: - "`catalogue_of_life`" - "`catalogue_of_life_version`" - "`WHOCC`" + - "`lifecycle`" - title: Other functions desc: > These functions are mostly for internal use, but some of diff --git a/data-raw/reproduction_of_antibiotics.R b/data-raw/reproduction_of_antibiotics.R index 521af24e2..6b9ddd923 100644 --- a/data-raw/reproduction_of_antibiotics.R +++ b/data-raw/reproduction_of_antibiotics.R @@ -327,8 +327,23 @@ antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(anti # High level Gentamcin and Streptomycin antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]] <- list(c("gehl", "gentamicin high", "genta high")) antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]] <- list(c("sthl", "streptomycin high", "strepto high")) -# add imi to imipenem +# add imi and "imipenem/cilastatine" to imipenem antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]] <- list(c("imip", "imi", "imp")) +antibiotics[which(antibiotics$ab == "IPM"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "IPM"), "synonyms"][[1]], "imipenem/cilastatin"))) +# add synonyms of ones not found +antibiotics[which(antibiotics$ab == "TZP"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "TZP"), "synonyms"][[1]], "Tazocel", "tazocillin", "Tazocin", "Zosyn"))) +antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]], "Colisticin", "Polymyxin E", "Colimycin", "Coly-Mycin", "Totazina", "Colistimethate", "Promixin", "Colistimethate Sodium")))) +# remove incorrect synonyms from rifampicin (RIF) and add them to the combination rifampicin/isoniazid (RFI) +old_sym <- antibiotics[which(antibiotics$ab == "RIF"), "synonyms"][[1]] +old_sym <- old_sym[!old_sym %in% c("Rifinah", "Rimactazid")] +antibiotics[which(antibiotics$ab == "RIF"), "synonyms"][[1]] <- list(old_sym) +antibiotics[which(antibiotics$ab == "RFI"), "synonyms"][[1]] <- list(sort(c("Rifinah", "Rimactazid"))) +# remove incorrect synonyms from sulfamethoxazole (SMX) and add them to the combination trimethoprim/sulfamethoxazole (SXT) +old_sym <- antibiotics[which(antibiotics$ab == "SMX"), "synonyms"][[1]] +old_sym <- old_sym[!old_sym %in% c("Cotrimoxazole", "Bactrimel")] +antibiotics[which(antibiotics$ab == "SMX"), "synonyms"][[1]] <- list(old_sym) +antibiotics[which(antibiotics$ab == "SXT"), "synonyms"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]], "Cotrimoxazole", "Bactrimel", "Septra", "Bactrim", "Cotrimazole")))) + ## new ATC codes # ceftaroline diff --git a/data/antibiotics.rda b/data/antibiotics.rda index 5174e2822..0762f5551 100755 Binary files a/data/antibiotics.rda and b/data/antibiotics.rda differ diff --git a/docs/404.html b/docs/404.html index d5d6fe446..30b5159c5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index eb22a69cc..ce4221080 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/index.html b/docs/articles/index.html index 7d4f3efa4..3f33fc1c7 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 39a5cf788..eb17b5d91 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ @@ -238,7 +238,7 @@
@Article{,
title = {AMR - An R Package for Working with Antimicrobial Resistance Data},
- author = {Matthijs S Berends and Christian F Luz and Alexander W Friedrich and Bhanu N M Sinha and Casper J Albers and Corinna Glasner},
+ author = {M S Berends and C F Luz and A W Friedrich and B N M Sinha and C J Albers and C Glasner},
journal = {bioRxiv},
publisher = {Cold Spring Harbor Laboratory},
year = {2019},
diff --git a/docs/index.html b/docs/index.html
index 5f176c1ce..486cc9f2d 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -45,7 +45,7 @@
diff --git a/docs/news/index.html b/docs/news/index.html
index 3c9b86142..bc850f506 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -84,7 +84,7 @@
@@ -231,13 +231,13 @@
-
+
-AMR 0.9.0.9008 Unreleased
+AMR 0.9.0.9009 Unreleased
-
+
-Last updated: 05-Jan-2020
+Last updated: 08-Jan-2020
@@ -248,6 +248,14 @@
Input values for as.disk() limited to a maximum of 50 millimeters
Added a lifecycle state to every function, following the lifecycle circle of the tidyverse
+For in as.ab(): support for drugs starting with “co-” like co-amoxiclav, co-trimoxazole, co-trimazine and co-trimazole (thanks to Peter Dutey)
+Changes to the antibiotics data set (thanks to Peter Dutey):
+
+- Added more synonyms to colistin, imipenem and piperacillin/tazobactam
+- Moved synonyms Rifinah and Rimactazid from rifampicin (
RIF) to rifampicin/isoniazid (RFI). Please note that the combination rifampicin/isoniazid has no DDDs defined, so e.g. ab_ddd("Rimactazid") will now return NA.
+- Moved synonyms Bactrimel and Cotrimazole from sulfamethoxazole (
SMX) to trimethoprim/sulfamethoxazole (SXT)
+
+
@@ -1418,7 +1426,7 @@ Using as.mo(..., allow_uncertain = 3)
Contents
diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html
index a64275ec2..81fd5d1bd 100644
--- a/docs/reference/ab_property.html
+++ b/docs/reference/ab_property.html
@@ -85,7 +85,7 @@
@@ -356,7 +356,13 @@ The lifecycle of this function is maturing<
ab_name("fluklox") # "Flucloxacillin"
ab_name("floxapen") # "Flucloxacillin"
ab_name(21319) # "Flucloxacillin" (using CID)
-ab_name("J01CF05") # "Flucloxacillin" (using ATC)
+ab_name("J01CF05") # "Flucloxacillin" (using ATC)
+
+# spelling from different languages and dyslexia are no problem
+ab_atc("ceftriaxon")
+ab_atc("cephtriaxone")
+ab_atc("cephthriaxone")
+ab_atc("seephthriaaksone")
diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html
index 9c6a427ce..61e269d90 100644
--- a/docs/reference/age_groups.html
+++ b/docs/reference/age_groups.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html
index 5f14951a4..9d1fcb9d6 100644
--- a/docs/reference/as.ab.html
+++ b/docs/reference/as.ab.html
@@ -85,7 +85,7 @@
@@ -293,7 +293,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral dru
antibiotics for the dataframe that is being used to determine ATCs.
Examples
- # These examples all return "ERY", the ID of Erythromycin:
+ # these examples all return "ERY", the ID of erythromycin:
as.ab("J01FA01")
as.ab("J 01 FA 01")
as.ab("Erythromycin")
@@ -305,7 +305,13 @@ This package contains all ~550 antibiotic, antimycotic and antiviral dru
as.ab("Erythrocin") # trade name
as.ab("Romycin") # trade name
-# Use ab_* functions to get a specific properties (see ?ab_property);
+# spelling from different languages and dyslexia are no problem
+ab_atc("ceftriaxon")
+ab_atc("cephtriaxone")
+ab_atc("cephthriaxone")
+ab_atc("seephthriaaksone")
+
+# use ab_* functions to get a specific properties (see ?ab_property);
# they use as.ab() internally:
ab_name("J01FA01") # "Erythromycin"
ab_name("eryt") # "Erythromycin"
diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html
index 6cc66ee13..c9de77ee9 100644
--- a/docs/reference/as.disk.html
+++ b/docs/reference/as.disk.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html
index 6b8fd67f1..a513bc238 100644
--- a/docs/reference/as.mic.html
+++ b/docs/reference/as.mic.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html
index 0d7f2519e..8abed42fc 100644
--- a/docs/reference/as.mo.html
+++ b/docs/reference/as.mo.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html
index d22487466..4ba152c49 100644
--- a/docs/reference/as.rsi.html
+++ b/docs/reference/as.rsi.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html
index f57f8c51e..9a0539afc 100644
--- a/docs/reference/atc_online.html
+++ b/docs/reference/atc_online.html
@@ -86,7 +86,7 @@ This function requires an internet connection." />
diff --git a/docs/reference/availability.html b/docs/reference/availability.html
index 3099d71b1..ef3b2ea19 100644
--- a/docs/reference/availability.html
+++ b/docs/reference/availability.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html
index 20ca48c4d..0e647492b 100644
--- a/docs/reference/bug_drug_combinations.html
+++ b/docs/reference/bug_drug_combinations.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/count.html b/docs/reference/count.html
index e8dc2a96f..7302ed74d 100644
--- a/docs/reference/count.html
+++ b/docs/reference/count.html
@@ -86,7 +86,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html
index bdf751099..818813ae9 100644
--- a/docs/reference/eucast_rules.html
+++ b/docs/reference/eucast_rules.html
@@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
diff --git a/docs/reference/extended-functions.html b/docs/reference/extended-functions.html
index d76904ff9..12664884b 100644
--- a/docs/reference/extended-functions.html
+++ b/docs/reference/extended-functions.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html
index 245ac7267..0bb26635b 100644
--- a/docs/reference/filter_ab_class.html
+++ b/docs/reference/filter_ab_class.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html
index acfa950d5..cf7f3c197 100644
--- a/docs/reference/g.test.html
+++ b/docs/reference/g.test.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html
index 5dc8b5cf3..a74f000a0 100644
--- a/docs/reference/ggplot_rsi.html
+++ b/docs/reference/ggplot_rsi.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html
index 6b2ecce02..09e683ded 100644
--- a/docs/reference/guess_ab_col.html
+++ b/docs/reference/guess_ab_col.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/index.html b/docs/reference/index.html
index b49c3488f..f7cb2416a 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -84,7 +84,7 @@
@@ -517,6 +517,12 @@
WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
+
+
+
+
+
+ Lifecycles of functions in the AMR package
diff --git a/docs/reference/join.html b/docs/reference/join.html
index e158f2069..46efe3705 100644
--- a/docs/reference/join.html
+++ b/docs/reference/join.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html
index fa1ec9c74..ff9e60575 100644
--- a/docs/reference/key_antibiotics.html
+++ b/docs/reference/key_antibiotics.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html
index e54eaadc0..69ba3a99c 100644
--- a/docs/reference/kurtosis.html
+++ b/docs/reference/kurtosis.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/lifecycle.html b/docs/reference/lifecycle.html
index 08cdc312a..a22e1a428 100644
--- a/docs/reference/lifecycle.html
+++ b/docs/reference/lifecycle.html
@@ -87,7 +87,7 @@ This page contains a section for every lifecycle (with text borrowed from the af
diff --git a/docs/reference/like.html b/docs/reference/like.html
index 9a5683b8d..23d68e0f9 100644
--- a/docs/reference/like.html
+++ b/docs/reference/like.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html
index 5bf3ae403..3fd6f62f8 100644
--- a/docs/reference/mdro.html
+++ b/docs/reference/mdro.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html
index 12f588c0d..420914d00 100644
--- a/docs/reference/mo_source.html
+++ b/docs/reference/mo_source.html
@@ -86,7 +86,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
diff --git a/docs/reference/p_symbol.html b/docs/reference/p_symbol.html
index eec1d452b..96f1dc342 100644
--- a/docs/reference/p_symbol.html
+++ b/docs/reference/p_symbol.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html
index 78effc2ba..8849206bc 100644
--- a/docs/reference/proportion.html
+++ b/docs/reference/proportion.html
@@ -86,7 +86,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html
index b5bcd252d..20dd3106b 100644
--- a/docs/reference/read.4D.html
+++ b/docs/reference/read.4D.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html
index 01f2abcbc..c357b3813 100644
--- a/docs/reference/resistance_predict.html
+++ b/docs/reference/resistance_predict.html
@@ -85,7 +85,7 @@
diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html
index 3286082f7..cc51ae323 100644
--- a/docs/reference/skewness.html
+++ b/docs/reference/skewness.html
@@ -86,7 +86,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
diff --git a/docs/reference/translate.html b/docs/reference/translate.html
index bc1aad71d..163b1feaa 100644
--- a/docs/reference/translate.html
+++ b/docs/reference/translate.html
@@ -85,7 +85,7 @@
diff --git a/inst/CITATION b/inst/CITATION
index 2e229915b..66ddc1d08 100644
--- a/inst/CITATION
+++ b/inst/CITATION
@@ -3,7 +3,7 @@ citHeader("To cite our AMR package in publications, please use (for now):")
citEntry(
entry = "Article",
title = "AMR - An R Package for Working with Antimicrobial Resistance Data",
- author = "Matthijs S Berends and Christian F Luz and Alexander W Friedrich and Bhanu N M Sinha and Casper J Albers and Corinna Glasner",
+ author = "M S Berends and C F Luz and A W Friedrich and B N M Sinha and C J Albers and C Glasner",
journal = "bioRxiv",
publisher = "Cold Spring Harbor Laboratory",
year = 2019,
diff --git a/man/ab_property.Rd b/man/ab_property.Rd
index 040c6c65c..4d9271160 100644
--- a/man/ab_property.Rd
+++ b/man/ab_property.Rd
@@ -116,6 +116,12 @@ ab_name("fluklox") # "Flucloxacillin"
ab_name("floxapen") # "Flucloxacillin"
ab_name(21319) # "Flucloxacillin" (using CID)
ab_name("J01CF05") # "Flucloxacillin" (using ATC)
+
+# spelling from different languages and dyslexia are no problem
+ab_atc("ceftriaxon")
+ab_atc("cephtriaxone")
+ab_atc("cephthriaxone")
+ab_atc("seephthriaaksone")
}
\seealso{
\link{antibiotics}
diff --git a/man/as.ab.Rd b/man/as.ab.Rd
index 275817391..9551e35b9 100644
--- a/man/as.ab.Rd
+++ b/man/as.ab.Rd
@@ -59,7 +59,7 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
}
\examples{
-# These examples all return "ERY", the ID of Erythromycin:
+# these examples all return "ERY", the ID of erythromycin:
as.ab("J01FA01")
as.ab("J 01 FA 01")
as.ab("Erythromycin")
@@ -71,7 +71,13 @@ as.ab("eritromicine") # spelled wrong, yet works
as.ab("Erythrocin") # trade name
as.ab("Romycin") # trade name
-# Use ab_* functions to get a specific properties (see ?ab_property);
+# spelling from different languages and dyslexia are no problem
+ab_atc("ceftriaxon")
+ab_atc("cephtriaxone")
+ab_atc("cephthriaxone")
+ab_atc("seephthriaaksone")
+
+# use ab_* functions to get a specific properties (see ?ab_property);
# they use as.ab() internally:
ab_name("J01FA01") # "Erythromycin"
ab_name("eryt") # "Erythromycin"