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 @@
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 @@ 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 @@ @@ -186,7 +186,7 @@vignettes/EUCAST.Rmd
EUCAST.Rmd