diff --git a/DESCRIPTION b/DESCRIPTION index 02a971ed..c0295067 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.1.0.9015 -Date: 2020-05-20 +Version: 1.1.0.9016 +Date: 2020-05-21 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index ef77ddd9..c86846d4 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 1.1.0.9015 -## Last updated: 20-May-2020 +# AMR 1.1.0.9016 +## Last updated: 21-May-2020 ### Breaking * Removed code dependency on all other R packages, making this package fully independent on the development process of others. This is a major code change, but will probably not be noticeable by most users. diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 70837e7f..2d976865 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -252,9 +252,9 @@ dataset_UTF8_to_ASCII <- function(df) { } -# replace crayon::has_color +# replace crayon::has_color, but now also FALSE on non-interactive mode has_colour <- function() { - if (Sys.getenv("TERM") == "dumb") { + if (Sys.getenv("TERM") == "dumb" | !interactive()) { return(FALSE) } if (tolower(Sys.info()["sysname"]) == "windows") { diff --git a/R/ab.R b/R/ab.R index adf56f69..cac11131 100755 --- a/R/ab.R +++ b/R/ab.R @@ -215,6 +215,8 @@ as.ab <- function(x, ...) { x_spelling <- gsub("(o\\+n|o\\+ne\\+)$", "o+ne*", x_spelling) # replace multiple same characters to single one with '+', like "ll" -> "l+" x_spelling <- gsub("(.)\\1+", "\\1+", x_spelling) + # replace spaces and slashes with a possibility on both + x_spelling <- gsub("[ /]", "( |/)", x_spelling) # try if name starts with it found <- antibiotics[which(antibiotics$name %like% paste0("^", x_spelling)), ]$ab diff --git a/R/atc_online.R b/R/atc_online.R index 2ddbc599..dac70119 100644 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -128,7 +128,7 @@ atc_online_property <- function(atc_code, returnvalue <- rep(NA_character_, length(atc_code)) } - progress <- progress_estimated(n = length(atc_code)) + progress <- progress_estimated(n = length(atc_code), 3) on.exit(close(progress)) for (i in seq_len(length(atc_code))) { @@ -160,7 +160,7 @@ atc_online_property <- function(atc_code, as.data.frame(stringsAsFactors = FALSE) # case insensitive column names - colnames(tbl) <- tolower(colnames(tbl)) %>% gsub("^atc.*", "atc", .) + colnames(tbl) <- gsub("^atc.*", "atc", tolower(colnames(tbl))) if (length(tbl) == 0) { warning("ATC not found: ", atc_code[i], ". Please check ", atc_url, ".", call. = FALSE) diff --git a/R/eucast_rules.R b/R/eucast_rules.R index cc5f68e5..d261f837 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -599,7 +599,7 @@ eucast_rules <- function(x, } } - if (!any(c("other", "all") %in% rules, na.rm = TRUE)) { + if (info == TRUE & !any(c("other", "all") %in% rules, na.rm = TRUE)) { cat(font_red("\nSkipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.\nUse eucast_rules(..., rules = \"all\") to also apply those rules.\n")) } diff --git a/R/sysdata.rda b/R/sysdata.rda index be08c5f4..6fc9133a 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/data-raw/eucast_rules.tsv b/data-raw/eucast_rules.tsv index 21ed2e1a..9518c084 100644 --- a/data-raw/eucast_rules.tsv +++ b/data-raw/eucast_rules.tsv @@ -16,10 +16,13 @@ genus like .* AMX S AMP S Non-EUCAST: inherit amoxicillin results for unavailabl genus like .* AMX I AMP I Non-EUCAST: inherit amoxicillin results for unavailable ampicillin Other rules genus like .* AMX R AMP R Non-EUCAST: inherit amoxicillin results for unavailable ampicillin Other rules genus like .* AMC R AMP, AMX R Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R Other rules +genus like .* SAM R AMP, AMX R Non-EUCAST: set ampicillin = R where ampicillin/sulbactam = R Other rules genus like .* TZP R PIP R Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R Other rules genus like .* SXT R TMP R Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R Other rules genus like .* AMP S AMC S Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S Other rules genus like .* AMX S AMC S Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S Other rules +genus like .* AMP S SAM S Non-EUCAST: set ampicillin/sulbactam = S where ampicillin = S Other rules +genus like .* AMX S SAM S Non-EUCAST: set ampicillin/sulbactam = S where ampicillin = S Other rules genus like .* PIP S TZP S Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S Other rules genus like .* TMP S SXT S Non-EUCAST: set trimethoprim/sulfa = S where trimethoprim = S Other rules order is Enterobacterales AMP S AMX S Enterobacterales (Order) Breakpoints diff --git a/docs/404.html b/docs/404.html index d911055f..c11fc012 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index affda865..e29fb5b0 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html index 9144cfc4..4f787ab1 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -39,7 +39,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 @@ -186,7 +186,7 @@

How to apply EUCAST rules

Matthijs S. Berends

-

20 May 2020

+

21 May 2020

Source: vignettes/EUCAST.Rmd @@ -218,10 +218,6 @@ # 2 Escherichia S eucast_rules(oops, info = FALSE) -# [31m -# Skipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R. -# Use eucast_rules(..., rules = "all") to also apply those rules. -# [39m # mo ampicillin # 1 Klebsiella R # 2 Escherichia S @@ -305,10 +301,6 @@
eucast_rules(data)
-
# [31m
-# Skipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.
-# Use eucast_rules(..., rules = "all") to also apply those rules.
-# [39m
diff --git a/docs/articles/index.html b/docs/articles/index.html index 9f42f40b..52616c29 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 diff --git a/docs/authors.html b/docs/authors.html index 22eb7d12..ad14db22 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 diff --git a/docs/index.html b/docs/index.html index 6602fb14..c2cdfc2a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 diff --git a/docs/news/index.html b/docs/news/index.html index f7d0a853..eb79a1cc 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016 @@ -229,13 +229,13 @@ Source: NEWS.md -
-

-AMR 1.1.0.9015 Unreleased +
+

+AMR 1.1.0.9016 Unreleased

-
+

-Last updated: 20-May-2020 +Last updated: 21-May-2020

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f8afe89c..c7eaa4b4 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: WHONET: WHONET.html benchmarks: benchmarks.html resistance_predict: resistance_predict.html -last_built: 2020-05-20T09:55Z +last_built: 2020-05-21T10:28Z urls: reference: https://msberends.gitlab.io/AMR/reference article: https://msberends.gitlab.io/AMR/articles diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index ddf2c3fd..57828c12 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 1.1.0.9015 + 1.1.0.9016

diff --git a/docs/reference/index.html b/docs/reference/index.html index 2791b0b7..cc481058 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.1.0.9015 + 1.1.0.9016

mo