From 699e87ab4a6637d9bf224e8bb655da448b663971 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Wed, 12 Jun 2019 16:08:20 +0200 Subject: [PATCH] (v0.7.0.9007) renamed notes fix --- DESCRIPTION | 4 ++-- NEWS.md | 3 ++- R/globals.R | 1 + R/mo.R | 10 +++++----- R/zzz.R | 17 ++++++++++------- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 10 ++++++---- docs/reference/index.html | 2 +- 11 files changed, 31 insertions(+), 24 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ca2ff9eb..ce1e4601 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.7.0.9006 -Date: 2019-06-11 +Version: 0.7.0.9007 +Date: 2019-06-12 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/NEWS.md b/NEWS.md index 947601a8..f1dc00f0 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.0.9006 +# AMR 0.7.0.9007 #### New * Support for all scientifically published pathotypes of *E. coli* to date. Supported are: AIEC (Adherent-Invasive *E. coli*), ATEC (Atypical Entero-pathogenic *E. coli*), DAEC (Diffusely Adhering *E. coli*), EAEC (Entero-Aggresive *E. coli*), EHEC (Entero-Haemorrhagic *E. coli*), EIEC (Entero-Invasive *E. coli*), EPEC (Entero-Pathogenic *E. coli*), ETEC (Entero-Toxigenic *E. coli*), NMEC (Neonatal Meningitisā€causing *E. coli*), STEC (Shiga-toxin producing *E. coli*) and UPEC (Uropathogenic *E. coli*). All these lead to the microbial ID of *E. coli*: @@ -22,6 +22,7 @@ * Fixed a EUCAST rule for Staphylococci, where amikacin resistance would not be inferred from tobramycin * Removed `latest_annual_release` from the `catalogue_of_life_version()` function * Removed antibiotic code `PVM1` from the `antibiotics` data set as this was a duplicate of `PME` +* Fixed bug where not all old taxonomic named would not be printed when using a vector as input for `as.mo()` #### Other * Fixed a note thrown by CRAN tests diff --git a/R/globals.R b/R/globals.R index 41bf5b06..db888464 100755 --- a/R/globals.R +++ b/R/globals.R @@ -89,6 +89,7 @@ globalVariables(c(".", "package_v", "Pasted", "patient_id", + "pattern", "phylum", "plural", "prevalence", diff --git a/R/mo.R b/R/mo.R index f87b7564..2aaaf9ca 100755 --- a/R/mo.R +++ b/R/mo.R @@ -748,7 +748,7 @@ exec_as.mo <- function(x, set_mo_history(x_backup[i], get_mo_code(x[i], property), 0, force = force_mo_history) } options(mo_renamed = c(getOption("mo_renamed"), - magenta(paste0("Note: ", + magenta(paste0("NOTE: ", italic("Salmonella"), " ", trimws(gsub("Salmonella", "", x_backup_without_spp[i])), " was considered ", italic("Salmonella species"), @@ -760,7 +760,7 @@ exec_as.mo <- function(x, set_mo_history(x_backup[i], get_mo_code(x[i], property), 0, force = force_mo_history) } options(mo_renamed = c(getOption("mo_renamed"), - magenta(paste0("Note: ", + magenta(paste0("NOTE: ", italic("Salmonella"), " ", trimws(gsub("Salmonella", "", x_backup_without_spp[i])), " was considered a subspecies of ", italic("Salmonella enterica"), @@ -1233,7 +1233,7 @@ exec_as.mo <- function(x, post_Becker <- c("argensis", "caeli", "cornubiensis", "edaphicus") if (any(x %in% MOs_staph[species %in% post_Becker, ..property][[1]])) { - warning("Becker ", italic("et al."), " (2014) does not contain species named after their publication: ", + warning("Becker ", italic("et al."), " (2014, 2019) does not contain species named after their publication: ", italic(paste("S.", sort(mo_species(unique(x[x %in% MOs_staph[species %in% post_Becker, ..property][[1]]]))), collapse = ", ")), @@ -1306,7 +1306,7 @@ exec_as.mo <- function(x, } notes <- sort(notes) for (i in 1:length(notes)) { - base::message(blue(paste("Note:", notes[i]))) + base::message(blue(paste("NOTE:", notes[i]))) } } @@ -1336,7 +1336,7 @@ was_renamed <- function(name_old, name_new, ref_old = "", ref_new = "", mo = "") } msg <- paste0(italic(name_old), ref_old, " was renamed ", italic(name_new), ref_new, mo) msg <- gsub("et al.", italic("et al."), msg) - options(mo_renamed = sort(msg)) + options(mo_renamed = c(getOption("mo_renamed"), sort(msg))) } #' @exportMethod print.mo diff --git a/R/zzz.R b/R/zzz.R index f21644bf..73ee21da 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -53,12 +53,14 @@ .onAttach <- function(...) { - if (interactive()) { + if (interactive() & !isFALSE(getOption("AMR_survey"))) { + options(AMR_survey = FALSE) console_width <- options()$width - 1 url <- "https://www.surveymonkey.com/r/AMR_for_R" - txt <- paste("Thanks for using the AMR package!", - "As researchers, we are interested in how and why you use this package and if there are things you're missing from it.", - "Please fill in our 2-minute survey at:", url) + txt <- paste0("Thanks for using the AMR package! ", + "As researchers, we are interested in how and why you use this package and if there are things you're missing from it. ", + "Please fill in our 2-minute survey at: ", url, ". ", + "This message can be turned off with: options(AMR_survey = FALSE)") # make it honour new lines bases on console width: txt <- unlist(strsplit(txt, " ")) @@ -278,9 +280,10 @@ make_trans_tbl <- function() { B_GRDNR = "B_GRLLA", B_SGMNS = "B_SNGMNS", B_TCLLS = "B_THBCL", F_CCCCS = "F_CRYPT", # renamings of old genus + species - F_CANDD_GLB = "F_CANDD_GLA", F_CANDD_KRU = "F_ISSTC_ORI", - F_CANDD_GUI = "F_MYRZY_GUI", - F_CANDD_LUS = "F_CLVSP_LUS", B_STRPT_TUS = "B_STRPT", + # putting full names here will throw notes with new taxonomic names + F_CANDD_GLB = "F_CANDD_GLA", F_CANDD_KRU = "Candida krusei", + F_CANDD_GUI = "Candida guilliermondii", F_HNSNL_ANO = "Hansenula anomala", + F_CANDD_LUS = "Candida lusitaniae", B_STRPT_TUS = "B_STRPT", B_PRVTL_OLA = "B_PRVTL_OULO", B_FSBCT_RUM = "B_FSBCT", B_CRYNB_EYI = "B_CRYNB_FRE", B_OLGLL_LIS = "B_OLGLL_URE") } diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 8b6719da..57467e8d 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.0.9006 + 0.7.0.9007 diff --git a/docs/articles/index.html b/docs/articles/index.html index 47c4f781..2858e420 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.0.9006 + 0.7.0.9007 diff --git a/docs/authors.html b/docs/authors.html index 2afaccf2..558d685f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.0.9006 + 0.7.0.9007 diff --git a/docs/index.html b/docs/index.html index 0229b58d..588ad0c8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.7.0.9006 + 0.7.0.9007 diff --git a/docs/news/index.html b/docs/news/index.html index 0a1aed95..b375b22c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.0.9006 + 0.7.0.9007 @@ -232,9 +232,9 @@ -
+

-AMR 0.7.0.9006 Unreleased +AMR 0.7.0.9007 Unreleased

@@ -268,6 +268,8 @@
  • Removed latest_annual_release from the catalogue_of_life_version() function
  • Removed antibiotic code PVM1 from the antibiotics data set as this was a duplicate of PME
  • +
  • Fixed bug where not all old taxonomic named would not be printed when using a vector as input for as.mo() +
  • @@ -1106,7 +1108,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents