mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 06:46:11 +01:00
fix for R < 3.4
This commit is contained in:
parent
1db74e86cd
commit
e4ea96cbf9
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 1.8.2.9074
|
||||
Date: 2022-12-29
|
||||
Version: 1.8.2.9075
|
||||
Date: 2022-12-30
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
data analysis and to work with microbial and antimicrobial properties by
|
||||
|
8
NEWS.md
8
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 1.8.2.9074
|
||||
# 1.8.2.9075
|
||||
|
||||
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
||||
|
||||
@ -19,7 +19,7 @@ This is a new major release of the AMR package, with great new additions but als
|
||||
|
||||
### Interpretation of MIC and disk diffusion values
|
||||
|
||||
EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 (v12.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for `eucast_rules()` to apply EUCAST Expert Rules. The default guideline (EUCAST) can now be changed with the new `AMR_guideline` option, such as: `options(AMR_guideline = "CLSI 2020")`.
|
||||
The clinical breakpoints and intrinsic resistance of EUCAST 2022 and CLSI 2022 have been added for `as.rsi()`. EUCAST 2022 (v12.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for `eucast_rules()` to apply EUCAST Expert Rules. The default guideline (EUCAST) can now be changed with the new `AMR_guideline` option, such as: `options(AMR_guideline = "CLSI 2020")`.
|
||||
|
||||
Interpretation guidelines older than 10 years were removed, the oldest now included guidelines of EUCAST and CLSI are from 2013.
|
||||
|
||||
@ -31,7 +31,7 @@ We are very grateful for the valuable input by our colleagues from other countri
|
||||
|
||||
### Microbiological taxonomy
|
||||
|
||||
The `microorganisms` no longer relies on the Catalogue of Life, but on the List of Prokaryotic names with Standing in Nomenclature (LPSN) and is supplemented with the 'backbone taxonomy' from the Global Biodiversity Information Facility (GBIF). The structure of this data set has changed to include separate LPSN and GBIF identifiers. Almost all previous MO codes were retained. It contains over 1,400 taxonomic names from 2022.
|
||||
The `microorganisms` data set no longer relies on the Catalogue of Life, but on the List of Prokaryotic names with Standing in Nomenclature (LPSN) and is supplemented with the 'backbone taxonomy' from the Global Biodiversity Information Facility (GBIF). The structure of this data set has changed to include separate LPSN and GBIF identifiers. Almost all previous MO codes were retained. It contains over 1,400 taxonomic names from 2022.
|
||||
|
||||
We previously relied on our own experience to categorise species into pathogenic groups, but we were very happy to encounter the very recent work of Bartlett *et al.* (2022, DOI [10.1099/mic.0.001269](https://doi.org/10.1099/mic.0.001269)) who extensively studied medical-scientific literature to categorise all bacterial species into groups. See `mo_matching_score()` on how their work was incorporated into the `prevalence` column of the `microorganisms` data set. Using their results, the `as.mo()` and all `mo_*()` functions are now much better capable of converting user input to valid taxonomic records.
|
||||
|
||||
@ -40,7 +40,7 @@ The new function `add_custom_microorganisms()` allows users to add custom microo
|
||||
We also made the following changes regarding the included taxonomy or microorganisms functions:
|
||||
|
||||
* Updated full microbiological taxonomy according to the latest daily LPSN data set (December 2022) and latest yearly GBIF taxonomy backbone (November 2022)
|
||||
* Support for all 1,515 city-like serovars of *Salmonella*, such as *Salmonella* Goldcoast. Formally, these are serovars belonging to the *S. enterica* species, but they are reported with only the name of the genus and the city. For this reason, the serovars are in the `subspecies` column of the `microorganisms` data set and "enterica" is in the `species` column, but the full name does not contain the species name (*enterica*).
|
||||
* Support for all 1,516 city-like serovars of *Salmonella*, such as *Salmonella* Goldcoast. Formally, these are serovars belonging to the *S. enterica* species, but they are reported with only the name of the genus and the city. For this reason, the serovars are in the `subspecies` column of the `microorganisms` data set and "enterica" is in the `species` column, but the full name does not contain the species name (*enterica*).
|
||||
* All new algorithm for `as.mo()` (and thus all `mo_*()` functions) while still following our original set-up as described in our recently published JSS paper (DOI [10.18637/jss.v104.i03](https://doi.org/10.18637/jss.v104.i03)).
|
||||
* A new argument `keep_synonyms` allows to *not* correct for updated taxonomy, in favour of the now deleted argument `allow_uncertain`
|
||||
* It has increased tremendously in speed and returns generally more consequent results
|
||||
|
@ -380,7 +380,7 @@ import_fn <- function(name, pkg, error_on_fail = TRUE) {
|
||||
error = function(e) {
|
||||
if (isTRUE(error_on_fail)) {
|
||||
stop_("function ", name, "() is not an exported object from package '", pkg,
|
||||
"'. Please create an issue at https://github.com/msberends/AMR/issues. Many thanks!",
|
||||
"'. Please create an issue at ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!",
|
||||
call = FALSE
|
||||
)
|
||||
} else {
|
||||
@ -476,6 +476,7 @@ word_wrap <- function(...,
|
||||
# remove extra space that was introduced (e.g. "Smith et al., 2022")
|
||||
msg <- gsub(". ,", ".,", msg, fixed = TRUE)
|
||||
msg <- gsub("[ ,", "[,", msg, fixed = TRUE)
|
||||
msg <- gsub("/ /", "//", msg, fixed = TRUE)
|
||||
|
||||
msg
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ add_custom_antimicrobials <- function(x) {
|
||||
x$generalised_name <- generalise_antibiotic_name(x$name)
|
||||
x$generalised_all <- as.list(x$generalised_name)
|
||||
for (col in colnames(x)) {
|
||||
if (is.list(AMR_env$AB_lookup[, col, drop = TRUE])) {
|
||||
if (is.list(AMR_env$AB_lookup[, col, drop = TRUE]) & !is.list(x[, col, drop = TRUE])) {
|
||||
x[, col] <- as.list(x[, col, drop = TRUE])
|
||||
}
|
||||
}
|
||||
@ -155,7 +155,8 @@ add_custom_antimicrobials <- function(x) {
|
||||
new_df[, col] <- x[, col, drop = TRUE]
|
||||
}
|
||||
AMR_env$AB_lookup <- unique(rbind(AMR_env$AB_lookup, new_df))
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(!AMR_env$ab_previously_coerced$ab %in% new_df$ab), , drop = FALSE]
|
||||
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(!AMR_env$ab_previously_coerced$ab %in% x$ab), , drop = FALSE]
|
||||
class(AMR_env$AB_lookup$ab) <- c("ab", "character")
|
||||
message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal `antibiotics` data set.")
|
||||
}
|
||||
@ -167,5 +168,6 @@ clear_custom_antimicrobials <- function() {
|
||||
AMR_env$AB_lookup <- create_AB_lookup()
|
||||
n2 <- nrow(AMR_env$AB_lookup)
|
||||
AMR_env$custom_ab_codes <- character(0)
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(AMR_env$ab_previously_coerced$ab %in% AMR_env$AB_lookup$ab), , drop = FALSE]
|
||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `antibiotics` data set.")
|
||||
}
|
||||
|
@ -185,11 +185,10 @@ add_custom_microorganisms <- function(x) {
|
||||
x$mo <- trimws2(x$mo)
|
||||
x$mo[x$mo == ""] <- NA_character_
|
||||
x$mo[is.na(x$mo)] <- paste0("CUSTOM_",
|
||||
toupper(abbreviate(gsub(" +", " _ ",
|
||||
toupper(unname(abbreviate(gsub(" +", " _ ",
|
||||
gsub("[^A-Za-z0-9-]", " ",
|
||||
trimws2(paste(x$genus, x$species, x$subspecies)))),
|
||||
minlength = 10,
|
||||
named = FALSE)))
|
||||
minlength = 10))))
|
||||
|
||||
# add to package ----
|
||||
|
||||
|
2
R/rsi.R
2
R/rsi.R
@ -804,7 +804,7 @@ as_rsi_method <- function(method_short,
|
||||
for (i in seq_len(length(messages))) {
|
||||
messages[i] <- word_wrap(extra_indent = 5, messages[i])
|
||||
}
|
||||
message(font_green(font_bold(" * NOTE *\n")),
|
||||
message(font_green(font_bold(" Note:\n")),
|
||||
paste0(" ", font_black(AMR_env$bullet_icon)," ", font_black(messages, collapse = NULL) , collapse = "\n"))
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ translate_into_language <- function(from,
|
||||
any_form_in_patterns <- tryCatch(
|
||||
any(from_unique %like% paste0("(", paste(gsub(" +\\(.*", "", df_trans$pattern), collapse = "|"), ")")),
|
||||
error = function(e) {
|
||||
warning_("Translation not possible. Please open an issue on GitHub (https://github.com/msberends/AMR/issues).")
|
||||
warning_("Translation not possible. Please create an issue at ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!")
|
||||
return(FALSE)
|
||||
}
|
||||
)
|
||||
|
15
_pkgdown.yml
15
_pkgdown.yml
@ -96,13 +96,13 @@ navbar:
|
||||
- text: "Apply EUCAST rules"
|
||||
icon: "fa-exchange-alt"
|
||||
href: "articles/EUCAST.html"
|
||||
- text: "Get properties of a microorganism"
|
||||
- text: "Get taxonomy of a microorganism"
|
||||
icon: "fa-bug"
|
||||
href: "reference/mo_property.html" # reference instead of an article
|
||||
- text: "Get properties of an antibiotic"
|
||||
- text: "Get properties of an antibiotic drug"
|
||||
icon: "fa-capsules"
|
||||
href: "reference/ab_property.html" # reference instead of an article
|
||||
- text: "Get properties of an antiviral agent"
|
||||
- text: "Get properties of an antiviral drug"
|
||||
icon: "fa-capsules"
|
||||
href: "reference/av_property.html" # reference instead of an article
|
||||
- text: "Manual"
|
||||
@ -118,15 +118,14 @@ navbar:
|
||||
- text: "Source Code"
|
||||
icon: "fab fa-github"
|
||||
href: "https://github.com/msberends/AMR"
|
||||
# - text: "Survey"
|
||||
# icon: "fa-clipboard-list"
|
||||
# href: "survey.html"
|
||||
|
||||
reference:
|
||||
- title: "Preparing data: microorganisms"
|
||||
desc: >
|
||||
These functions are meant to get taxonomically valid properties of microorganisms from any input.
|
||||
Use `mo_source()` to teach this package how to translate your own codes to valid microorganism codes.
|
||||
These functions are meant to get taxonomically valid properties of microorganisms from any input, but
|
||||
also properties derived from taxonomy, such as the Gram stain (`mo_gramstain()`) , or `mo_is_yeast()`.
|
||||
Use `mo_source()` to teach this package how to translate your own codes to valid microorganisms, and
|
||||
use `add_custom_microorganisms() to add your own custom microorganisms to this package.
|
||||
contents:
|
||||
- "`as.mo`"
|
||||
- "`mo_property`"
|
||||
|
Loading…
Reference in New Issue
Block a user