1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 22:22:03 +02:00

(v0.7.0.9007) renamed notes fix

This commit is contained in:
2019-06-12 16:08:20 +02:00
parent 44ab53128e
commit 699e87ab4a
11 changed files with 31 additions and 24 deletions

View File

@ -89,6 +89,7 @@ globalVariables(c(".",
"package_v",
"Pasted",
"patient_id",
"pattern",
"phylum",
"plural",
"prevalence",

10
R/mo.R
View File

@ -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

17
R/zzz.R
View File

@ -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")
}