(v1.7.1.9000) ab_class update, unit tests

pull/67/head
dr. M.S. (Matthijs) Berends 2021-06-04 21:07:55 +02:00
parent 7e70403efb
commit 1908e7cc7a
34 changed files with 365 additions and 1368 deletions

View File

@ -32,9 +32,9 @@ on:
branches:
- master
schedule:
# run a schedule everyday at 3 AM.
# run a schedule everyday at 1 AM.
# this is to check that all dependencies are still available (see R/zzz.R)
- cron: '0 3 * * *'
- cron: '0 1 * * *'
name: R-code-check
@ -98,8 +98,7 @@ jobs:
- name: Restore cached R packages
# this step will add the step 'Post Restore cached R packages' on a succesful run
if: runner.os != 'Windows'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-v4

View File

@ -50,7 +50,7 @@ jobs:
- name: Restore cached R packages
# this step will add the step 'Post Restore cached R packages' on a succesful run
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-latest-r-release-v5-codecovr
@ -68,20 +68,6 @@ jobs:
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
shell: Rscript {0}
# - name: Test coverage
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# run: |
# library(AMR)
# library(tinytest)
# library(covr)
# source_files <- list.files("R", pattern = ".R$", full.names = TRUE)
# test_files <- list.files("inst/tinytest", full.names = TRUE)
# cov <- file_coverage(source_files = source_files, test_files = test_files, parent_env = asNamespace("AMR"), line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/translate.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R"))
# attr(cov, which = "package") <- list(path = ".") # until https://github.com/r-lib/covr/issues/478 is solved
# codecov(coverage = cov, quiet = FALSE)
# shell: Rscript {0}
- name: Test coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@ -89,5 +75,6 @@ jobs:
run: |
library(AMR)
library(tinytest)
covr::codecov(line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/translate.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R"))
x <- covr::codecov(line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/translate.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R"))
print(x)
shell: Rscript {0}

View File

@ -52,7 +52,7 @@ jobs:
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 1.7.1
Date: 2021-06-03
Version: 1.7.1.9000
Date: 2021-06-04
Title: Antimicrobial Resistance Data Analysis
Authors@R: c(
person(role = c("aut", "cre"),

View File

@ -170,6 +170,7 @@ export(age)
export(age_groups)
export(all_antimicrobials)
export(aminoglycosides)
export(aminopenicillins)
export(anti_join_microorganisms)
export(antimicrobials_equal)
export(as.ab)
@ -255,6 +256,8 @@ export(kurtosis)
export(labels_rsi_count)
export(left_join_microorganisms)
export(like)
export(lincosamides)
export(lipoglycopeptides)
export(macrolides)
export(mdr_cmi2012)
export(mdr_tb)
@ -297,12 +300,14 @@ export(oxazolidinones)
export(p_symbol)
export(pca)
export(penicillins)
export(polymyxins)
export(proportion_I)
export(proportion_IR)
export(proportion_R)
export(proportion_S)
export(proportion_SI)
export(proportion_df)
export(quinolones)
export(random_disk)
export(random_mic)
export(random_rsi)
@ -316,9 +321,11 @@ export(scale_y_percent)
export(semi_join_microorganisms)
export(set_mo_source)
export(skewness)
export(streptogramins)
export(susceptibility)
export(tetracyclines)
export(theme_rsi)
export(ureidopenicillins)
importFrom(graphics,arrows)
importFrom(graphics,axis)
importFrom(graphics,barplot)

View File

@ -1,3 +1,10 @@
# `AMR` 1.7.1.9000
## <small>Last updated: 4 June 2021</small>
### Changed
* Added more antibiotic class selectors, such as `lincosamides()` and `lipoglycopeptides()`
# `AMR` 1.7.1
### Breaking change

View File

@ -506,7 +506,7 @@ dataset_UTF8_to_ASCII <- function(df) {
# for eucast_rules() and mdro(), creates markdown output with URLs and names
create_eucast_ab_documentation <- function() {
x <- trimws(unique(toupper(unlist(strsplit(eucast_rules_file$then_change_these_antibiotics, ",")))))
x <- trimws(unique(toupper(unlist(strsplit(EUCAST_RULES_DF$then_change_these_antibiotics, ",")))))
ab <- character()
for (val in x) {
if (val %in% ls(envir = asNamespace("AMR"))) {
@ -713,9 +713,10 @@ meet_criteria <- function(object,
return(invisible())
}
get_current_data <- function(arg_name, call) {
# check if retrieved before, then get it from package environment
if (identical(unique_call_id(entire_session = FALSE), pkg_env$get_current_data.call)) {
get_current_data <- function(arg_name, call, reuse_equal_call = TRUE) {
# check if retrieved before, then get it from package environment to improve speed
if (reuse_equal_call == TRUE &&
identical(unique_call_id(entire_session = FALSE), pkg_env$get_current_data.call)) {
return(pkg_env$get_current_data.out)
}
@ -735,9 +736,10 @@ get_current_data <- function(arg_name, call) {
if (getRversion() < "3.2") {
# R-3.0 and R-3.1 do not have an `x` element in the call stack, rendering this function useless
# R-3.2 was released in April 2015
if (is.na(arg_name)) {
# like in carbapenems() etc.
warning_("this function can only be used in R >= 3.2", call = call)
# such as for carbapenems() etc.
warning_("this function requires R version 3.2 or later - you have ", R.version.string, call = call)
return(data.frame())
} else {
# mimic a default R error, e.g. for example_isolates[which(mo_name() %like% "^ent"), ]

6
R/ab.R
View File

@ -325,9 +325,9 @@ as.ab <- function(x, flag_multiple_results = TRUE, info = interactive(), ...) {
function(y) {
for (i in seq_len(length(y))) {
for (lang in LANGUAGES_SUPPORTED[LANGUAGES_SUPPORTED != "en"]) {
y[i] <- ifelse(tolower(y[i]) %in% tolower(translations_file[, lang, drop = TRUE]),
translations_file[which(tolower(translations_file[, lang, drop = TRUE]) == tolower(y[i]) &
!isFALSE(translations_file$fixed)), "pattern"],
y[i] <- ifelse(tolower(y[i]) %in% tolower(TRANSLATIONS[, lang, drop = TRUE]),
TRANSLATIONS[which(tolower(TRANSLATIONS[, lang, drop = TRUE]) == tolower(y[i]) &
!isFALSE(TRANSLATIONS$fixed)), "pattern"],
y[i])
}
}

View File

@ -25,18 +25,19 @@
#' Antibiotic Class Selectors
#'
#' These functions help to filter and select columns with antibiotic test results that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. \strong{\Sexpr{ifelse(getRversion() < "3.2", paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}}
#' These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. \strong{\Sexpr{ifelse(getRversion() < "3.2", paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}}
#' @inheritSection lifecycle Stable Lifecycle
#' @param ab_class an antimicrobial class, such as `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antibiotics] data set will be searched (case-insensitive) for this value.
#' @param only_rsi_columns a [logical] to indicate whether only columns of class `<rsi>` must be selected (defaults to `FALSE`), see [as.rsi()]
#' @details \strong{\Sexpr{ifelse(getRversion() < "3.2", paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}}
#'
#'
#' These functions can be used in data set calls for selecting columns and filtering rows, see *Examples*. They support base R, but work more convenient in dplyr functions such as [`select()`][dplyr::select()], [`filter()`][dplyr::filter()] and [`summarise()`][dplyr::summarise()].
#'
#' All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector like e.g. [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
#' All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector such as [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. Use the [ab_class()] function to filter/select on a manually defined antibiotic class.
#'
#' The group of betalactams consists of all carbapenems, cephalosporins and penicillins.
#' @section Full list of supported agents:
#'
#' `r paste0("* ", sapply(c("AMINOGLYCOSIDES", "AMINOPENICILLINS", "BETALACTAMS", "CARBAPENEMS", "CEPHALOSPORINS", "CEPHALOSPORINS_1ST", "CEPHALOSPORINS_2ND", "CEPHALOSPORINS_3RD", "CEPHALOSPORINS_4TH", "CEPHALOSPORINS_5TH", "FLUOROQUINOLONES", "GLYCOPEPTIDES", "LINCOSAMIDES", "LIPOGLYCOPEPTIDES", "MACROLIDES", "OXAZOLIDINONES", "PENICILLINS", "POLYMYXINS", "STREPTOGRAMINS", "QUINOLONES", "TETRACYCLINES", "UREIDOPENICILLINS"), function(x) paste0("``", tolower(x), "()`` can select ", vector_and(paste0(ab_name(eval(parse(text = x), envir = asNamespace("AMR")), language = NULL, tolower = TRUE), " (", eval(parse(text = x), envir = asNamespace("AMR")), ")"), quotes = FALSE))), "\n", collapse = "")`
#' @rdname antibiotic_class_selectors
#' @name antibiotic_class_selectors
#' @export
@ -46,7 +47,7 @@
#' # `example_isolates` is a data set available in the AMR package.
#' # See ?example_isolates.
#'
#' # Base R ------------------------------------------------------------------
#' # base R ------------------------------------------------------------------
#'
#' # select columns 'IPM' (imipenem) and 'MEM' (meropenem)
#' example_isolates[, carbapenems()]
@ -104,7 +105,6 @@
#' example_isolates %>%
#' select(mo, ab_class("mycobact"))
#'
#'
#' # get bug/drug combinations for only macrolides in Gram-positives:
#' example_isolates %>%
#' filter(mo_is_gram_positive()) %>%
@ -112,14 +112,12 @@
#' bug_drug_combinations() %>%
#' format()
#'
#'
#' data.frame(some_column = "some_value",
#' J01CA01 = "S") %>% # ATC code of ampicillin
#' select(penicillins()) # only the 'J01CA01' column will be selected
#'
#'
#' # with dplyr 1.0.0 and higher (that adds 'across()'), this is all equal:
#' # (though the row names on the first are more correct)
#' example_isolates[carbapenems() == "R", ]
#' example_isolates %>% filter(carbapenems() == "R")
#' example_isolates %>% filter(across(carbapenems(), ~.x == "R"))
@ -127,138 +125,193 @@
#' }
ab_class <- function(ab_class,
only_rsi_columns = FALSE) {
ab_selector(ab_class, function_name = "ab_class", only_rsi_columns = only_rsi_columns)
meet_criteria(ab_class, allow_class = "character", has_length = 1)
ab_selector(NULL, only_rsi_columns = only_rsi_columns, ab_class = ab_class)
}
#' @rdname antibiotic_class_selectors
#' @export
aminoglycosides <- function(only_rsi_columns = FALSE) {
ab_selector("aminoglycoside", function_name = "aminoglycosides", only_rsi_columns = only_rsi_columns)
ab_selector("aminoglycosides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
aminopenicillins <- function(only_rsi_columns = FALSE) {
ab_selector("aminopenicillins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
betalactams <- function(only_rsi_columns = FALSE) {
ab_selector("carbapenem|cephalosporin|penicillin", function_name = "betalactams", only_rsi_columns = only_rsi_columns)
ab_selector("betalactams", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
carbapenems <- function(only_rsi_columns = FALSE) {
ab_selector("carbapenem", function_name = "carbapenems", only_rsi_columns = only_rsi_columns)
ab_selector("carbapenems", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporin", function_name = "cephalosporins", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_1st <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporins.*1", function_name = "cephalosporins_1st", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins_1st", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_2nd <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporins.*2", function_name = "cephalosporins_2nd", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins_2nd", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_3rd <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporins.*3", function_name = "cephalosporins_3rd", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins_3rd", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_4th <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporins.*4", function_name = "cephalosporins_4th", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins_4th", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_5th <- function(only_rsi_columns = FALSE) {
ab_selector("cephalosporins.*5", function_name = "cephalosporins_5th", only_rsi_columns = only_rsi_columns)
ab_selector("cephalosporins_5th", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
fluoroquinolones <- function(only_rsi_columns = FALSE) {
ab_selector("fluoroquinolone", function_name = "fluoroquinolones", only_rsi_columns = only_rsi_columns)
ab_selector("fluoroquinolones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
glycopeptides <- function(only_rsi_columns = FALSE) {
ab_selector("glycopeptide", function_name = "glycopeptides", only_rsi_columns = only_rsi_columns)
ab_selector("glycopeptides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
lincosamides <- function(only_rsi_columns = FALSE) {
ab_selector("lincosamides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
lipoglycopeptides <- function(only_rsi_columns = FALSE) {
ab_selector("lipoglycopeptides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
macrolides <- function(only_rsi_columns = FALSE) {
ab_selector("macrolide", function_name = "macrolides", only_rsi_columns = only_rsi_columns)
ab_selector("macrolides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
oxazolidinones <- function(only_rsi_columns = FALSE) {
ab_selector("oxazolidinone", function_name = "oxazolidinones", only_rsi_columns = only_rsi_columns)
ab_selector("oxazolidinones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
penicillins <- function(only_rsi_columns = FALSE) {
ab_selector("penicillin", function_name = "penicillins", only_rsi_columns = only_rsi_columns)
ab_selector("penicillins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
polymyxins <- function(only_rsi_columns = FALSE) {
ab_selector("polymyxins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
streptogramins <- function(only_rsi_columns = FALSE) {
ab_selector("streptogramins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
quinolones <- function(only_rsi_columns = FALSE) {
ab_selector("quinolones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
tetracyclines <- function(only_rsi_columns = FALSE) {
ab_selector("tetracycline", function_name = "tetracyclines", only_rsi_columns = only_rsi_columns)
ab_selector("tetracyclines", only_rsi_columns = only_rsi_columns)
}
ab_selector <- function(ab_class,
function_name,
only_rsi_columns) {
meet_criteria(ab_class, allow_class = "character", has_length = 1, .call_depth = 1)
meet_criteria(function_name, allow_class = "character", has_length = 1, .call_depth = 1)
#' @rdname antibiotic_class_selectors
#' @export
ureidopenicillins <- function(only_rsi_columns = FALSE) {
ab_selector("ureidopenicillins", only_rsi_columns = only_rsi_columns)
}
ab_selector <- function(function_name,
only_rsi_columns,
ab_class = NULL) {
meet_criteria(function_name, allow_class = "character", has_length = 1, allow_NULL = TRUE, .call_depth = 1)
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1, .call_depth = 1)
meet_criteria(ab_class, allow_class = "character", has_length = 1, allow_NULL = TRUE, .call_depth = 1)
if (getRversion() < "3.2") {
# get_current_data() does not work on R 3.0 and R 3.1.
# R 3.2 was released in April 2015.
warning_("antibiotic class selectors such as ", function_name,
"() require R version 3.2 or later - you have ", R.version.string,
call = FALSE)
return(NULL)
}
# to improve speed, get_current_data() and get_column_abx() only run once when e.g. in a select or group call
vars_df <- get_current_data(arg_name = NA, call = -3)
# get_current_data() has to run each time, for cases where e.g., filter() and select() are used in same call
vars_df <- get_current_data(arg_name = NA, call = -3, reuse_equal_call = FALSE)
# to improve speed, get_column_abx() will only run once when e.g. in a select or group call
ab_in_data <- get_column_abx(vars_df, info = FALSE, only_rsi_columns = only_rsi_columns, sort = FALSE)
if (length(ab_in_data) == 0) {
message_("No antimicrobial agents found.")
message_("No antimicrobial agents found in the data.")
return(NULL)
}
ab_reference <- subset(antibiotics,
group %like% ab_class |
atc_group1 %like% ab_class |
atc_group2 %like% ab_class)
ab_group <- find_ab_group(ab_class)
if (ab_group == "") {
ab_group <- paste0("'", ab_class, "'")
examples <- ""
if (is.null(ab_class)) {
# their upper case equivalent are vectors with class <ab>, created in data-raw/_internals.R
abx <- get(toupper(function_name), envir = asNamespace("AMR"))
ab_group <- function_name
examples <- paste0(" (such as ", vector_or(ab_name(sample(abx, size = min(2, length(abx)), replace = FALSE),
tolower = TRUE,
language = NULL),
quotes = FALSE), ")")
} else {
# this for the 'manual' ab_class() function
abx <- subset(AB_lookup,
group %like% ab_class |
atc_group1 %like% ab_class |
atc_group2 %like% ab_class)$ab
ab_group <- find_ab_group(ab_class)
function_name <- "ab_class"
examples <- paste0(" (such as ", find_ab_names(ab_class, 2), ")")
}
# get the columns with a group names in the chosen ab class
agents <- ab_in_data[names(ab_in_data) %in% ab_reference$ab]
agents <- ab_in_data[names(ab_in_data) %in% abx]
if (message_not_thrown_before(function_name)) {
if (length(agents) == 0) {
message_("No antimicrobial agents of class ", ab_group, " found", examples, ".")
message_("No antimicrobial agents of class '", ab_group, "' found", examples, ".")
} else {
agents_formatted <- paste0("'", font_bold(agents, collapse = NULL), "'")
agents_names <- ab_name(names(agents), tolower = TRUE, language = NULL)
@ -423,28 +476,16 @@ is_all <- function(el1) {
find_ab_group <- function(ab_class) {
ab_class[ab_class == "carbapenem|cephalosporin|penicillin"] <- "betalactam"
ab_class <- gsub("[^a-zA-Z0-9]", ".*", ab_class)
ifelse(ab_class %in% c("aminoglycoside",
"betalactam",
"carbapenem",
"cephalosporin",
"fluoroquinolone",
"glycopeptide",
"macrolide",
"oxazolidinone",
"tetracycline"),
paste0(ab_class, "s"),
antibiotics %pm>%
subset(group %like% ab_class |
atc_group1 %like% ab_class |
atc_group2 %like% ab_class) %pm>%
pm_pull(group) %pm>%
unique() %pm>%
tolower() %pm>%
sort() %pm>%
paste(collapse = "/")
)
AB_lookup %pm>%
subset(group %like% ab_class |
atc_group1 %like% ab_class |
atc_group2 %like% ab_class) %pm>%
pm_pull(group) %pm>%
unique() %pm>%
tolower() %pm>%
sort() %pm>%
paste(collapse = "/")
}
find_ab_names <- function(ab_group, n = 3) {
@ -462,6 +503,9 @@ find_ab_names <- function(ab_group, n = 3) {
antibiotics$atc_group2 %like% ab_group) &
antibiotics$ab %unlike% "[0-9]$"), ]$name
}
if (length(drugs) == 0) {
return("??")
}
vector_or(ab_name(sample(drugs, size = min(n, length(drugs)), replace = FALSE),
tolower = TRUE,
language = NULL),

View File

@ -55,7 +55,7 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
#' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time.
#' @param version_breakpoints the version number to use for the EUCAST Clinical Breakpoints guideline. Can be either `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), reverse = TRUE)`.
#' @param version_expertrules the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), reverse = TRUE)`.
#' @param ampc_cephalosporin_resistance a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants, defaults to `NA`. Currently only works when `version_expertrules` is `3.2`; '*EUCAST Expert Rules v3.2 on Enterobacterales*' states that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of `NA` (the default) for this argument will remove results for these three agents, while e.g. a value of `"R"` will make the results for these agents resistant. Use `NULL` or `FALSE` to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(eucast_rules_file[which(eucast_rules_file$reference.version == 3.2 & eucast_rules_file$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`.
#' @param ampc_cephalosporin_resistance a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants, defaults to `NA`. Currently only works when `version_expertrules` is `3.2`; '*EUCAST Expert Rules v3.2 on Enterobacterales*' states that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of `NA` (the default) for this argument will remove results for these three agents, while e.g. a value of `"R"` will make the results for these agents resistant. Use `NULL` or `FALSE` to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(EUCAST_RULES_DF[which(EUCAST_RULES_DF$reference.version == 3.2 & EUCAST_RULES_DF$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`.
#' @param ... column name of an antibiotic, see section *Antibiotics* below
#' @param ab any (vector of) text that can be coerced to a valid antibiotic code with [as.ab()]
#' @param administration route of administration, either `r vector_or(dosage$administration)`
@ -561,11 +561,11 @@ eucast_rules <- function(x,
# Official EUCAST rules ---------------------------------------------------
eucast_notification_shown <- FALSE
if (!is.null(list(...)$eucast_rules_df)) {
# this allows: eucast_rules(x, eucast_rules_df = AMR:::eucast_rules_file %>% filter(is.na(have_these_values)))
# this allows: eucast_rules(x, eucast_rules_df = AMR:::EUCAST_RULES_DF %>% filter(is.na(have_these_values)))
eucast_rules_df <- list(...)$eucast_rules_df
} else {
# otherwise internal data file, created in data-raw/_internals.R
eucast_rules_df <- eucast_rules_file
eucast_rules_df <- EUCAST_RULES_DF
}
# filter on user-set guideline versions ----

View File

@ -386,15 +386,15 @@ scale_rsi_colours <- function(...,
}
names_susceptible <- c("S", "SI", "IS", "S+I", "I+S", "susceptible", "Susceptible",
unique(translations_file[which(translations_file$pattern == "Susceptible"),
unique(TRANSLATIONS[which(TRANSLATIONS$pattern == "Susceptible"),
"replacement", drop = TRUE]))
names_incr_exposure <- c("I", "intermediate", "increased exposure", "incr. exposure", "Increased exposure", "Incr. exposure",
unique(translations_file[which(translations_file$pattern == "Intermediate"),
unique(TRANSLATIONS[which(TRANSLATIONS$pattern == "Intermediate"),
"replacement", drop = TRUE]),
unique(translations_file[which(translations_file$pattern == "Incr. exposure"),
unique(TRANSLATIONS[which(TRANSLATIONS$pattern == "Incr. exposure"),
"replacement", drop = TRUE]))
names_resistant <- c("R", "IR", "RI", "R+I", "I+R", "resistant", "Resistant",
unique(translations_file[which(translations_file$pattern == "Resistant"),
unique(TRANSLATIONS[which(TRANSLATIONS$pattern == "Resistant"),
"replacement", drop = TRUE]))
susceptible <- rep("#3CAEA3", length(names_susceptible))

2
R/mo.R
View File

@ -469,7 +469,7 @@ exec_as.mo <- function(x,
x <- strip_whitespace(x, dyslexia_mode)
# translate 'unknown' names back to English
if (any(x %like% "unbekannt|onbekend|desconocid|sconosciut|iconnu|desconhecid", na.rm = TRUE)) {
trns <- subset(translations_file, pattern %like% "unknown" | affect_mo_name == TRUE)
trns <- subset(TRANSLATIONS, pattern %like% "unknown" | affect_mo_name == TRUE)
langs <- LANGUAGES_SUPPORTED[LANGUAGES_SUPPORTED != "en"]
for (l in langs) {
for (i in seq_len(nrow(trns))) {

Binary file not shown.

View File

@ -136,7 +136,7 @@ translate_AMR <- function(from,
return(from)
}
df_trans <- translations_file # internal data file
df_trans <- TRANSLATIONS # internal data file
from.bak <- from
from_unique <- unique(from)
from_unique_translated <- from_unique

Binary file not shown.

View File

@ -34,7 +34,7 @@ old_globalenv <- ls(envir = globalenv())
# Save internal data to R/sysdata.rda -------------------------------------
# See 'data-raw/eucast_rules.tsv' for the EUCAST reference file
eucast_rules_file <- utils::read.delim(file = "data-raw/eucast_rules.tsv",
EUCAST_RULES_DF <- utils::read.delim(file = "data-raw/eucast_rules.tsv",
skip = 10,
sep = "\t",
stringsAsFactors = FALSE,
@ -54,7 +54,7 @@ eucast_rules_file <- utils::read.delim(file = "data-raw/eucast_rules.tsv",
select(-sorting_rule)
# Translations
translations_file <- utils::read.delim(file = "data-raw/translations.tsv",
TRANSLATIONS <- utils::read.delim(file = "data-raw/translations.tsv",
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
@ -68,7 +68,7 @@ translations_file <- utils::read.delim(file = "data-raw/translations.tsv",
quote = "")
# for checking input in `language` argument in e.g. mo_*() and ab_*() functions
LANGUAGES_SUPPORTED <- sort(c("en", colnames(translations_file)[nchar(colnames(translations_file)) == 2]))
LANGUAGES_SUPPORTED <- sort(c("en", colnames(TRANSLATIONS)[nchar(colnames(TRANSLATIONS)) == 2]))
# vectors of CoNS and CoPS, improves speed in as.mo()
create_species_cons_cops <- function(type = c("CoNS", "CoPS")) {
@ -121,6 +121,8 @@ CEPHALOSPORINS <- antibiotics %>% filter(group %like% "cephalosporin") %>% pull(
CEPHALOSPORINS_1ST <- antibiotics %>% filter(group %like% "cephalosporin.*1") %>% pull(ab)
CEPHALOSPORINS_2ND <- antibiotics %>% filter(group %like% "cephalosporin.*2") %>% pull(ab)
CEPHALOSPORINS_3RD <- antibiotics %>% filter(group %like% "cephalosporin.*3") %>% pull(ab)
CEPHALOSPORINS_4TH <- antibiotics %>% filter(group %like% "cephalosporin.*4") %>% pull(ab)
CEPHALOSPORINS_5TH <- antibiotics %>% filter(group %like% "cephalosporin.*5") %>% pull(ab)
CEPHALOSPORINS_EXCEPT_CAZ <- CEPHALOSPORINS[CEPHALOSPORINS != "CAZ"]
FLUOROQUINOLONES <- antibiotics %>% filter(atc_group2 %like% "fluoroquinolone") %>% pull(ab)
LIPOGLYCOPEPTIDES <- as.ab(c("DAL", "ORI", "TLV")) # dalba/orita/tela
@ -131,6 +133,7 @@ MACROLIDES <- antibiotics %>% filter(atc_group2 %like% "macrolide") %>% pull(ab)
OXAZOLIDINONES <- antibiotics %>% filter(group %like% "oxazolidinone") %>% pull(ab)
PENICILLINS <- antibiotics %>% filter(group %like% "penicillin") %>% pull(ab)
POLYMYXINS <- antibiotics %>% filter(group %like% "polymyxin") %>% pull(ab)
QUINOLONES <- antibiotics %>% filter(group %like% "quinolone") %>% pull(ab)
STREPTOGRAMINS <- antibiotics %>% filter(atc_group2 %like% "streptogramin") %>% pull(ab)
TETRACYCLINES <- antibiotics %>% filter(atc_group2 %like% "tetracycline") %>% pull(ab)
TETRACYCLINES_EXCEPT_TGC <- TETRACYCLINES[TETRACYCLINES != "TGC"]
@ -141,8 +144,8 @@ DEFINED_AB_GROUPS <- ls(envir = globalenv())
DEFINED_AB_GROUPS <- DEFINED_AB_GROUPS[!DEFINED_AB_GROUPS %in% globalenv_before_ab]
# Export to package as internal data ----
usethis::use_data(eucast_rules_file,
translations_file,
usethis::use_data(EUCAST_RULES_DF,
TRANSLATIONS,
LANGUAGES_SUPPORTED,
MO_CONS,
MO_COPS,
@ -153,6 +156,8 @@ usethis::use_data(eucast_rules_file,
CEPHALOSPORINS_1ST,
CEPHALOSPORINS_2ND,
CEPHALOSPORINS_3RD,
CEPHALOSPORINS_4TH,
CEPHALOSPORINS_5TH,
CEPHALOSPORINS_EXCEPT_CAZ,
FLUOROQUINOLONES,
LIPOGLYCOPEPTIDES,
@ -163,6 +168,7 @@ usethis::use_data(eucast_rules_file,
OXAZOLIDINONES,
PENICILLINS,
POLYMYXINS,
QUINOLONES,
STREPTOGRAMINS,
TETRACYCLINES,
TETRACYCLINES_EXCEPT_TGC,

View File

@ -32,7 +32,7 @@ for (i in seq_len(nrow(antibiotics))) {
}
int_resis <- eucast_rules(int_resis,
eucast_rules_df = subset(AMR:::eucast_rules_file,
eucast_rules_df = subset(AMR:::EUCAST_RULES_DF,
is.na(have_these_values) & reference.version == 3.2),
info = FALSE)

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>
@ -192,7 +192,7 @@
<div class="page-header toc-ignore">
<h1 data-toc-skip>Data sets for download / own use</h1>
<h4 class="date">03 June 2021</h4>
<h4 class="date">04 June 2021</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/datasets.Rmd"><code>vignettes/datasets.Rmd</code></a></small>
<div class="hidden name"><code>datasets.Rmd</code></div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>

View File

@ -42,7 +42,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>
@ -400,7 +400,7 @@
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/options.html">options</a></span><span class="op">(</span>repos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/options.html">getOption</a></span><span class="op">(</span><span class="st">"repos"</span><span class="op">)</span>,
msberends <span class="op">=</span> <span class="st">"https://msberends.r-universe.dev"</span><span class="op">)</span><span class="op">)</span></code></pre></div>
<p>After this, you can install and update this <code>AMR</code> package like any official release (using <code><a href="https://rdrr.io/r/utils/install.packages.html">install.packages("AMR")</a></code> or in RStudio via <em>Tools</em> &gt; <em>Check of Package Updates…</em>).</p>
<p>After this, you can install and update this <code>AMR</code> package like any official release (e.g., using <code><a href="https://rdrr.io/r/utils/install.packages.html">install.packages("AMR")</a></code> or in RStudio via <em>Tools</em> &gt; <em>Check for Package Updates…</em>).</p>
</li>
</ol>
<p>You can also download the latest build from our repository: <a href="https://github.com/msberends/AMR/raw/master/data-raw/AMR_latest.tar.gz" class="uri">https://github.com/msberends/AMR/raw/master/data-raw/AMR_latest.tar.gz</a></p>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>
@ -236,9 +236,26 @@
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="amr-1719000" class="section level1">
<h1 class="page-header" data-toc-text="1.7.1.9000">
<a href="#amr-1719000" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9000</h1>
<div id="last-updated-4-june-2021" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-4-june-2021" class="anchor"></a><small>Last updated: 4 June 2021</small>
</h2>
<div id="changed" class="section level3">
<h3 class="hasAnchor">
<a href="#changed" class="anchor"></a>Changed</h3>
<ul>
<li>Added more antibiotic class selectors, such as <code><a href="../reference/antibiotic_class_selectors.html">lincosamides()</a></code> and <code><a href="../reference/antibiotic_class_selectors.html">lipoglycopeptides()</a></code>
</li>
</ul>
</div>
</div>
</div>
<div id="amr-171" class="section level1">
<h1 class="page-header" data-toc-text="1.7.1">
<a href="#amr-171" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1</h1>
<a href="#amr-171" class="anchor"></a><small> 2021-06-03 </small><code>AMR</code> 1.7.1</h1>
<div id="breaking-change" class="section level3">
<h3 class="hasAnchor">
<a href="#breaking-change" class="anchor"></a>Breaking change</h3>
@ -289,9 +306,9 @@
</li>
</ul>
</div>
<div id="changed" class="section level3">
<div id="changed-1" class="section level3">
<h3 class="hasAnchor">
<a href="#changed" class="anchor"></a>Changed</h3>
<a href="#changed-1" class="anchor"></a>Changed</h3>
<ul>
<li>
<code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> now supports grouping using the <code>dplyr</code> package</li>
@ -427,9 +444,9 @@
</li>
</ul>
</div>
<div id="changed-1" class="section level3">
<div id="changed-2" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-1" class="anchor"></a>Changed</h3>
<a href="#changed-2" class="anchor"></a>Changed</h3>
<ul>
<li>Updated the bacterial taxonomy to 3 March 2021 (using <a href="https://lpsn.dsmz.de">LPSN</a>)
<ul>
@ -506,9 +523,9 @@
<li><p>Functions <code><a href="../reference/random.html">random_mic()</a></code>, <code><a href="../reference/random.html">random_disk()</a></code> and <code><a href="../reference/random.html">random_rsi()</a></code> for random value generation. The functions <code><a href="../reference/random.html">random_mic()</a></code> and <code><a href="../reference/random.html">random_disk()</a></code> take microorganism names and antibiotic names as input to make generation more realistic.</p></li>
</ul>
</div>
<div id="changed-2" class="section level3">
<div id="changed-3" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-2" class="anchor"></a>Changed</h3>
<a href="#changed-3" class="anchor"></a>Changed</h3>
<ul>
<li><p>New argument <code>ampc_cephalosporin_resistance</code> in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> to correct for AmpC de-repressed cephalosporin-resistant mutants</p></li>
<li>
@ -623,9 +640,9 @@
<li><p>Support for skimming classes <code>&lt;rsi&gt;</code>, <code>&lt;mic&gt;</code>, <code>&lt;disk&gt;</code> and <code>&lt;mo&gt;</code> with the <code>skimr</code> package</p></li>
</ul>
</div>
<div id="changed-3" class="section level3">
<div id="changed-4" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-3" class="anchor"></a>Changed</h3>
<a href="#changed-4" class="anchor"></a>Changed</h3>
<ul>
<li><p>Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.</p></li>
<li>
@ -728,9 +745,9 @@
<li><p>Added argument <code>conserve_capped_values</code> to <code><a href="../reference/as.rsi.html">as.rsi()</a></code> for interpreting MIC values - it makes sure that values starting with “&lt;” (but not “&lt;=”) will always return “S” and values starting with “&gt;” (but not “&gt;=”) will always return “R”. The default behaviour of <code><a href="../reference/as.rsi.html">as.rsi()</a></code> has not changed, so you need to specifically do <code><a href="../reference/as.rsi.html">as.rsi(..., conserve_capped_values = TRUE)</a></code>.</p></li>
</ul>
</div>
<div id="changed-4" class="section level3">
<div id="changed-5" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-4" class="anchor"></a>Changed</h3>
<a href="#changed-5" class="anchor"></a>Changed</h3>
<ul>
<li>
<p>Big speed improvement for using any function on microorganism codes from earlier package versions (prior to <code>AMR</code> v1.2.0), such as <code><a href="../reference/as.mo.html">as.mo()</a></code>, <code><a href="../reference/mo_property.html">mo_name()</a></code>, <code><a href="../reference/first_isolate.html">first_isolate()</a></code>, <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>, <code><a href="../reference/mdro.html">mdro()</a></code>, etc.</p>
@ -803,9 +820,9 @@
</li>
</ul>
</div>
<div id="changed-5" class="section level3">
<div id="changed-6" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-5" class="anchor"></a>Changed</h3>
<a href="#changed-6" class="anchor"></a>Changed</h3>
<ul>
<li>Taxonomy:
<ul>
@ -857,9 +874,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>Plotting biplots for principal component analysis using the new <code><a href="../reference/ggplot_pca.html">ggplot_pca()</a></code> function</li>
</ul>
</div>
<div id="changed-6" class="section level3">
<div id="changed-7" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-6" class="anchor"></a>Changed</h3>
<a href="#changed-7" class="anchor"></a>Changed</h3>
<ul>
<li>Improvements for the algorithm used by <code><a href="../reference/as.mo.html">as.mo()</a></code> (and consequently all <code>mo_*</code> functions, that use <code><a href="../reference/as.mo.html">as.mo()</a></code> internally):
<ul>
@ -890,9 +907,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<div id="amr-101" class="section level1">
<h1 class="page-header" data-toc-text="1.0.1">
<a href="#amr-101" class="anchor"></a><small> 2020-02-23 </small><code>AMR</code> 1.0.1</h1>
<div id="changed-7" class="section level3">
<div id="changed-8" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-7" class="anchor"></a>Changed</h3>
<a href="#changed-8" class="anchor"></a>Changed</h3>
<ul>
<li><p>Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline</p></li>
<li>
@ -1198,9 +1215,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
</li>
</ul>
</div>
<div id="changed-8" class="section level3">
<div id="changed-9" class="section level3">
<h3 class="hasAnchor">
<a href="#changed-8" class="anchor"></a>Changed</h3>
<a href="#changed-9" class="anchor"></a>Changed</h3>
<ul>
<li>Many algorithm improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code> (of which some led to additions to the <code>microorganisms</code> data set). Many thanks to all contributors that helped improving the algorithms.
<ul>
@ -1310,9 +1327,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Function <code><a href="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
</ul>
</div>
<div id="changed-9" class="section level4">
<div id="changed-10" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-9" class="anchor"></a>Changed</h4>
<a href="#changed-10" class="anchor"></a>Changed</h4>
<ul>
<li>Column names of output <code><a href="../reference/count.html">count_df()</a></code> and <code>portion_df()</code> are now lowercase</li>
<li>Fixed bug in translation of microorganism names</li>
@ -1358,9 +1375,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (<code><a href="../reference/mdro.html">mdr_tb()</a></code>) and added a new vignette about MDR. Read this tutorial <a href="https://msberends.gitlab.io/AMR/articles/MDR.html">here on our website</a>.</li>
</ul>
</div>
<div id="changed-10" class="section level4">
<div id="changed-11" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-10" class="anchor"></a>Changed</h4>
<a href="#changed-11" class="anchor"></a>Changed</h4>
<ul>
<li>Fixed a critical bug in <code><a href="../reference/first_isolate.html">first_isolate()</a></code> where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.</li>
<li>Fixed a bug in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> where antibiotics from WHONET software would not be recognised</li>
@ -1444,9 +1461,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<div id="amr-061" class="section level1">
<h1 class="page-header" data-toc-text="0.6.1">
<a href="#amr-061" class="anchor"></a><small> 2019-03-29 </small><code>AMR</code> 0.6.1</h1>
<div id="changed-11" class="section level4">
<div id="changed-12" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-11" class="anchor"></a>Changed</h4>
<a href="#changed-12" class="anchor"></a>Changed</h4>
<ul>
<li>Fixed a critical bug when using <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> with <code>verbose = TRUE</code>
</li>
@ -1563,9 +1580,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</p></li>
</ul>
</div>
<div id="changed-12" class="section level4">
<div id="changed-13" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-12" class="anchor"></a>Changed</h4>
<a href="#changed-13" class="anchor"></a>Changed</h4>
<ul>
<li>Function <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:
<ul>
@ -1721,9 +1738,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>Functions <code>mo_authors</code> and <code>mo_year</code> to get specific values about the scientific reference of a taxonomic entry</li>
</ul>
</div>
<div id="changed-13" class="section level4">
<div id="changed-14" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-13" class="anchor"></a>Changed</h4>
<a href="#changed-14" class="anchor"></a>Changed</h4>
<ul>
<li><p>Functions <code>MDRO</code>, <code>BRMO</code>, <code>MRGN</code> and <code>EUCAST_exceptional_phenotypes</code> were renamed to <code>mdro</code>, <code>brmo</code>, <code>mrgn</code> and <code>eucast_exceptional_phenotypes</code></p></li>
<li><p><code>EUCAST_rules</code> was renamed to <code>eucast_rules</code>, the old function still exists as a deprecated function</p></li>
@ -1911,9 +1928,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Renamed <code>septic_patients$sex</code> to <code>septic_patients$gender</code></p></li>
</ul>
</div>
<div id="changed-14" class="section level4">
<div id="changed-15" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-14" class="anchor"></a>Changed</h4>
<a href="#changed-15" class="anchor"></a>Changed</h4>
<ul>
<li><p>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</p></li>
<li>
@ -2052,9 +2069,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
</li>
</ul>
</div>
<div id="changed-15" class="section level4">
<div id="changed-16" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-15" class="anchor"></a>Changed</h4>
<a href="#changed-16" class="anchor"></a>Changed</h4>
<ul>
<li>Improvements for forecasting with <code>resistance_predict</code> and added more examples</li>
<li>More antibiotics added as arguments for EUCAST rules</li>
@ -2137,9 +2154,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>New print format for <code>tibble</code>s and <code>data.table</code>s</li>
</ul>
</div>
<div id="changed-16" class="section level4">
<div id="changed-17" class="section level4">
<h4 class="hasAnchor">
<a href="#changed-16" class="anchor"></a>Changed</h4>
<a href="#changed-17" class="anchor"></a>Changed</h4>
<ul>
<li>Fixed <code>rsi</code> class for vectors that contain only invalid antimicrobial interpretations</li>
<li>Renamed dataset <code>ablist</code> to <code>antibiotics</code>

View File

@ -12,7 +12,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
last_built: 2021-06-03T13:04Z
last_built: 2021-06-04T19:07Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles

File diff suppressed because it is too large Load Diff

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>
@ -321,6 +321,8 @@
<li><p><code>cephalosporins_1st</code><br />(cefacetrile, cefadroxil, cefaloridine, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, cephalexin, cephalothin, cephapirin, cephradine)</p></li>
<li><p><code>cephalosporins_2nd</code><br />(cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening, cefprozil, cefuroxime, cefuroxime axetil, loracarbef)</p></li>
<li><p><code>cephalosporins_3rd</code><br />(cadazolid, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotiam hexetil, cefovecin, cefpimizole, cefpiramide, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefsulodin, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftibuten, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone, latamoxef)</p></li>
<li><p><code>cephalosporins_4th</code><br />(cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetecol (Cefcatacol), cefoselis, cefozopran, cefpirome, cefquinome)</p></li>
<li><p><code>cephalosporins_5th</code><br />(ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam)</p></li>
<li><p><code>cephalosporins_except_caz</code><br />(cadazolid, cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol (Cefcatacol), cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, cephradine, latamoxef, loracarbef)</p></li>
<li><p><code>fluoroquinolones</code><br />(ciprofloxacin, enoxacin, fleroxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, lomefloxacin, moxifloxacin, norfloxacin, ofloxacin, pazufloxacin, pefloxacin, prulifloxacin, rufloxacin, sparfloxacin, temafloxacin, trovafloxacin)</p></li>
<li><p><code>glycopeptides</code><br />(avoparcin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin, vancomycin-macromethod)</p></li>
@ -331,6 +333,7 @@
<li><p><code>oxazolidinones</code><br />(cycloserine, linezolid, tedizolid, thiacetazone)</p></li>
<li><p><code>penicillins</code><br />(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, avibactam, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, carbenicillin, carindacillin, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam (Amdinocillin), metampicillin, methicillin, mezlocillin, mezlocillin/sulbactam, nacubactam, nafcillin, oxacillin, penamecillin, penicillin/novobiocin, penicillin/sulbactam, phenethicillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbactam, sulbenicillin, sultamicillin, talampicillin, tazobactam, temocillin, ticarcillin, ticarcillin/clavulanic acid)</p></li>
<li><p><code>polymyxins</code><br />(colistin, polymyxin B, polymyxin B/polysorbate 80)</p></li>
<li><p><code>quinolones</code><br />(besifloxacin, cinoxacin, ciprofloxacin, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nifuroquine, nitroxoline, norfloxacin, ofloxacin, orbifloxacin, oxolinic acid, pazufloxacin, pefloxacin, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, trovafloxacin)</p></li>
<li><p><code>streptogramins</code><br />(pristinamycin, quinupristin/dalfopristin)</p></li>
<li><p><code>tetracyclines</code><br />(chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, oxytetracycline, penimepicycline, rolitetracycline, tetracycline, tigecycline)</p></li>
<li><p><code>tetracyclines_except_tgc</code><br />(chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, oxytetracycline, penimepicycline, rolitetracycline, tetracycline)</p></li>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9000</span>
</span>
</div>
@ -526,7 +526,7 @@
</tr><tr>
<td>
<p><code><a href="antibiotic_class_selectors.html">ab_class()</a></code> <code><a href="antibiotic_class_selectors.html">aminoglycosides()</a></code> <code><a href="antibiotic_class_selectors.html">betalactams()</a></code> <code><a href="antibiotic_class_selectors.html">carbapenems()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_1st()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_2nd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_3rd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_4th()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_5th()</a></code> <code><a href="antibiotic_class_selectors.html">fluoroquinolones()</a></code> <code><a href="antibiotic_class_selectors.html">glycopeptides()</a></code> <code><a href="antibiotic_class_selectors.html">macrolides()</a></code> <code><a href="antibiotic_class_selectors.html">oxazolidinones()</a></code> <code><a href="antibiotic_class_selectors.html">penicillins()</a></code> <code><a href="antibiotic_class_selectors.html">tetracyclines()</a></code> </p>
<p><code><a href="antibiotic_class_selectors.html">ab_class()</a></code> <code><a href="antibiotic_class_selectors.html">aminoglycosides()</a></code> <code><a href="antibiotic_class_selectors.html">aminopenicillins()</a></code> <code><a href="antibiotic_class_selectors.html">betalactams()</a></code> <code><a href="antibiotic_class_selectors.html">carbapenems()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_1st()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_2nd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_3rd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_4th()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_5th()</a></code> <code><a href="antibiotic_class_selectors.html">fluoroquinolones()</a></code> <code><a href="antibiotic_class_selectors.html">glycopeptides()</a></code> <code><a href="antibiotic_class_selectors.html">lincosamides()</a></code> <code><a href="antibiotic_class_selectors.html">lipoglycopeptides()</a></code> <code><a href="antibiotic_class_selectors.html">macrolides()</a></code> <code><a href="antibiotic_class_selectors.html">oxazolidinones()</a></code> <code><a href="antibiotic_class_selectors.html">penicillins()</a></code> <code><a href="antibiotic_class_selectors.html">polymyxins()</a></code> <code><a href="antibiotic_class_selectors.html">streptogramins()</a></code> <code><a href="antibiotic_class_selectors.html">quinolones()</a></code> <code><a href="antibiotic_class_selectors.html">tetracyclines()</a></code> <code><a href="antibiotic_class_selectors.html">ureidopenicillins()</a></code> </p>
</td>
<td><p>Antibiotic Class Selectors</p></td>
</tr><tr>