new antibiotics
@@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 0.6.1.9002
|
||||
Date: 2019-04-11
|
||||
Version: 0.6.1.9003
|
||||
Date: 2019-05-10
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(
|
||||
@@ -53,6 +53,7 @@ Imports:
|
||||
knitr (>= 1.0.0),
|
||||
microbenchmark,
|
||||
rlang (>= 0.3.1),
|
||||
scales,
|
||||
tidyr (>= 0.7.0)
|
||||
Suggests:
|
||||
covr (>= 3.0.1),
|
||||
|
||||
30
NAMESPACE
@@ -1,11 +1,16 @@
|
||||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
S3method(as.data.frame,ab)
|
||||
S3method(as.data.frame,atc)
|
||||
S3method(as.data.frame,frequency_tbl)
|
||||
S3method(as.data.frame,mo)
|
||||
S3method(as.double,mic)
|
||||
S3method(as.integer,mic)
|
||||
S3method(as.numeric,mic)
|
||||
S3method(as.rsi,data.frame)
|
||||
S3method(as.rsi,default)
|
||||
S3method(as.rsi,disk)
|
||||
S3method(as.rsi,mic)
|
||||
S3method(as.vector,frequency_tbl)
|
||||
S3method(as_tibble,frequency_tbl)
|
||||
S3method(barplot,mic)
|
||||
@@ -22,14 +27,17 @@ S3method(plot,frequency_tbl)
|
||||
S3method(plot,mic)
|
||||
S3method(plot,resistance_predict)
|
||||
S3method(plot,rsi)
|
||||
S3method(print,ab)
|
||||
S3method(print,atc)
|
||||
S3method(print,catalogue_of_life_version)
|
||||
S3method(print,disk)
|
||||
S3method(print,frequency_tbl)
|
||||
S3method(print,mic)
|
||||
S3method(print,mo)
|
||||
S3method(print,mo_renamed)
|
||||
S3method(print,mo_uncertainties)
|
||||
S3method(print,rsi)
|
||||
S3method(pull,ab)
|
||||
S3method(pull,atc)
|
||||
S3method(pull,mo)
|
||||
S3method(select,frequency_tbl)
|
||||
@@ -41,24 +49,26 @@ S3method(summary,mo)
|
||||
S3method(summary,rsi)
|
||||
export("%like%")
|
||||
export(ab_atc)
|
||||
export(ab_certe)
|
||||
export(ab_atc_group1)
|
||||
export(ab_atc_group2)
|
||||
export(ab_cid)
|
||||
export(ab_ddd)
|
||||
export(ab_group)
|
||||
export(ab_name)
|
||||
export(ab_official)
|
||||
export(ab_property)
|
||||
export(ab_synonyms)
|
||||
export(ab_tradenames)
|
||||
export(ab_trivial_nl)
|
||||
export(ab_umcg)
|
||||
export(abname)
|
||||
export(age)
|
||||
export(age_groups)
|
||||
export(anti_join_microorganisms)
|
||||
export(as.ab)
|
||||
export(as.atc)
|
||||
export(as.disk)
|
||||
export(as.mic)
|
||||
export(as.mo)
|
||||
export(as.rsi)
|
||||
export(atc_certe)
|
||||
export(atc_ddd)
|
||||
export(atc_groups)
|
||||
export(atc_name)
|
||||
export(atc_official)
|
||||
export(atc_online_ddd)
|
||||
@@ -67,7 +77,6 @@ export(atc_online_property)
|
||||
export(atc_property)
|
||||
export(atc_tradenames)
|
||||
export(atc_trivial_nl)
|
||||
export(atc_umcg)
|
||||
export(availability)
|
||||
export(brmo)
|
||||
export(catalogue_of_life_version)
|
||||
@@ -109,7 +118,9 @@ export(ggplot_rsi_predict)
|
||||
export(guess_ab_col)
|
||||
export(header)
|
||||
export(inner_join_microorganisms)
|
||||
export(is.ab)
|
||||
export(is.atc)
|
||||
export(is.disk)
|
||||
export(is.mic)
|
||||
export(is.mo)
|
||||
export(is.rsi)
|
||||
@@ -156,7 +167,6 @@ export(ratio)
|
||||
export(read.4D)
|
||||
export(resistance_predict)
|
||||
export(right_join_microorganisms)
|
||||
export(rsi)
|
||||
export(rsi_predict)
|
||||
export(scale_rsi_colours)
|
||||
export(scale_y_percent)
|
||||
@@ -165,6 +175,7 @@ export(set_mo_source)
|
||||
export(skewness)
|
||||
export(theme_rsi)
|
||||
export(top_freq)
|
||||
exportMethods(as.data.frame.ab)
|
||||
exportMethods(as.data.frame.atc)
|
||||
exportMethods(as.data.frame.frequency_tbl)
|
||||
exportMethods(as.data.frame.mo)
|
||||
@@ -187,14 +198,17 @@ exportMethods(kurtosis.matrix)
|
||||
exportMethods(plot.frequency_tbl)
|
||||
exportMethods(plot.mic)
|
||||
exportMethods(plot.rsi)
|
||||
exportMethods(print.ab)
|
||||
exportMethods(print.atc)
|
||||
exportMethods(print.catalogue_of_life_version)
|
||||
exportMethods(print.disk)
|
||||
exportMethods(print.frequency_tbl)
|
||||
exportMethods(print.mic)
|
||||
exportMethods(print.mo)
|
||||
exportMethods(print.mo_renamed)
|
||||
exportMethods(print.mo_uncertainties)
|
||||
exportMethods(print.rsi)
|
||||
exportMethods(pull.ab)
|
||||
exportMethods(pull.atc)
|
||||
exportMethods(pull.mo)
|
||||
exportMethods(select.frequency_tbl)
|
||||
|
||||
18
NEWS.md
@@ -1,9 +1,24 @@
|
||||
# AMR 0.6.1.9001
|
||||
**Note: latest development version**
|
||||
|
||||
#### New
|
||||
* Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use `as.rsi()` on an MIC value (created with `as.mic()`), a disk diffusion value (created with the new `as.disk()`) or on a complete date set containing columns with MIC or disk diffusion values.
|
||||
|
||||
#### Changed
|
||||
* Removed deprecated functions `guess_mo()`, `guess_atc()`, `EUCAST_rules()`, `interpretive_reading()`
|
||||
* Completely reworked the `antibiotics` data set:
|
||||
* All entries now have 3 different identifiers: a human readable EARS-Net code (`ab`, used by ECDC and WHONET), an ATC code (`atc`, used by WHO), and a CID code (`cid`, Compound ID, used by PubChem)
|
||||
* Based on the Compound ID, more than a thousand official brand names have been added from many different countries
|
||||
* All references to antibiotics in our package now use EARS-Net codes, like `AMX` for amoxicillin
|
||||
* Functions `atc_certe`, `ab_umcg` and `atc_trivial_nl` have been removed
|
||||
* All `atc_*` functions are superceded by `ab_*` functions
|
||||
* All output will be translated by using an included, local translation file that can be found after install with:
|
||||
```r
|
||||
system.file("translations.tsv", package = "AMR")
|
||||
```
|
||||
Please create an issue in one of our repositories if you want additions in this file.
|
||||
* Improved intelligence of looking up antibiotic tables in data set using `guess_ab_col()`
|
||||
* Added ~5,000 more old taxonomic names to the `microorganisms.old` data set, which leads to better results finding when using the `as.mo()` function
|
||||
* Removed deprecated functions `guess_mo()`, `guess_atc()`, `EUCAST_rules()`, `interpretive_reading()`, `rsi()`
|
||||
* Frequency tables of microbial IDs speed improvement
|
||||
* Removed all hardcoded EUCAST rules and replaced them with a new reference file: `./inst/eucast/eucast.tsv`.
|
||||
* Added ceftazidim intrinsic resistance to *Streptococci*
|
||||
@@ -11,6 +26,7 @@
|
||||
* Fix for `freq()` for when all values are `NA`.
|
||||
|
||||
#### Other
|
||||
* Support for R 3.6.0
|
||||
* Prevented [staged install](https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html) in R 3.6.0 and later by adding `StagedInstall: false` to the DESCRIPTION file
|
||||
|
||||
# AMR 0.6.1
|
||||
|
||||
242
R/ab.R
Executable file
@@ -0,0 +1,242 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform to antibiotic ID
|
||||
#'
|
||||
#' Use this function to determine the antibiotic code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and synonyms (brand names).
|
||||
#' @param x character vector to determine to antibiotic ID
|
||||
#' @rdname as.ab
|
||||
#' @keywords atc
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @export
|
||||
#' @importFrom dplyr %>% filter slice pull
|
||||
#' @details Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples.
|
||||
#'
|
||||
#' In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
|
||||
#' Source: \url{https://www.whocc.no/atc/structure_and_principles/}
|
||||
#' @section Source:
|
||||
#' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
|
||||
#'
|
||||
#' WHONET 2019 software: \url{http://www.whonet.org/software.html}
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
|
||||
#' @return Character (vector) with class \code{"act"}. Unknown values will return \code{NA}.
|
||||
#' @seealso \code{\link{antibiotics}} for the dataframe that is being used to determine ATCs.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # These examples all return "ERY", the ID of Erythromycin:
|
||||
#' as.ab("J01FA01")
|
||||
#' as.ab("J 01 FA 01")
|
||||
#' as.ab("Erythromycin")
|
||||
#' as.ab("eryt")
|
||||
#' as.ab(" eryt 123")
|
||||
#' as.ab("ERYT")
|
||||
#' as.ab("ERY")
|
||||
#' as.ab("erytromicine") # spelled wrong
|
||||
#' as.ab("Erythrocin") # trade name
|
||||
#' as.ab("Romycin") # trade name
|
||||
#'
|
||||
#' # Use ab_* functions to get a specific properties (see ?ab_property);
|
||||
#' # they use as.ab() internally:
|
||||
#' ab_name("J01FA01") # "Erythromycin"
|
||||
#' ab_name("eryt") # "Erythromycin"
|
||||
as.ab <- function(x) {
|
||||
if (is.ab(x)) {
|
||||
return(x)
|
||||
}
|
||||
x_bak <- x
|
||||
# remove suffices
|
||||
x_bak_clean <- gsub("_(mic|rsi)$", "", x)
|
||||
# remove disk concentrations, like LVX_NM -> LVX
|
||||
x_bak_clean <- gsub("_[A-Z]{2}[0-9_]{0,3}$", "", x_bak_clean)
|
||||
# clean rest of it
|
||||
x_bak_clean <- gsub("[^a-zA-Z0-9/-]", "", x_bak_clean)
|
||||
# keep only a-z when it's not an ATC code or only numbers
|
||||
x_bak_clean[!x_bak_clean %like% "^([A-Z][0-9]{2}[A-Z]{2}[0-9]{2}|[0-9]+)$"] <- gsub("[^a-zA-Z]+",
|
||||
"",
|
||||
x_bak_clean[!x_bak_clean %like% "^([A-Z][0-9]{2}[A-Z]{2}[0-9]{2}|[0-9]+)$"])
|
||||
x <- unique(x_bak_clean)
|
||||
x_new <- rep(NA_character_, length(x))
|
||||
x_unknown <- character(0)
|
||||
|
||||
for (i in 1:length(x)) {
|
||||
if (is.na(x[i]) | is.null(x[i])) {
|
||||
next
|
||||
}
|
||||
if (identical(x[i], "")) {
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
next
|
||||
}
|
||||
|
||||
# exact AB code
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$ab == toupper(x[i])),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact ATC code
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$atc == toupper(x[i])),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact CID code
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$cid == x[i]),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact name
|
||||
found <- AMR::antibiotics[which(toupper(AMR::antibiotics$name) == toupper(x[i])),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact synonym
|
||||
synonym_found <- unlist(lapply(AMR::antibiotics$synonyms,
|
||||
function(s) if (toupper(x[i]) %in% toupper(s)) {
|
||||
TRUE
|
||||
} else {
|
||||
FALSE
|
||||
}))
|
||||
found <- AMR::antibiotics$ab[synonym_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact abbreviation
|
||||
abbr_found <- unlist(lapply(AMR::antibiotics$abbreviations,
|
||||
function(a) if (toupper(x[i]) %in% toupper(a)) {
|
||||
TRUE
|
||||
} else {
|
||||
FALSE
|
||||
}))
|
||||
found <- AMR::antibiotics$ab[abbr_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# first >=4 characters of name
|
||||
if (nchar(x[i]) >= 4) {
|
||||
found <- AMR::antibiotics[which(toupper(AMR::antibiotics$name) %like% paste0("^", x[i])),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
# allow characters that resemble others, but only continue when having more than 3 characters
|
||||
if (nchar(x[i]) <= 3) {
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
next
|
||||
}
|
||||
x_spelling <- x[i]
|
||||
x_spelling <- gsub("[iy]+", "[iy]+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("[sz]+", "[sz]+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("(c|k|q|qu)+", "(c|k|q|qu)+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("(ph|f|v)+", "(ph|f|v)+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("(th|t)+", "(th|t)+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("a+", "a+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("e+", "e+", x_spelling, ignore.case = TRUE)
|
||||
x_spelling <- gsub("o+", "o+", x_spelling, ignore.case = TRUE)
|
||||
# allow any ending of -in/-ine and -im/-ime
|
||||
x_spelling <- gsub("(\\[iy\\]\\+(n|m)|\\[iy\\]\\+(n|m)e\\+)$", "[iy]+(n|m)e*", x_spelling, ignore.case = TRUE)
|
||||
# allow any ending of -ol/-ole
|
||||
x_spelling <- gsub("(o\\+l|o\\+le\\+)$", "o+le*", x_spelling, ignore.case = TRUE)
|
||||
# try if name starts with it
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$name %like% paste0("^", x_spelling)),]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
# and try if any synonym starts with it
|
||||
synonym_found <- unlist(lapply(AMR::antibiotics$synonyms,
|
||||
function(s) if (any(s %like% paste0("^", x_spelling))) {
|
||||
TRUE
|
||||
} else {
|
||||
FALSE
|
||||
}))
|
||||
found <- AMR::antibiotics$ab[synonym_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# not found
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
}
|
||||
|
||||
if (length(x_unknown) > 0) {
|
||||
warning("These values could not be coerced to a valid antibiotic ID: ",
|
||||
paste('"', sort(unique(x_unknown)), '"', sep = "", collapse = ', '),
|
||||
".",
|
||||
call. = FALSE)
|
||||
}
|
||||
|
||||
x_result <- data.frame(x = x_bak_clean, stringsAsFactors = FALSE) %>%
|
||||
left_join(data.frame(x = x, x_new = x_new, stringsAsFactors = FALSE), by = "x") %>%
|
||||
pull(x_new)
|
||||
|
||||
structure(.Data = x_result,
|
||||
class = "ab")
|
||||
}
|
||||
|
||||
#' @rdname as.atc
|
||||
#' @export
|
||||
is.ab <- function(x) {
|
||||
identical(class(x), "ab")
|
||||
}
|
||||
|
||||
#' @exportMethod print.ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.ab <- function(x, ...) {
|
||||
cat("Class 'ab'\n")
|
||||
print.default(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
#' @exportMethod as.data.frame.ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
as.data.frame.ab <- function (x, ...) {
|
||||
# same as as.data.frame.character but with removed stringsAsFactors
|
||||
nm <- paste(deparse(substitute(x), width.cutoff = 500L),
|
||||
collapse = " ")
|
||||
if (!"nm" %in% names(list(...))) {
|
||||
as.data.frame.vector(x, ..., nm = nm)
|
||||
} else {
|
||||
as.data.frame.vector(x, ...)
|
||||
}
|
||||
}
|
||||
|
||||
#' @exportMethod pull.ab
|
||||
#' @export
|
||||
#' @importFrom dplyr pull
|
||||
#' @noRd
|
||||
pull.ab <- function(.data, ...) {
|
||||
pull(as.data.frame(.data), ...)
|
||||
}
|
||||
185
R/ab_property.R
Normal file
@@ -0,0 +1,185 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Property of an antibiotic
|
||||
#'
|
||||
#' Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}.
|
||||
#' @param x any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}}
|
||||
#' @param tolower logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".
|
||||
#' @param property one of the column names of one of the \code{\link{antibiotics}} data set
|
||||
#' @param language language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.
|
||||
#' @param administration way of administration, either \code{"oral"} or \code{"iv"}
|
||||
#' @param units a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples
|
||||
#' @param ... other parameters passed on to \code{\link{as.ab}}
|
||||
#' @details All output will be \link{translate}d where possible.
|
||||
#' @inheritSection as.ab Source
|
||||
#' @rdname ab_property
|
||||
#' @name ab_property
|
||||
#' @return \itemize{
|
||||
#' \item{An \code{integer} in case of \code{ab_cid}}
|
||||
#' \item{A named \code{list} in case of multiple \code{ab_synonyms}}
|
||||
#' \item{A \code{double} in case of \code{ab_ddd}}
|
||||
#' \item{A \code{character} in all other cases}
|
||||
#' }
|
||||
#' @export
|
||||
#' @seealso \code{\link{antibiotics}}
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # all properties:
|
||||
#' ab_name("AMX") # "Amoxicillin"
|
||||
#' ab_atc("AMX") # J01CA04 (ATC code from the WHO)
|
||||
#' ab_cid("AMX") # 33613 (Compound ID from PubChem)
|
||||
#'
|
||||
#' ab_synonyms("AMX") # a list with brand names of amoxicillin
|
||||
#' ab_tradenames("AMX") # same
|
||||
#'
|
||||
#' ab_group("AMX") # "Beta-lactams/penicillins"
|
||||
#' ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
|
||||
#' ab_atc_group2("AMX") # "Penicillins with extended spectrum"
|
||||
#'
|
||||
#' ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
|
||||
#' ab_name(x = c("AMC", "PLB"),
|
||||
#' tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
|
||||
#'
|
||||
#' ab_ddd("AMX", "oral") # 1
|
||||
#' ab_ddd("AMX", "oral", units = TRUE) # "g"
|
||||
#' ab_ddd("AMX", "iv") # 1
|
||||
#' ab_ddd("AMX", "iv", units = TRUE) # "g"
|
||||
#'
|
||||
#' # all ab_* functions use as.ab() internally:
|
||||
#' ab_name("Fluclox") # "Flucloxacillin"
|
||||
#' ab_name("fluklox") # "Flucloxacillin"
|
||||
#' ab_name("floxapen") # "Flucloxacillin"
|
||||
#' ab_name(21319) # "Flucloxacillin" (using CID)
|
||||
#' ab_name("J01CF05") # "Flucloxacillin" (using ATC)
|
||||
ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) {
|
||||
x <- ab_validate(x = x, property = "name", ...)
|
||||
res <- t(x, language = language)
|
||||
if (tolower == TRUE) {
|
||||
# use perl to only transform the first character
|
||||
# as we want "polymyxin B", not "polymyxin b"
|
||||
res <- gsub("^([A-Z])", "\\L\\1", res, perl = TRUE)
|
||||
}
|
||||
res
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_atc <- function(x, ...) {
|
||||
ab_validate(x = x, property = "atc", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_cid <- function(x, ...) {
|
||||
ab_validate(x = x, property = "cid", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_synonyms <- function(x, ...) {
|
||||
syns <- ab_validate(x = x, property = "synonyms", ...)
|
||||
names(syns) <- x
|
||||
if (length(syns) == 1) {
|
||||
unname(unlist(syns))
|
||||
} else {
|
||||
syns
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_tradenames <- function(x, ...) {
|
||||
ab_synonyms(x, ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_group <- function(x, ...) {
|
||||
ab_validate(x = x, property = "group", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_atc_group1 <- function(x, ...) {
|
||||
ab_validate(x = x, property = "atc_group1", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_atc_group2 <- function(x, ...) {
|
||||
ab_validate(x = x, property = "atc_group2", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_ddd <- function(x, administration = "oral", units = FALSE, ...) {
|
||||
if (!administration %in% c("oral", "iv")) {
|
||||
stop("`administration` must be 'oral' or 'iv'", call. = FALSE)
|
||||
}
|
||||
ddd_prop <- administration
|
||||
if (units == TRUE) {
|
||||
ddd_prop <- paste0(ddd_prop, "_units")
|
||||
} else {
|
||||
ddd_prop <- paste0(ddd_prop, "_ddd")
|
||||
}
|
||||
ab_validate(x = x, property = ddd_prop, ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_property <- function(x, property = 'name', language = get_locale(), ...) {
|
||||
if (length(property) != 1L) {
|
||||
stop("'property' must be of length 1.")
|
||||
}
|
||||
if (!property %in% colnames(AMR::antibiotics)) {
|
||||
stop("invalid property: '", property, "' - use a column name of the `antibiotics` data set")
|
||||
}
|
||||
|
||||
t(ab_validate(x = x, property = property, ...), language = language)
|
||||
}
|
||||
|
||||
ab_validate <- function(x, property, ...) {
|
||||
if (!"AMR" %in% base::.packages()) {
|
||||
library("AMR")
|
||||
# check onLoad() in R/zzz.R: data tables are created there.
|
||||
}
|
||||
|
||||
# try to catch an error when inputting an invalid parameter
|
||||
# so the 'call.' can be set to FALSE
|
||||
tryCatch(x[1L] %in% AMR::antibiotics[1, property],
|
||||
error = function(e) stop(e$message, call. = FALSE))
|
||||
|
||||
if (!all(x %in% AMR::antibiotics[, property])) {
|
||||
x <- data.frame(ab = as.ab(x), stringsAsFactors = FALSE) %>%
|
||||
left_join(antibiotics %>% select(c("ab", property)), by = "ab") %>%
|
||||
pull(property)
|
||||
}
|
||||
if (property %in% c("ab", "atc")) {
|
||||
return(structure(x, class = property))
|
||||
} else if (property == "cid") {
|
||||
return(as.integer(x))
|
||||
} else if (property %like% "ddd") {
|
||||
return(as.double(x))
|
||||
} else {
|
||||
return(x)
|
||||
}
|
||||
}
|
||||
162
R/abname.R
@@ -1,162 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Name of an antibiotic
|
||||
#'
|
||||
#' Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from \code{\link{antibiotics}}.
|
||||
#' @param abcode a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}
|
||||
#' @param from,to type to transform from and to. See \code{\link{antibiotics}} for its column names. WIth \code{from = "guess"} the from will be guessed from \code{"atc"}, \code{"certe"} and \code{"umcg"}. When using \code{to = "atc"}, the ATC code will be searched using \code{\link{as.atc}}.
|
||||
#' @param textbetween text to put between multiple returned texts
|
||||
#' @param tolower return output as lower case with function \code{\link{tolower}}.
|
||||
#' @details \strong{The \code{\link{ab_property}} functions are faster and more concise}, but do not support concatenated strings, like \code{abname("AMCL+GENT"}.
|
||||
#' @keywords ab antibiotics
|
||||
#' @source \code{\link{antibiotics}}
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @export
|
||||
#' @importFrom dplyr %>% pull
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' abname("AMCL")
|
||||
#' # "Amoxicillin and beta-lactamase inhibitor"
|
||||
#'
|
||||
#' # It is quite flexible at default (having `from = "guess"`)
|
||||
#' abname(c("amox", "J01CA04", "Trimox", "dispermox", "Amoxil"))
|
||||
#' # "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin"
|
||||
#'
|
||||
#' # Multiple antibiotics can be combined with "+".
|
||||
#' # The second antibiotic will be set to lower case when `tolower` was not set:
|
||||
#' abname("AMCL+GENT", textbetween = "/")
|
||||
#' # "amoxicillin and enzyme inhibitor/gentamicin"
|
||||
#'
|
||||
#' abname(c("AMCL", "GENT"))
|
||||
#' # "Amoxicillin and beta-lactamase inhibitor" "Gentamicin"
|
||||
#'
|
||||
#' abname("AMCL", to = "trivial_nl")
|
||||
#' # "Amoxicilline/clavulaanzuur"
|
||||
#'
|
||||
#' abname("AMCL", to = "atc")
|
||||
#' # "J01CR02"
|
||||
#'
|
||||
#' # specific codes for University Medical Center Groningen (UMCG):
|
||||
#' abname("J01CR02", from = "atc", to = "umcg")
|
||||
#' # "AMCL"
|
||||
#'
|
||||
#' # specific codes for Certe:
|
||||
#' abname("J01CR02", from = "atc", to = "certe")
|
||||
#' # "amcl"
|
||||
abname <- function(abcode,
|
||||
from = c("guess", "atc", "certe", "umcg"),
|
||||
to = 'official',
|
||||
textbetween = ' + ',
|
||||
tolower = FALSE) {
|
||||
|
||||
if (length(to) != 1L) {
|
||||
stop('`to` must be of length 1', call. = FALSE)
|
||||
}
|
||||
|
||||
if (to == "atc") {
|
||||
return(as.character(as.atc(abcode)))
|
||||
}
|
||||
|
||||
abx <- AMR::antibiotics
|
||||
|
||||
from <- from[1]
|
||||
colnames(abx) <- colnames(abx) %>% tolower()
|
||||
from <- from %>% tolower()
|
||||
to <- to %>% tolower()
|
||||
|
||||
if (!(from %in% colnames(abx) | from == "guess") |
|
||||
!to %in% colnames(abx)) {
|
||||
stop(paste0('Invalid `from` or `to`. Choose one of ',
|
||||
colnames(abx) %>% paste(collapse = ", "), '.'), call. = FALSE)
|
||||
}
|
||||
|
||||
abcode <- as.character(abcode)
|
||||
abcode.bak <- abcode
|
||||
|
||||
for (i in 1:length(abcode)) {
|
||||
if (abcode[i] %like% "[+]") {
|
||||
# support for multiple ab's with +
|
||||
parts <- trimws(strsplit(abcode[i], split = "+", fixed = TRUE)[[1]])
|
||||
ab1 <- abname(parts[1], from = from, to = to)
|
||||
ab2 <- abname(parts[2], from = from, to = to)
|
||||
if (missing(tolower)) {
|
||||
ab2 <- tolower(ab2)
|
||||
}
|
||||
abcode[i] <- paste0(ab1, textbetween, ab2)
|
||||
next
|
||||
}
|
||||
if (from %in% c("atc", "guess")) {
|
||||
if (abcode[i] %in% abx$atc) {
|
||||
abcode[i] <- abx[which(abx$atc == abcode[i]),] %>% pull(to) %>% .[1]
|
||||
next
|
||||
}
|
||||
}
|
||||
if (from %in% c("certe", "guess")) {
|
||||
if (abcode[i] %in% abx$certe) {
|
||||
abcode[i] <- abx[which(abx$certe == abcode[i]),] %>% pull(to) %>% .[1]
|
||||
next
|
||||
}
|
||||
}
|
||||
if (from %in% c("umcg", "guess")) {
|
||||
if (abcode[i] %in% abx$umcg) {
|
||||
abcode[i] <- abx[which(abx$umcg == abcode[i]),] %>% pull(to) %>% .[1]
|
||||
next
|
||||
}
|
||||
}
|
||||
if (from %in% c("trade_name", "guess")) {
|
||||
if (abcode[i] %in% abx$trade_name) {
|
||||
abcode[i] <- abx[which(abx$trade_name == abcode[i]),] %>% pull(to) %>% .[1]
|
||||
next
|
||||
}
|
||||
if (sum(abx$trade_name %like% abcode[i]) > 0) {
|
||||
abcode[i] <- abx[which(abx$trade_name %like% abcode[i]),] %>% pull(to) %>% .[1]
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
if (from != "guess") {
|
||||
# when not found, try any `from`
|
||||
abcode[i] <- abx[which(abx[,from] == abcode[i]),] %>% pull(to) %>% .[1]
|
||||
}
|
||||
|
||||
if (is.na(abcode[i]) | length(abcode[i] == 0)) {
|
||||
# try as.atc
|
||||
try(suppressWarnings(
|
||||
abcode[i] <- as.atc(abcode[i])
|
||||
), silent = TRUE)
|
||||
if (is.na(abcode[i])) {
|
||||
# still not found
|
||||
abcode[i] <- abcode.bak[i]
|
||||
warning('Code "', abcode.bak[i], '" not found in antibiotics list.', call. = FALSE)
|
||||
} else {
|
||||
# fill in the found ATC code
|
||||
abcode[i] <- abname(abcode[i], from = "atc", to = to)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tolower == TRUE) {
|
||||
abcode <- abcode %>% tolower()
|
||||
}
|
||||
|
||||
abcode
|
||||
}
|
||||
2
R/age.R
@@ -112,7 +112,7 @@ age <- function(x, reference = Sys.Date()) {
|
||||
#' mo == as.mo("E. coli")) %>%
|
||||
#' group_by(age_group = age_groups(age)) %>%
|
||||
#' select(age_group,
|
||||
#' cipr) %>%
|
||||
#' CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
age_groups <- function(x, split_at = c(12, 25, 55, 75)) {
|
||||
if (is.character(split_at)) {
|
||||
|
||||
112
R/atc.R
@@ -44,118 +44,8 @@
|
||||
#' as.atc(" eryt 123")
|
||||
#' as.atc("ERYT")
|
||||
#' as.atc("ERY")
|
||||
#' as.atc("Erythrocin") # Trade name
|
||||
#' as.atc("Eryzole") # Trade name
|
||||
#' as.atc("Pediamycin") # Trade name
|
||||
#'
|
||||
#' # Use ab_* functions to get a specific property based on an ATC code
|
||||
#' Cipro <- as.atc("cipro") # returns `J01MA02`
|
||||
#' atc_official(Cipro) # returns "Ciprofloxacin"
|
||||
#' atc_umcg(Cipro) # returns "CIPR", the code used in the UMCG
|
||||
as.atc <- function(x) {
|
||||
|
||||
x.new <- rep(NA_character_, length(x))
|
||||
x <- trimws(x, which = "both")
|
||||
# keep only a-z when it's not an ATC code
|
||||
x[!x %like% "[A-Z][0-9]{2}[A-Z]{2}[0-9]{2}"] <- gsub("[^a-zA-Z]+", "", x[!x %like% "[A-Z][0-9]{2}[A-Z]{2}[0-9]{2}"])
|
||||
|
||||
x.bak <- x
|
||||
x <- unique(x)
|
||||
failures <- character(0)
|
||||
|
||||
for (i in 1:length(x)) {
|
||||
if (is.na(x[i]) | is.null(x[i]) | identical(x[i], "")) {
|
||||
x.new[i] <- x[i]
|
||||
next
|
||||
}
|
||||
|
||||
fail <- TRUE
|
||||
|
||||
# first try atc
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$atc == x[i]),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try ATC in ATC code form, even if it does not exist in the antibiotics data set YET
|
||||
if (length(found) == 0 & x[i] %like% '[A-Z][0-9][0-9][A-Z][A-Z][0-9][0-9]') {
|
||||
warning("ATC code ", x[i], " is not yet in the `antibiotics` data set.")
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- x[i]
|
||||
}
|
||||
|
||||
# try abbreviation of EARS-Net/WHONET
|
||||
found <- AMR::antibiotics[which(tolower(AMR::antibiotics$ears_net) == tolower(x[i])),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try abbreviation of certe and glims
|
||||
found <- AMR::antibiotics[which(tolower(AMR::antibiotics$certe) == tolower(x[i])),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
found <- AMR::antibiotics[which(tolower(AMR::antibiotics$umcg) == tolower(x[i])),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try exact official name
|
||||
found <- AMR::antibiotics[which(tolower(AMR::antibiotics$official) == tolower(x[i])),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try exact official Dutch
|
||||
found <- AMR::antibiotics[which(tolower(AMR::antibiotics$official_nl) == tolower(x[i])),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try trade name
|
||||
found <- AMR::antibiotics[which(paste0("(", AMR::antibiotics$trade_name, ")") %like% x[i]),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# try abbreviation
|
||||
found <- AMR::antibiotics[which(paste0("(", AMR::antibiotics$abbr, ")") %like% x[i]),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
|
||||
# nothing helped, try first chars of official name, but only if nchar > 4 (cipro, nitro, fosfo)
|
||||
if (nchar(x[i]) > 4) {
|
||||
found <- AMR::antibiotics[which(AMR::antibiotics$official %like% paste0("^", substr(x[i], 1, 5))),]$atc
|
||||
if (length(found) > 0) {
|
||||
fail <- FALSE
|
||||
x.new[is.na(x.new) & x.bak == x[i]] <- found[1L]
|
||||
}
|
||||
}
|
||||
|
||||
# not found
|
||||
if (fail == TRUE) {
|
||||
failures <- c(failures, x[i])
|
||||
}
|
||||
}
|
||||
|
||||
failures <- failures[!failures %in% c(NA, NULL, NaN)]
|
||||
if (length(failures) > 0) {
|
||||
warning("These values could not be coerced to a valid atc: ",
|
||||
paste('"', unique(failures), '"', sep = "", collapse = ', '),
|
||||
".",
|
||||
call. = FALSE)
|
||||
}
|
||||
class(x.new) <- "atc"
|
||||
x.new
|
||||
ab_atc(x)
|
||||
}
|
||||
|
||||
#' @rdname as.atc
|
||||
|
||||
107
R/atc_property.R
@@ -1,107 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Property of an antibiotic
|
||||
#'
|
||||
#' Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set, based on their ATC code. Get such a code with \code{\link{as.atc}}.
|
||||
#' @param x a (vector of a) valid \code{\link{atc}} code or any text that can be coerced to a valid atc with \code{\link{as.atc}}
|
||||
#' @param property one of the column names of one of the \code{\link{antibiotics}} data set, like \code{"atc"} and \code{"official"}
|
||||
#' @param language language of the returned text, defaults to English (\code{"en"}) and can be set with \code{\link{getOption}("AMR_locale")}. Either one of \code{"en"} (English) or \code{"nl"} (Dutch).
|
||||
#' @rdname atc_property
|
||||
#' @return A vector of values. In case of \code{atc_tradenames}, if \code{x} is of length one, a vector will be returned. Otherwise a \code{\link{list}}, with \code{x} as names.
|
||||
#' @export
|
||||
#' @importFrom dplyr %>% left_join pull
|
||||
#' @seealso \code{\link{antibiotics}}
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' as.atc("amcl") # J01CR02
|
||||
#' atc_name("amcl") # Amoxicillin and beta-lactamase inhibitor
|
||||
#' atc_name("amcl", "nl") # Amoxicilline met enzymremmer
|
||||
#' atc_trivial_nl("amcl") # Amoxicilline/clavulaanzuur
|
||||
#' atc_certe("amcl") # amcl
|
||||
#' atc_umcg("amcl") # AMCL
|
||||
atc_property <- function(x, property = 'official') {
|
||||
property <- property[1]
|
||||
if (!property %in% colnames(AMR::antibiotics)) {
|
||||
stop("invalid property: ", property, " - use a column name of the `antibiotics` data set")
|
||||
}
|
||||
if (!is.atc(x)) {
|
||||
x <- as.atc(x) # this will give a warning if x cannot be coerced
|
||||
}
|
||||
suppressWarnings(
|
||||
data.frame(atc = x, stringsAsFactors = FALSE) %>%
|
||||
left_join(AMR::antibiotics, by = "atc") %>%
|
||||
pull(property)
|
||||
)
|
||||
}
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_official <- function(x, language = NULL) {
|
||||
|
||||
if (is.null(language)) {
|
||||
language <- getOption("AMR_locale", default = "en")[1L]
|
||||
} else {
|
||||
language <- tolower(language[1])
|
||||
}
|
||||
if (language %in% c("en", "")) {
|
||||
atc_property(x, "official")
|
||||
} else if (language == "nl") {
|
||||
atc_property(x, "official_nl")
|
||||
} else {
|
||||
stop("Unsupported language: '", language, "' - use one of: 'en', 'nl'", call. = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_name <- atc_official
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_trivial_nl <- function(x) {
|
||||
atc_property(x, "trivial_nl")
|
||||
}
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_certe <- function(x) {
|
||||
atc_property(x, "certe")
|
||||
}
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_umcg <- function(x) {
|
||||
atc_property(x, "umcg")
|
||||
}
|
||||
|
||||
#' @rdname atc_property
|
||||
#' @export
|
||||
atc_tradenames <- function(x) {
|
||||
res <- atc_property(x, "trade_name")
|
||||
res <- strsplit(res, "|", fixed = TRUE)
|
||||
if (length(x) == 1) {
|
||||
res <- unlist(res)
|
||||
} else {
|
||||
names(res) <- x
|
||||
}
|
||||
res
|
||||
}
|
||||
55
R/count.R
@@ -44,55 +44,55 @@
|
||||
#' ?septic_patients
|
||||
#'
|
||||
#' # Count resistant isolates
|
||||
#' count_R(septic_patients$amox)
|
||||
#' count_IR(septic_patients$amox)
|
||||
#' count_R(septic_patients$AMX)
|
||||
#' count_IR(septic_patients$AMX)
|
||||
#'
|
||||
#' # Or susceptible isolates
|
||||
#' count_S(septic_patients$amox)
|
||||
#' count_SI(septic_patients$amox)
|
||||
#' count_S(septic_patients$AMX)
|
||||
#' count_SI(septic_patients$AMX)
|
||||
#'
|
||||
#' # Count all available isolates
|
||||
#' count_all(septic_patients$amox)
|
||||
#' n_rsi(septic_patients$amox)
|
||||
#' count_all(septic_patients$AMX)
|
||||
#' n_rsi(septic_patients$AMX)
|
||||
#'
|
||||
#' # Since n_rsi counts available isolates, you can
|
||||
#' # calculate back to count e.g. non-susceptible isolates.
|
||||
#' # This results in the same:
|
||||
#' count_IR(septic_patients$amox)
|
||||
#' portion_IR(septic_patients$amox) * n_rsi(septic_patients$amox)
|
||||
#' count_IR(septic_patients$AMX)
|
||||
#' portion_IR(septic_patients$AMX) * n_rsi(septic_patients$AMX)
|
||||
#'
|
||||
#' library(dplyr)
|
||||
#' septic_patients %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(R = count_R(cipr),
|
||||
#' I = count_I(cipr),
|
||||
#' S = count_S(cipr),
|
||||
#' n1 = count_all(cipr), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(cipr), # same - analogous to n_distinct
|
||||
#' summarise(R = count_R(CIP),
|
||||
#' I = count_I(CIP),
|
||||
#' S = count_S(CIP),
|
||||
#' n1 = count_all(CIP), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||
#' total = n()) # NOT the number of tested isolates!
|
||||
#'
|
||||
#' # Count co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
#' # so we can see that combination therapy does a lot more than mono therapy.
|
||||
#' # Please mind that `portion_S` calculates percentages right away instead.
|
||||
#' count_S(septic_patients$amcl) # S = 1342 (71.4%)
|
||||
#' count_all(septic_patients$amcl) # n = 1879
|
||||
#' count_S(septic_patients$AMC) # S = 1342 (71.4%)
|
||||
#' count_all(septic_patients$AMC) # n = 1879
|
||||
#'
|
||||
#' count_S(septic_patients$gent) # S = 1372 (74.0%)
|
||||
#' count_all(septic_patients$gent) # n = 1855
|
||||
#' count_S(septic_patients$GEN) # S = 1372 (74.0%)
|
||||
#' count_all(septic_patients$GEN) # n = 1855
|
||||
#'
|
||||
#' with(septic_patients,
|
||||
#' count_S(amcl, gent)) # S = 1660 (92.3%)
|
||||
#' count_S(AMC, GEN)) # S = 1660 (92.3%)
|
||||
#' with(septic_patients, # n = 1798
|
||||
#' n_rsi(amcl, gent))
|
||||
#' n_rsi(AMC, GEN))
|
||||
#'
|
||||
#' # Get portions S/I/R immediately of all rsi columns
|
||||
#' septic_patients %>%
|
||||
#' select(amox, cipr) %>%
|
||||
#' select(AMX, CIP) %>%
|
||||
#' count_df(translate = FALSE)
|
||||
#'
|
||||
#' # It also supports grouping variables
|
||||
#' septic_patients %>%
|
||||
#' select(hospital_id, amox, cipr) %>%
|
||||
#' select(hospital_id, AMX, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' count_df(translate = FALSE)
|
||||
#'
|
||||
@@ -172,7 +172,8 @@ n_rsi <- function(...) {
|
||||
#' @importFrom dplyr %>% select_if bind_rows summarise_if mutate group_vars select everything
|
||||
#' @export
|
||||
count_df <- function(data,
|
||||
translate_ab = getOption("get_antibiotic_names", "official"),
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
combine_IR = FALSE) {
|
||||
|
||||
if (!"data.frame" %in% class(data)) {
|
||||
@@ -183,10 +184,9 @@ count_df <- function(data,
|
||||
stop("No columns with class 'rsi' found. See ?as.rsi.")
|
||||
}
|
||||
|
||||
if (as.character(translate_ab) == "TRUE") {
|
||||
translate_ab <- "official"
|
||||
if (as.character(translate_ab) %in% c("TRUE", "official")) {
|
||||
translate_ab <- "name"
|
||||
}
|
||||
options(get_antibiotic_names = translate_ab)
|
||||
|
||||
resS <- summarise_if(.tbl = data,
|
||||
.predicate = is.rsi,
|
||||
@@ -227,10 +227,7 @@ count_df <- function(data,
|
||||
}
|
||||
|
||||
if (!translate_ab == FALSE) {
|
||||
if (!tolower(translate_ab) %in% tolower(colnames(AMR::antibiotics))) {
|
||||
stop("Parameter `translate_ab` does not occur in the `antibiotics` data set.", call. = FALSE)
|
||||
}
|
||||
res <- res %>% mutate(Antibiotic = abname(Antibiotic, from = "guess", to = translate_ab))
|
||||
res <- res %>% mutate(Antibiotic = ab_property(Antibiotic, property = translate_ab, language = language))
|
||||
}
|
||||
|
||||
res
|
||||
|
||||
148
R/data.R
@@ -19,115 +19,36 @@
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Data set with ~500 antibiotics
|
||||
#' Data set with ~450 antibiotics
|
||||
#'
|
||||
#' A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source.
|
||||
#' @format A \code{\link{data.frame}} with 488 observations and 17 variables:
|
||||
#' A data set containing all antibiotics. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
|
||||
#' @format A \code{\link{data.frame}} with 455 observations and 13 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical), like \code{J01CR02}}
|
||||
#' \item{\code{ears_net}}{EARS-Net code (European Antimicrobial Resistance Surveillance Network), like \code{AMC}}
|
||||
#' \item{\code{certe}}{Certe code, like \code{amcl}}
|
||||
#' \item{\code{umcg}}{UMCG code, like \code{AMCL}}
|
||||
#' \item{\code{abbr}}{Abbreviation as used by many countries, used internally by \code{\link{as.atc}}}
|
||||
#' \item{\code{official}}{Official name by the WHO, like \code{"Amoxicillin and beta-lactamase inhibitor"}}
|
||||
#' \item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
|
||||
#' \item{\code{trivial_nl}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
|
||||
#' \item{\code{trade_name}}{Trade name as used by many countries (a total of 294), used internally by \code{\link{as.atc}}}
|
||||
#' \item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available}
|
||||
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}}
|
||||
#' \item{\code{cid}}{Compound ID as found in PubChem}
|
||||
#' \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO}
|
||||
#' \item{\code{group}}{A short and concise group name, based on WHONET and WHOCC definitions}
|
||||
#' \item{\code{atc_group1}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"}}
|
||||
#' \item{\code{atc_group2}}{Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"}}
|
||||
#' \item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)}
|
||||
#' \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID}
|
||||
#' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment}
|
||||
#' \item{\code{oral_units}}{Units of \code{ddd_units}}
|
||||
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
|
||||
#' \item{\code{iv_units}}{Units of \code{iv_ddd}}
|
||||
#' \item{\code{atc_group1}}{ATC group, like \code{"Macrolides, lincosamides and streptogramins"}}
|
||||
#' \item{\code{atc_group2}}{Subgroup of \code{atc_group1}, like \code{"Macrolides"}}
|
||||
#' \item{\code{useful_gramnegative}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)}
|
||||
#' \item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)}
|
||||
#' }
|
||||
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
|
||||
#' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}
|
||||
#'
|
||||
#' Table antibiotic coding EARSS (from WHONET 5.3): \url{http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf}
|
||||
#' Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
|
||||
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
|
||||
#'
|
||||
#' EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}
|
||||
#' WHONET 2019 software: \url{http://www.whonet.org/software.html}
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso \code{\link{microorganisms}}
|
||||
# use this later to further fill AMR::antibiotics
|
||||
# drug <- "Ciprofloxacin"
|
||||
# url <- xml2::read_html(paste0("https://www.ncbi.nlm.nih.gov/pccompound?term=", drug)) %>%
|
||||
# html_nodes(".rslt") %>%
|
||||
# .[[1]] %>%
|
||||
# html_nodes(".title a") %>%
|
||||
# html_attr("href") %>%
|
||||
# gsub("/compound/", "/rest/pug_view/data/compound/", ., fixed = TRUE) %>%
|
||||
# paste0("/XML/?response_type=display")
|
||||
# synonyms <- url %>%
|
||||
# read_xml() %>%
|
||||
# xml_contents() %>% .[[6]] %>%
|
||||
# xml_contents() %>% .[[8]] %>%
|
||||
# xml_contents() %>% .[[3]] %>%
|
||||
# xml_contents() %>% .[[3]] %>%
|
||||
# xml_contents() %>%
|
||||
# paste() %>%
|
||||
# .[. %like% "StringValueList"] %>%
|
||||
# gsub("[</]+StringValueList[>]", "", .)
|
||||
|
||||
# last two columns created with:
|
||||
# antibiotics %>%
|
||||
# mutate(useful_gramnegative =
|
||||
# if_else(
|
||||
# atc_group1 %like% '(fusidic|glycopeptide|macrolide|lincosamide|daptomycin|linezolid)' |
|
||||
# atc_group2 %like% '(fusidic|glycopeptide|macrolide|lincosamide|daptomycin|linezolid)' |
|
||||
# official %like% '(fusidic|glycopeptide|macrolide|lincosamide|daptomycin|linezolid)',
|
||||
# FALSE,
|
||||
# NA
|
||||
# ),
|
||||
# useful_grampositive =
|
||||
# if_else(
|
||||
# atc_group1 %like% '(aztreonam|temocillin|polymyxin|colistin|nalidixic)' |
|
||||
# atc_group2 %like% '(aztreonam|temocillin|polymyxin|colistin|nalidixic)' |
|
||||
# official %like% '(aztreonam|temocillin|polymyxin|colistin|nalidixic)',
|
||||
# FALSE,
|
||||
# NA
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# ADD NEW TRADE NAMES FROM OTHER DATAFRAME
|
||||
# antibiotics_add_to_property <- function(ab_df, atc, property, value) {
|
||||
# if (length(atc) > 1L) {
|
||||
# stop("only one atc at a time")
|
||||
# }
|
||||
# if (!property %in% c("abbr", "trade_name")) {
|
||||
# stop("only possible for abbr and trade_name")
|
||||
# }
|
||||
#
|
||||
# value <- gsub(ab_df[which(ab_df$atc == atc),] %>% pull("official"), "", value, fixed = TRUE)
|
||||
# value <- gsub("||", "|", value, fixed = TRUE)
|
||||
# value <- gsub("[äáàâ]", "a", value)
|
||||
# value <- gsub("[ëéèê]", "e", value)
|
||||
# value <- gsub("[ïíìî]", "i", value)
|
||||
# value <- gsub("[öóòô]", "o", value)
|
||||
# value <- gsub("[üúùû]", "u", value)
|
||||
# if (!atc %in% ab_df$atc) {
|
||||
# message("SKIPPING - UNKNOWN ATC: ", atc)
|
||||
# }
|
||||
# if (is.na(value)) {
|
||||
# message("SKIPPING - VALUE MISSES: ", atc)
|
||||
# }
|
||||
# if (atc %in% ab_df$atc & !is.na(value)) {
|
||||
# current <- ab_df[which(ab_df$atc == atc),] %>% pull(property)
|
||||
# if (!is.na(current)) {
|
||||
# value <- paste(current, value, sep = "|")
|
||||
# }
|
||||
# value <- strsplit(value, "|", fixed = TRUE) %>% unlist() %>% unique() %>% paste(collapse = "|")
|
||||
# value <- gsub("||", "|", value, fixed = TRUE)
|
||||
# # print(value)
|
||||
# ab_df[which(ab_df$atc == atc), property] <- value
|
||||
# message("Added ", value, " to ", ab_official(atc), " (", atc, ", ", ab_certe(atc), ")")
|
||||
# }
|
||||
# ab_df
|
||||
# }
|
||||
#
|
||||
"antibiotics"
|
||||
|
||||
#' Data set with ~65,000 microorganisms
|
||||
@@ -262,6 +183,24 @@ catalogue_of_life <- list(
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"WHONET"
|
||||
|
||||
#' Data set for RSI interpretation
|
||||
#'
|
||||
#' Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link{as.rsi}} to transform MICs or disks measurements to RSI values.
|
||||
#' @format A \code{\link{data.frame}} with 11,559 observations and 9 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{guideline}}{Name of the guideline}
|
||||
#' \item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}}
|
||||
#' \item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}}
|
||||
#' \item{\code{ref_tbl}}{Info about where the guideline rule can be found}
|
||||
#' \item{\code{S_mic}}{Lowest MIC value that leads to "S"}
|
||||
#' \item{\code{R_mic}}{Highest MIC value that leads to "R"}
|
||||
#' \item{\code{dose_disk}}{Dose of the used disk diffusion method}
|
||||
#' \item{\code{S_disk}}{Lowest number of millimeters that leads to "S"}
|
||||
#' \item{\code{R_disk}}{Highest number of millimeters that leads to "R"}
|
||||
#' }
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"rsi_translation"
|
||||
|
||||
# transforms data set to data.frame with only ASCII values, to comply with CRAN policies
|
||||
dataset_UTF8_to_ASCII <- function(df) {
|
||||
trans <- function(vect) {
|
||||
@@ -270,14 +209,21 @@ dataset_UTF8_to_ASCII <- function(df) {
|
||||
df <- as.data.frame(df, stringsAsFactors = FALSE)
|
||||
for (i in 1:NCOL(df)) {
|
||||
col <- df[, i]
|
||||
if (is.factor(col)) {
|
||||
levels(col) <- trans(levels(col))
|
||||
} else if (is.character(col)) {
|
||||
col <- trans(col)
|
||||
if (is.list(col)) {
|
||||
for (j in 1:length(col)) {
|
||||
col[[j]] <- trans(col[[j]])
|
||||
}
|
||||
df[, i] <- list(col)
|
||||
} else {
|
||||
col
|
||||
if (is.factor(col)) {
|
||||
levels(col) <- trans(levels(col))
|
||||
} else if (is.character(col)) {
|
||||
col <- trans(col)
|
||||
} else {
|
||||
col
|
||||
}
|
||||
df[, i] <- col
|
||||
}
|
||||
df[, i] <- col
|
||||
}
|
||||
df
|
||||
}
|
||||
|
||||
@@ -49,71 +49,49 @@ ratio <- function(x, ratio) {
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_property <- function(...) {
|
||||
.Deprecated(new = "atc_property", package = "AMR")
|
||||
atc_property(...)
|
||||
abname <- function(...) {
|
||||
.Deprecated("ab_name", package = "AMR")
|
||||
ab_name(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_atc <- function(...) {
|
||||
.Deprecated(new = "as.atc", package = "AMR")
|
||||
as.atc(...)
|
||||
atc_property <- function(...) {
|
||||
.Deprecated("ab_property", package = "AMR")
|
||||
ab_property(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
atc_official <- function(...) {
|
||||
.Deprecated("ab_name", package = "AMR")
|
||||
ab_name(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_official <- function(...) {
|
||||
.Deprecated(new = "atc_official", package = "AMR")
|
||||
atc_official(...)
|
||||
.Deprecated("ab_name", package = "AMR")
|
||||
ab_name(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_name <- function(...) {
|
||||
.Deprecated(new = "atc_name", package = "AMR")
|
||||
atc_name(...)
|
||||
atc_name <- function(...) {
|
||||
.Deprecated("ab_name", package = "AMR")
|
||||
ab_name(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_trivial_nl <- function(...) {
|
||||
.Deprecated(new = "atc_trivial_nl", package = "AMR")
|
||||
atc_trivial_nl(...)
|
||||
atc_trivial_nl <- function(...) {
|
||||
.Deprecated("ab_name", package = "AMR")
|
||||
ab_name(..., language = "nl")
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_certe <- function(...) {
|
||||
.Deprecated(new = "atc_certe", package = "AMR")
|
||||
atc_certe(...)
|
||||
atc_tradenames <- function(...) {
|
||||
.Deprecated("ab_tradenames", package = "AMR")
|
||||
ab_tradenames(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_umcg <- function(...) {
|
||||
.Deprecated(new = "atc_umcg", package = "AMR")
|
||||
atc_umcg(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_tradenames <- function(...) {
|
||||
.Deprecated(new = "atc_tradenames", package = "AMR")
|
||||
atc_tradenames(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
atc_ddd <- function(...) {
|
||||
.Deprecated(new = "atc_online_ddd", package = "AMR")
|
||||
atc_online_ddd(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
atc_groups <- function(...) {
|
||||
.Deprecated(new = "atc_online_groups", package = "AMR")
|
||||
atc_online_groups(...)
|
||||
}
|
||||
|
||||
|
||||
92
R/disk.R
Normal file
@@ -0,0 +1,92 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Class 'disk'
|
||||
#'
|
||||
#' This transforms a vector to a new class \code{disk}, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99.
|
||||
#' @rdname as.disk
|
||||
#' @param x vector
|
||||
#' @param na.rm a logical indicating whether missing values should be removed
|
||||
#' @details Interpret disk values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI.
|
||||
#' @return Ordered integer factor with new class \code{disk}
|
||||
#' @keywords disk
|
||||
#' @export
|
||||
#' @seealso \code{\link{as.rsi}}
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # interpret disk values
|
||||
#' as.rsi(x = 12,
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#' as.rsi(x = 12,
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "CLSI")
|
||||
as.disk <- function(x, na.rm = FALSE) {
|
||||
if (is.disk(x)) {
|
||||
x
|
||||
} else {
|
||||
x <- x %>% unlist()
|
||||
if (na.rm == TRUE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
x.bak <- x
|
||||
|
||||
na_before <- length(x[is.na(x)])
|
||||
|
||||
# force it to be integer
|
||||
x <- suppressWarnings(as.integer(x))
|
||||
|
||||
# disks can never be less than 9 mm (size of a disk) or more than 50 mm
|
||||
x[x < 6 | x > 99] <- NA_integer_
|
||||
na_after <- length(x[is.na(x)])
|
||||
|
||||
if (na_before != na_after) {
|
||||
list_missing <- x.bak[is.na(x) & !is.na(x.bak)] %>%
|
||||
unique() %>%
|
||||
sort()
|
||||
list_missing <- paste0('"', list_missing , '"', collapse = ", ")
|
||||
warning(na_after - na_before, ' results truncated (',
|
||||
round(((na_after - na_before) / length(x)) * 100),
|
||||
'%) that were invalid disk zones: ',
|
||||
list_missing, call. = FALSE)
|
||||
}
|
||||
|
||||
class(x) <- c('disk', 'integer')
|
||||
x
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname as.disk
|
||||
#' @export
|
||||
#' @importFrom dplyr %>%
|
||||
is.disk <- function(x) {
|
||||
class(x) %>% identical(c('disk', 'integer'))
|
||||
}
|
||||
|
||||
#' @exportMethod print.disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.disk <- function(x, ...) {
|
||||
cat("Class 'disk'\n")
|
||||
print(as.integer(x), quote = FALSE)
|
||||
}
|
||||
556
R/eucast_rules.R
@@ -27,94 +27,95 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
|
||||
#' EUCAST rules
|
||||
#'
|
||||
#' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
|
||||
#' @param x data with antibiotic columns, like e.g. \code{amox} and \code{amcl}
|
||||
#' @param x data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}
|
||||
#' @param info print progress
|
||||
#' @param rules a character vector that specifies which rules should be applied - one or more of \code{c("breakpoints", "expert", "other", "all")}
|
||||
#' @param verbose a logical to indicate whether extensive info should be returned as a \code{data.frame} with info about which rows and columns are effected. It runs all EUCAST rules, but will not be applied to an output - only an informative \code{data.frame} with changes will be returned as output.
|
||||
#' @param amcl,amik,amox,ampi,azit,azlo,aztr,cefa,cfep,cfot,cfox,cfra,cfta,cftr,cfur,chlo,cipr,clar,clin,clox,coli,czol,dapt,doxy,erta,eryt,fosf,fusi,gent,imip,kana,levo,linc,line,mero,mezl,mino,moxi,nali,neom,neti,nitr,norf,novo,oflo,oxac,peni,pipe,pita,poly,pris,qida,rifa,roxi,siso,teic,tetr,tica,tige,tobr,trim,trsu,vanc column name of an antibiotic, see Antibiotics
|
||||
#' @param ... parameters that are passed on to \code{eucast_rules}
|
||||
#' @param ... column name of an antibiotic, see section Antibiotics
|
||||
#' @inheritParams first_isolate
|
||||
#' @details
|
||||
#' \strong{NOTE:} This function does not translate MIC values to RSI values. It only applies (1) inferred susceptibility and resistance based on results of other antibiotics and (2) intrinsic resistance based on taxonomic properties of a microorganism.
|
||||
#' \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr
|
||||
#' \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
|
||||
#'
|
||||
#' The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by this function can be found when running this command: \cr
|
||||
#' The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by \code{eucast_rules()} can be found by running this command: \cr
|
||||
#' \code{AMR::EUCAST_RULES_FILE_LOCATION} (without brackets).
|
||||
#'
|
||||
#' In the source code it is located under \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{\code{./inst/eucast/eucast_rules.tsv}}.
|
||||
#' In the source code the file containing all rules is located \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{here}.
|
||||
#'
|
||||
#' \strong{Note:} When ampicillin (J01CA01) is not available but amoxicillin (J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
|
||||
#' @section Antibiotics:
|
||||
#' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive) or use \code{NULL} to skip a column (e.g. \code{tica = NULL}). Non-existing columns will anyway be skipped with a warning.
|
||||
#' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.
|
||||
#'
|
||||
#' Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})
|
||||
#' Available abbrevations of the column containing antibiotics in the form '\strong{antimicrobial ID}: name (\emph{ATC code})':
|
||||
#'
|
||||
#' \strong{amcl}: amoxicillin+clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
|
||||
#' \strong{amik}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
|
||||
#' \strong{amox}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
|
||||
#' \strong{ampi}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
|
||||
#' \strong{azit}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
|
||||
#' \strong{azlo}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
|
||||
#' \strong{aztr}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
|
||||
#' \strong{cefa}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
|
||||
#' \strong{cfep}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
|
||||
#' \strong{cfot}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
|
||||
#' \strong{cfox}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
|
||||
#' \strong{cfra}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
|
||||
#' \strong{cfta}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
|
||||
#' \strong{cftr}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
|
||||
#' \strong{cfur}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
|
||||
#' \strong{chlo}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
|
||||
#' \strong{cipr}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
|
||||
#' \strong{clar}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
|
||||
#' \strong{clin}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
|
||||
#' \strong{clox}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
|
||||
#' \strong{coli}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
|
||||
#' \strong{czol}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
|
||||
#' \strong{dapt}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
|
||||
#' \strong{doxy}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
|
||||
#' \strong{erta}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
|
||||
#' \strong{eryt}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
|
||||
#' \strong{fosf}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
|
||||
#' \strong{fusi}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
|
||||
#' \strong{gent}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
|
||||
#' \strong{imip}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
|
||||
#' \strong{kana}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
|
||||
#' \strong{levo}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
|
||||
#' \strong{linc}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
|
||||
#' \strong{line}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
|
||||
#' \strong{mero}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
|
||||
#' \strong{mezl}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
|
||||
#' \strong{mino}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
|
||||
#' \strong{moxi}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
|
||||
#' \strong{nali}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
|
||||
#' \strong{neom}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
|
||||
#' \strong{neti}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
|
||||
#' \strong{nitr}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
|
||||
#' \strong{norf}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
|
||||
#' \strong{novo}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
|
||||
#' \strong{oflo}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
|
||||
#' \strong{peni}: (benzyl)penicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
|
||||
#' \strong{pipe}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
|
||||
#' \strong{pita}: piperacillin+tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
|
||||
#' \strong{poly}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
|
||||
#' \strong{pris}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
|
||||
#' \strong{qida}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
|
||||
#' \strong{rifa}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
|
||||
#' \strong{roxi}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
|
||||
#' \strong{siso}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
|
||||
#' \strong{teic}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
|
||||
#' \strong{tetr}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
|
||||
#' \strong{tica}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
|
||||
#' \strong{tige}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
|
||||
#' \strong{tobr}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
|
||||
#' \strong{trim}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
|
||||
#' \strong{trsu}: sulfamethoxazole and trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
|
||||
#' \strong{vanc}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
|
||||
#' \strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
|
||||
#' \strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
|
||||
#' \strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
|
||||
#' \strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
|
||||
#' \strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
|
||||
#' \strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
|
||||
#' \strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
|
||||
#' \strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
|
||||
#' \strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
|
||||
#' \strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
|
||||
#' \strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
|
||||
#' \strong{CED}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
|
||||
#' \strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
|
||||
#' \strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
|
||||
#' \strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
|
||||
#' \strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
|
||||
#' \strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
|
||||
#' \strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
|
||||
#' \strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
|
||||
#' \strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
|
||||
#' \strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
|
||||
#' \strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
|
||||
#' \strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
|
||||
#' \strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
|
||||
#' \strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
|
||||
#' \strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
|
||||
#' \strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
|
||||
#' \strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
|
||||
#' \strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
|
||||
#' \strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
|
||||
#' \strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
|
||||
#' \strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
|
||||
#' \strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
|
||||
#' \strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
|
||||
#' \strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
|
||||
#' \strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
|
||||
#' \strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
|
||||
#' \strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
|
||||
#' \strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01XD01}),
|
||||
#' \strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
|
||||
#' \strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
|
||||
#' \strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
|
||||
#' \strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
|
||||
#' \strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
|
||||
#' \strong{NOV}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
|
||||
#' \strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
|
||||
#' \strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01CF04}),
|
||||
#' \strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
|
||||
#' \strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
|
||||
#' \strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
|
||||
#' \strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
|
||||
#' \strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
|
||||
#' \strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
|
||||
#' \strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
|
||||
#' \strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
|
||||
#' \strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
|
||||
#' \strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
|
||||
#' \strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
|
||||
#' \strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
|
||||
#' \strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
|
||||
#' \strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
|
||||
#' \strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
|
||||
#' \strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
|
||||
#' \strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
|
||||
#' @keywords interpretive eucast reading resistance
|
||||
#' @rdname eucast_rules
|
||||
#' @export
|
||||
#' @importFrom dplyr %>% select pull mutate_at vars group_by summarise n
|
||||
#' @importFrom crayon bold bgGreen bgYellow bgRed black green blue italic strip_style
|
||||
#' @importFrom crayon bold bgGreen bgYellow bgRed black green blue italic strip_style white
|
||||
#' @return The input of \code{tbl_}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{data.frame} with all original and new values of the affected bug-drug combinations.
|
||||
#' @source
|
||||
#' \itemize{
|
||||
@@ -133,7 +134,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
|
||||
#' }
|
||||
#' }
|
||||
#'
|
||||
#' For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like amcl. They can be separated by comma: \code{"amcl, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).
|
||||
#' For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: \code{"AMC, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' a <- eucast_rules(septic_patients)
|
||||
@@ -143,17 +144,17 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
|
||||
#' "Escherichia coli",
|
||||
#' "Klebsiella pneumoniae",
|
||||
#' "Pseudomonas aeruginosa"),
|
||||
#' vanc = "-", # Vancomycin
|
||||
#' amox = "-", # Amoxicillin
|
||||
#' coli = "-", # Colistin
|
||||
#' cfta = "-", # Ceftazidime
|
||||
#' cfur = "-", # Cefuroxime
|
||||
#' peni = "S", # Benzylpenicillin
|
||||
#' cfox = "S", # Cefoxitin
|
||||
#' VAN = "-", # Vancomycin
|
||||
#' AMX = "-", # Amoxicillin
|
||||
#' COL = "-", # Colistin
|
||||
#' CAZ = "-", # Ceftazidime
|
||||
#' CXM = "-", # Cefuroxime
|
||||
#' PEN = "S", # Penicillin G
|
||||
#' FOX = "S", # Cefoxitin
|
||||
#' stringsAsFactors = FALSE)
|
||||
#'
|
||||
#' a
|
||||
#' # mo vanc amox coli cfta cfur peni cfox
|
||||
#' # mo VAN AMX COL CAZ CXM PEN FOX
|
||||
#' # 1 Staphylococcus aureus - - - - - S S
|
||||
#' # 2 Enterococcus faecalis - - - - - S S
|
||||
#' # 3 Escherichia coli - - - - - S S
|
||||
@@ -165,7 +166,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
|
||||
#' b <- eucast_rules(a)
|
||||
#'
|
||||
#' b
|
||||
#' # mo vanc amox coli cfta cfur peni cfox
|
||||
#' # mo VAN AMX COL CAZ CXM PEN FOX
|
||||
#' # 1 Staphylococcus aureus - S R R S S S
|
||||
#' # 2 Enterococcus faecalis - - R R R S R
|
||||
#' # 3 Escherichia coli R - - - - R S
|
||||
@@ -181,81 +182,12 @@ eucast_rules <- function(x,
|
||||
info = TRUE,
|
||||
rules = c("breakpoints", "expert", "other", "all"),
|
||||
verbose = FALSE,
|
||||
amcl = guess_ab_col(),
|
||||
amik = guess_ab_col(),
|
||||
amox = guess_ab_col(),
|
||||
ampi = guess_ab_col(),
|
||||
azit = guess_ab_col(),
|
||||
azlo = guess_ab_col(),
|
||||
aztr = guess_ab_col(),
|
||||
cefa = guess_ab_col(),
|
||||
cfep = guess_ab_col(),
|
||||
cfot = guess_ab_col(),
|
||||
cfox = guess_ab_col(),
|
||||
cfra = guess_ab_col(),
|
||||
cfta = guess_ab_col(),
|
||||
cftr = guess_ab_col(),
|
||||
cfur = guess_ab_col(),
|
||||
chlo = guess_ab_col(),
|
||||
cipr = guess_ab_col(),
|
||||
clar = guess_ab_col(),
|
||||
clin = guess_ab_col(),
|
||||
clox = guess_ab_col(),
|
||||
coli = guess_ab_col(),
|
||||
czol = guess_ab_col(),
|
||||
dapt = guess_ab_col(),
|
||||
doxy = guess_ab_col(),
|
||||
erta = guess_ab_col(),
|
||||
eryt = guess_ab_col(),
|
||||
fosf = guess_ab_col(),
|
||||
fusi = guess_ab_col(),
|
||||
gent = guess_ab_col(),
|
||||
imip = guess_ab_col(),
|
||||
kana = guess_ab_col(),
|
||||
levo = guess_ab_col(),
|
||||
linc = guess_ab_col(),
|
||||
line = guess_ab_col(),
|
||||
mero = guess_ab_col(),
|
||||
mezl = guess_ab_col(),
|
||||
mino = guess_ab_col(),
|
||||
moxi = guess_ab_col(),
|
||||
nali = guess_ab_col(),
|
||||
neom = guess_ab_col(),
|
||||
neti = guess_ab_col(),
|
||||
nitr = guess_ab_col(),
|
||||
norf = guess_ab_col(),
|
||||
novo = guess_ab_col(),
|
||||
oflo = guess_ab_col(),
|
||||
oxac = guess_ab_col(),
|
||||
peni = guess_ab_col(),
|
||||
pipe = guess_ab_col(),
|
||||
pita = guess_ab_col(),
|
||||
poly = guess_ab_col(),
|
||||
pris = guess_ab_col(),
|
||||
qida = guess_ab_col(),
|
||||
rifa = guess_ab_col(),
|
||||
roxi = guess_ab_col(),
|
||||
siso = guess_ab_col(),
|
||||
teic = guess_ab_col(),
|
||||
tetr = guess_ab_col(),
|
||||
tica = guess_ab_col(),
|
||||
tige = guess_ab_col(),
|
||||
tobr = guess_ab_col(),
|
||||
trim = guess_ab_col(),
|
||||
trsu = guess_ab_col(),
|
||||
vanc = guess_ab_col(),
|
||||
...) {
|
||||
|
||||
|
||||
# support old `tbl` parameter
|
||||
if ("tbl" %in% names(list(...))) {
|
||||
x <- list(...)$tbl
|
||||
}
|
||||
|
||||
tbl_ <- x
|
||||
|
||||
if (!is.data.frame(tbl_)) {
|
||||
stop("`tbl_` must be a data frame.", call. = FALSE)
|
||||
stop("`x` must be a data frame.", call. = FALSE)
|
||||
}
|
||||
|
||||
# try to find columns based on type
|
||||
@@ -277,7 +209,7 @@ eucast_rules <- function(x,
|
||||
|
||||
warned <- FALSE
|
||||
|
||||
txt_error <- function() { cat("", bgRed(black(" ERROR ")), "\n") }
|
||||
txt_error <- function() { cat("", bgRed(white(" ERROR ")), "\n") }
|
||||
txt_warning <- function() { if (warned == FALSE) { cat("", bgYellow(black(" WARNING ")), "\n") }; warned <<- TRUE }
|
||||
txt_ok <- function(no_of_changes) {
|
||||
if (warned == FALSE) {
|
||||
@@ -294,145 +226,137 @@ eucast_rules <- function(x,
|
||||
}
|
||||
}
|
||||
|
||||
# check columns
|
||||
if (identical(amcl, as.name("guess_ab_col"))) { amcl <- guess_ab_col(tbl_, "amcl", verbose = verbose) }
|
||||
if (identical(amik, as.name("guess_ab_col"))) { amik <- guess_ab_col(tbl_, "amik", verbose = verbose) }
|
||||
if (identical(amox, as.name("guess_ab_col"))) { amox <- guess_ab_col(tbl_, "amox", verbose = verbose) }
|
||||
if (identical(ampi, as.name("guess_ab_col"))) { ampi <- guess_ab_col(tbl_, "ampi", verbose = verbose) }
|
||||
if (identical(azit, as.name("guess_ab_col"))) { azit <- guess_ab_col(tbl_, "azit", verbose = verbose) }
|
||||
if (identical(azlo, as.name("guess_ab_col"))) { azlo <- guess_ab_col(tbl_, "azlo", verbose = verbose) }
|
||||
if (identical(aztr, as.name("guess_ab_col"))) { aztr <- guess_ab_col(tbl_, "aztr", verbose = verbose) }
|
||||
if (identical(cefa, as.name("guess_ab_col"))) { cefa <- guess_ab_col(tbl_, "cefa", verbose = verbose) }
|
||||
if (identical(cfep, as.name("guess_ab_col"))) { cfep <- guess_ab_col(tbl_, "cfep", verbose = verbose) }
|
||||
if (identical(cfot, as.name("guess_ab_col"))) { cfot <- guess_ab_col(tbl_, "cfot", verbose = verbose) }
|
||||
if (identical(cfox, as.name("guess_ab_col"))) { cfox <- guess_ab_col(tbl_, "cfox", verbose = verbose) }
|
||||
if (identical(cfra, as.name("guess_ab_col"))) { cfra <- guess_ab_col(tbl_, "cfra", verbose = verbose) }
|
||||
if (identical(cfta, as.name("guess_ab_col"))) { cfta <- guess_ab_col(tbl_, "cfta", verbose = verbose) }
|
||||
if (identical(cftr, as.name("guess_ab_col"))) { cftr <- guess_ab_col(tbl_, "cftr", verbose = verbose) }
|
||||
if (identical(cfur, as.name("guess_ab_col"))) { cfur <- guess_ab_col(tbl_, "cfur", verbose = verbose) }
|
||||
if (identical(chlo, as.name("guess_ab_col"))) { chlo <- guess_ab_col(tbl_, "chlo", verbose = verbose) }
|
||||
if (identical(cipr, as.name("guess_ab_col"))) { cipr <- guess_ab_col(tbl_, "cipr", verbose = verbose) }
|
||||
if (identical(clar, as.name("guess_ab_col"))) { clar <- guess_ab_col(tbl_, "clar", verbose = verbose) }
|
||||
if (identical(clin, as.name("guess_ab_col"))) { clin <- guess_ab_col(tbl_, "clin", verbose = verbose) }
|
||||
if (identical(clox, as.name("guess_ab_col"))) { clox <- guess_ab_col(tbl_, "clox", verbose = verbose) }
|
||||
if (identical(coli, as.name("guess_ab_col"))) { coli <- guess_ab_col(tbl_, "coli", verbose = verbose) }
|
||||
if (identical(czol, as.name("guess_ab_col"))) { czol <- guess_ab_col(tbl_, "czol", verbose = verbose) }
|
||||
if (identical(dapt, as.name("guess_ab_col"))) { dapt <- guess_ab_col(tbl_, "dapt", verbose = verbose) }
|
||||
if (identical(doxy, as.name("guess_ab_col"))) { doxy <- guess_ab_col(tbl_, "doxy", verbose = verbose) }
|
||||
if (identical(erta, as.name("guess_ab_col"))) { erta <- guess_ab_col(tbl_, "erta", verbose = verbose) }
|
||||
if (identical(eryt, as.name("guess_ab_col"))) { eryt <- guess_ab_col(tbl_, "eryt", verbose = verbose) }
|
||||
if (identical(fosf, as.name("guess_ab_col"))) { fosf <- guess_ab_col(tbl_, "fosf", verbose = verbose) }
|
||||
if (identical(fusi, as.name("guess_ab_col"))) { fusi <- guess_ab_col(tbl_, "fusi", verbose = verbose) }
|
||||
if (identical(gent, as.name("guess_ab_col"))) { gent <- guess_ab_col(tbl_, "gent", verbose = verbose) }
|
||||
if (identical(imip, as.name("guess_ab_col"))) { imip <- guess_ab_col(tbl_, "imip", verbose = verbose) }
|
||||
if (identical(kana, as.name("guess_ab_col"))) { kana <- guess_ab_col(tbl_, "kana", verbose = verbose) }
|
||||
if (identical(levo, as.name("guess_ab_col"))) { levo <- guess_ab_col(tbl_, "levo", verbose = verbose) }
|
||||
if (identical(linc, as.name("guess_ab_col"))) { linc <- guess_ab_col(tbl_, "linc", verbose = verbose) }
|
||||
if (identical(line, as.name("guess_ab_col"))) { line <- guess_ab_col(tbl_, "line", verbose = verbose) }
|
||||
if (identical(mero, as.name("guess_ab_col"))) { mero <- guess_ab_col(tbl_, "mero", verbose = verbose) }
|
||||
if (identical(mezl, as.name("guess_ab_col"))) { mezl <- guess_ab_col(tbl_, "mezl", verbose = verbose) }
|
||||
if (identical(mino, as.name("guess_ab_col"))) { mino <- guess_ab_col(tbl_, "mino", verbose = verbose) }
|
||||
if (identical(moxi, as.name("guess_ab_col"))) { moxi <- guess_ab_col(tbl_, "moxi", verbose = verbose) }
|
||||
if (identical(nali, as.name("guess_ab_col"))) { nali <- guess_ab_col(tbl_, "nali", verbose = verbose) }
|
||||
if (identical(neom, as.name("guess_ab_col"))) { neom <- guess_ab_col(tbl_, "neom", verbose = verbose) }
|
||||
if (identical(neti, as.name("guess_ab_col"))) { neti <- guess_ab_col(tbl_, "neti", verbose = verbose) }
|
||||
if (identical(nitr, as.name("guess_ab_col"))) { nitr <- guess_ab_col(tbl_, "nitr", verbose = verbose) }
|
||||
if (identical(norf, as.name("guess_ab_col"))) { norf <- guess_ab_col(tbl_, "norf", verbose = verbose) }
|
||||
if (identical(novo, as.name("guess_ab_col"))) { novo <- guess_ab_col(tbl_, "novo", verbose = verbose) }
|
||||
if (identical(oflo, as.name("guess_ab_col"))) { oflo <- guess_ab_col(tbl_, "oflo", verbose = verbose) }
|
||||
if (identical(oxac, as.name("guess_ab_col"))) { oxac <- guess_ab_col(tbl_, "oxac", verbose = verbose) }
|
||||
if (identical(peni, as.name("guess_ab_col"))) { peni <- guess_ab_col(tbl_, "peni", verbose = verbose) }
|
||||
if (identical(pipe, as.name("guess_ab_col"))) { pipe <- guess_ab_col(tbl_, "pipe", verbose = verbose) }
|
||||
if (identical(pita, as.name("guess_ab_col"))) { pita <- guess_ab_col(tbl_, "pita", verbose = verbose) }
|
||||
if (identical(poly, as.name("guess_ab_col"))) { poly <- guess_ab_col(tbl_, "poly", verbose = verbose) }
|
||||
if (identical(pris, as.name("guess_ab_col"))) { pris <- guess_ab_col(tbl_, "pris", verbose = verbose) }
|
||||
if (identical(qida, as.name("guess_ab_col"))) { qida <- guess_ab_col(tbl_, "qida", verbose = verbose) }
|
||||
if (identical(rifa, as.name("guess_ab_col"))) { rifa <- guess_ab_col(tbl_, "rifa", verbose = verbose) }
|
||||
if (identical(roxi, as.name("guess_ab_col"))) { roxi <- guess_ab_col(tbl_, "roxi", verbose = verbose) }
|
||||
if (identical(siso, as.name("guess_ab_col"))) { siso <- guess_ab_col(tbl_, "siso", verbose = verbose) }
|
||||
if (identical(teic, as.name("guess_ab_col"))) { teic <- guess_ab_col(tbl_, "teic", verbose = verbose) }
|
||||
if (identical(tetr, as.name("guess_ab_col"))) { tetr <- guess_ab_col(tbl_, "tetr", verbose = verbose) }
|
||||
if (identical(tica, as.name("guess_ab_col"))) { tica <- guess_ab_col(tbl_, "tica", verbose = verbose) }
|
||||
if (identical(tige, as.name("guess_ab_col"))) { tige <- guess_ab_col(tbl_, "tige", verbose = verbose) }
|
||||
if (identical(tobr, as.name("guess_ab_col"))) { tobr <- guess_ab_col(tbl_, "tobr", verbose = verbose) }
|
||||
if (identical(trim, as.name("guess_ab_col"))) { trim <- guess_ab_col(tbl_, "trim", verbose = verbose) }
|
||||
if (identical(trsu, as.name("guess_ab_col"))) { trsu <- guess_ab_col(tbl_, "trsu", verbose = verbose) }
|
||||
if (identical(vanc, as.name("guess_ab_col"))) { vanc <- guess_ab_col(tbl_, "vanc", verbose = verbose) }
|
||||
col.list <- c(amcl, amik, amox, ampi, azit, azlo, aztr, cefa, cfra, cfep, cfot,
|
||||
cfox, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli,
|
||||
czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana,
|
||||
levo, linc, line, mero, mezl, mino, moxi, nali, neom, neti, nitr,
|
||||
novo, norf, oflo, oxac, peni, pipe, pita, poly, pris, qida, rifa,
|
||||
roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc)
|
||||
if (length(col.list) < 63) {
|
||||
warning('Some columns do not exist -- THIS MAY STRONGLY INFLUENCE THE OUTCOME.',
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
col.list <- check_available_columns(tbl = tbl_, col.list = col.list, info = info)
|
||||
amcl <- col.list[amcl]
|
||||
amik <- col.list[amik]
|
||||
amox <- col.list[amox]
|
||||
ampi <- col.list[ampi]
|
||||
azit <- col.list[azit]
|
||||
azlo <- col.list[azlo]
|
||||
aztr <- col.list[aztr]
|
||||
cefa <- col.list[cefa]
|
||||
cfep <- col.list[cfep]
|
||||
cfot <- col.list[cfot]
|
||||
cfox <- col.list[cfox]
|
||||
cfra <- col.list[cfra]
|
||||
cfta <- col.list[cfta]
|
||||
cftr <- col.list[cftr]
|
||||
cfur <- col.list[cfur]
|
||||
chlo <- col.list[chlo]
|
||||
cipr <- col.list[cipr]
|
||||
clar <- col.list[clar]
|
||||
clin <- col.list[clin]
|
||||
clox <- col.list[clox]
|
||||
coli <- col.list[coli]
|
||||
czol <- col.list[czol]
|
||||
dapt <- col.list[dapt]
|
||||
doxy <- col.list[doxy]
|
||||
erta <- col.list[erta]
|
||||
eryt <- col.list[eryt]
|
||||
fosf <- col.list[fosf]
|
||||
fusi <- col.list[fusi]
|
||||
gent <- col.list[gent]
|
||||
imip <- col.list[imip]
|
||||
kana <- col.list[kana]
|
||||
levo <- col.list[levo]
|
||||
linc <- col.list[linc]
|
||||
line <- col.list[line]
|
||||
mero <- col.list[mero]
|
||||
mezl <- col.list[mezl]
|
||||
mino <- col.list[mino]
|
||||
moxi <- col.list[moxi]
|
||||
nali <- col.list[nali]
|
||||
neom <- col.list[neom]
|
||||
neti <- col.list[neti]
|
||||
nitr <- col.list[nitr]
|
||||
norf <- col.list[norf]
|
||||
novo <- col.list[novo]
|
||||
oflo <- col.list[oflo]
|
||||
oxac <- col.list[oxac]
|
||||
peni <- col.list[peni]
|
||||
pipe <- col.list[pipe]
|
||||
pita <- col.list[pita]
|
||||
poly <- col.list[poly]
|
||||
pris <- col.list[pris]
|
||||
qida <- col.list[qida]
|
||||
rifa <- col.list[rifa]
|
||||
roxi <- col.list[roxi]
|
||||
siso <- col.list[siso]
|
||||
teic <- col.list[teic]
|
||||
tetr <- col.list[tetr]
|
||||
tica <- col.list[tica]
|
||||
tige <- col.list[tige]
|
||||
tobr <- col.list[tobr]
|
||||
trim <- col.list[trim]
|
||||
trsu <- col.list[trsu]
|
||||
vanc <- col.list[vanc]
|
||||
cols_ab <- get_column_abx(tbl = x,
|
||||
soft_dependencies = c("AMC",
|
||||
"AMK",
|
||||
"AMX",
|
||||
"AMP",
|
||||
"AZM",
|
||||
"AZL",
|
||||
"ATM",
|
||||
"RID",
|
||||
"FEP",
|
||||
"CTX",
|
||||
"FOX",
|
||||
"CED",
|
||||
"CAZ",
|
||||
"CRO",
|
||||
"CXM",
|
||||
"CHL",
|
||||
"CIP",
|
||||
"CLR",
|
||||
"CLI",
|
||||
"FLC",
|
||||
"COL",
|
||||
"CZO",
|
||||
"DAP",
|
||||
"DOX",
|
||||
"ETP",
|
||||
"ERY",
|
||||
"FOS",
|
||||
"FUS",
|
||||
"GEN",
|
||||
"IPM",
|
||||
"KAN",
|
||||
"LVX",
|
||||
"LIN",
|
||||
"LNZ",
|
||||
"MEM",
|
||||
"MEZ",
|
||||
"MNO",
|
||||
"MFX",
|
||||
"NAL",
|
||||
"NEO",
|
||||
"NET",
|
||||
"NIT",
|
||||
"NOR",
|
||||
"NOV",
|
||||
"OFX",
|
||||
"OXA",
|
||||
"PEN",
|
||||
"PIP",
|
||||
"TZP",
|
||||
"PLB",
|
||||
"PRI",
|
||||
"QDA",
|
||||
"RIF",
|
||||
"RXT",
|
||||
"SIS",
|
||||
"TEC",
|
||||
"TCY",
|
||||
"TIC",
|
||||
"TGC",
|
||||
"TOB",
|
||||
"TMP",
|
||||
"SXT",
|
||||
"VAN"),
|
||||
hard_dependencies = NULL,
|
||||
verbose = verbose,
|
||||
...)
|
||||
|
||||
AMC <- cols_ab['AMC']
|
||||
AMK <- cols_ab['AMK']
|
||||
AMP <- cols_ab['AMP']
|
||||
AMX <- cols_ab['AMX']
|
||||
ATM <- cols_ab['ATM']
|
||||
AZL <- cols_ab['AZL']
|
||||
AZM <- cols_ab['AZM']
|
||||
CAZ <- cols_ab['CAZ']
|
||||
CED <- cols_ab['CED']
|
||||
CHL <- cols_ab['CHL']
|
||||
CIP <- cols_ab['CIP']
|
||||
CLI <- cols_ab['CLI']
|
||||
CLR <- cols_ab['CLR']
|
||||
COL <- cols_ab['COL']
|
||||
CRO <- cols_ab['CRO']
|
||||
CTX <- cols_ab['CTX']
|
||||
CXM <- cols_ab['CXM']
|
||||
CZO <- cols_ab['CZO']
|
||||
DAP <- cols_ab['DAP']
|
||||
DOX <- cols_ab['DOX']
|
||||
ERY <- cols_ab['ERY']
|
||||
ETP <- cols_ab['ETP']
|
||||
FEP <- cols_ab['FEP']
|
||||
FLC <- cols_ab['FLC']
|
||||
FOS <- cols_ab['FOS']
|
||||
FOX <- cols_ab['FOX']
|
||||
FUS <- cols_ab['FUS']
|
||||
GEN <- cols_ab['GEN']
|
||||
IPM <- cols_ab['IPM']
|
||||
KAN <- cols_ab['KAN']
|
||||
LIN <- cols_ab['LIN']
|
||||
LNZ <- cols_ab['LNZ']
|
||||
LVX <- cols_ab['LVX']
|
||||
MEM <- cols_ab['MEM']
|
||||
MEZ <- cols_ab['MEZ']
|
||||
MFX <- cols_ab['MFX']
|
||||
MNO <- cols_ab['MNO']
|
||||
NAL <- cols_ab['NAL']
|
||||
NEO <- cols_ab['NEO']
|
||||
NET <- cols_ab['NET']
|
||||
NIT <- cols_ab['NIT']
|
||||
NOR <- cols_ab['NOR']
|
||||
NOV <- cols_ab['NOV']
|
||||
OFX <- cols_ab['OFX']
|
||||
OXA <- cols_ab['OXA']
|
||||
PEN <- cols_ab['PEN']
|
||||
PIP <- cols_ab['PIP']
|
||||
PLB <- cols_ab['PLB']
|
||||
PRI <- cols_ab['PRI']
|
||||
QDA <- cols_ab['QDA']
|
||||
RID <- cols_ab['RID']
|
||||
RIF <- cols_ab['RIF']
|
||||
RXT <- cols_ab['RXT']
|
||||
SIS <- cols_ab['SIS']
|
||||
SXT <- cols_ab['SXT']
|
||||
TCY <- cols_ab['TCY']
|
||||
TEC <- cols_ab['TEC']
|
||||
TGC <- cols_ab['TGC']
|
||||
TIC <- cols_ab['TIC']
|
||||
TMP <- cols_ab['TMP']
|
||||
TOB <- cols_ab['TOB']
|
||||
TZP <- cols_ab['TZP']
|
||||
VAN <- cols_ab['VAN']
|
||||
|
||||
ab_missing <- function(ab) {
|
||||
all(ab %in% c(NULL, NA))
|
||||
@@ -521,41 +445,41 @@ eucast_rules <- function(x,
|
||||
}
|
||||
|
||||
# since ampicillin ^= amoxicillin, get the first from the latter (not in original EUCAST table)
|
||||
if (!ab_missing(ampi) & !ab_missing(amox)) {
|
||||
if (!ab_missing(AMP) & !ab_missing(AMX)) {
|
||||
if (verbose == TRUE) {
|
||||
cat("\n VERBOSE: transforming",
|
||||
length(which(tbl_[, amox] == "S" & !tbl_[, ampi] %in% c("S", "I", "R"))),
|
||||
length(which(tbl_[, AMX] == "S" & !tbl_[, AMP] %in% c("S", "I", "R"))),
|
||||
"empty ampicillin fields to 'S' based on amoxicillin. ")
|
||||
cat("\n VERBOSE: transforming",
|
||||
length(which(tbl_[, amox] == "I" & !tbl_[, ampi] %in% c("S", "I", "R"))),
|
||||
length(which(tbl_[, AMX] == "I" & !tbl_[, AMP] %in% c("S", "I", "R"))),
|
||||
"empty ampicillin fields to 'I' based on amoxicillin. ")
|
||||
cat("\n VERBOSE: transforming",
|
||||
length(which(tbl_[, amox] == "R" & !tbl_[, ampi] %in% c("S", "I", "R"))),
|
||||
length(which(tbl_[, AMX] == "R" & !tbl_[, AMP] %in% c("S", "I", "R"))),
|
||||
"empty ampicillin fields to 'R' based on amoxicillin. \n")
|
||||
}
|
||||
tbl_[which(tbl_[, amox] == "S" & !tbl_[, ampi] %in% c("S", "I", "R")), ampi] <- "S"
|
||||
tbl_[which(tbl_[, amox] == "I" & !tbl_[, ampi] %in% c("S", "I", "R")), ampi] <- "I"
|
||||
tbl_[which(tbl_[, amox] == "R" & !tbl_[, ampi] %in% c("S", "I", "R")), ampi] <- "R"
|
||||
} else if (ab_missing(ampi) & !ab_missing(amox)) {
|
||||
tbl_[which(tbl_[, AMX] == "S" & !tbl_[, AMP] %in% c("S", "I", "R")), AMP] <- "S"
|
||||
tbl_[which(tbl_[, AMX] == "I" & !tbl_[, AMP] %in% c("S", "I", "R")), AMP] <- "I"
|
||||
tbl_[which(tbl_[, AMX] == "R" & !tbl_[, AMP] %in% c("S", "I", "R")), AMP] <- "R"
|
||||
} else if (ab_missing(AMP) & !ab_missing(AMX)) {
|
||||
# ampicillin column is missing, but amoxicillin is available
|
||||
message(blue(paste0("NOTE: Using column `", bold(amox), "` as input for ampicillin (J01CA01) since many EUCAST rules depend on it.")))
|
||||
ampi <- amox
|
||||
message(blue(paste0("NOTE: Using column `", bold(AMX), "` as input for ampicillin (J01CA01) since many EUCAST rules depend on it.")))
|
||||
AMP <- AMX
|
||||
}
|
||||
|
||||
# antibiotic classes
|
||||
aminoglycosides <- c(tobr, gent, kana, neom, neti, siso)
|
||||
tetracyclines <- c(doxy, mino, tetr) # since EUCAST v3.1 tige(cycline) is set apart
|
||||
polymyxins <- c(poly, coli)
|
||||
macrolides <- c(eryt, azit, roxi, clar) # since EUCAST v3.1 clinda is set apart
|
||||
glycopeptides <- c(vanc, teic)
|
||||
streptogramins <- c(qida, pris) # should officially also be quinupristin/dalfopristin
|
||||
cephalosporins <- c(cfep, cfot, cfox, cfra, cfta, cftr, cfur, czol)
|
||||
cephalosporins_without_cfta <- cephalosporins[cephalosporins != ifelse(is.null(cfta), "", cfta)]
|
||||
carbapenems <- c(erta, imip, mero)
|
||||
aminopenicillins <- c(ampi, amox)
|
||||
ureidopenicillins <- c(pipe, pita, azlo, mezl)
|
||||
fluoroquinolones <- c(oflo, cipr, norf, levo, moxi)
|
||||
all_betalactams <- c(aminopenicillins, ureidopenicillins, cephalosporins, carbapenems, amcl, oxac, clox, peni)
|
||||
aminoglycosides <- c(TOB, GEN, KAN, NEO, NET, SIS)
|
||||
tetracyclines <- c(DOX, MNO, TCY) # since EUCAST v3.1 tigecycline (TGC) is set apart
|
||||
polymyxins <- c(PLB, COL)
|
||||
macrolides <- c(ERY, AZM, RXT, CLR) # since EUCAST v3.1 clinda is set apart
|
||||
glycopeptides <- c(VAN, TEC)
|
||||
streptogramins <- c(QDA, PRI) # should officially also be quinupristin/dalfopristin
|
||||
aminopenicillins <- c(AMP, AMX)
|
||||
cephalosporins <- c(FEP, CTX, FOX, CED, CAZ, CRO, CXM, CZO)
|
||||
cephalosporins_without_CAZ <- cephalosporins[cephalosporins != ifelse(is.null(CAZ), "", CAZ)]
|
||||
carbapenems <- c(ETP, IPM, MEM)
|
||||
ureidopenicillins <- c(PIP, TZP, AZL, MEZ)
|
||||
all_betalactams <- c(aminopenicillins, cephalosporins, carbapenems, ureidopenicillins, AMC, OXA, FLC, PEN)
|
||||
fluoroquinolones <- c(OFX, CIP, NOR, LVX, MFX)
|
||||
|
||||
# Help function to get available antibiotic column names ------------------
|
||||
get_antibiotic_columns <- function(x, df) {
|
||||
@@ -578,7 +502,7 @@ eucast_rules <- function(x,
|
||||
rule_group_current <- eucast_rules_df[i, "reference.rule_group"]
|
||||
rule_group_next <- eucast_rules_df[min(nrow(eucast_rules_df), i + 1), "reference.rule_group"]
|
||||
if (is.na(eucast_rules_df[i, 4])) {
|
||||
rule_text <- paste(eucast_rules_df[i, 6], "=", eucast_rules_df[i, 7])
|
||||
rule_text <- paste("always:", eucast_rules_df[i, 6], "=", eucast_rules_df[i, 7])
|
||||
} else {
|
||||
rule_text <- paste("if", eucast_rules_df[i, 4], "=", eucast_rules_df[i, 5],
|
||||
"then", eucast_rules_df[i, 6], "=", eucast_rules_df[i, 7])
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
#' # filter on isolates that have any result for any aminoglycoside
|
||||
#' septic_patients %>% filter_aminoglycosides()
|
||||
#'
|
||||
#' # this is essentially the same as:
|
||||
#' # this is essentially the same as (but without determination of column names):
|
||||
#' septic_patients %>%
|
||||
#' filter_at(.vars = vars(c("gent", "tobr", "amik", "kana")),
|
||||
#' filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
|
||||
#' .vars_predicate = any_vars(. %in% c("S", "I", "R")))
|
||||
#'
|
||||
#'
|
||||
@@ -264,7 +264,8 @@ filter_tetracyclines <- function(tbl,
|
||||
ab_class_vars <- function(ab_class) {
|
||||
ab_vars <- AMR::antibiotics %>%
|
||||
filter_at(vars(c("atc_group1", "atc_group2")), any_vars(. %like% ab_class)) %>%
|
||||
select(atc:trade_name) %>%
|
||||
select(ab:name, abbreviations, synonyms) %>%
|
||||
unlist() %>%
|
||||
as.matrix() %>%
|
||||
as.character() %>%
|
||||
paste(collapse = "|") %>%
|
||||
@@ -289,7 +290,7 @@ ab_class_atcgroups <- function(ab_class) {
|
||||
"tetracycline"),
|
||||
paste0(ab_class, "s"),
|
||||
AMR::antibiotics %>%
|
||||
filter(atc %in% ab_class_vars(ab_class)) %>%
|
||||
filter(ab %in% ab_class_vars(ab_class)) %>%
|
||||
pull("atc_group2") %>%
|
||||
unique() %>%
|
||||
tolower() %>%
|
||||
|
||||
@@ -98,14 +98,14 @@
|
||||
#' # Now let's see if first isolates matter:
|
||||
#' A <- septic_patients %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(count = n_rsi(gent), # gentamicin availability
|
||||
#' resistance = portion_IR(gent)) # gentamicin resistance
|
||||
#' summarise(count = n_rsi(GEN), # gentamicin availability
|
||||
#' resistance = portion_IR(GEN)) # gentamicin resistance
|
||||
#'
|
||||
#' B <- septic_patients %>%
|
||||
#' filter_first_weighted_isolate() %>% # the 1st isolate filter
|
||||
#' filter_first_weighted_isolate() %>% # the 1st isolate filter
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(count = n_rsi(gent), # gentamicin availability
|
||||
#' resistance = portion_IR(gent)) # gentamicin resistance
|
||||
#' summarise(count = n_rsi(GEN), # gentamicin availability
|
||||
#' resistance = portion_IR(GEN)) # gentamicin resistance
|
||||
#'
|
||||
#' # Have a look at A and B.
|
||||
#' # B is more reliable because every isolate is only counted once.
|
||||
|
||||
17
R/freq.R
@@ -181,8 +181,8 @@
|
||||
#'
|
||||
#'
|
||||
#' # check differences between frequency tables
|
||||
#' diff(freq(septic_patients$trim),
|
||||
#' freq(septic_patients$trsu))
|
||||
#' diff(freq(septic_patients$TMP),
|
||||
#' freq(septic_patients$SXT))
|
||||
frequency_tbl <- function(x,
|
||||
...,
|
||||
sort.count = TRUE,
|
||||
@@ -419,8 +419,8 @@ frequency_tbl <- function(x,
|
||||
}
|
||||
|
||||
if (any(class(x) == "rsi")) {
|
||||
header_list$count_S <- max(0, sum(x == "S", na.rm = TRUE), na.rm = TRUE)
|
||||
header_list$count_IR <- max(0, sum(x %in% c("I", "R"), na.rm = TRUE), na.rm = TRUE)
|
||||
header_list$count_SI <- max(0, sum(x %in% c("S", "I"), na.rm = TRUE), na.rm = TRUE)
|
||||
header_list$count_R <- max(0, sum(x == "R", na.rm = TRUE), na.rm = TRUE)
|
||||
}
|
||||
|
||||
formatdates <- "%e %B %Y" # = d mmmm yyyy
|
||||
@@ -565,14 +565,15 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ",
|
||||
# FORMATTING
|
||||
# rsi
|
||||
if (has_length == TRUE & any(x_class == "rsi")) {
|
||||
ab <- tryCatch(atc_name(attributes(x)$opt$vars), error = function(e) NA)
|
||||
ab <- tryCatch(as.ab(attributes(x)$opt$vars), error = function(e) NA)
|
||||
if (!is.na(ab)) {
|
||||
header$drug <- ab[1L]
|
||||
header$drug <- paste0(ab_name(ab[1L]), " (", ab[1L], ", ", ab_atc(ab[1L]), ")")
|
||||
header$group <- ab_group(ab[1L])
|
||||
}
|
||||
header$`%IR` <- percent(header$count_IR / (header$count_S + header$count_IR),
|
||||
header$`%SI` <- percent(header$count_SI / (header$count_SI + header$count_R),
|
||||
force_zero = TRUE, round = digits, decimal.mark = decimal.mark)
|
||||
}
|
||||
header <- header[!names(header) %in% c("count_S", "count_IR")]
|
||||
header <- header[!names(header) %in% c("count_SI", "count_R")]
|
||||
# dates
|
||||
if (!is.null(header$date_format)) {
|
||||
if (header$date_format == "%H:%M:%S") {
|
||||
|
||||
@@ -19,20 +19,53 @@
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Get language for AMR
|
||||
#' Translate strings from AMR package
|
||||
#'
|
||||
#' Determines the system language to be used for language-dependent output of AMR functions, like \code{\link{mo_gramstain}} and \code{\link{mo_type}}.
|
||||
#' @details The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
|
||||
#' @section Supported languages:
|
||||
#' Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} (Dutch), \code{"es"} (Spanish), \code{"it"} (Italian), \code{"fr"} (French), and \code{"pt"} (Portuguese).
|
||||
#' For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}.
|
||||
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running:
|
||||
#'
|
||||
#' \code{system.file("translations.tsv", package = "AMR")}
|
||||
#'
|
||||
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation suggestion}{by creating a new issue on our repository}.
|
||||
#'
|
||||
#' The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @rdname translate
|
||||
#' @name translate
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # The 'language' parameter of below functions
|
||||
#' # will be set automatically to your system language
|
||||
#' # with get_locale()
|
||||
#'
|
||||
#' # English
|
||||
#' mo_fullname("CoNS", language = "en")
|
||||
#' #> "Coagulase-negative Staphylococcus (CoNS)"
|
||||
#'
|
||||
#' # German
|
||||
#' mo_fullname("CoNS", language = "de")
|
||||
#' #> "Koagulase-negative Staphylococcus (KNS)"
|
||||
#'
|
||||
#' # Dutch
|
||||
#' mo_fullname("CoNS", language = "nl")
|
||||
#' #> "Coagulase-negatieve Staphylococcus (CNS)"
|
||||
#'
|
||||
#' # Spanish
|
||||
#' mo_fullname("CoNS", language = "es")
|
||||
#' #> "Staphylococcus coagulasa negativo (SCN)"
|
||||
#'
|
||||
#' # Italian
|
||||
#' mo_fullname("CoNS", language = "it")
|
||||
#' #> "Staphylococcus negativo coagulasi (CoNS)"
|
||||
#'
|
||||
#' # Portuguese
|
||||
#' mo_fullname("CoNS", language = "pt")
|
||||
#' #> "Staphylococcus coagulase negativo (CoNS)"
|
||||
get_locale <- function() {
|
||||
if (!is.null(getOption("AMR_locale"))) {
|
||||
if (getOption("AMR_locale") %in% c("en", "de", "nl", "es", "it", "fr", "pt")) {
|
||||
return(getOption("AMR_locale"))
|
||||
}
|
||||
if (getOption("AMR_locale", "en") != "en") {
|
||||
return(getOption("AMR_locale"))
|
||||
}
|
||||
|
||||
lang <- Sys.getlocale("LC_COLLATE")
|
||||
# grepl with case = FALSE is faster than like
|
||||
if (grepl("^(English|en_|EN_)", lang, ignore.case = FALSE)) {
|
||||
|
||||
@@ -29,14 +29,15 @@
|
||||
#' @param breaks numeric vector of positions
|
||||
#' @param limits numeric vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum
|
||||
#' @param facet variable to split plots by, either \code{"Interpretation"} (default) or \code{"Antibiotic"} or a grouping variable
|
||||
#' @param translate_ab a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations into, using \code{\link{abname}}. Default behaviour is to translate to official names according to the WHO. Use \code{translate_ab = FALSE} to disable translation.
|
||||
#' @param translate_ab a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations into, using \code{\link{ab_name}}. Default behaviour is to translate to official names according to the WHO. Use \code{translate_ab = FALSE} to disable translation.
|
||||
#' @param language the language used for translation of antibiotic names
|
||||
#' @param fun function to transform \code{data}, either \code{\link{count_df}} (default) or \code{\link{portion_df}}
|
||||
#' @param nrow (when using \code{facet}) number of rows
|
||||
#' @param datalabels show datalabels using \code{labels_rsi_count}, will at default only be shown when \code{fun = count_df}
|
||||
#' @param datalabels.size size of the datalabels
|
||||
#' @param datalabels.colour colour of the datalabels
|
||||
#' @param ... other parameters passed on to \code{geom_rsi}
|
||||
#' @details At default, the names of antibiotics will be shown on the plots using \code{\link{abname}}. This can be set with the option \code{get_antibiotic_names} (a logical value), so change it e.g. to \code{FALSE} with \code{options(get_antibiotic_names = FALSE)}.
|
||||
#' @details At default, the names of antibiotics will be shown on the plots using \code{\link{ab_name}}. This can be set with the option \code{get_antibiotic_names} (a logical value), so change it e.g. to \code{FALSE} with \code{options(get_antibiotic_names = FALSE)}.
|
||||
#'
|
||||
#' \strong{The functions}\cr
|
||||
#' \code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{fun} (\code{\link{count_df}} at default, can also be \code{\link{portion_df}}) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
|
||||
@@ -61,11 +62,11 @@
|
||||
#' library(ggplot2)
|
||||
#'
|
||||
#' # get antimicrobial results for drugs against a UTI:
|
||||
#' ggplot(septic_patients %>% select(amox, nitr, fosf, trim, cipr)) +
|
||||
#' ggplot(septic_patients %>% select(AMX, NIT, FOS, TMP, CIP)) +
|
||||
#' geom_rsi()
|
||||
#'
|
||||
#' # prettify the plot using some additional functions:
|
||||
#' df <- septic_patients[, c("amox", "nitr", "fosf", "trim", "cipr")]
|
||||
#' df <- septic_patients[, c("AMX", "NIT", "FOS", "TMP", "CIP")]
|
||||
#' ggplot(df) +
|
||||
#' geom_rsi() +
|
||||
#' scale_y_percent() +
|
||||
@@ -75,17 +76,17 @@
|
||||
#'
|
||||
#' # or better yet, simplify this using the wrapper function - a single command:
|
||||
#' septic_patients %>%
|
||||
#' select(amox, nitr, fosf, trim, cipr) %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi()
|
||||
#'
|
||||
#' # get only portions and no counts:
|
||||
#' septic_patients %>%
|
||||
#' select(amox, nitr, fosf, trim, cipr) %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi(fun = portion_df)
|
||||
#'
|
||||
#' # add other ggplot2 parameters as you like:
|
||||
#' septic_patients %>%
|
||||
#' select(amox, nitr, fosf, trim, cipr) %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi(width = 0.5,
|
||||
#' colour = "black",
|
||||
#' size = 1,
|
||||
@@ -100,19 +101,19 @@
|
||||
#' # `age_group` is also a function of this package:
|
||||
#' group_by(age_group = age_groups(age)) %>%
|
||||
#' select(age_group,
|
||||
#' cipr) %>%
|
||||
#' CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
#' \donttest{
|
||||
#'
|
||||
#' # for colourblind mode, use divergent colours from the viridis package:
|
||||
#' septic_patients %>%
|
||||
#' select(amox, nitr, fosf, trim, cipr) %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi() + scale_fill_viridis_d()
|
||||
#'
|
||||
#'
|
||||
#' # it also supports groups (don't forget to use the group var on `x` or `facet`):
|
||||
#' septic_patients %>%
|
||||
#' select(hospital_id, amox, nitr, fosf, trim, cipr) %>%
|
||||
#' select(hospital_id, AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' ggplot_rsi(x = hospital_id,
|
||||
#' facet = Antibiotic,
|
||||
@@ -136,7 +137,7 @@
|
||||
#' # get short MO names (like "E. coli")
|
||||
#' mutate(mo = mo_shortname(mo, Becker = TRUE)) %>%
|
||||
#' # select this short name and some antiseptic drugs
|
||||
#' select(mo, cfur, gent, cipr) %>%
|
||||
#' select(mo, CXM, GEN, CIP) %>%
|
||||
#' # group by MO
|
||||
#' group_by(mo) %>%
|
||||
#' # plot the thing, putting MOs on the facet
|
||||
@@ -156,7 +157,8 @@ ggplot_rsi <- function(data,
|
||||
facet = NULL,
|
||||
breaks = seq(0, 1, 0.1),
|
||||
limits = NULL,
|
||||
translate_ab = "official",
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
fun = count_df,
|
||||
nrow = NULL,
|
||||
datalabels = TRUE,
|
||||
@@ -229,7 +231,8 @@ ggplot_rsi <- function(data,
|
||||
geom_rsi <- function(position = NULL,
|
||||
x = c("Antibiotic", "Interpretation"),
|
||||
fill = "Interpretation",
|
||||
translate_ab = "official",
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
fun = count_df,
|
||||
...) {
|
||||
|
||||
@@ -267,8 +270,6 @@ geom_rsi <- function(position = NULL,
|
||||
x <- "Interpretation"
|
||||
}
|
||||
|
||||
options(get_antibiotic_names = translate_ab)
|
||||
|
||||
ggplot2::layer(geom = "bar", stat = "identity", position = position,
|
||||
mapping = ggplot2::aes_string(x = x, y = y, fill = fill),
|
||||
data = fun, params = list(...))
|
||||
|
||||
10
R/globals.R
@@ -21,13 +21,14 @@
|
||||
|
||||
globalVariables(c(".",
|
||||
"..property",
|
||||
"ab",
|
||||
"abbreviations",
|
||||
"antibiotic",
|
||||
"Antibiotic",
|
||||
"antibiotics",
|
||||
"atc",
|
||||
"authors",
|
||||
"Becker",
|
||||
"certe",
|
||||
"CNS_CPS",
|
||||
"cnt",
|
||||
"col_id",
|
||||
@@ -56,8 +57,10 @@ globalVariables(c(".",
|
||||
"kingdom",
|
||||
"labs",
|
||||
"Lancefield",
|
||||
"lang",
|
||||
"Last name",
|
||||
"lbl",
|
||||
"lookup",
|
||||
"median",
|
||||
"mic",
|
||||
"microorganisms",
|
||||
@@ -70,6 +73,7 @@ globalVariables(c(".",
|
||||
"mo",
|
||||
"mo.old",
|
||||
"more_than_episode_ago",
|
||||
"MPM",
|
||||
"n",
|
||||
"name",
|
||||
"new",
|
||||
@@ -92,6 +96,7 @@ globalVariables(c(".",
|
||||
"ref",
|
||||
"reference.rule",
|
||||
"reference.rule_group",
|
||||
"rsi",
|
||||
"rule_group",
|
||||
"rule_name",
|
||||
"S",
|
||||
@@ -103,12 +108,13 @@ globalVariables(c(".",
|
||||
"species",
|
||||
"species_id",
|
||||
"subspecies",
|
||||
"synonyms",
|
||||
"trade_name",
|
||||
"trans",
|
||||
"transmute",
|
||||
"tsn",
|
||||
"tsn_new",
|
||||
"txt",
|
||||
"umcg",
|
||||
"value",
|
||||
"Value",
|
||||
"x",
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#'
|
||||
#' guess_ab_col(df, "amoxicillin")
|
||||
#' # [1] "amox"
|
||||
#' guess_ab_col(df, "J01AA07") # ATC code of Tetracycline
|
||||
#' guess_ab_col(df, "J01AA07") # ATC code of tetracycline
|
||||
#' # [1] "tetr"
|
||||
#'
|
||||
#' guess_ab_col(df, "J01AA07", verbose = TRUE)
|
||||
@@ -49,7 +49,7 @@
|
||||
#' # [1] "AMP_ND10"
|
||||
#' guess_ab_col(df, "J01CR02")
|
||||
#' # [1] "AMC_ED20"
|
||||
#' guess_ab_col(df, as.atc("augmentin"))
|
||||
#' guess_ab_col(df, as.ab("augmentin"))
|
||||
#' # [1] "AMC_ED20"
|
||||
guess_ab_col <- function(tbl = NULL, col = NULL, verbose = FALSE) {
|
||||
if (is.null(tbl) & is.null(col)) {
|
||||
@@ -60,77 +60,21 @@ guess_ab_col <- function(tbl = NULL, col = NULL, verbose = FALSE) {
|
||||
warning("argument 'col' has length > 1 and only the first element will be used")
|
||||
col <- col[1]
|
||||
}
|
||||
col <- as.character(col)
|
||||
if (!is.data.frame(tbl)) {
|
||||
stop("`tbl` must be a data.frame")
|
||||
}
|
||||
|
||||
tbl_names <- colnames(tbl)
|
||||
tbl_names_stripped <- colnames(tbl) %>%
|
||||
strsplit("_") %>%
|
||||
lapply(function(x) {x[1]}) %>%
|
||||
unlist()
|
||||
|
||||
if (col %in% tbl_names) {
|
||||
if (verbose == TRUE) {
|
||||
message(blue(paste0("NOTE: Using column `", bold(col), "` as input for `", col, "`.")))
|
||||
}
|
||||
return(col)
|
||||
}
|
||||
ab_result <- antibiotics %>%
|
||||
select(atc:trade_name) %>%
|
||||
filter_all(any_vars(tolower(.) == tolower(col))) %>%
|
||||
filter_all(any_vars(. %in% tbl_names))
|
||||
|
||||
if (nrow(ab_result) == 0 & nchar(col) >= 5) {
|
||||
# use like when col >= 5 characters
|
||||
ab_result <- antibiotics %>%
|
||||
select(atc:trade_name) %>%
|
||||
filter_all(any_vars(tolower(.) %like% tolower(col))) %>%
|
||||
filter_all(any_vars(. %in% tbl_names))
|
||||
}
|
||||
|
||||
# WHONET
|
||||
if (nrow(ab_result) == 0) {
|
||||
# use like for any case
|
||||
ab_result <- antibiotics %>%
|
||||
select(atc:trade_name) %>%
|
||||
filter_all(any_vars(tolower(.) == tolower(col))) %>%
|
||||
filter_all(any_vars(. %in% tbl_names_stripped))
|
||||
}
|
||||
|
||||
found_based_on_official_name <- FALSE
|
||||
if (nrow(ab_result) == 0) {
|
||||
# check if first part of official name resembles the columns that's been looking for
|
||||
name <- suppressWarnings(atc_name(col))
|
||||
if (!is.null(name)) {
|
||||
ab_result <-
|
||||
antibiotics %>%
|
||||
filter(official == name) %>%
|
||||
pull(official)
|
||||
ab_result <- tbl_names[tbl_names %like% paste0("^", substr(ab_result, 1, 5))]
|
||||
found_based_on_official_name <- TRUE
|
||||
}
|
||||
}
|
||||
|
||||
if (NROW(ab_result) > 1 & found_based_on_official_name == FALSE) {
|
||||
# looking more and more for reliable hit
|
||||
ab_result_1 <- ab_result %>% filter(tolower(atc) == tolower(col))
|
||||
if (nrow(ab_result_1) == 0) {
|
||||
ab_result_1 <- ab_result %>% filter(tolower(certe) == tolower(col))
|
||||
}
|
||||
if (nrow(ab_result_1) == 0) {
|
||||
ab_result_1 <- ab_result %>% filter(tolower(umcg) == tolower(col))
|
||||
}
|
||||
if (nrow(ab_result_1) == 0) {
|
||||
ab_result_1 <- ab_result %>% filter(tolower(official) == tolower(col))
|
||||
}
|
||||
if (nrow(ab_result_1) == 0) {
|
||||
ab_result_1 <- ab_result %>% filter(tolower(official) == tolower(col))
|
||||
}
|
||||
if (nrow(ab_result_1) == 0) {
|
||||
ab_result_1 <- ab_result[1, ]
|
||||
}
|
||||
ab_result <- ab_result_1
|
||||
if (col %in% colnames(tbl)) {
|
||||
ab_result <- col
|
||||
} else {
|
||||
# sort colnames on length - longest first
|
||||
cols <- colnames(tbl[, tbl %>% colnames() %>% nchar() %>% order() %>% rev()])
|
||||
df_trans <- data.frame(cols = cols,
|
||||
abs = suppressWarnings(as.ab(cols)),
|
||||
stringsAsFactors = FALSE)
|
||||
ab_result <- df_trans[which(df_trans$abs == as.ab(col)), "cols"]
|
||||
ab_result <- ab_result[!is.na(ab_result)][1L]
|
||||
}
|
||||
|
||||
if (length(ab_result) == 0) {
|
||||
@@ -139,19 +83,9 @@ guess_ab_col <- function(tbl = NULL, col = NULL, verbose = FALSE) {
|
||||
}
|
||||
return(NULL)
|
||||
} else {
|
||||
result <- tbl_names[tbl_names %in% ab_result]
|
||||
if (length(result) == 0) {
|
||||
result <- tbl_names[tbl_names_stripped %in% ab_result]
|
||||
}
|
||||
if (length(result) == 0 | length(result) > 1) {
|
||||
if (verbose == TRUE) {
|
||||
message('No column found as input for `', col, '`.')
|
||||
}
|
||||
return(NULL)
|
||||
}
|
||||
if (verbose == TRUE) {
|
||||
message(blue(paste0("NOTE: Using column `", bold(result), "` as input for `", col, "`.")))
|
||||
message(blue(paste0("NOTE: Using column `", bold(ab_result), "` as input for `", col, "`.")))
|
||||
}
|
||||
return(result)
|
||||
return(ab_result)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,24 +78,24 @@
|
||||
#' # FALSE, because I is not ignored and so the 4th value differs
|
||||
key_antibiotics <- function(tbl,
|
||||
col_mo = NULL,
|
||||
universal_1 = guess_ab_col(tbl, "amox"),
|
||||
universal_2 = guess_ab_col(tbl, "amcl"),
|
||||
universal_3 = guess_ab_col(tbl, "cfur"),
|
||||
universal_4 = guess_ab_col(tbl, "pita"),
|
||||
universal_5 = guess_ab_col(tbl, "cipr"),
|
||||
universal_6 = guess_ab_col(tbl, "trsu"),
|
||||
GramPos_1 = guess_ab_col(tbl, "vanc"),
|
||||
GramPos_2 = guess_ab_col(tbl, "teic"),
|
||||
GramPos_3 = guess_ab_col(tbl, "tetr"),
|
||||
GramPos_4 = guess_ab_col(tbl, "eryt"),
|
||||
GramPos_5 = guess_ab_col(tbl, "oxac"),
|
||||
GramPos_6 = guess_ab_col(tbl, "rifa"),
|
||||
GramNeg_1 = guess_ab_col(tbl, "gent"),
|
||||
GramNeg_2 = guess_ab_col(tbl, "tobr"),
|
||||
GramNeg_3 = guess_ab_col(tbl, "coli"),
|
||||
GramNeg_4 = guess_ab_col(tbl, "cfot"),
|
||||
GramNeg_5 = guess_ab_col(tbl, "cfta"),
|
||||
GramNeg_6 = guess_ab_col(tbl, "mero"),
|
||||
universal_1 = guess_ab_col(tbl, "AMX"),
|
||||
universal_2 = guess_ab_col(tbl, "AMC"),
|
||||
universal_3 = guess_ab_col(tbl, "CXM"),
|
||||
universal_4 = guess_ab_col(tbl, "TZP"),
|
||||
universal_5 = guess_ab_col(tbl, "CIP"),
|
||||
universal_6 = guess_ab_col(tbl, "SXT"),
|
||||
GramPos_1 = guess_ab_col(tbl, "VAN"),
|
||||
GramPos_2 = guess_ab_col(tbl, "TEC"),
|
||||
GramPos_3 = guess_ab_col(tbl, "TCY"),
|
||||
GramPos_4 = guess_ab_col(tbl, "ERY"),
|
||||
GramPos_5 = guess_ab_col(tbl, "OXA"),
|
||||
GramPos_6 = guess_ab_col(tbl, "RIF"),
|
||||
GramNeg_1 = guess_ab_col(tbl, "GEN"),
|
||||
GramNeg_2 = guess_ab_col(tbl, "TOB"),
|
||||
GramNeg_3 = guess_ab_col(tbl, "COL"),
|
||||
GramNeg_4 = guess_ab_col(tbl, "CTX"),
|
||||
GramNeg_5 = guess_ab_col(tbl, "CAZ"),
|
||||
GramNeg_6 = guess_ab_col(tbl, "MEM"),
|
||||
warnings = TRUE,
|
||||
...) {
|
||||
|
||||
@@ -112,6 +112,35 @@ key_antibiotics <- function(tbl,
|
||||
col.list <- c(universal_1, universal_2, universal_3, universal_4, universal_5, universal_6,
|
||||
GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6,
|
||||
GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6)
|
||||
check_available_columns <- function(tbl, col.list, info = TRUE) {
|
||||
# check columns
|
||||
col.list <- col.list[!is.na(col.list) & !is.null(col.list)]
|
||||
names(col.list) <- col.list
|
||||
col.list.bak <- col.list
|
||||
# are they available as upper case or lower case then?
|
||||
for (i in 1:length(col.list)) {
|
||||
if (is.null(col.list[i]) | isTRUE(is.na(col.list[i]))) {
|
||||
col.list[i] <- NA
|
||||
} else if (toupper(col.list[i]) %in% colnames(tbl)) {
|
||||
col.list[i] <- toupper(col.list[i])
|
||||
} else if (tolower(col.list[i]) %in% colnames(tbl)) {
|
||||
col.list[i] <- tolower(col.list[i])
|
||||
} else if (!col.list[i] %in% colnames(tbl)) {
|
||||
col.list[i] <- NA
|
||||
}
|
||||
}
|
||||
if (!all(col.list %in% colnames(tbl))) {
|
||||
if (info == TRUE) {
|
||||
warning('Some columns do not exist and will be ignored: ',
|
||||
col.list.bak[!(col.list %in% colnames(tbl))] %>% toString(),
|
||||
'.\nTHIS MAY STRONGLY INFLUENCE THE OUTCOME.',
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
}
|
||||
col.list
|
||||
}
|
||||
|
||||
col.list <- check_available_columns(tbl = tbl, col.list = col.list, info = warnings)
|
||||
universal_1 <- col.list[universal_1]
|
||||
universal_2 <- col.list[universal_2]
|
||||
@@ -139,11 +168,19 @@ key_antibiotics <- function(tbl,
|
||||
GramPos_1, GramPos_2, GramPos_3,
|
||||
GramPos_4, GramPos_5, GramPos_6)
|
||||
gram_positive <- gram_positive[!is.null(gram_positive)]
|
||||
gram_positive <- gram_positive[!is.na(gram_positive)]
|
||||
if (length(gram_positive) < 12) {
|
||||
warning("only using ", length(gram_positive), " different antibiotics as key antibiotics for Gram positives. See ?key_antibiotics.", call. = FALSE)
|
||||
}
|
||||
|
||||
gram_negative = c(universal,
|
||||
GramNeg_1, GramNeg_2, GramNeg_3,
|
||||
GramNeg_4, GramNeg_5, GramNeg_6)
|
||||
gram_negative <- gram_negative[!is.null(gram_negative)]
|
||||
gram_negative <- gram_negative[!is.na(gram_negative)]
|
||||
if (length(gram_negative) < 12) {
|
||||
warning("only using ", length(gram_negative), " different antibiotics as key antibiotics for Gram negatives. See ?key_antibiotics.", call. = FALSE)
|
||||
}
|
||||
|
||||
# join to microorganisms data set
|
||||
tbl <- tbl %>%
|
||||
|
||||
463
R/mdro.R
@@ -22,13 +22,11 @@
|
||||
#' Determine multidrug-resistant organisms (MDRO)
|
||||
#'
|
||||
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to country-specific guidelines.
|
||||
#' @param tbl table with antibiotic columns, like e.g. \code{amox} and \code{amcl}
|
||||
#' @param x table with antibiotic columns, like e.g. \code{AMX} and \code{AMC}
|
||||
#' @param country country code to determine guidelines. EUCAST rules will be used when left empty, see Details. Should be or a code from the \href{https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements}{list of ISO 3166-1 alpha-2 country codes}. Case-insensitive. Currently supported are \code{de} (Germany) and \code{nl} (the Netherlands).
|
||||
#' @param info print progress
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param metr column name of an antibiotic, see Antibiotics
|
||||
#' @param verbose print additional info: missing antibiotic columns per parameter
|
||||
#' @param ... parameters that are passed on to methods
|
||||
#' @inheritSection eucast_rules Antibiotics
|
||||
#' @details When \code{country} will be left blank, guidelines will be taken from EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link}).
|
||||
#' @return Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}.
|
||||
@@ -43,86 +41,28 @@
|
||||
#' septic_patients %>%
|
||||
#' mutate(EUCAST = mdro(.),
|
||||
#' BRMO = brmo(.))
|
||||
mdro <- function(tbl,
|
||||
mdro <- function(x,
|
||||
country = NULL,
|
||||
col_mo = NULL,
|
||||
info = TRUE,
|
||||
amcl = guess_ab_col(),
|
||||
amik = guess_ab_col(),
|
||||
amox = guess_ab_col(),
|
||||
ampi = guess_ab_col(),
|
||||
azit = guess_ab_col(),
|
||||
aztr = guess_ab_col(),
|
||||
cefa = guess_ab_col(),
|
||||
cfra = guess_ab_col(),
|
||||
cfep = guess_ab_col(),
|
||||
cfot = guess_ab_col(),
|
||||
cfox = guess_ab_col(),
|
||||
cfta = guess_ab_col(),
|
||||
cftr = guess_ab_col(),
|
||||
cfur = guess_ab_col(),
|
||||
chlo = guess_ab_col(),
|
||||
cipr = guess_ab_col(),
|
||||
clar = guess_ab_col(),
|
||||
clin = guess_ab_col(),
|
||||
clox = guess_ab_col(),
|
||||
coli = guess_ab_col(),
|
||||
czol = guess_ab_col(),
|
||||
dapt = guess_ab_col(),
|
||||
doxy = guess_ab_col(),
|
||||
erta = guess_ab_col(),
|
||||
eryt = guess_ab_col(),
|
||||
fosf = guess_ab_col(),
|
||||
fusi = guess_ab_col(),
|
||||
gent = guess_ab_col(),
|
||||
imip = guess_ab_col(),
|
||||
kana = guess_ab_col(),
|
||||
levo = guess_ab_col(),
|
||||
linc = guess_ab_col(),
|
||||
line = guess_ab_col(),
|
||||
mero = guess_ab_col(),
|
||||
metr = guess_ab_col(),
|
||||
mino = guess_ab_col(),
|
||||
moxi = guess_ab_col(),
|
||||
nali = guess_ab_col(),
|
||||
neom = guess_ab_col(),
|
||||
neti = guess_ab_col(),
|
||||
nitr = guess_ab_col(),
|
||||
novo = guess_ab_col(),
|
||||
norf = guess_ab_col(),
|
||||
oflo = guess_ab_col(),
|
||||
peni = guess_ab_col(),
|
||||
pipe = guess_ab_col(),
|
||||
pita = guess_ab_col(),
|
||||
poly = guess_ab_col(),
|
||||
qida = guess_ab_col(),
|
||||
rifa = guess_ab_col(),
|
||||
roxi = guess_ab_col(),
|
||||
siso = guess_ab_col(),
|
||||
teic = guess_ab_col(),
|
||||
tetr = guess_ab_col(),
|
||||
tica = guess_ab_col(),
|
||||
tige = guess_ab_col(),
|
||||
tobr = guess_ab_col(),
|
||||
trim = guess_ab_col(),
|
||||
trsu = guess_ab_col(),
|
||||
vanc = guess_ab_col(),
|
||||
verbose = FALSE) {
|
||||
verbose = FALSE,
|
||||
...) {
|
||||
|
||||
if (!is.data.frame(tbl)) {
|
||||
stop("`tbl` must be a data frame.", call. = FALSE)
|
||||
tbl_ <- x
|
||||
|
||||
if (!is.data.frame(tbl_)) {
|
||||
stop("`x` must be a data frame.", call. = FALSE)
|
||||
}
|
||||
|
||||
# try to find columns based on type
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(tbl = tbl, type = "mo")
|
||||
col_mo <- search_type_in_df(tbl = tbl_, type = "mo")
|
||||
}
|
||||
if (is.null(col_mo)) {
|
||||
stop("`col_mo` must be set.", call. = FALSE)
|
||||
}
|
||||
|
||||
# strip whitespaces
|
||||
if (length(country) > 1) {
|
||||
stop('`country` must be a length one character string.', call. = FALSE)
|
||||
}
|
||||
@@ -169,169 +109,105 @@ mdro <- function(tbl,
|
||||
"\n", sep = "")
|
||||
}
|
||||
|
||||
# check columns
|
||||
if (identical(amcl, as.name("guess_ab_col"))) { amcl <- guess_ab_col(tbl, "amcl", verbose = verbose) }
|
||||
if (identical(amik, as.name("guess_ab_col"))) { amik <- guess_ab_col(tbl, "amik", verbose = verbose) }
|
||||
if (identical(amox, as.name("guess_ab_col"))) { amox <- guess_ab_col(tbl, "amox", verbose = verbose) }
|
||||
if (identical(ampi, as.name("guess_ab_col"))) { ampi <- guess_ab_col(tbl, "ampi", verbose = verbose) }
|
||||
if (identical(azit, as.name("guess_ab_col"))) { azit <- guess_ab_col(tbl, "azit", verbose = verbose) }
|
||||
if (identical(aztr, as.name("guess_ab_col"))) { aztr <- guess_ab_col(tbl, "aztr", verbose = verbose) }
|
||||
if (identical(cefa, as.name("guess_ab_col"))) { cefa <- guess_ab_col(tbl, "cefa", verbose = verbose) }
|
||||
if (identical(cfra, as.name("guess_ab_col"))) { cfra <- guess_ab_col(tbl, "cfra", verbose = verbose) }
|
||||
if (identical(cfep, as.name("guess_ab_col"))) { cfep <- guess_ab_col(tbl, "cfep", verbose = verbose) }
|
||||
if (identical(cfot, as.name("guess_ab_col"))) { cfot <- guess_ab_col(tbl, "cfot", verbose = verbose) }
|
||||
if (identical(cfox, as.name("guess_ab_col"))) { cfox <- guess_ab_col(tbl, "cfox", verbose = verbose) }
|
||||
if (identical(cfta, as.name("guess_ab_col"))) { cfta <- guess_ab_col(tbl, "cfta", verbose = verbose) }
|
||||
if (identical(cftr, as.name("guess_ab_col"))) { cftr <- guess_ab_col(tbl, "cftr", verbose = verbose) }
|
||||
if (identical(cfur, as.name("guess_ab_col"))) { cfur <- guess_ab_col(tbl, "cfur", verbose = verbose) }
|
||||
if (identical(chlo, as.name("guess_ab_col"))) { chlo <- guess_ab_col(tbl, "chlo", verbose = verbose) }
|
||||
if (identical(cipr, as.name("guess_ab_col"))) { cipr <- guess_ab_col(tbl, "cipr", verbose = verbose) }
|
||||
if (identical(clar, as.name("guess_ab_col"))) { clar <- guess_ab_col(tbl, "clar", verbose = verbose) }
|
||||
if (identical(clin, as.name("guess_ab_col"))) { clin <- guess_ab_col(tbl, "clin", verbose = verbose) }
|
||||
if (identical(clox, as.name("guess_ab_col"))) { clox <- guess_ab_col(tbl, "clox", verbose = verbose) }
|
||||
if (identical(coli, as.name("guess_ab_col"))) { coli <- guess_ab_col(tbl, "coli", verbose = verbose) }
|
||||
if (identical(czol, as.name("guess_ab_col"))) { czol <- guess_ab_col(tbl, "czol", verbose = verbose) }
|
||||
if (identical(dapt, as.name("guess_ab_col"))) { dapt <- guess_ab_col(tbl, "dapt", verbose = verbose) }
|
||||
if (identical(doxy, as.name("guess_ab_col"))) { doxy <- guess_ab_col(tbl, "doxy", verbose = verbose) }
|
||||
if (identical(erta, as.name("guess_ab_col"))) { erta <- guess_ab_col(tbl, "erta", verbose = verbose) }
|
||||
if (identical(eryt, as.name("guess_ab_col"))) { eryt <- guess_ab_col(tbl, "eryt", verbose = verbose) }
|
||||
if (identical(fosf, as.name("guess_ab_col"))) { fosf <- guess_ab_col(tbl, "fosf", verbose = verbose) }
|
||||
if (identical(fusi, as.name("guess_ab_col"))) { fusi <- guess_ab_col(tbl, "fusi", verbose = verbose) }
|
||||
if (identical(gent, as.name("guess_ab_col"))) { gent <- guess_ab_col(tbl, "gent", verbose = verbose) }
|
||||
if (identical(imip, as.name("guess_ab_col"))) { imip <- guess_ab_col(tbl, "imip", verbose = verbose) }
|
||||
if (identical(kana, as.name("guess_ab_col"))) { kana <- guess_ab_col(tbl, "kana", verbose = verbose) }
|
||||
if (identical(levo, as.name("guess_ab_col"))) { levo <- guess_ab_col(tbl, "levo", verbose = verbose) }
|
||||
if (identical(linc, as.name("guess_ab_col"))) { linc <- guess_ab_col(tbl, "linc", verbose = verbose) }
|
||||
if (identical(line, as.name("guess_ab_col"))) { line <- guess_ab_col(tbl, "line", verbose = verbose) }
|
||||
if (identical(mero, as.name("guess_ab_col"))) { mero <- guess_ab_col(tbl, "mero", verbose = verbose) }
|
||||
if (identical(metr, as.name("guess_ab_col"))) { metr <- guess_ab_col(tbl, "metr", verbose = verbose) }
|
||||
if (identical(mino, as.name("guess_ab_col"))) { mino <- guess_ab_col(tbl, "mino", verbose = verbose) }
|
||||
if (identical(moxi, as.name("guess_ab_col"))) { moxi <- guess_ab_col(tbl, "moxi", verbose = verbose) }
|
||||
if (identical(nali, as.name("guess_ab_col"))) { nali <- guess_ab_col(tbl, "nali", verbose = verbose) }
|
||||
if (identical(neom, as.name("guess_ab_col"))) { neom <- guess_ab_col(tbl, "neom", verbose = verbose) }
|
||||
if (identical(neti, as.name("guess_ab_col"))) { neti <- guess_ab_col(tbl, "neti", verbose = verbose) }
|
||||
if (identical(nitr, as.name("guess_ab_col"))) { nitr <- guess_ab_col(tbl, "nitr", verbose = verbose) }
|
||||
if (identical(novo, as.name("guess_ab_col"))) { novo <- guess_ab_col(tbl, "novo", verbose = verbose) }
|
||||
if (identical(norf, as.name("guess_ab_col"))) { norf <- guess_ab_col(tbl, "norf", verbose = verbose) }
|
||||
if (identical(oflo, as.name("guess_ab_col"))) { oflo <- guess_ab_col(tbl, "oflo", verbose = verbose) }
|
||||
if (identical(peni, as.name("guess_ab_col"))) { peni <- guess_ab_col(tbl, "peni", verbose = verbose) }
|
||||
if (identical(pipe, as.name("guess_ab_col"))) { pipe <- guess_ab_col(tbl, "pipe", verbose = verbose) }
|
||||
if (identical(pita, as.name("guess_ab_col"))) { pita <- guess_ab_col(tbl, "pita", verbose = verbose) }
|
||||
if (identical(poly, as.name("guess_ab_col"))) { poly <- guess_ab_col(tbl, "poly", verbose = verbose) }
|
||||
if (identical(qida, as.name("guess_ab_col"))) { qida <- guess_ab_col(tbl, "qida", verbose = verbose) }
|
||||
if (identical(rifa, as.name("guess_ab_col"))) { rifa <- guess_ab_col(tbl, "rifa", verbose = verbose) }
|
||||
if (identical(roxi, as.name("guess_ab_col"))) { roxi <- guess_ab_col(tbl, "roxi", verbose = verbose) }
|
||||
if (identical(siso, as.name("guess_ab_col"))) { siso <- guess_ab_col(tbl, "siso", verbose = verbose) }
|
||||
if (identical(teic, as.name("guess_ab_col"))) { teic <- guess_ab_col(tbl, "teic", verbose = verbose) }
|
||||
if (identical(tetr, as.name("guess_ab_col"))) { tetr <- guess_ab_col(tbl, "tetr", verbose = verbose) }
|
||||
if (identical(tica, as.name("guess_ab_col"))) { tica <- guess_ab_col(tbl, "tica", verbose = verbose) }
|
||||
if (identical(tige, as.name("guess_ab_col"))) { tige <- guess_ab_col(tbl, "tige", verbose = verbose) }
|
||||
if (identical(tobr, as.name("guess_ab_col"))) { tobr <- guess_ab_col(tbl, "tobr", verbose = verbose) }
|
||||
if (identical(trim, as.name("guess_ab_col"))) { trim <- guess_ab_col(tbl, "trim", verbose = verbose) }
|
||||
if (identical(trsu, as.name("guess_ab_col"))) { trsu <- guess_ab_col(tbl, "trsu", verbose = verbose) }
|
||||
if (identical(vanc, as.name("guess_ab_col"))) { vanc <- guess_ab_col(tbl, "vanc", verbose = verbose) }
|
||||
col.list <- c(amcl, amik, amox, ampi, azit, aztr, cefa, cfra, cfep, cfot,
|
||||
cfox, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli,
|
||||
czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana,
|
||||
levo, linc, line, mero, metr, mino, moxi, nali, neom, neti,
|
||||
nitr, novo, norf, oflo, peni, pipe, pita, poly, qida, rifa,
|
||||
roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc)
|
||||
if (length(col.list) < 60) {
|
||||
warning('Some columns do not exist -- THIS MAY STRONGLY INFLUENCE THE OUTCOME.',
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
col.list <- check_available_columns(tbl = tbl, col.list = col.list, info = info)
|
||||
amcl <- col.list[amcl]
|
||||
amik <- col.list[amik]
|
||||
amox <- col.list[amox]
|
||||
ampi <- col.list[ampi]
|
||||
azit <- col.list[azit]
|
||||
aztr <- col.list[aztr]
|
||||
cefa <- col.list[cefa]
|
||||
cfra <- col.list[cfra]
|
||||
cfep <- col.list[cfep]
|
||||
cfot <- col.list[cfot]
|
||||
cfox <- col.list[cfox]
|
||||
cfta <- col.list[cfta]
|
||||
cftr <- col.list[cftr]
|
||||
cfur <- col.list[cfur]
|
||||
chlo <- col.list[chlo]
|
||||
cipr <- col.list[cipr]
|
||||
clar <- col.list[clar]
|
||||
clin <- col.list[clin]
|
||||
clox <- col.list[clox]
|
||||
coli <- col.list[coli]
|
||||
czol <- col.list[czol]
|
||||
dapt <- col.list[dapt]
|
||||
doxy <- col.list[doxy]
|
||||
erta <- col.list[erta]
|
||||
eryt <- col.list[eryt]
|
||||
fosf <- col.list[fosf]
|
||||
fusi <- col.list[fusi]
|
||||
gent <- col.list[gent]
|
||||
imip <- col.list[imip]
|
||||
kana <- col.list[kana]
|
||||
levo <- col.list[levo]
|
||||
linc <- col.list[linc]
|
||||
line <- col.list[line]
|
||||
mero <- col.list[mero]
|
||||
metr <- col.list[metr]
|
||||
mino <- col.list[mino]
|
||||
moxi <- col.list[moxi]
|
||||
nali <- col.list[nali]
|
||||
neom <- col.list[neom]
|
||||
neti <- col.list[neti]
|
||||
nitr <- col.list[nitr]
|
||||
novo <- col.list[novo]
|
||||
norf <- col.list[norf]
|
||||
oflo <- col.list[oflo]
|
||||
peni <- col.list[peni]
|
||||
pipe <- col.list[pipe]
|
||||
pita <- col.list[pita]
|
||||
poly <- col.list[poly]
|
||||
qida <- col.list[qida]
|
||||
rifa <- col.list[rifa]
|
||||
roxi <- col.list[roxi]
|
||||
siso <- col.list[siso]
|
||||
teic <- col.list[teic]
|
||||
tetr <- col.list[tetr]
|
||||
tica <- col.list[tica]
|
||||
tige <- col.list[tige]
|
||||
tobr <- col.list[tobr]
|
||||
trim <- col.list[trim]
|
||||
trsu <- col.list[trsu]
|
||||
vanc <- col.list[vanc]
|
||||
|
||||
cols_ab <- get_column_abx(tbl = x,
|
||||
...)
|
||||
|
||||
AMC <- cols_ab['AMC']
|
||||
AMK <- cols_ab['AMK']
|
||||
AMP <- cols_ab['AMP']
|
||||
AMX <- cols_ab['AMX']
|
||||
ATM <- cols_ab['ATM']
|
||||
AZL <- cols_ab['AZL']
|
||||
AZM <- cols_ab['AZM']
|
||||
CAZ <- cols_ab['CAZ']
|
||||
CED <- cols_ab['CED']
|
||||
CHL <- cols_ab['CHL']
|
||||
CIP <- cols_ab['CIP']
|
||||
CLI <- cols_ab['CLI']
|
||||
CLR <- cols_ab['CLR']
|
||||
COL <- cols_ab['COL']
|
||||
CRO <- cols_ab['CRO']
|
||||
CTX <- cols_ab['CTX']
|
||||
CXM <- cols_ab['CXM']
|
||||
CZO <- cols_ab['CZO']
|
||||
DAP <- cols_ab['DAP']
|
||||
DOX <- cols_ab['DOX']
|
||||
ERY <- cols_ab['ERY']
|
||||
ETP <- cols_ab['ETP']
|
||||
FEP <- cols_ab['FEP']
|
||||
FLC <- cols_ab['FLC']
|
||||
FOS <- cols_ab['FOS']
|
||||
FOX <- cols_ab['FOX']
|
||||
FUS <- cols_ab['FUS']
|
||||
GEN <- cols_ab['GEN']
|
||||
IPM <- cols_ab['IPM']
|
||||
KAN <- cols_ab['KAN']
|
||||
LIN <- cols_ab['LIN']
|
||||
LNZ <- cols_ab['LNZ']
|
||||
LVX <- cols_ab['LVX']
|
||||
MEM <- cols_ab['MEM']
|
||||
MEZ <- cols_ab['MEZ']
|
||||
MTR <- cols_ab['MTR']
|
||||
MFX <- cols_ab['MFX']
|
||||
MNO <- cols_ab['MNO']
|
||||
NAL <- cols_ab['NAL']
|
||||
NEO <- cols_ab['NEO']
|
||||
NET <- cols_ab['NET']
|
||||
NIT <- cols_ab['NIT']
|
||||
NOR <- cols_ab['NOR']
|
||||
NOV <- cols_ab['NOV']
|
||||
OFX <- cols_ab['OFX']
|
||||
PEN <- cols_ab['PEN']
|
||||
PIP <- cols_ab['PIP']
|
||||
PLB <- cols_ab['PLB']
|
||||
PRI <- cols_ab['PRI']
|
||||
QDA <- cols_ab['QDA']
|
||||
RID <- cols_ab['RID']
|
||||
RIF <- cols_ab['RIF']
|
||||
RXT <- cols_ab['RXT']
|
||||
SIS <- cols_ab['SIS']
|
||||
SXT <- cols_ab['SXT']
|
||||
TCY <- cols_ab['TCY']
|
||||
TEC <- cols_ab['TEC']
|
||||
TGC <- cols_ab['TGC']
|
||||
TIC <- cols_ab['TIC']
|
||||
TMP <- cols_ab['TMP']
|
||||
TOB <- cols_ab['TOB']
|
||||
TZP <- cols_ab['TZP']
|
||||
VAN <- cols_ab['VAN']
|
||||
|
||||
|
||||
ab_missing <- function(ab) {
|
||||
isTRUE(ab %in% c(NULL, NA)) | length(ab) == 0
|
||||
}
|
||||
|
||||
# antibiotic classes
|
||||
aminoglycosides <- c(tobr, gent) # can also be kana but that one is often intrinsic R
|
||||
cephalosporins <- c(cfep, cfot, cfox, cfra, cfta, cftr, cfur, czol)
|
||||
cephalosporins_3rd <- c(cfot, cftr, cfta)
|
||||
carbapenems <- c(erta, imip, mero)
|
||||
fluoroquinolones <- c(oflo, cipr, levo, moxi)
|
||||
aminoglycosides <- c(TOB, GEN)
|
||||
cephalosporins <- c(FEP, CTX, FOX, CED, CAZ, CRO, CXM, CZO)
|
||||
cephalosporins_3rd <- c(CTX, CRO, CAZ)
|
||||
carbapenems <- c(ETP, IPM, MEM)
|
||||
fluoroquinolones <- c(OFX, CIP, LVX, MFX)
|
||||
|
||||
# helper function for editing the table
|
||||
trans_tbl <- function(to, rows, cols, any_all) {
|
||||
cols <- cols[!ab_missing(cols)]
|
||||
cols <- cols[!is.na(cols)]
|
||||
if (length(rows) > 0 & length(cols) > 0) {
|
||||
if (any_all == "any") {
|
||||
col_filter <- which(tbl[, cols] == 'R')
|
||||
col_filter <- which(tbl_[, cols] == 'R')
|
||||
} else if (any_all == "all") {
|
||||
col_filter <- tbl %>%
|
||||
col_filter <- tbl_ %>%
|
||||
mutate(index = 1:nrow(.)) %>%
|
||||
filter_at(vars(cols), all_vars(. == "R")) %>%
|
||||
pull((index))
|
||||
}
|
||||
rows <- rows[rows %in% col_filter]
|
||||
tbl[rows, 'MDRO'] <<- to
|
||||
tbl_[rows, 'MDRO'] <<- to
|
||||
}
|
||||
}
|
||||
|
||||
tbl <- tbl %>%
|
||||
tbl_ <- tbl_ %>%
|
||||
mutate_at(vars(col_mo), as.mo) %>%
|
||||
# join to microorganisms data set
|
||||
left_join_microorganisms(by = col_mo) %>%
|
||||
@@ -342,64 +218,64 @@ mdro <- function(tbl,
|
||||
# EUCAST ------------------------------------------------------------------
|
||||
# Table 5
|
||||
trans_tbl(3,
|
||||
which(tbl$family == 'Enterobacteriaceae'
|
||||
| tbl$fullname %like% '^Pseudomonas aeruginosa'
|
||||
| tbl$genus == 'Acinetobacter'),
|
||||
coli,
|
||||
which(tbl_$family == 'Enterobacteriaceae'
|
||||
| tbl_$fullname %like% '^Pseudomonas aeruginosa'
|
||||
| tbl_$genus == 'Acinetobacter'),
|
||||
COL,
|
||||
"all")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Salmonella Typhi'),
|
||||
which(tbl_$fullname %like% '^Salmonella Typhi'),
|
||||
c(carbapenems, fluoroquinolones),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Haemophilus influenzae'),
|
||||
which(tbl_$fullname %like% '^Haemophilus influenzae'),
|
||||
c(cephalosporins_3rd, carbapenems, fluoroquinolones),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Moraxella catarrhalis'),
|
||||
which(tbl_$fullname %like% '^Moraxella catarrhalis'),
|
||||
c(cephalosporins_3rd, fluoroquinolones),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Neisseria meningitidis'),
|
||||
which(tbl_$fullname %like% '^Neisseria meningitidis'),
|
||||
c(cephalosporins_3rd, fluoroquinolones),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Neisseria gonorrhoeae'),
|
||||
azit,
|
||||
which(tbl_$fullname %like% '^Neisseria gonorrhoeae'),
|
||||
AZM,
|
||||
"any")
|
||||
# Table 6
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Staphylococcus (aureus|epidermidis|coagulase negatief|hominis|haemolyticus|intermedius|pseudointermedius)'),
|
||||
c(vanc, teic, dapt, line, qida, tige),
|
||||
which(tbl_$fullname %like% '^Staphylococcus (aureus|epidermidis|coagulase negatief|hominis|haemolyticus|intermedius|pseudointermedius)'),
|
||||
c(VAN, TEC, DAP, LNZ, QDA, TGC),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$genus == 'Corynebacterium'),
|
||||
c(vanc, teic, dapt, line, qida, tige),
|
||||
which(tbl_$genus == 'Corynebacterium'),
|
||||
c(VAN, TEC, DAP, LNZ, QDA, TGC),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Streptococcus pneumoniae'),
|
||||
c(carbapenems, vanc, teic, dapt, line, qida, tige, rifa),
|
||||
which(tbl_$fullname %like% '^Streptococcus pneumoniae'),
|
||||
c(carbapenems, VAN, TEC, DAP, LNZ, QDA, TGC, RIF),
|
||||
"any")
|
||||
trans_tbl(3, # Sr. groups A/B/C/G
|
||||
which(tbl$fullname %like% '^Streptococcus (pyogenes|agalactiae|equisimilis|equi|zooepidemicus|dysgalactiae|anginosus)'),
|
||||
c(peni, cephalosporins, vanc, teic, dapt, line, qida, tige),
|
||||
which(tbl_$fullname %like% '^Streptococcus (pyogenes|agalactiae|equisimilis|equi|zooepidemicus|dysgalactiae|anginosus)'),
|
||||
c(PEN, cephalosporins, VAN, TEC, DAP, LNZ, QDA, TGC),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$genus == 'Enterococcus'),
|
||||
c(dapt, line, tige, teic),
|
||||
which(tbl_$genus == 'Enterococcus'),
|
||||
c(DAP, LNZ, TGC, TEC),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Enterococcus faecalis'),
|
||||
c(ampi, amox),
|
||||
which(tbl_$fullname %like% '^Enterococcus faecalis'),
|
||||
c(AMP, AMX),
|
||||
"any")
|
||||
# Table 7
|
||||
trans_tbl(3,
|
||||
which(tbl$genus == 'Bacteroides'),
|
||||
metr,
|
||||
which(tbl_$genus == 'Bacteroides'),
|
||||
MTR,
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Clostridium difficile'),
|
||||
c(metr, vanc),
|
||||
which(tbl_$fullname %like% '^Clostridium difficile'),
|
||||
c( MTR, VAN),
|
||||
"any")
|
||||
}
|
||||
|
||||
@@ -416,68 +292,68 @@ mdro <- function(tbl,
|
||||
|
||||
# Table 1
|
||||
trans_tbl(3,
|
||||
which(tbl$family == 'Enterobacteriaceae'),
|
||||
which(tbl_$family == 'Enterobacteriaceae'),
|
||||
c(aminoglycosides, fluoroquinolones),
|
||||
"all")
|
||||
|
||||
trans_tbl(2,
|
||||
which(tbl$family == 'Enterobacteriaceae'),
|
||||
which(tbl_$family == 'Enterobacteriaceae'),
|
||||
c(carbapenems),
|
||||
"any")
|
||||
|
||||
# Table 2
|
||||
trans_tbl(2,
|
||||
which(tbl$genus == 'Acinetobacter'),
|
||||
which(tbl_$genus == 'Acinetobacter'),
|
||||
c(carbapenems),
|
||||
"any")
|
||||
trans_tbl(3,
|
||||
which(tbl$genus == 'Acinetobacter'),
|
||||
which(tbl_$genus == 'Acinetobacter'),
|
||||
c(aminoglycosides, fluoroquinolones),
|
||||
"all")
|
||||
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% '^Stenotrophomonas maltophilia'),
|
||||
trsu,
|
||||
which(tbl_$fullname %like% '^Stenotrophomonas maltophilia'),
|
||||
SXT,
|
||||
"all")
|
||||
|
||||
if (!ab_missing(mero) & !ab_missing(imip)
|
||||
& !ab_missing(gent) & !ab_missing(tobr)
|
||||
& !ab_missing(cipr)
|
||||
& !ab_missing(cfta)
|
||||
& !ab_missing(pita) ) {
|
||||
tbl <- tbl %>% mutate(
|
||||
if (!ab_missing(MEM) & !ab_missing(IPM)
|
||||
& !ab_missing(GEN) & !ab_missing(TOB)
|
||||
& !ab_missing(CIP)
|
||||
& !ab_missing(CAZ)
|
||||
& !ab_missing(TZP) ) {
|
||||
tbl_ <- tbl_ %>% mutate(
|
||||
psae = 0,
|
||||
psae = ifelse(mero == "R" | imip == "R", psae + 1, psae),
|
||||
psae = ifelse(gent == "R" & tobr == "R", psae + 1, psae),
|
||||
psae = ifelse(cipr == "R", psae + 1, psae),
|
||||
psae = ifelse(cfta == "R", psae + 1, psae),
|
||||
psae = ifelse(pita == "R", psae + 1, psae),
|
||||
psae = ifelse(MEM == "R" | IPM == "R", psae + 1, psae),
|
||||
psae = ifelse(GEN == "R" & TOB == "R", psae + 1, psae),
|
||||
psae = ifelse(CIP == "R", psae + 1, psae),
|
||||
psae = ifelse(CAZ == "R", psae + 1, psae),
|
||||
psae = ifelse(TZP == "R", psae + 1, psae),
|
||||
psae = ifelse(is.na(psae), 0, psae)
|
||||
)
|
||||
} else {
|
||||
tbl$psae <- 0
|
||||
tbl_$psae <- 0
|
||||
}
|
||||
tbl[which(
|
||||
tbl$fullname %like% 'Pseudomonas aeruginosa'
|
||||
& tbl$psae >= 3
|
||||
tbl_[which(
|
||||
tbl_$fullname %like% 'Pseudomonas aeruginosa'
|
||||
& tbl_$psae >= 3
|
||||
), 'MDRO'] <- 3
|
||||
|
||||
# Table 3
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% 'Streptococcus pneumoniae'),
|
||||
peni,
|
||||
which(tbl_$fullname %like% 'Streptococcus pneumoniae'),
|
||||
PEN,
|
||||
"all")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% 'Streptococcus pneumoniae'),
|
||||
vanc,
|
||||
which(tbl_$fullname %like% 'Streptococcus pneumoniae'),
|
||||
VAN,
|
||||
"all")
|
||||
trans_tbl(3,
|
||||
which(tbl$fullname %like% 'Enterococcus faecium'),
|
||||
c(peni, vanc),
|
||||
which(tbl_$fullname %like% 'Enterococcus faecium'),
|
||||
c(PEN, VAN),
|
||||
"all")
|
||||
}
|
||||
|
||||
factor(x = tbl$MDRO,
|
||||
factor(x = tbl_$MDRO,
|
||||
levels = 1:3,
|
||||
labels = c('Negative', 'Positive, unconfirmed', 'Positive'),
|
||||
ordered = TRUE)
|
||||
@@ -491,12 +367,61 @@ brmo <- function(..., country = "nl") {
|
||||
|
||||
#' @rdname mdro
|
||||
#' @export
|
||||
mrgn <- function(tbl, country = "de", ...) {
|
||||
mdro(tbl = tbl, country = "de", ...)
|
||||
mrgn <- function(x, country = "de", ...) {
|
||||
mdro(x = x, country = "de", ...)
|
||||
}
|
||||
|
||||
#' @rdname mdro
|
||||
#' @export
|
||||
eucast_exceptional_phenotypes <- function(tbl, country = "EUCAST", ...) {
|
||||
mdro(tbl = tbl, country = "EUCAST", ...)
|
||||
eucast_exceptional_phenotypes <- function(x, country = "EUCAST", ...) {
|
||||
mdro(x = x, country = "EUCAST", ...)
|
||||
}
|
||||
|
||||
is_ESBL <- function(x, col_mo = NULL, ...) {
|
||||
col_mo <- get_column_mo(tbl = x, col_mo = col_mo)
|
||||
cols_ab <- get_column_abx(tbl = x,
|
||||
soft_dependencies = c("AMX", "AMP"),
|
||||
hard_dependencies = c("CAZ"),
|
||||
...)
|
||||
|
||||
if (!any(c("AMX", "AMP") %in% names(cols_ab))) {
|
||||
# both ampicillin and amoxicillin are missing
|
||||
generate_warning_abs_missing(c("AMX", "AMP"), any = TRUE)
|
||||
return(rep(NA, nrow(x)))
|
||||
}
|
||||
|
||||
ESBLs <- rep(NA, nrow(x))
|
||||
|
||||
# first make all eligible cases FALSE
|
||||
ESBLs[which(mo_family(x[, col_mo]) == "Enterobacteriaceae"
|
||||
& x[, get_ab_col(cols_ab, "AMX")] %in% c("R", "I", "S")
|
||||
& x[, get_ab_col(cols_ab, "AMX")] %in% c("R", "I", "S")
|
||||
& x[, get_ab_col(cols_ab, "AMX")] %in% c("R", "I", "S")
|
||||
)] <- FALSE
|
||||
# now make the positives cases TRUE
|
||||
ESBLs[which(!is.na(ESBLs)
|
||||
& x[, get_ab_col(cols_ab, "AMX")] == "R"
|
||||
& x[, get_ab_col(cols_ab, "CAZ")] == "R")] <- TRUE
|
||||
ESBLs
|
||||
|
||||
}
|
||||
|
||||
is_3MRGN <- function(x, ...) {
|
||||
|
||||
}
|
||||
|
||||
is_4MRGN <- function(x, ...) {
|
||||
|
||||
}
|
||||
|
||||
get_column_mo <- function(tbl, col_mo = NULL) {
|
||||
# throws a blue note about which column will be used if guessed
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(tbl = tbl, type = "mo")
|
||||
}
|
||||
if (is.null(col_mo)) {
|
||||
stop("`col_mo` must be set.", call. = FALSE)
|
||||
}
|
||||
col_mo
|
||||
}
|
||||
|
||||
|
||||
24
R/mic.R
@@ -25,6 +25,7 @@
|
||||
#' @rdname as.mic
|
||||
#' @param x vector
|
||||
#' @param na.rm a logical indicating whether missing values should be removed
|
||||
#' @details Interpret MIC values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI.
|
||||
#' @return Ordered factor with new class \code{mic}
|
||||
#' @keywords mic
|
||||
#' @export
|
||||
@@ -38,6 +39,16 @@
|
||||
#' # this can also coerce combined MIC/RSI values:
|
||||
#' as.mic("<=0.002; S") # will return <=0.002
|
||||
#'
|
||||
#' # interpret MIC values
|
||||
#' as.rsi(x = as.mic(2),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#' as.rsi(x = as.mic(4),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#'
|
||||
#' plot(mic_data)
|
||||
#' barplot(mic_data)
|
||||
#' freq(mic_data)
|
||||
@@ -71,11 +82,12 @@ as.mic <- function(x, na.rm = FALSE) {
|
||||
# force to be character
|
||||
x <- as.character(x)
|
||||
|
||||
# previously unempty values now empty - should return a warning later on
|
||||
## previously unempty values now empty - should return a warning later on
|
||||
x[x.bak != "" & x == ""] <- "invalid"
|
||||
|
||||
# these are alllowed MIC values and will become factor levels
|
||||
lvls <- c("<0.002", "<=0.002", "0.002", ">=0.002", ">0.002",
|
||||
# these are allowed MIC values and will become factor levels
|
||||
lvls <- c("<0.001", "<=0.001", "0.001", ">=0.001", ">0.001",
|
||||
"<0.002", "<=0.002", "0.002", ">=0.002", ">0.002",
|
||||
"<0.003", "<=0.003", "0.003", ">=0.003", ">0.003",
|
||||
"<0.004", "<=0.004", "0.004", ">=0.004", ">0.004",
|
||||
"<0.006", "<=0.006", "0.006", ">=0.006", ">0.006",
|
||||
@@ -134,11 +146,15 @@ as.mic <- function(x, na.rm = FALSE) {
|
||||
"<80", "<=80", "80", ">=80", ">80",
|
||||
"<96", "<=96", "96", ">=96", ">96",
|
||||
"<128", "<=128", "128", ">=128", ">128",
|
||||
"129",
|
||||
"<160", "<=160", "160", ">=160", ">160",
|
||||
"<256", "<=256", "256", ">=256", ">256",
|
||||
"257",
|
||||
"<320", "<=320", "320", ">=320", ">320",
|
||||
"<512", "<=512", "512", ">=512", ">512",
|
||||
"<1024", "<=1024", "1024", ">=1024", ">1024")
|
||||
"513",
|
||||
"<1024", "<=1024", "1024", ">=1024", ">1024",
|
||||
"1025")
|
||||
|
||||
na_before <- x[is.na(x) | x == ''] %>% length()
|
||||
x[!x %in% lvls] <- NA
|
||||
|
||||
322
R/misc.R
@@ -30,7 +30,8 @@ addin_insert_like <- function() {
|
||||
}
|
||||
|
||||
# No export, no Rd
|
||||
# works exactly like round(), but rounds `round(44.55, 1)` as 44.6 instead of 44.5 and adds decimal zeroes until `digits` is reached
|
||||
# works exactly like round(), but rounds `round(44.55, 1)` as 44.6 instead of 44.5
|
||||
# and adds decimal zeroes until `digits` is reached when force_zero = TRUE
|
||||
round2 <- function(x, digits = 0, force_zero = TRUE) {
|
||||
# https://stackoverflow.com/a/12688836/4575331
|
||||
val <- (trunc((abs(x) * 10 ^ digits) + 0.5) / 10 ^ digits) * sign(x)
|
||||
@@ -41,62 +42,6 @@ round2 <- function(x, digits = 0, force_zero = TRUE) {
|
||||
val
|
||||
}
|
||||
|
||||
# No export, no Rd
|
||||
percent <- function(x, round = 1, force_zero = FALSE, decimal.mark = getOption("OutDec"), ...) {
|
||||
|
||||
decimal.mark.options <- getOption("OutDec")
|
||||
options(OutDec = ".")
|
||||
|
||||
val <- round2(x, round + 2, force_zero = FALSE) # round up 0.5
|
||||
val <- round(x = val * 100, digits = round) # remove floating point error
|
||||
|
||||
if (force_zero == TRUE) {
|
||||
if (any(val == as.integer(val) & !is.na(val))) {
|
||||
# add zeroes to all integers
|
||||
val[val == as.integer(as.character(val))] <- paste0(val[val == as.integer(val)], ".", strrep(0, round))
|
||||
}
|
||||
# add extra zeroes if needed
|
||||
val_decimals <- nchar(gsub(".*[.](.*)", "\\1", as.character(val)))
|
||||
val[val_decimals < round] <- paste0(val[val_decimals < round], strrep(0, max(0, round - val_decimals)))
|
||||
}
|
||||
pct <- base::paste0(val, "%")
|
||||
pct[pct %in% c("NA%", "NaN%")] <- NA_character_
|
||||
if (decimal.mark != ".") {
|
||||
pct <- gsub(".", decimal.mark, pct, fixed = TRUE)
|
||||
}
|
||||
options(OutDec = decimal.mark.options)
|
||||
pct
|
||||
}
|
||||
|
||||
check_available_columns <- function(tbl, col.list, info = TRUE) {
|
||||
# check columns
|
||||
col.list <- col.list[!is.na(col.list) & !is.null(col.list)]
|
||||
names(col.list) <- col.list
|
||||
col.list.bak <- col.list
|
||||
# are they available as upper case or lower case then?
|
||||
for (i in 1:length(col.list)) {
|
||||
if (is.null(col.list[i]) | isTRUE(is.na(col.list[i]))) {
|
||||
col.list[i] <- NA
|
||||
} else if (toupper(col.list[i]) %in% colnames(tbl)) {
|
||||
col.list[i] <- toupper(col.list[i])
|
||||
} else if (tolower(col.list[i]) %in% colnames(tbl)) {
|
||||
col.list[i] <- tolower(col.list[i])
|
||||
} else if (!col.list[i] %in% colnames(tbl)) {
|
||||
col.list[i] <- NA
|
||||
}
|
||||
}
|
||||
if (!all(col.list %in% colnames(tbl))) {
|
||||
if (info == TRUE) {
|
||||
warning('Some columns do not exist and will be ignored: ',
|
||||
col.list.bak[!(col.list %in% colnames(tbl))] %>% toString(),
|
||||
'.\nTHIS MAY STRONGLY INFLUENCE THE OUTCOME.',
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
}
|
||||
col.list
|
||||
}
|
||||
|
||||
# Coefficient of variation (CV)
|
||||
cv <- function(x, na.rm = TRUE) {
|
||||
stats::sd(x, na.rm = na.rm) / base::abs(base::mean(x, na.rm = na.rm))
|
||||
@@ -126,6 +71,20 @@ size_humanreadable <- function(bytes, decimals = 1) {
|
||||
out
|
||||
}
|
||||
|
||||
percent_scales <- scales::percent
|
||||
# No export, no Rd
|
||||
# based on scales::percent
|
||||
percent <- function(x, round = 1, force_zero = FALSE, decimal.mark = getOption("OutDec"), ...) {
|
||||
x <- percent_scales(x = as.double(x),
|
||||
accuracy = 1 / 10 ^ round,
|
||||
decimal.mark = decimal.mark,
|
||||
...)
|
||||
if (force_zero == FALSE) {
|
||||
x <- gsub("([.]%|%%)", "%", paste0(gsub("0+%$", "", x), "%"))
|
||||
}
|
||||
x
|
||||
}
|
||||
|
||||
#' @importFrom crayon blue bold red
|
||||
#' @importFrom dplyr %>% pull
|
||||
search_type_in_df <- function(tbl, type) {
|
||||
@@ -195,8 +154,257 @@ search_type_in_df <- function(tbl, type) {
|
||||
found
|
||||
}
|
||||
|
||||
get_ab_col <- function(columns, ab) {
|
||||
columns[names(columns) == ab]
|
||||
}
|
||||
|
||||
get_column_abx <- function(tbl,
|
||||
soft_dependencies = NULL,
|
||||
hard_dependencies = NULL,
|
||||
verbose = FALSE,
|
||||
AMC = guess_ab_col(),
|
||||
AMK = guess_ab_col(),
|
||||
AMX = guess_ab_col(),
|
||||
AMP = guess_ab_col(),
|
||||
AZM = guess_ab_col(),
|
||||
AZL = guess_ab_col(),
|
||||
ATM = guess_ab_col(),
|
||||
RID = guess_ab_col(),
|
||||
FEP = guess_ab_col(),
|
||||
CTX = guess_ab_col(),
|
||||
FOX = guess_ab_col(),
|
||||
CED = guess_ab_col(),
|
||||
CAZ = guess_ab_col(),
|
||||
CRO = guess_ab_col(),
|
||||
CXM = guess_ab_col(),
|
||||
CHL = guess_ab_col(),
|
||||
CIP = guess_ab_col(),
|
||||
CLR = guess_ab_col(),
|
||||
CLI = guess_ab_col(),
|
||||
FLC = guess_ab_col(),
|
||||
COL = guess_ab_col(),
|
||||
CZO = guess_ab_col(),
|
||||
DAP = guess_ab_col(),
|
||||
DOX = guess_ab_col(),
|
||||
ETP = guess_ab_col(),
|
||||
ERY = guess_ab_col(),
|
||||
FOS = guess_ab_col(),
|
||||
FUS = guess_ab_col(),
|
||||
GEN = guess_ab_col(),
|
||||
IPM = guess_ab_col(),
|
||||
KAN = guess_ab_col(),
|
||||
LVX = guess_ab_col(),
|
||||
LIN = guess_ab_col(),
|
||||
LNZ = guess_ab_col(),
|
||||
MEM = guess_ab_col(),
|
||||
MTR = guess_ab_col(),
|
||||
MEZ = guess_ab_col(),
|
||||
MNO = guess_ab_col(),
|
||||
MFX = guess_ab_col(),
|
||||
NAL = guess_ab_col(),
|
||||
NEO = guess_ab_col(),
|
||||
NET = guess_ab_col(),
|
||||
NIT = guess_ab_col(),
|
||||
NOR = guess_ab_col(),
|
||||
NOV = guess_ab_col(),
|
||||
OFX = guess_ab_col(),
|
||||
OXA = guess_ab_col(),
|
||||
PEN = guess_ab_col(),
|
||||
PIP = guess_ab_col(),
|
||||
TZP = guess_ab_col(),
|
||||
PLB = guess_ab_col(),
|
||||
PRI = guess_ab_col(),
|
||||
QDA = guess_ab_col(),
|
||||
RIF = guess_ab_col(),
|
||||
RXT = guess_ab_col(),
|
||||
SIS = guess_ab_col(),
|
||||
TEC = guess_ab_col(),
|
||||
TCY = guess_ab_col(),
|
||||
TIC = guess_ab_col(),
|
||||
TGC = guess_ab_col(),
|
||||
TOB = guess_ab_col(),
|
||||
TMP = guess_ab_col(),
|
||||
SXT = guess_ab_col(),
|
||||
VAN = guess_ab_col()) {
|
||||
# check columns
|
||||
if (identical(AMC, as.name("guess_ab_col"))) AMC <- guess_ab_col(tbl, "AMC", verbose = verbose)
|
||||
if (identical(AMK, as.name("guess_ab_col"))) AMK <- guess_ab_col(tbl, "AMK", verbose = verbose)
|
||||
if (identical(AMX, as.name("guess_ab_col"))) AMX <- guess_ab_col(tbl, "AMX", verbose = verbose)
|
||||
if (identical(AMP, as.name("guess_ab_col"))) AMP <- guess_ab_col(tbl, "AMP", verbose = verbose)
|
||||
if (identical(AZM, as.name("guess_ab_col"))) AZM <- guess_ab_col(tbl, "AZM", verbose = verbose)
|
||||
if (identical(AZL, as.name("guess_ab_col"))) AZL <- guess_ab_col(tbl, "AZL", verbose = verbose)
|
||||
if (identical(ATM, as.name("guess_ab_col"))) ATM <- guess_ab_col(tbl, "ATM", verbose = verbose)
|
||||
if (identical(RID, as.name("guess_ab_col"))) RID <- guess_ab_col(tbl, "RID", verbose = verbose)
|
||||
if (identical(FEP, as.name("guess_ab_col"))) FEP <- guess_ab_col(tbl, "FEP", verbose = verbose)
|
||||
if (identical(CTX, as.name("guess_ab_col"))) CTX <- guess_ab_col(tbl, "CTX", verbose = verbose)
|
||||
if (identical(FOX, as.name("guess_ab_col"))) FOX <- guess_ab_col(tbl, "FOX", verbose = verbose)
|
||||
if (identical(CED, as.name("guess_ab_col"))) CED <- guess_ab_col(tbl, "CED", verbose = verbose)
|
||||
if (identical(CAZ, as.name("guess_ab_col"))) CAZ <- guess_ab_col(tbl, "CAZ", verbose = verbose)
|
||||
if (identical(CRO, as.name("guess_ab_col"))) CRO <- guess_ab_col(tbl, "CRO", verbose = verbose)
|
||||
if (identical(CXM, as.name("guess_ab_col"))) CXM <- guess_ab_col(tbl, "CXM", verbose = verbose)
|
||||
if (identical(CHL, as.name("guess_ab_col"))) CHL <- guess_ab_col(tbl, "CHL", verbose = verbose)
|
||||
if (identical(CIP, as.name("guess_ab_col"))) CIP <- guess_ab_col(tbl, "CIP", verbose = verbose)
|
||||
if (identical(CLR, as.name("guess_ab_col"))) CLR <- guess_ab_col(tbl, "CLR", verbose = verbose)
|
||||
if (identical(CLI, as.name("guess_ab_col"))) CLI <- guess_ab_col(tbl, "CLI", verbose = verbose)
|
||||
if (identical(FLC, as.name("guess_ab_col"))) FLC <- guess_ab_col(tbl, "FLC", verbose = verbose)
|
||||
if (identical(COL, as.name("guess_ab_col"))) COL <- guess_ab_col(tbl, "COL", verbose = verbose)
|
||||
if (identical(CZO, as.name("guess_ab_col"))) CZO <- guess_ab_col(tbl, "CZO", verbose = verbose)
|
||||
if (identical(DAP, as.name("guess_ab_col"))) DAP <- guess_ab_col(tbl, "DAP", verbose = verbose)
|
||||
if (identical(DOX, as.name("guess_ab_col"))) DOX <- guess_ab_col(tbl, "DOX", verbose = verbose)
|
||||
if (identical(ETP, as.name("guess_ab_col"))) ETP <- guess_ab_col(tbl, "ETP", verbose = verbose)
|
||||
if (identical(ERY, as.name("guess_ab_col"))) ERY <- guess_ab_col(tbl, "ERY", verbose = verbose)
|
||||
if (identical(FOS, as.name("guess_ab_col"))) FOS <- guess_ab_col(tbl, "FOS", verbose = verbose)
|
||||
if (identical(FUS, as.name("guess_ab_col"))) FUS <- guess_ab_col(tbl, "FUS", verbose = verbose)
|
||||
if (identical(GEN, as.name("guess_ab_col"))) GEN <- guess_ab_col(tbl, "GEN", verbose = verbose)
|
||||
if (identical(IPM, as.name("guess_ab_col"))) IPM <- guess_ab_col(tbl, "IPM", verbose = verbose)
|
||||
if (identical(KAN, as.name("guess_ab_col"))) KAN <- guess_ab_col(tbl, "KAN", verbose = verbose)
|
||||
if (identical(LVX, as.name("guess_ab_col"))) LVX <- guess_ab_col(tbl, "LVX", verbose = verbose)
|
||||
if (identical(LIN, as.name("guess_ab_col"))) LIN <- guess_ab_col(tbl, "LIN", verbose = verbose)
|
||||
if (identical(LNZ, as.name("guess_ab_col"))) LNZ <- guess_ab_col(tbl, "LNZ", verbose = verbose)
|
||||
if (identical(MEM, as.name("guess_ab_col"))) MEM <- guess_ab_col(tbl, "MEM", verbose = verbose)
|
||||
if (identical(MTR, as.name("guess_ab_col"))) MTR <- guess_ab_col(tbl, "MTR", verbose = verbose)
|
||||
if (identical(MEZ, as.name("guess_ab_col"))) MEZ <- guess_ab_col(tbl, "MEZ", verbose = verbose)
|
||||
if (identical(MNO, as.name("guess_ab_col"))) MNO <- guess_ab_col(tbl, "MNO", verbose = verbose)
|
||||
if (identical(MFX, as.name("guess_ab_col"))) MFX <- guess_ab_col(tbl, "MFX", verbose = verbose)
|
||||
if (identical(NAL, as.name("guess_ab_col"))) NAL <- guess_ab_col(tbl, "NAL", verbose = verbose)
|
||||
if (identical(NEO, as.name("guess_ab_col"))) NEO <- guess_ab_col(tbl, "NEO", verbose = verbose)
|
||||
if (identical(NET, as.name("guess_ab_col"))) NET <- guess_ab_col(tbl, "NET", verbose = verbose)
|
||||
if (identical(NIT, as.name("guess_ab_col"))) NIT <- guess_ab_col(tbl, "NIT", verbose = verbose)
|
||||
if (identical(NOR, as.name("guess_ab_col"))) NOR <- guess_ab_col(tbl, "NOR", verbose = verbose)
|
||||
if (identical(NOV, as.name("guess_ab_col"))) NOV <- guess_ab_col(tbl, "NOV", verbose = verbose)
|
||||
if (identical(OFX, as.name("guess_ab_col"))) OFX <- guess_ab_col(tbl, "OFX", verbose = verbose)
|
||||
if (identical(OXA, as.name("guess_ab_col"))) OXA <- guess_ab_col(tbl, "OXA", verbose = verbose)
|
||||
if (identical(PEN, as.name("guess_ab_col"))) PEN <- guess_ab_col(tbl, "PEN", verbose = verbose)
|
||||
if (identical(PIP, as.name("guess_ab_col"))) PIP <- guess_ab_col(tbl, "PIP", verbose = verbose)
|
||||
if (identical(TZP, as.name("guess_ab_col"))) TZP <- guess_ab_col(tbl, "TZP", verbose = verbose)
|
||||
if (identical(PLB, as.name("guess_ab_col"))) PLB <- guess_ab_col(tbl, "PLB", verbose = verbose)
|
||||
if (identical(PRI, as.name("guess_ab_col"))) PRI <- guess_ab_col(tbl, "PRI", verbose = verbose)
|
||||
if (identical(QDA, as.name("guess_ab_col"))) QDA <- guess_ab_col(tbl, "QDA", verbose = verbose)
|
||||
if (identical(RIF, as.name("guess_ab_col"))) RIF <- guess_ab_col(tbl, "RIF", verbose = verbose)
|
||||
if (identical(RXT, as.name("guess_ab_col"))) RXT <- guess_ab_col(tbl, "RXT", verbose = verbose)
|
||||
if (identical(SIS, as.name("guess_ab_col"))) SIS <- guess_ab_col(tbl, "SIS", verbose = verbose)
|
||||
if (identical(TEC, as.name("guess_ab_col"))) TEC <- guess_ab_col(tbl, "TEC", verbose = verbose)
|
||||
if (identical(TCY, as.name("guess_ab_col"))) TCY <- guess_ab_col(tbl, "TCY", verbose = verbose)
|
||||
if (identical(TIC, as.name("guess_ab_col"))) TIC <- guess_ab_col(tbl, "TIC", verbose = verbose)
|
||||
if (identical(TGC, as.name("guess_ab_col"))) TGC <- guess_ab_col(tbl, "TGC", verbose = verbose)
|
||||
if (identical(TOB, as.name("guess_ab_col"))) TOB <- guess_ab_col(tbl, "TOB", verbose = verbose)
|
||||
if (identical(TMP, as.name("guess_ab_col"))) TMP <- guess_ab_col(tbl, "TMP", verbose = verbose)
|
||||
if (identical(SXT, as.name("guess_ab_col"))) SXT <- guess_ab_col(tbl, "SXT", verbose = verbose)
|
||||
if (identical(VAN, as.name("guess_ab_col"))) VAN <- guess_ab_col(tbl, "VAN", verbose = verbose)
|
||||
columns_available <- c(AMC = AMC, AMK = AMK, AMX = AMX, AMP = AMP, AZM = AZM,
|
||||
AZL = AZL, ATM = ATM, RID = RID, FEP = FEP, CTX = CTX,
|
||||
FOX = FOX, CED = CED, CAZ = CAZ, CRO = CRO, CXM = CXM,
|
||||
CHL = CHL, CIP = CIP, CLR = CLR, CLI = CLI, FLC = FLC,
|
||||
COL = COL, CZO = CZO, DAP = DAP, DOX = DOX, ETP = ETP,
|
||||
ERY = ERY, FOS = FOS, FUS = FUS, GEN = GEN, IPM = IPM,
|
||||
KAN = KAN, LVX = LVX, LIN = LIN, LNZ = LNZ, MEM = MEM,
|
||||
MTR = MTR, MEZ = MEZ, MNO = MNO, MFX = MFX, NAL = NAL,
|
||||
NEO = NEO, NET = NET, NIT = NIT, NOR = NOR, NOV = NOV,
|
||||
OFX = OFX, OXA = OXA, PEN = PEN, PIP = PIP, TZP = TZP,
|
||||
PLB = PLB, PRI = PRI, QDA = QDA, RIF = RIF, RXT = RXT,
|
||||
SIS = SIS, TEC = TEC, TCY = TCY, TIC = TIC, TGC = TGC,
|
||||
TOB = TOB, TMP = TMP, SXT = SXT, VAN = VAN)
|
||||
|
||||
if (!is.null(hard_dependencies)) {
|
||||
if (!all(hard_dependencies %in% names(columns_available))) {
|
||||
# missing a hard dependency will return NA and consequently the data will not be analysed
|
||||
missing <- hard_dependencies[!hard_dependencies %in% names(columns_available)]
|
||||
generate_warning_abs_missing(missing, any = FALSE)
|
||||
return(NA)
|
||||
}
|
||||
}
|
||||
if (!is.null(soft_dependencies)) {
|
||||
if (!all(soft_dependencies %in% names(columns_available))) {
|
||||
# missing a soft dependency may lower the reliability
|
||||
missing <- soft_dependencies[!soft_dependencies %in% names(columns_available)]
|
||||
missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")")
|
||||
warning('Reliability might be improved if these antimicrobial results would be available too: ', paste(missing, collapse = ", "),
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
}
|
||||
#deps <- c(soft_dependencies, hard_dependencies)
|
||||
#if (length(deps) > 0) {
|
||||
# columns_available[names(columns_available) %in% deps]
|
||||
#} else {
|
||||
columns_available
|
||||
#}
|
||||
}
|
||||
|
||||
generate_warning_abs_missing <- function(missing, any = FALSE) {
|
||||
missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")")
|
||||
if (any == TRUE) {
|
||||
any_txt <- c(" any of", "is")
|
||||
} else {
|
||||
any_txt <- c("", "are")
|
||||
}
|
||||
warning(paste0("Introducing NAs since", any_txt[1], " these antimicrobials ", any_txt[2], " required: ",
|
||||
paste(missing, collapse = ", ")),
|
||||
immediate. = TRUE,
|
||||
call. = FALSE)
|
||||
}
|
||||
|
||||
|
||||
stopifnot_installed_package <- function(package) {
|
||||
if (!package %in% base::rownames(utils::installed.packages())) {
|
||||
stop("this function requires the ", package, " package.", call. = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
# translate strings based on inst/translations.tsv
|
||||
#' @importFrom dplyr %>% filter
|
||||
t <- function(from, language = get_locale()) {
|
||||
# if (getOption("AMR_locale", "en") != language) {
|
||||
# language <- getOption("AMR_locale", "en")
|
||||
# }
|
||||
|
||||
if (is.null(language)) {
|
||||
return(from)
|
||||
}
|
||||
if (language %in% c("en", "")) {
|
||||
return(from)
|
||||
}
|
||||
|
||||
df_trans <- utils::read.table(file = system.file("translations.tsv", package = "AMR"),
|
||||
sep = "\t",
|
||||
stringsAsFactors = FALSE,
|
||||
header = TRUE,
|
||||
blank.lines.skip = TRUE,
|
||||
fill = TRUE,
|
||||
strip.white = TRUE,
|
||||
encoding = "UTF-8",
|
||||
fileEncoding = "UTF-8",
|
||||
na.strings = c(NA, "", NULL))
|
||||
|
||||
if (!language %in% df_trans$lang) {
|
||||
stop("Unsupported language: '", language, "' - use one of: ",
|
||||
paste0("'", sort(unique(df_trans$lang)), "'", collapse = ", "),
|
||||
call. = FALSE)
|
||||
}
|
||||
|
||||
df_trans <- df_trans %>% filter(lang == language)
|
||||
|
||||
# default case sensitive if value if 'ignore.case' is missing:
|
||||
df_trans$ignore.case[is.na(df_trans$ignore.case)] <- FALSE
|
||||
# default not using regular expressions (fixed = TRUE) if 'fixed' is missing:
|
||||
df_trans$fixed[is.na(df_trans$fixed)] <- TRUE
|
||||
|
||||
# check if text to look for is in one of the patterns
|
||||
pattern_total <- tryCatch(paste0("(", paste(df_trans$pattern, collapse = "|"), ")"),
|
||||
error = "")
|
||||
if (NROW(df_trans) == 0 | !any(from %like% pattern_total)) {
|
||||
return(from)
|
||||
}
|
||||
|
||||
for (i in 1:nrow(df_trans)) {
|
||||
from <- gsub(x = from,
|
||||
pattern = df_trans$pattern[i],
|
||||
replacement = df_trans$replacement[i],
|
||||
fixed = df_trans$fixed[i],
|
||||
ignore.case = df_trans$ignore.case[i])
|
||||
}
|
||||
|
||||
# force UTF-8 for diacritics
|
||||
base::enc2utf8(from)
|
||||
|
||||
}
|
||||
|
||||
16
R/mo.R
@@ -126,7 +126,7 @@
|
||||
#' @section Source:
|
||||
#' [1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870–926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
|
||||
#'
|
||||
#' [2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).}. 2019. Clin Microbiol Infect. 2019 Mar 11. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
|
||||
#' [2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
|
||||
#'
|
||||
#' [3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 571–95. \url{https://dx.doi.org/10.1084/jem.57.4.571}
|
||||
#'
|
||||
@@ -195,6 +195,8 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE,
|
||||
# check onLoad() in R/zzz.R: data tables are created there.
|
||||
}
|
||||
|
||||
x[x == ""] <- NA_character_
|
||||
|
||||
uncertainty_level <- translate_allow_uncertain(allow_uncertain)
|
||||
mo_hist <- get_mo_history(x, uncertainty_level, force = isTRUE(list(...)$force_mo_history))
|
||||
|
||||
@@ -261,7 +263,8 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE,
|
||||
y <- mo_validate(x = x, property = "mo",
|
||||
Becker = Becker, Lancefield = Lancefield,
|
||||
allow_uncertain = uncertainty_level, reference_df = reference_df,
|
||||
force_mo_history = isTRUE(list(...)$force_mo_history))
|
||||
force_mo_history = isTRUE(list(...)$force_mo_history),
|
||||
...)
|
||||
}
|
||||
|
||||
|
||||
@@ -296,6 +299,8 @@ exec_as.mo <- function(x,
|
||||
# check onLoad() in R/zzz.R: data tables are created there.
|
||||
}
|
||||
|
||||
x[x == ""] <- NA_character_
|
||||
|
||||
if (initial_search == TRUE) {
|
||||
options(mo_failures = NULL)
|
||||
options(mo_uncertainties = NULL)
|
||||
@@ -548,7 +553,9 @@ exec_as.mo <- function(x,
|
||||
next
|
||||
}
|
||||
|
||||
if (nchar(gsub("[^a-zA-Z]", "", x_trimmed[i])) < 3) {
|
||||
# check for very small input, but ignore the O antigens of E. coli
|
||||
if (nchar(gsub("[^a-zA-Z]", "", x_trimmed[i])) < 3
|
||||
& !x_backup_without_spp[i] %like% "O?(26|103|104|104|111|121|145|157)") {
|
||||
# check if search term was like "A. species", then return first genus found with ^A
|
||||
if (x_backup[i] %like% "[a-z]+ species" | x_backup[i] %like% "[a-z] spp[.]?") {
|
||||
# get mo code of first hit
|
||||
@@ -609,7 +616,8 @@ exec_as.mo <- function(x,
|
||||
}
|
||||
next
|
||||
}
|
||||
if (toupper(x_backup_without_spp[i]) %in% c("EHEC", "EPEC", "EIEC", "STEC", "ATEC")) {
|
||||
if (toupper(x_backup_without_spp[i]) %in% c("EHEC", "EPEC", "EIEC", "STEC", "ATEC")
|
||||
| x_backup_without_spp[i] %like% "O?(26|103|104|104|111|121|145|157)") {
|
||||
x[i] <- microorganismsDT[mo == 'B_ESCHR_COL', ..property][[1]][1L]
|
||||
if (initial_search == TRUE) {
|
||||
set_mo_history(x_backup[i], get_mo_code(x[i], property), 0, force = force_mo_history)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
# print successful as.mo coercions to AMR environment
|
||||
#' @importFrom dplyr %>% distinct filter
|
||||
set_mo_history <- function(x, mo, uncertainty_level, force = FALSE) {
|
||||
# disable function
|
||||
# disable function for now
|
||||
return(base::invisible())
|
||||
|
||||
# if (base::interactive() | force == TRUE) {
|
||||
@@ -58,7 +58,7 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE) {
|
||||
}
|
||||
|
||||
get_mo_history <- function(x, uncertainty_level, force = FALSE) {
|
||||
# disable function
|
||||
# disable function for now
|
||||
return(NA)
|
||||
|
||||
# history <- read_mo_history(uncertainty_level = uncertainty_level, force = force)
|
||||
@@ -73,7 +73,7 @@ get_mo_history <- function(x, uncertainty_level, force = FALSE) {
|
||||
|
||||
#' @importFrom dplyr %>% filter distinct
|
||||
read_mo_history <- function(uncertainty_level = 2, force = FALSE, unfiltered = FALSE) {
|
||||
# disable function
|
||||
# disable function for now
|
||||
return(NULL)
|
||||
|
||||
# if ((!base::interactive() & force == FALSE)) {
|
||||
|
||||
246
R/mo_property.R
@@ -36,8 +36,9 @@
|
||||
#'
|
||||
#' The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
|
||||
#'
|
||||
#' All output will be \link{translate}d where possible.
|
||||
#'
|
||||
#' The function \code{mo_url()} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
|
||||
#' @inheritSection get_locale Supported languages
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @inheritSection as.mo Source
|
||||
#' @rdname mo_property
|
||||
@@ -70,7 +71,7 @@
|
||||
#' mo_gramstain("E. coli") # "Gram negative"
|
||||
#' mo_type("E. coli") # "Bacteria" (equal to kingdom)
|
||||
#' mo_rank("E. coli") # "species"
|
||||
#' mo_url("E. coli") # get the direct url to the Catalogue of Life
|
||||
#' mo_url("E. coli") # get the direct url to the online database entry
|
||||
#'
|
||||
#' ## scientific reference
|
||||
#' mo_ref("E. coli") # "Castellani et al., 1919"
|
||||
@@ -128,11 +129,11 @@
|
||||
#' language = "nl") # "Streptococcus groep A"
|
||||
#'
|
||||
#'
|
||||
#' # get a list with the complete taxonomy (kingdom to subspecies)
|
||||
#' # get a list with the complete taxonomy (from kingdom to subspecies)
|
||||
#' mo_taxonomy("E. coli")
|
||||
mo_fullname <- function(x, language = get_locale(), ...) {
|
||||
x <- mo_validate(x = x, property = "fullname", ...)
|
||||
mo_translate(x, language = language)
|
||||
t(x, language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
@@ -199,49 +200,49 @@ mo_shortname <- function(x, language = get_locale(), ...) {
|
||||
}
|
||||
}
|
||||
|
||||
mo_translate(result, language = language)
|
||||
t(result, language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_subspecies <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "subspecies", ...), language = language)
|
||||
t(mo_validate(x = x, property = "subspecies", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_species <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "species", ...), language = language)
|
||||
t(mo_validate(x = x, property = "species", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_genus <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "genus", ...), language = language)
|
||||
t(mo_validate(x = x, property = "genus", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_family <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "family", ...), language = language)
|
||||
t(mo_validate(x = x, property = "family", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_order <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "order", ...), language = language)
|
||||
t(mo_validate(x = x, property = "order", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_class <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "class", ...), language = language)
|
||||
t(mo_validate(x = x, property = "class", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_phylum <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "phylum", ...), language = language)
|
||||
t(mo_validate(x = x, property = "phylum", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
@@ -250,10 +251,10 @@ mo_kingdom <- function(x, language = get_locale(), ...) {
|
||||
if (all(x %in% AMR::microorganisms$kingdom)) {
|
||||
return(x)
|
||||
}
|
||||
x <- as.mo(x, language = "en", ...)
|
||||
x <- as.mo(x, ...)
|
||||
kngdm <- mo_validate(x = x, property = "kingdom", ...)
|
||||
if (language != "en") {
|
||||
kngdm[x == "UNKNOWN"] <- mo_translate(kngdm[x == "UNKNOWN"], language = language)
|
||||
kngdm[x == "UNKNOWN"] <- t(kngdm[x == "UNKNOWN"], language = language)
|
||||
}
|
||||
kngdm
|
||||
}
|
||||
@@ -261,13 +262,13 @@ mo_kingdom <- function(x, language = get_locale(), ...) {
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_type <- function(x, language = get_locale(), ...) {
|
||||
mo_translate(mo_validate(x = x, property = "kingdom", ...), language = language)
|
||||
t(mo_validate(x = x, property = "kingdom", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_gramstain <- function(x, language = get_locale(), ...) {
|
||||
x.mo <- as.mo(x, language = "en", ...)
|
||||
x.mo <- as.mo(x, ...)
|
||||
x.phylum <- mo_phylum(x.mo, language = "en")
|
||||
x[x.phylum %in% c("Actinobacteria",
|
||||
"Chloroflexi",
|
||||
@@ -278,7 +279,7 @@ mo_gramstain <- function(x, language = get_locale(), ...) {
|
||||
x[x.mo == "B_GRAMP"] <- "Gram positive"
|
||||
x[x.mo == "B_GRAMN"] <- "Gram negative"
|
||||
|
||||
mo_translate(x, language = language)
|
||||
t(x, language = language)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
@@ -363,214 +364,7 @@ mo_property <- function(x, property = 'fullname', language = get_locale(), ...)
|
||||
stop("invalid property: '", property, "' - use a column name of the `microorganisms` data set")
|
||||
}
|
||||
|
||||
mo_translate(mo_validate(x = x, property = property, ...), language = language)
|
||||
}
|
||||
|
||||
#' @importFrom dplyr %>% case_when
|
||||
mo_translate <- function(x, language) {
|
||||
if (is.null(language)) {
|
||||
return(x)
|
||||
}
|
||||
if (language %in% c("en", "")) {
|
||||
return(x)
|
||||
}
|
||||
|
||||
supported <- c("en", "de", "nl", "es", "pt", "it", "fr")
|
||||
if (!language %in% supported) {
|
||||
stop("Unsupported language: '", language, "' - use one of: ", paste0("'", sort(supported), "'", collapse = ", "), call. = FALSE)
|
||||
}
|
||||
|
||||
x_tobetranslated <- grepl(x = x,
|
||||
pattern = "(Coagulase-negative Staphylococcus|Coagulase-positive Staphylococcus|Beta-haemolytic Streptococcus|unknown Gram negatives|unknown Gram positives|unknown name|unknown kingdom|unknown phylum|unknown class|unknown order|unknown family|unknown genus|unknown species|unknown subspecies|unknown rank|CoNS|CoPS|Gram negative|Gram positive|Bacteria|Fungi|Protozoa|biogroup|biotype|vegetative|group|Group)")
|
||||
|
||||
if (sum(x_tobetranslated, na.rm = TRUE) == 0) {
|
||||
return(x)
|
||||
}
|
||||
|
||||
# only translate the ones that need translation
|
||||
x[x_tobetranslated] <- case_when(
|
||||
# German
|
||||
language == "de" ~ x[x_tobetranslated] %>%
|
||||
gsub("Coagulase-negative Staphylococcus","Koagulase-negative Staphylococcus", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Koagulase-positive Staphylococcus", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Beta-h\u00e4molytischer Streptococcus", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "unbekannte Gramnegativen", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "unbekannte Grampositiven", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "unbekannte Name", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "unbekanntes Reich", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "unbekannter Stamm", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "unbekannte Klasse", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "unbekannte Ordnung", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "unbekannte Familie", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "unbekannte Gattung", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "unbekannte Art", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "unbekannte Unterart", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "unbekannter Rang", ., fixed = TRUE) %>%
|
||||
gsub("(CoNS)", "(KNS)", ., fixed = TRUE) %>%
|
||||
gsub("(CoPS)", "(KPS)", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gramnegativ", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Grampositiv", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Bakterien", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Hefen/Pilze", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "Protozoen", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "Biogruppe", ., fixed = TRUE) %>%
|
||||
gsub("biotype", "Biotyp", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "vegetativ", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1Gruppe", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Gruppe", .) %>%
|
||||
iconv(to = "UTF-8"),
|
||||
|
||||
# Dutch
|
||||
language == "nl" ~ x[x_tobetranslated] %>%
|
||||
gsub("Coagulase-negative Staphylococcus","Coagulase-negatieve Staphylococcus", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Coagulase-positieve Staphylococcus", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Beta-hemolytische Streptococcus", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "onbekende Gram-negatieven", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "onbekende Gram-positieven", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "onbekende naam", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "onbekend koninkrijk", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "onbekende fylum", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "onbekende klasse", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "onbekende orde", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "onbekende familie", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "onbekend geslacht", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "onbekende soort", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "onbekende ondersoort", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "onbekende rang", ., fixed = TRUE) %>%
|
||||
gsub("(CoNS)", "(CNS)", ., fixed = TRUE) %>%
|
||||
gsub("(CoPS)", "(CPS)", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gram-negatief", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Gram-positief", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Bacteri\u00ebn", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Schimmels/gisten", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "protozo\u00ebn", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "biogroep", ., fixed = TRUE) %>%
|
||||
# gsub("biotype", "biotype", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "vegetatief", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1groep", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Groep", .) %>%
|
||||
iconv(to = "UTF-8"),
|
||||
|
||||
# Spanish
|
||||
language == "es" ~ x[x_tobetranslated] %>%
|
||||
# not 'negativa'
|
||||
# https://www.sciencedirect.com/science/article/pii/S0123939215000739
|
||||
gsub("Coagulase-negative Staphylococcus","Staphylococcus coagulasa negativo", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Staphylococcus coagulasa positivo", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Streptococcus Beta-hemol\u00edtico", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "Gram negativos desconocidos", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "Gram positivos desconocidos", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "nombre desconocido", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "reino desconocido", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "filo desconocido", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "clase desconocida", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "orden desconocido", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "familia desconocida", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "g\u00e9nero desconocido", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "especie desconocida", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "subespecie desconocida", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "rango desconocido", ., fixed = TRUE) %>%
|
||||
gsub("(CoNS)", "(SCN)", ., fixed = TRUE) %>%
|
||||
gsub("(CoPS)", "(SCP)", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gram negativo", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Gram positivo", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Bacterias", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Hongos", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "Protozoarios", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "biogrupo", ., fixed = TRUE) %>%
|
||||
gsub("biotype", "biotipo", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "vegetativo", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1grupo", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Grupo", .) %>%
|
||||
iconv(to = "UTF-8"),
|
||||
|
||||
# Italian
|
||||
language == "it" ~ x[x_tobetranslated] %>%
|
||||
gsub("Coagulase-negative Staphylococcus","Staphylococcus negativo coagulasi", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Staphylococcus positivo coagulasi", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Streptococcus Beta-emolitico", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "Gram negativi sconosciuti", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "Gram positivi sconosciuti", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "nome sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "regno sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "phylum sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "classe sconosciuta", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "ordine sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "famiglia sconosciuta", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "genere sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "specie sconosciute", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "sottospecie sconosciute", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "grado sconosciuto", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gram negativo", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Gram positivo", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Batteri", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Fungo", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "Protozoi", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "biogruppo", ., fixed = TRUE) %>%
|
||||
gsub("biotype", "biotipo", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "vegetativo", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1gruppo", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Gruppo", .),
|
||||
|
||||
# French
|
||||
language == "fr" ~ x[x_tobetranslated] %>%
|
||||
gsub("Coagulase-negative Staphylococcus","Staphylococcus \u00e0 coagulase n\u00e9gative", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Staphylococcus \u00e0 coagulase positif", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Streptococcus B\u00eata-h\u00e9molytique", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "Gram n\u00e9gatifs inconnus", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "Gram positifs inconnus", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "nom inconnu", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "r\u00e8gme inconnu", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "embranchement inconnu", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "classe inconnue", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "ordre inconnu", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "famille inconnue", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "genre inconnu", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "esp\u00e8ce inconnue", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "sous-esp\u00e8ce inconnue", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "rang inconnu", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gram n\u00e9gatif", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Gram positif", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Bact\u00e9ries", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Champignons", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "Protozoaires", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "biogroupe", ., fixed = TRUE) %>%
|
||||
# gsub("biotype", "biotype", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "v\u00e9g\u00e9tatif", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1groupe", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Groupe", .) %>%
|
||||
iconv(to = "UTF-8"),
|
||||
|
||||
# Portuguese
|
||||
language == "pt" ~ x[x_tobetranslated] %>%
|
||||
gsub("Coagulase-negative Staphylococcus","Staphylococcus coagulase negativo", ., fixed = TRUE) %>%
|
||||
gsub("Coagulase-positive Staphylococcus","Staphylococcus coagulase positivo", ., fixed = TRUE) %>%
|
||||
gsub("Beta-haemolytic Streptococcus", "Streptococcus Beta-hemol\u00edtico", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram negatives", "Gram negativos desconhecidos", ., fixed = TRUE) %>%
|
||||
gsub("unknown Gram positives", "Gram positivos desconhecidos", ., fixed = TRUE) %>%
|
||||
gsub("unknown name", "nome desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("unknown kingdom", "reino desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("unknown phylum", "filo desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("unknown class", "classe desconhecida", ., fixed = TRUE) %>%
|
||||
gsub("unknown order", "ordem desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("unknown family", "fam\u00edlia desconhecida", ., fixed = TRUE) %>%
|
||||
gsub("unknown genus", "g\u00eanero desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("unknown species", "esp\u00e9cies desconhecida", ., fixed = TRUE) %>%
|
||||
gsub("unknown subspecies", "subesp\u00e9cies desconhecida", ., fixed = TRUE) %>%
|
||||
gsub("unknown rank", "classifica\u00e7\u00e3o desconhecido", ., fixed = TRUE) %>%
|
||||
gsub("Gram negative", "Gram negativo", ., fixed = TRUE) %>%
|
||||
gsub("Gram positive", "Gram positivo", ., fixed = TRUE) %>%
|
||||
gsub("Bacteria", "Bact\u00e9rias", ., fixed = TRUE) %>%
|
||||
gsub("Fungi", "Fungos", ., fixed = TRUE) %>%
|
||||
gsub("Protozoa", "Protozo\u00e1rios", ., fixed = TRUE) %>%
|
||||
gsub("biogroup", "biogrupo", ., fixed = TRUE) %>%
|
||||
gsub("biotype", "bi\u00f3tipo", ., fixed = TRUE) %>%
|
||||
gsub("vegetative", "vegetativo", ., fixed = TRUE) %>%
|
||||
gsub("([([ ]*?)group", "\\1grupo", .) %>%
|
||||
gsub("([([ ]*?)Group", "\\1Grupo", .) %>%
|
||||
iconv(to = "UTF-8"))
|
||||
|
||||
x
|
||||
t(mo_validate(x = x, property = property, ...), language = language)
|
||||
}
|
||||
|
||||
mo_validate <- function(x, property, ...) {
|
||||
@@ -591,7 +385,7 @@ mo_validate <- function(x, property, ...) {
|
||||
}
|
||||
|
||||
# try to catch an error when inputting an invalid parameter
|
||||
# so the call can be set to FALSE
|
||||
# so the 'call.' can be set to FALSE
|
||||
tryCatch(x[1L] %in% AMR::microorganisms[1, property],
|
||||
error = function(e) stop(e$message, call. = FALSE))
|
||||
|
||||
|
||||
124
R/portion.R
@@ -29,15 +29,14 @@
|
||||
#' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.
|
||||
#' @param also_single_tested a logical to indicate whether (in combination therapies) also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of \code{portion_S} and R in case of \code{portion_R}). \strong{This would lead to selection bias in almost all cases.}
|
||||
#' @param data a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})
|
||||
#' @param translate_ab a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{abname}}. This can be set with \code{\link{getOption}("get_antibiotic_names")}.
|
||||
#' @param translate_ab a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}
|
||||
#' @inheritParams ab_property
|
||||
#' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
|
||||
#' @details \strong{Remember that you should filter your table to let it contain only first isolates!} Use \code{\link{first_isolate}} to determine them in your data set.
|
||||
#'
|
||||
#' These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. \emph{Low counts can infuence the outcome - these \code{portion} functions may camouflage this, since they only return the portion albeit being dependent on the \code{minimum} parameter.}
|
||||
#'
|
||||
#' \code{portion_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and calculates the portions R, I and S. The resulting \emph{tidy data} (see Source) \code{data.frame} will have three rows (S/I/R) and a column for each variable with class \code{"rsi"}.
|
||||
#'
|
||||
#' The old \code{\link{rsi}} function is still available for backwards compatibility but is deprecated.
|
||||
#' \if{html}{
|
||||
# (created with https://www.latex4technics.com/)
|
||||
#' \cr\cr
|
||||
@@ -69,64 +68,64 @@
|
||||
#' ?septic_patients
|
||||
#'
|
||||
#' # Calculate resistance
|
||||
#' portion_R(septic_patients$amox)
|
||||
#' portion_IR(septic_patients$amox)
|
||||
#' portion_R(septic_patients$AMX)
|
||||
#' portion_IR(septic_patients$AMX)
|
||||
#'
|
||||
#' # Or susceptibility
|
||||
#' portion_S(septic_patients$amox)
|
||||
#' portion_SI(septic_patients$amox)
|
||||
#' portion_S(septic_patients$AMX)
|
||||
#' portion_SI(septic_patients$AMX)
|
||||
#'
|
||||
|
||||
#' # Do the above with pipes:
|
||||
#' library(dplyr)
|
||||
#' septic_patients %>% portion_R(amox)
|
||||
#' septic_patients %>% portion_IR(amox)
|
||||
#' septic_patients %>% portion_S(amox)
|
||||
#' septic_patients %>% portion_SI(amox)
|
||||
#' septic_patients %>% portion_R(AMX)
|
||||
#' septic_patients %>% portion_IR(AMX)
|
||||
#' septic_patients %>% portion_S(AMX)
|
||||
#' septic_patients %>% portion_SI(AMX)
|
||||
#'
|
||||
#' septic_patients %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(p = portion_S(cipr),
|
||||
#' n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr
|
||||
#' summarise(p = portion_S(CIP),
|
||||
#' n = n_rsi(CIP)) # n_rsi works like n_distinct in dplyr
|
||||
#'
|
||||
#' septic_patients %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(R = portion_R(cipr, as_percent = TRUE),
|
||||
#' I = portion_I(cipr, as_percent = TRUE),
|
||||
#' S = portion_S(cipr, as_percent = TRUE),
|
||||
#' n1 = count_all(cipr), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(cipr), # same - analogous to n_distinct
|
||||
#' summarise(R = portion_R(CIP, as_percent = TRUE),
|
||||
#' I = portion_I(CIP, as_percent = TRUE),
|
||||
#' S = portion_S(CIP, as_percent = TRUE),
|
||||
#' n1 = count_all(CIP), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||
#' total = n()) # NOT the number of tested isolates!
|
||||
#'
|
||||
#' # Calculate co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
#' # so we can see that combination therapy does a lot more than mono therapy:
|
||||
#' septic_patients %>% portion_S(amcl) # S = 71.4%
|
||||
#' septic_patients %>% count_all(amcl) # n = 1879
|
||||
#' septic_patients %>% portion_S(AMC) # S = 71.4%
|
||||
#' septic_patients %>% count_all(AMC) # n = 1879
|
||||
#'
|
||||
#' septic_patients %>% portion_S(gent) # S = 74.0%
|
||||
#' septic_patients %>% count_all(gent) # n = 1855
|
||||
#' septic_patients %>% portion_S(GEN) # S = 74.0%
|
||||
#' septic_patients %>% count_all(GEN) # n = 1855
|
||||
#'
|
||||
#' septic_patients %>% portion_S(amcl, gent) # S = 92.3%
|
||||
#' septic_patients %>% count_all(amcl, gent) # n = 1798
|
||||
#' septic_patients %>% portion_S(AMC, GEN) # S = 92.3%
|
||||
#' septic_patients %>% count_all(AMC, GEN) # n = 1798
|
||||
#'
|
||||
#'
|
||||
#' septic_patients %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(cipro_p = portion_S(cipr, as_percent = TRUE),
|
||||
#' cipro_n = count_all(cipr),
|
||||
#' genta_p = portion_S(gent, as_percent = TRUE),
|
||||
#' genta_n = count_all(gent),
|
||||
#' combination_p = portion_S(cipr, gent, as_percent = TRUE),
|
||||
#' combination_n = count_all(cipr, gent))
|
||||
#' summarise(cipro_p = portion_S(CIP, as_percent = TRUE),
|
||||
#' cipro_n = count_all(CIP),
|
||||
#' genta_p = portion_S(GEN, as_percent = TRUE),
|
||||
#' genta_n = count_all(GEN),
|
||||
#' combination_p = portion_S(CIP, GEN, as_percent = TRUE),
|
||||
#' combination_n = count_all(CIP, GEN))
|
||||
#'
|
||||
#' # Get portions S/I/R immediately of all rsi columns
|
||||
#' septic_patients %>%
|
||||
#' select(amox, cipr) %>%
|
||||
#' select(AMX, CIP) %>%
|
||||
#' portion_df(translate = FALSE)
|
||||
#'
|
||||
#' # It also supports grouping variables
|
||||
#' septic_patients %>%
|
||||
#' select(hospital_id, amox, cipr) %>%
|
||||
#' select(hospital_id, AMX, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' portion_df(translate = FALSE)
|
||||
#'
|
||||
@@ -137,8 +136,8 @@
|
||||
#' my_table %>%
|
||||
#' filter(first_isolate == TRUE,
|
||||
#' genus == "Helicobacter") %>%
|
||||
#' summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole
|
||||
#' n = count_all(amox, metr))
|
||||
#' summarise(p = portion_S(AMX, MTR), # amoxicillin with metronidazole
|
||||
#' n = count_all(AMX, MTR))
|
||||
#' }
|
||||
portion_R <- function(...,
|
||||
minimum = 30,
|
||||
@@ -217,7 +216,8 @@ portion_S <- function(...,
|
||||
#' @importFrom dplyr %>% select_if bind_rows summarise_if mutate group_vars select everything
|
||||
#' @export
|
||||
portion_df <- function(data,
|
||||
translate_ab = getOption("get_antibiotic_names", "official"),
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_IR = FALSE) {
|
||||
@@ -230,10 +230,9 @@ portion_df <- function(data,
|
||||
stop("No columns with class 'rsi' found. See ?as.rsi.")
|
||||
}
|
||||
|
||||
if (as.character(translate_ab) == "TRUE") {
|
||||
translate_ab <- "official"
|
||||
if (as.character(translate_ab) %in% c("TRUE", "official")) {
|
||||
translate_ab <- "name"
|
||||
}
|
||||
options(get_antibiotic_names = translate_ab)
|
||||
|
||||
resS <- summarise_if(.tbl = data,
|
||||
.predicate = is.rsi,
|
||||
@@ -282,55 +281,8 @@ portion_df <- function(data,
|
||||
}
|
||||
|
||||
if (!translate_ab == FALSE) {
|
||||
if (!tolower(translate_ab) %in% tolower(colnames(AMR::antibiotics))) {
|
||||
stop("Parameter `translate_ab` does not occur in the `antibiotics` data set.", call. = FALSE)
|
||||
}
|
||||
res <- res %>% mutate(Antibiotic = abname(Antibiotic, from = "guess", to = translate_ab))
|
||||
res <- res %>% mutate(Antibiotic = ab_property(Antibiotic, property = translate_ab, language = language))
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
|
||||
#' Calculate resistance of isolates
|
||||
#'
|
||||
#' This function is deprecated. Use the \code{\link{portion}} functions instead.
|
||||
#' @inheritParams portion
|
||||
#' @param ab1,ab2 vector (or column) with antibiotic interpretations. It will be transformed internally with \code{\link{as.rsi}} if needed.
|
||||
#' @param interpretation antimicrobial interpretation to check for
|
||||
#' @param ... deprecated parameters to support usage on older versions
|
||||
#' @importFrom dplyr tibble case_when
|
||||
#' @export
|
||||
rsi <- function(ab1,
|
||||
ab2 = NULL,
|
||||
interpretation = "IR",
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
...) {
|
||||
|
||||
.Deprecated(new = paste0("portion_", interpretation))
|
||||
|
||||
if (all(is.null(ab2))) {
|
||||
df <- tibble(ab1 = ab1)
|
||||
} else {
|
||||
df <- tibble(ab1 = ab1,
|
||||
ab2 = ab2)
|
||||
}
|
||||
|
||||
if (!interpretation %in% c("S", "SI", "IS", "I", "RI", "IR", "R")) {
|
||||
stop("invalid interpretation")
|
||||
}
|
||||
|
||||
result <- case_when(
|
||||
interpretation == "S" ~ portion_S(df, minimum = minimum, as_percent = FALSE),
|
||||
interpretation %in% c("SI", "IS") ~ portion_SI(df, minimum = minimum, as_percent = FALSE),
|
||||
interpretation == "I" ~ portion_I(df, minimum = minimum, as_percent = FALSE),
|
||||
interpretation %in% c("RI", "IR") ~ portion_IR(df, minimum = minimum, as_percent = FALSE),
|
||||
interpretation == "R" ~ portion_R(df, minimum = minimum, as_percent = FALSE))
|
||||
|
||||
if (as_percent == TRUE) {
|
||||
percent(result, force_zero = TRUE)
|
||||
} else {
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#' @importFrom dplyr %>% pull mutate mutate_at n group_by_at summarise filter filter_at all_vars n_distinct arrange case_when n_groups transmute
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' x <- resistance_predict(septic_patients, col_ab = "amox", year_min = 2010)
|
||||
#' x <- resistance_predict(septic_patients, col_ab = "AMX", year_min = 2010)
|
||||
#' plot(x)
|
||||
#' ggplot_rsi_predict(x)
|
||||
#'
|
||||
@@ -69,7 +69,7 @@
|
||||
#' x <- septic_patients %>%
|
||||
#' filter_first_isolate() %>%
|
||||
#' filter(mo_genus(mo) == "Staphylococcus") %>%
|
||||
#' resistance_predict("peni")
|
||||
#' resistance_predict("PEN")
|
||||
#' plot(x)
|
||||
#'
|
||||
#'
|
||||
@@ -83,7 +83,7 @@
|
||||
#'
|
||||
#' data <- septic_patients %>%
|
||||
#' filter(mo == as.mo("E. coli")) %>%
|
||||
#' resistance_predict(col_ab = "amox",
|
||||
#' resistance_predict(col_ab = "AMX",
|
||||
#' col_date = "date",
|
||||
#' info = FALSE,
|
||||
#' minimum = 15)
|
||||
|
||||
213
R/rsi.R
@@ -21,14 +21,20 @@
|
||||
|
||||
#' Class 'rsi'
|
||||
#'
|
||||
#' This transforms a vector to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning.
|
||||
#' Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning.
|
||||
#' @rdname as.rsi
|
||||
#' @param x vector
|
||||
#' @param x vector of values (for class \code{mic}: an MIC value in mg/L, for class \code{disk}: a disk diffusion radius in millimeters)
|
||||
#' @param mo a microorganism code, generated with \code{\link{as.mo}}
|
||||
#' @param ab an antibiotic code, generated with \code{\link{as.ab}}
|
||||
#' @inheritParams first_isolate
|
||||
#' @param guideline defaults to the latest included EUCAST guideline, run \code{unique(AMR::rsi_translation$guideline)} for all options
|
||||
#' @param threshold maximum fraction of \code{x} that is allowed to fail transformation, see Examples
|
||||
#' @details
|
||||
#' \strong{NOTE:} This function does not translate MIC values to RSI values. If more than 50\% of the input resembles MIC values, it will warn about this.\cr You can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
|
||||
#' @param ... parameters passed on to methods
|
||||
#' @details Run \code{unique(AMR::rsi_translation$guideline)} for a list of all supported guidelines.
|
||||
#'
|
||||
#' The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains only valid antimicrobial interpretations (S and/or I and/or R), and \code{FALSE} otherwise.
|
||||
#' After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
|
||||
#'
|
||||
#' The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter.
|
||||
#' @return Ordered factor with new class \code{rsi}
|
||||
#' @keywords rsi
|
||||
#' @export
|
||||
@@ -43,6 +49,16 @@
|
||||
#' # this can also coerce combined MIC/RSI values:
|
||||
#' as.rsi("<= 0.002; S") # will return S
|
||||
#'
|
||||
#' # interpret MIC values
|
||||
#' as.rsi(x = as.mic(2),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#' as.rsi(x = as.mic(4),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#'
|
||||
#' plot(rsi_data) # for percentages
|
||||
#' barplot(rsi_data) # for frequencies
|
||||
#' freq(rsi_data) # frequency table with informative header
|
||||
@@ -50,7 +66,7 @@
|
||||
#' # using dplyr's mutate
|
||||
#' library(dplyr)
|
||||
#' septic_patients %>%
|
||||
#' mutate_at(vars(peni:rifa), as.rsi)
|
||||
#' mutate_at(vars(PEN:RIF), as.rsi)
|
||||
#'
|
||||
#'
|
||||
#' # fastest way to transform all columns with already valid AB results to class `rsi`:
|
||||
@@ -60,16 +76,21 @@
|
||||
#'
|
||||
#' # default threshold of `is.rsi.eligible` is 5%.
|
||||
#' is.rsi.eligible(WHONET$`First name`) # fails, >80% is invalid
|
||||
#' is.rsi.eligible(WHONET$`First name`, threshold = 0.9) # succeeds
|
||||
as.rsi <- function(x) {
|
||||
#' is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds
|
||||
as.rsi <- function(x, ...) {
|
||||
UseMethod("as.rsi")
|
||||
}
|
||||
|
||||
#' @export
|
||||
as.rsi.default <- function(x, ...) {
|
||||
if (is.rsi(x)) {
|
||||
x
|
||||
} else if (identical(levels(x), c("S", "I", "R"))) {
|
||||
structure(x, class = c('rsi', 'ordered', 'factor'))
|
||||
} else {
|
||||
if (input_resembles_mic(x) > 0.5) {
|
||||
warning("`as.rsi` is intended to clean antimicrobial interpretations - not to interpret MIC values.", call. = FALSE)
|
||||
}
|
||||
# if (input_resembles_mic(x) > 0.5) {
|
||||
# warning("`as.rsi` is intended to clean antimicrobial interpretations - not to interpret MIC values.", call. = FALSE)
|
||||
# }
|
||||
|
||||
x <- x %>% unlist()
|
||||
x.bak <- x
|
||||
@@ -106,9 +127,8 @@ as.rsi <- function(x) {
|
||||
list_missing, call. = FALSE)
|
||||
}
|
||||
|
||||
x <- factor(x, levels = c("S", "I", "R"), ordered = TRUE)
|
||||
class(x) <- c('rsi', 'ordered', 'factor')
|
||||
x
|
||||
structure(.Data = factor(x, levels = c("S", "I", "R"), ordered = TRUE),
|
||||
class = c('rsi', 'ordered', 'factor'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +145,160 @@ input_resembles_mic <- function(x) {
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname as.rsi
|
||||
#' @importFrom dplyr case_when
|
||||
#' @export
|
||||
as.rsi.mic <- function(x, mo, ab, guideline = "EUCAST", ...) {
|
||||
exec_as.rsi(method = "mic",
|
||||
x = x,
|
||||
mo = mo,
|
||||
ab = ab,
|
||||
guideline = guideline)
|
||||
}
|
||||
|
||||
#' @rdname as.rsi
|
||||
#' @export
|
||||
as.rsi.disk <- function(x, mo, ab, guideline = "EUCAST", ...) {
|
||||
exec_as.rsi(method = "disk",
|
||||
x = x,
|
||||
mo = mo,
|
||||
ab = ab,
|
||||
guideline = guideline)
|
||||
}
|
||||
|
||||
exec_as.rsi <- function(method, x, mo, ab, guideline) {
|
||||
if (method == "mic") {
|
||||
x <- as.mic(x) # when as.rsi.mic is called directly
|
||||
} else if (method == "disk") {
|
||||
x <- as.disk(x) # when as.rsi.disk is called directly
|
||||
}
|
||||
|
||||
mo <- as.mo(mo)
|
||||
ab <- as.ab(ab)
|
||||
|
||||
mo_genus <- as.mo(mo_genus(mo))
|
||||
mo_family <- as.mo(mo_family(mo))
|
||||
mo_order <- as.mo(mo_order(mo))
|
||||
mo_becker <- as.mo(mo, Becker = TRUE)
|
||||
mo_lancefield <- as.mo(mo, Lancefield = TRUE)
|
||||
|
||||
guideline <- toupper(guideline)
|
||||
if (guideline %in% c("CLSI", "EUCAST")) {
|
||||
guideline <- AMR::rsi_translation %>%
|
||||
filter(guideline %like% guideline) %>%
|
||||
pull(guideline) %>%
|
||||
sort() %>%
|
||||
rev() %>%
|
||||
.[1]
|
||||
}
|
||||
|
||||
if (!guideline %in% AMR::rsi_translation$guideline) {
|
||||
stop(paste0("invalid guideline: '", guideline,
|
||||
"'.\nValid guidelines are: ", paste0("'", rev(sort(unique(AMR::rsi_translation$guideline))), "'", collapse = ", ")),
|
||||
call. = FALSE)
|
||||
}
|
||||
|
||||
new_rsi <- rep(NA_character_, length(x))
|
||||
trans <- AMR::rsi_translation %>%
|
||||
filter(guideline == guideline) %>%
|
||||
mutate(lookup = paste(mo, ab))
|
||||
|
||||
lookup_mo <- paste(mo, ab)
|
||||
lookup_genus <- paste(mo_genus, ab)
|
||||
lookup_family <- paste(mo_family, ab)
|
||||
lookup_order <- paste(mo_order, ab)
|
||||
lookup_becker <- paste(mo_becker, ab)
|
||||
lookup_lancefield <- paste(mo_lancefield, ab)
|
||||
|
||||
for (i in 1:length(x)) {
|
||||
get_record <- trans %>%
|
||||
filter(lookup %in% c(lookup_mo[i],
|
||||
lookup_genus[i],
|
||||
lookup_family[i],
|
||||
lookup_order[i],
|
||||
lookup_becker[i],
|
||||
lookup_lancefield[i])) %>%
|
||||
# be as specific as possible (i.e. prefer species over genus):
|
||||
arrange(desc(nchar(mo))) %>%
|
||||
.[1L,]
|
||||
|
||||
if (NROW(get_record) > 0) {
|
||||
if (method == "mic") {
|
||||
new_rsi[i] <- case_when(is.na(get_record$S_mic) | is.na(get_record$R_mic) ~ NA_character_,
|
||||
x[i] <= get_record$S_mic ~ "S",
|
||||
x[i] >= get_record$R_mic ~ "R",
|
||||
TRUE ~ "I")
|
||||
} else if (method == "disk") {
|
||||
new_rsi[i] <- case_when(is.na(get_record$S_disk) | is.na(get_record$R_disk) ~ NA_character_,
|
||||
x[i] <= get_record$S_disk ~ "S",
|
||||
x[i] >= get_record$R_disk ~ "R",
|
||||
TRUE ~ "I")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
structure(.Data = factor(new_rsi, levels = c("S", "I", "R"), ordered = TRUE),
|
||||
class = c('rsi', 'ordered', 'factor'))
|
||||
}
|
||||
|
||||
#' @rdname as.rsi
|
||||
#' @importFrom crayon red blue
|
||||
#' @export
|
||||
as.rsi.data.frame <- function(x, col_mo = NULL, guideline = "EUCAST", ...) {
|
||||
tbl_ <- x
|
||||
|
||||
ab_cols <- colnames(tbl_)[sapply(tbl_, function(x) is.mic(x) | is.disk(x))]
|
||||
if (length(ab_cols) == 0) {
|
||||
stop("No columns with MIC values or disk zones found in this data set. Use as.mic or as.disk to transform antibiotic columns.", call. = FALSE)
|
||||
}
|
||||
|
||||
# try to find columns based on type
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(tbl = tbl_, type = "mo")
|
||||
}
|
||||
if (is.null(col_mo)) {
|
||||
stop("`col_mo` must be set.", call. = FALSE)
|
||||
}
|
||||
|
||||
# transform all MICs
|
||||
ab_cols <- colnames(tbl_)[sapply(tbl_, is.mic)]
|
||||
if (length(ab_cols) > 0) {
|
||||
for (i in 1:length(ab_cols)) {
|
||||
if (is.na(suppressWarnings(as.ab(ab_cols[i])))) {
|
||||
message(red(paste0("Unknown drug: `", bold(ab_cols[i]), "`. Rename this column to a drug name or code, and check the output with as.ab().")))
|
||||
next
|
||||
}
|
||||
message(blue(paste0("Interpreting column `", bold(ab_cols[i]), "` (", ab_name(ab_cols[i], tolower = TRUE), ")...")), appendLF = FALSE)
|
||||
tbl_[, ab_cols[i]] <- exec_as.rsi(method = "mic",
|
||||
x = tbl_ %>% pull(ab_cols[i]),
|
||||
mo = tbl_ %>% pull(col_mo),
|
||||
ab = as.ab(ab_cols[i]),
|
||||
guideline = guideline)
|
||||
message(blue(" OK."))
|
||||
}
|
||||
}
|
||||
# transform all disks
|
||||
ab_cols <- colnames(tbl_)[sapply(tbl_, is.disk)]
|
||||
if (length(ab_cols) > 0) {
|
||||
for (i in 1:length(ab_cols)) {
|
||||
if (is.na(suppressWarnings(as.ab(ab_cols[i])))) {
|
||||
message(red(paste0("Unknown drug: `", bold(ab_cols[i]), "`. Rename this column to a drug name or code, and check the output with as.ab().")))
|
||||
next
|
||||
}
|
||||
message(blue(paste0("Interpreting column `", bold(ab_cols[i]), "` (", ab_name(ab_cols[i], tolower = TRUE), ")...")), appendLF = FALSE)
|
||||
tbl_[, ab_cols[i]] <- exec_as.rsi(method = "disk",
|
||||
x = tbl_ %>% pull(ab_cols[i]),
|
||||
mo = tbl_ %>% pull(col_mo),
|
||||
ab = as.ab(ab_cols[i]),
|
||||
guideline = guideline)
|
||||
message(blue(" OK."))
|
||||
}
|
||||
}
|
||||
|
||||
tbl_
|
||||
}
|
||||
|
||||
#' @rdname as.rsi
|
||||
#' @export
|
||||
is.rsi <- function(x) {
|
||||
@@ -211,6 +385,15 @@ plot.rsi <- function(x, ...) {
|
||||
filter(!is.na(x)) %>%
|
||||
mutate(s = round((n / sum(n)) * 100, 1))
|
||||
)
|
||||
if (!"S" %in% data$x) {
|
||||
data <- rbind(data, data.frame(x = "S", n = 0, s = 0))
|
||||
}
|
||||
if (!"I" %in% data$x) {
|
||||
data <- rbind(data, data.frame(x = "I", n = 0, s = 0))
|
||||
}
|
||||
if (!"R" %in% data$x) {
|
||||
data <- rbind(data, data.frame(x = "R", n = 0, s = 0))
|
||||
}
|
||||
|
||||
data$x <- factor(data$x, levels = c('S', 'I', 'R'), ordered = TRUE)
|
||||
|
||||
@@ -239,7 +422,7 @@ plot.rsi <- function(x, ...) {
|
||||
|
||||
#' @exportMethod barplot.rsi
|
||||
#' @export
|
||||
#' @importFrom dplyr %>% group_by summarise filter mutate if_else n_distinct
|
||||
#' @importFrom dplyr %>% group_by summarise
|
||||
#' @importFrom graphics barplot axis
|
||||
#' @noRd
|
||||
barplot.rsi <- function(height, ...) {
|
||||
|
||||
@@ -73,6 +73,11 @@ rsi_calc <- function(...,
|
||||
}
|
||||
}
|
||||
|
||||
if (is.null(x)) {
|
||||
warning("argument is NULL (check if columns exist): returning NA", call. = FALSE)
|
||||
return(NA)
|
||||
}
|
||||
|
||||
print_warning <- FALSE
|
||||
|
||||
type_trans <- as.integer(as.rsi(type))
|
||||
|
||||
1
R/zzz.R
@@ -84,6 +84,7 @@ make <- function() {
|
||||
"Treponema",
|
||||
"Trichophyton",
|
||||
"Ureaplasma")
|
||||
| rank %in% c("kingdom", "phylum", "class", "order", "family")
|
||||
~ 2,
|
||||
TRUE ~ 3
|
||||
))
|
||||
|
||||
11
_pkgdown.yml
@@ -53,8 +53,8 @@ navbar:
|
||||
href: 'reference/mo_property.html'
|
||||
- text: 'Get properties of an antibiotic'
|
||||
icon: 'fa-capsules'
|
||||
# href: 'articles/atc_property.html'
|
||||
href: 'reference/atc_property.html'
|
||||
# href: 'articles/ab_property.html'
|
||||
href: 'reference/ab_property.html'
|
||||
- text: 'Create frequency tables'
|
||||
icon: 'fa-sort-amount-down'
|
||||
href: 'articles/freq.html'
|
||||
@@ -100,6 +100,7 @@ reference:
|
||||
- starts_with("as.")
|
||||
- '`mo_source`'
|
||||
- '`eucast_rules`'
|
||||
- '`rsi_translation`'
|
||||
- '`guess_ab_col`'
|
||||
- '`read.4D`'
|
||||
- title: 'Adding variables to your data'
|
||||
@@ -113,13 +114,12 @@ reference:
|
||||
- '`mdro`'
|
||||
- '`key_antibiotics`'
|
||||
- '`mo_property`'
|
||||
- '`atc_property`'
|
||||
- '`atc_online_property`'
|
||||
- '`abname`'
|
||||
- '`ab_property`'
|
||||
- '`age`'
|
||||
- '`age_groups`'
|
||||
- '`p.symbol`'
|
||||
- '`join`'
|
||||
- '`atc_online_property`'
|
||||
- title: 'Analysing your data'
|
||||
desc: >
|
||||
Functions for conducting AMR analysis, like counting isolates, calculating
|
||||
@@ -134,7 +134,6 @@ reference:
|
||||
- '`ggplot_rsi`'
|
||||
- '`kurtosis`'
|
||||
- '`resistance_predict`'
|
||||
- '`rsi`'
|
||||
- '`skewness`'
|
||||
- title: 'Included data sets'
|
||||
desc: >
|
||||
|
||||
BIN
data/rsi_translation.rda
Normal file
@@ -78,7 +78,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/atc_property.html">
|
||||
<a href="reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 50 KiB |
@@ -40,7 +40,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -192,7 +192,7 @@
|
||||
<h1>How to import data from SPSS / SAS / Stata</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">05 April 2019</h4>
|
||||
<h4 class="date">10 May 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>SPSS.Rmd</code></div>
|
||||
@@ -240,7 +240,7 @@
|
||||
<p>If you are working at a midsized or small company, you can save it tens of thousands of dollars by using R instead of e.g. SPSS - gaining even more functions and flexibility. And all R enthousiasts can do as much PR as they want (like I do here), because nobody is officially associated with or affiliated by R. It is really free.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>If you sometimes write syntaxes in SPSS to run a complete analysis or to ‘automate’ some of your work, you should perhaps do this in R. You will notice that writing syntaxes in R is a lot more nifty and clever than in SPSS.</p>
|
||||
<p>If you sometimes write syntaxes in SPSS to run a complete analysis or to ‘automate’ some of your work, you should perhaps do this in R. You will notice that writing syntaxes in R is a lot more nifty and clever than in SPSS. Still, as working with any statistical package, you will have to have knowledge about what you are doing (statistically) and what you are willing to accomplish.</p>
|
||||
<p>To demonstrate the first point:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="co"># not all values are valid MIC values:</span></a>
|
||||
<a class="sourceLine" id="cb1-2" title="2"><span class="kw"><a href="../reference/as.mic.html">as.mic</a></span>(<span class="fl">0.125</span>)</a>
|
||||
@@ -265,14 +265,17 @@
|
||||
<a class="sourceLine" id="cb1-21" title="21"><span class="co">#> mo amox</span></a>
|
||||
<a class="sourceLine" id="cb1-22" title="22"><span class="co">#> 1 klebsiella R</span></a>
|
||||
<a class="sourceLine" id="cb1-23" title="23"></a>
|
||||
<a class="sourceLine" id="cb1-24" title="24"><span class="co"># hundreds of trade names can be translated to an ATC or name:</span></a>
|
||||
<a class="sourceLine" id="cb1-25" title="25"><span class="kw"><a href="../reference/atc_property.html">atc_name</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-24" title="24"><span class="co"># hundreds of trade names can be translated to a name, trade name or an ATC code:</span></a>
|
||||
<a class="sourceLine" id="cb1-25" title="25"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-26" title="26"><span class="co">#> [1] "Flucloxacillin"</span></a>
|
||||
<a class="sourceLine" id="cb1-27" title="27"><span class="kw"><a href="../reference/as.atc.html">as.atc</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-28" title="28"><span class="co">#> Class 'atc'</span></a>
|
||||
<a class="sourceLine" id="cb1-29" title="29"><span class="co">#> [1] J01CF05</span></a>
|
||||
<a class="sourceLine" id="cb1-30" title="30"><span class="kw"><a href="../reference/atc_property.html">atc_tradenames</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-31" title="31"><span class="co">#> [1] "Flopen" "Floxapen" "Fluclox" "Sesamol" "Softapen" "Staphylex"</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb1-27" title="27"><span class="kw"><a href="../reference/ab_property.html">ab_tradenames</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-28" title="28"><span class="co">#> [1] "Floxacillin" "FLOXACILLIN" "Floxapen" </span></a>
|
||||
<a class="sourceLine" id="cb1-29" title="29"><span class="co">#> [4] "Floxapen sodium salt" "Fluclox" "Flucloxacilina" </span></a>
|
||||
<a class="sourceLine" id="cb1-30" title="30"><span class="co">#> [7] "Flucloxacillin" "Flucloxacilline" "Flucloxacillinum" </span></a>
|
||||
<a class="sourceLine" id="cb1-31" title="31"><span class="co">#> [10] "Fluorochloroxacillin"</span></a>
|
||||
<a class="sourceLine" id="cb1-32" title="32"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="st">"floxapen"</span>)</a>
|
||||
<a class="sourceLine" id="cb1-33" title="33"><span class="co">#> Class 'atc'</span></a>
|
||||
<a class="sourceLine" id="cb1-34" title="34"><span class="co">#> [1] J01CF05</span></a></code></pre></div>
|
||||
</div>
|
||||
<div id="import-data-from-spsssasstata" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
|
||||
@@ -40,7 +40,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="Released version">0.5.0.9017</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/Predict.html">
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
@@ -83,6 +83,13 @@
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
@@ -91,14 +98,14 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/mo_property.html">
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/ab_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -185,7 +192,7 @@
|
||||
<h1>How to get properties of an antibiotic</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">09 February 2019</h4>
|
||||
<h4 class="date">10 May 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>ab_property.Rmd</code></div>
|
||||
|
||||
@@ -40,7 +40,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -192,7 +192,7 @@
|
||||
<h1>Benchmarks</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">09 April 2019</h4>
|
||||
<h4 class="date">10 May 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>benchmarks.Rmd</code></div>
|
||||
@@ -217,14 +217,14 @@
|
||||
<a class="sourceLine" id="cb2-8" title="8"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb2-9" title="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
|
||||
<a class="sourceLine" id="cb2-10" title="10"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#> as.mo("sau") 18 18.0 27 18.0 18.0 65 10</span></a>
|
||||
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#> as.mo("stau") 48 48.0 56 48.0 48.0 130 10</span></a>
|
||||
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#> as.mo("staaur") 18 18.0 24 18.0 18.0 76 10</span></a>
|
||||
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#> as.mo("STAAUR") 18 18.0 27 18.0 19.0 63 10</span></a>
|
||||
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#> as.mo("S. aureus") 28 28.0 33 28.0 29.0 72 10</span></a>
|
||||
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#> as.mo("S. aureus") 28 29.0 38 29.0 31.0 76 10</span></a>
|
||||
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#> as.mo("Staphylococcus aureus") 8 8.1 12 8.1 8.2 52 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#> as.mo("sau") 18.0 18 23.0 18 18.0 65 10</span></a>
|
||||
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#> as.mo("stau") 47.0 48 48.0 48 48.0 50 10</span></a>
|
||||
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#> as.mo("staaur") 18.0 18 22.0 18 18.0 62 10</span></a>
|
||||
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#> as.mo("STAAUR") 18.0 18 32.0 19 62.0 62 10</span></a>
|
||||
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#> as.mo("S. aureus") 28.0 28 42.0 28 28.0 120 10</span></a>
|
||||
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#> as.mo("S. aureus") 28.0 28 40.0 28 29.0 98 10</span></a>
|
||||
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#> as.mo("Staphylococcus aureus") 7.9 8 9.2 8 8.1 20 10</span></a></code></pre></div>
|
||||
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</p>
|
||||
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Thermus islandicus</em> (<code>B_THERMS_ISL</code>), a bug probably never found before in humans:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">T.islandicus <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"theisl"</span>),</a>
|
||||
@@ -236,12 +236,12 @@
|
||||
<a class="sourceLine" id="cb3-7" title="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(T.islandicus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
|
||||
<a class="sourceLine" id="cb3-8" title="8"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb3-9" title="9"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#> as.mo("theisl") 460 480 490 500 510 510 10</span></a>
|
||||
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#> as.mo("THEISL") 460 460 490 470 510 520 10</span></a>
|
||||
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#> as.mo("T. islandicus") 72 73 88 75 110 120 10</span></a>
|
||||
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#> as.mo("T. islandicus") 73 73 87 74 100 140 10</span></a>
|
||||
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#> as.mo("Thermus islandicus") 72 73 90 75 120 130 10</span></a></code></pre></div>
|
||||
<p>That takes 8 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
|
||||
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#> as.mo("theisl") 470 470 490 470 520 520 10</span></a>
|
||||
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#> as.mo("THEISL") 470 470 500 510 520 520 10</span></a>
|
||||
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#> as.mo("T. islandicus") 76 76 81 76 77 120 10</span></a>
|
||||
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#> as.mo("T. islandicus") 76 76 94 78 120 120 10</span></a>
|
||||
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#> as.mo("Thermus islandicus") 74 74 96 77 120 150 10</span></a></code></pre></div>
|
||||
<p>That takes 8.2 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
|
||||
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Thermus islandicus</em> (which is very uncommon):</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">16</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (16)</span></a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"></a>
|
||||
@@ -253,7 +253,7 @@
|
||||
<a class="sourceLine" id="cb4-8" title="8"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>),</a>
|
||||
<a class="sourceLine" id="cb4-9" title="9"> <span class="dt">times =</span> <span class="dv">10</span>),</a>
|
||||
<a class="sourceLine" id="cb4-10" title="10"> <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"s"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>,</a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"> <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylab =</span> <span class="st">"Time in seconds"</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, <span class="fl">0.5</span>),</a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"> <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylab =</span> <span class="st">"Time in seconds"</span>,</a>
|
||||
<a class="sourceLine" id="cb4-12" title="12"> <span class="dt">main =</span> <span class="st">"Benchmarks per prevalence"</span>)</a></code></pre></div>
|
||||
<p><img src="benchmarks_files/figure-html/unnamed-chunk-5-1.png" width="720"></p>
|
||||
<p>Uncommon microorganisms take a lot more time than common microorganisms. To relieve this pitfall and further improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
|
||||
@@ -286,9 +286,9 @@
|
||||
<a class="sourceLine" id="cb5-23" title="23"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb5-24" title="24"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb5-25" title="25"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb5-26" title="26"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb5-27" title="27"><span class="co">#> mo_fullname(x) 774 777 811 783 829 947 10</span></a></code></pre></div>
|
||||
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.78 seconds (783 ms). You only lose time on your unique input values.</p>
|
||||
<a class="sourceLine" id="cb5-26" title="26"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb5-27" title="27"><span class="co">#> mo_fullname(x) 777 780 859 864 870 1080 10</span></a></code></pre></div>
|
||||
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.86 seconds (864 ms). You only lose time on your unique input values.</p>
|
||||
</div>
|
||||
<div id="precalculated-results" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -300,11 +300,11 @@
|
||||
<a class="sourceLine" id="cb6-4" title="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb6-5" title="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#> A 12.000 12.100 12.500 12.400 12.800 13.20 10</span></a>
|
||||
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#> B 25.800 26.200 26.900 26.600 27.800 28.00 10</span></a>
|
||||
<a class="sourceLine" id="cb6-10" title="10"><span class="co">#> C 0.476 0.691 0.758 0.812 0.848 1.03 10</span></a></code></pre></div>
|
||||
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0008 seconds - it doesn’t even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
|
||||
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#> A 13.30 14.0 14.3 14.1 14.30 17.30 10</span></a>
|
||||
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#> B 25.20 25.5 36.5 26.5 39.60 71.30 10</span></a>
|
||||
<a class="sourceLine" id="cb6-10" title="10"><span class="co">#> C 1.68 1.7 1.9 1.8 1.94 2.81 10</span></a></code></pre></div>
|
||||
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0018 seconds - it doesn’t even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">run_it <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
|
||||
<a class="sourceLine" id="cb7-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
|
||||
<a class="sourceLine" id="cb7-3" title="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
|
||||
@@ -317,14 +317,14 @@
|
||||
<a class="sourceLine" id="cb7-10" title="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb7-11" title="11"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb7-12" title="12"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb7-13" title="13"><span class="co">#> A 0.364 0.403 0.452 0.455 0.496 0.575 10</span></a>
|
||||
<a class="sourceLine" id="cb7-14" title="14"><span class="co">#> B 0.478 0.533 0.566 0.565 0.594 0.645 10</span></a>
|
||||
<a class="sourceLine" id="cb7-15" title="15"><span class="co">#> C 0.512 0.726 0.851 0.893 1.010 1.150 10</span></a>
|
||||
<a class="sourceLine" id="cb7-16" title="16"><span class="co">#> D 0.409 0.460 0.490 0.507 0.530 0.544 10</span></a>
|
||||
<a class="sourceLine" id="cb7-17" title="17"><span class="co">#> E 0.375 0.380 0.454 0.476 0.488 0.524 10</span></a>
|
||||
<a class="sourceLine" id="cb7-18" title="18"><span class="co">#> F 0.395 0.411 0.463 0.442 0.522 0.587 10</span></a>
|
||||
<a class="sourceLine" id="cb7-19" title="19"><span class="co">#> G 0.381 0.404 0.454 0.451 0.495 0.546 10</span></a>
|
||||
<a class="sourceLine" id="cb7-20" title="20"><span class="co">#> H 0.232 0.268 0.304 0.297 0.336 0.391 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb7-13" title="13"><span class="co">#> A 0.417 0.456 0.511 0.494 0.558 0.612 10</span></a>
|
||||
<a class="sourceLine" id="cb7-14" title="14"><span class="co">#> B 0.416 0.555 0.620 0.614 0.658 0.837 10</span></a>
|
||||
<a class="sourceLine" id="cb7-15" title="15"><span class="co">#> C 1.360 1.630 1.970 1.880 1.970 3.220 10</span></a>
|
||||
<a class="sourceLine" id="cb7-16" title="16"><span class="co">#> D 0.435 0.519 0.671 0.665 0.734 1.120 10</span></a>
|
||||
<a class="sourceLine" id="cb7-17" title="17"><span class="co">#> E 0.356 0.429 0.491 0.452 0.486 0.916 10</span></a>
|
||||
<a class="sourceLine" id="cb7-18" title="18"><span class="co">#> F 0.384 0.450 0.559 0.502 0.543 1.180 10</span></a>
|
||||
<a class="sourceLine" id="cb7-19" title="19"><span class="co">#> G 0.407 0.450 0.591 0.527 0.663 1.080 10</span></a>
|
||||
<a class="sourceLine" id="cb7-20" title="20"><span class="co">#> H 0.219 0.272 0.295 0.276 0.311 0.420 10</span></a></code></pre></div>
|
||||
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
|
||||
</div>
|
||||
<div id="results-in-other-languages" class="section level3">
|
||||
@@ -350,14 +350,14 @@
|
||||
<a class="sourceLine" id="cb8-17" title="17"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb8-18" title="18"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
|
||||
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#> Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb8-21" title="21"><span class="co">#> en 18.37 19.07 19.98 19.22 19.41 27.24 10</span></a>
|
||||
<a class="sourceLine" id="cb8-22" title="22"><span class="co">#> de 30.58 31.06 35.93 31.42 31.54 77.27 10</span></a>
|
||||
<a class="sourceLine" id="cb8-23" title="23"><span class="co">#> nl 31.01 31.33 37.73 31.41 31.59 93.52 10</span></a>
|
||||
<a class="sourceLine" id="cb8-24" title="24"><span class="co">#> es 31.38 31.45 36.30 31.81 32.53 76.12 10</span></a>
|
||||
<a class="sourceLine" id="cb8-25" title="25"><span class="co">#> it 30.98 31.40 36.99 31.58 32.30 84.46 10</span></a>
|
||||
<a class="sourceLine" id="cb8-26" title="26"><span class="co">#> fr 31.19 31.21 35.82 31.45 31.62 75.52 10</span></a>
|
||||
<a class="sourceLine" id="cb8-27" title="27"><span class="co">#> pt 31.02 31.36 40.85 32.22 33.84 76.22 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#> expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb8-21" title="21"><span class="co">#> en 18.34 18.37 23.22 18.54 19.53 63.17 10</span></a>
|
||||
<a class="sourceLine" id="cb8-22" title="22"><span class="co">#> de 23.46 23.50 23.76 23.57 23.76 25.10 10</span></a>
|
||||
<a class="sourceLine" id="cb8-23" title="23"><span class="co">#> nl 50.78 52.48 62.59 53.54 57.07 100.20 10</span></a>
|
||||
<a class="sourceLine" id="cb8-24" title="24"><span class="co">#> es 23.53 23.59 28.70 23.76 24.17 68.55 10</span></a>
|
||||
<a class="sourceLine" id="cb8-25" title="25"><span class="co">#> it 23.31 23.40 23.69 23.51 23.79 24.73 10</span></a>
|
||||
<a class="sourceLine" id="cb8-26" title="26"><span class="co">#> fr 23.45 23.52 24.21 24.06 24.88 25.21 10</span></a>
|
||||
<a class="sourceLine" id="cb8-27" title="27"><span class="co">#> pt 23.54 23.72 24.37 24.39 24.90 25.58 10</span></a></code></pre></div>
|
||||
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@@ -78,7 +78,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -241,7 +241,7 @@
|
||||
<li><a href="G_test.html">How to use the *G*-test</a></li>
|
||||
<li><a href="SPSS.html">How to import data from SPSS / SAS / Stata</a></li>
|
||||
<li><a href="WHONET.html">How to work with WHONET data</a></li>
|
||||
<li><a href="atc_property.html">How to get properties of an antibiotic</a></li>
|
||||
<li><a href="ab_property.html">How to get properties of an antibiotic</a></li>
|
||||
<li><a href="benchmarks.html">Benchmarks</a></li>
|
||||
<li><a href="freq.html">How to create frequency tables</a></li>
|
||||
<li><a href="mo_property.html">How to get properties of a microorganism</a></li>
|
||||
|
||||
@@ -40,7 +40,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -192,7 +192,7 @@
|
||||
<h1>How to predict antimicrobial resistance</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">27 March 2019</h4>
|
||||
<h4 class="date">10 May 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>resistance_predict.Rmd</code></div>
|
||||
@@ -218,16 +218,16 @@
|
||||
<a href="#prediction-analysis" class="anchor"></a>Prediction analysis</h2>
|
||||
<p>Our package contains a function <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>, which takes the same input as functions for <a href="./AMR.html">other AMR analysis</a>. Based on a date column, it calculates cases per year and uses a regression model to predict antimicrobial resistance.</p>
|
||||
<p>It is basically as easy as:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="co"># resistance prediction of piperacillin/tazobactam (pita):</span></a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">tbl =</span> septic_patients, <span class="dt">col_date =</span> <span class="st">"date"</span>, <span class="dt">col_ab =</span> <span class="st">"pita"</span>)</a>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="co"># resistance prediction of piperacillin/tazobactam (TZP):</span></a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">tbl =</span> septic_patients, <span class="dt">col_date =</span> <span class="st">"date"</span>, <span class="dt">col_ab =</span> <span class="st">"TZP"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-3" title="3"></a>
|
||||
<a class="sourceLine" id="cb2-4" title="4"><span class="co"># or:</span></a>
|
||||
<a class="sourceLine" id="cb2-5" title="5">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"pita"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"TZP"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-7" title="7"></a>
|
||||
<a class="sourceLine" id="cb2-8" title="8"><span class="co"># to bind it to object 'predict_pita' for example:</span></a>
|
||||
<a class="sourceLine" id="cb2-9" title="9">predict_pita <-<span class="st"> </span>septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-10" title="10"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"pita"</span>)</a></code></pre></div>
|
||||
<a class="sourceLine" id="cb2-8" title="8"><span class="co"># to bind it to object 'predict_TZP' for example:</span></a>
|
||||
<a class="sourceLine" id="cb2-9" title="9">predict_TZP <-<span class="st"> </span>septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-10" title="10"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"TZP"</span>)</a></code></pre></div>
|
||||
<p>The function will look for a date column itself if <code>col_date</code> is not set.</p>
|
||||
<p>When running any of these commands, a summary of the regression model will be printed unless using <code><a href="../reference/resistance_predict.html">resistance_predict(..., info = FALSE)</a></code>.</p>
|
||||
<pre><code>#> NOTE: Using column `date` as input for `col_date`.
|
||||
@@ -240,62 +240,62 @@
|
||||
#>
|
||||
#> Deviance Residuals:
|
||||
#> Min 1Q Median 3Q Max
|
||||
#> -2.9224 -1.3120 0.0170 0.7586 3.1932
|
||||
#> -2.9203 -1.3066 0.0166 0.7641 3.1984
|
||||
#>
|
||||
#> Coefficients:
|
||||
#> Estimate Std. Error z value Pr(>|z|)
|
||||
#> (Intercept) -222.92857 45.93922 -4.853 1.22e-06 ***
|
||||
#> year 0.10994 0.02284 4.814 1.48e-06 ***
|
||||
#> (Intercept) -222.51053 45.94675 -4.843 1.28e-06 ***
|
||||
#> year 0.10973 0.02284 4.805 1.55e-06 ***
|
||||
#> ---
|
||||
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
|
||||
#>
|
||||
#> (Dispersion parameter for binomial family taken to be 1)
|
||||
#>
|
||||
#> Null deviance: 59.794 on 14 degrees of freedom
|
||||
#> Residual deviance: 35.191 on 13 degrees of freedom
|
||||
#> AIC: 93.464
|
||||
#> Null deviance: 59.763 on 14 degrees of freedom
|
||||
#> Residual deviance: 35.261 on 13 degrees of freedom
|
||||
#> AIC: 93.537
|
||||
#>
|
||||
#> Number of Fisher Scoring iterations: 4</code></pre>
|
||||
<p>This text is only a printed summary - the actual result (output) of the function is a <code>data.frame</code> containing for each year: the number of observations, the actual observed resistance, the estimated resistance and the standard error below and above the estimation:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">predict_pita</a>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">predict_TZP</a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"><span class="co">#> year value se_min se_max observations observed estimated</span></a>
|
||||
<a class="sourceLine" id="cb4-3" title="3"><span class="co">#> 1 2003 0.06250000 NA NA 32 0.06250000 0.06177594</span></a>
|
||||
<a class="sourceLine" id="cb4-4" title="4"><span class="co">#> 2 2004 0.08536585 NA NA 82 0.08536585 0.06846343</span></a>
|
||||
<a class="sourceLine" id="cb4-5" title="5"><span class="co">#> 3 2005 0.10000000 NA NA 60 0.10000000 0.07581637</span></a>
|
||||
<a class="sourceLine" id="cb4-6" title="6"><span class="co">#> 4 2006 0.05084746 NA NA 59 0.05084746 0.08388789</span></a>
|
||||
<a class="sourceLine" id="cb4-7" title="7"><span class="co">#> 5 2007 0.12121212 NA NA 66 0.12121212 0.09273250</span></a>
|
||||
<a class="sourceLine" id="cb4-8" title="8"><span class="co">#> 6 2008 0.04166667 NA NA 72 0.04166667 0.10240539</span></a>
|
||||
<a class="sourceLine" id="cb4-9" title="9"><span class="co">#> 7 2009 0.01639344 NA NA 61 0.01639344 0.11296163</span></a>
|
||||
<a class="sourceLine" id="cb4-10" title="10"><span class="co">#> 8 2010 0.09433962 NA NA 53 0.09433962 0.12445516</span></a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"><span class="co">#> 9 2011 0.18279570 NA NA 93 0.18279570 0.13693759</span></a>
|
||||
<a class="sourceLine" id="cb4-12" title="12"><span class="co">#> 10 2012 0.30769231 NA NA 65 0.30769231 0.15045682</span></a>
|
||||
<a class="sourceLine" id="cb4-13" title="13"><span class="co">#> 11 2013 0.08620690 NA NA 58 0.08620690 0.16505550</span></a>
|
||||
<a class="sourceLine" id="cb4-14" title="14"><span class="co">#> 12 2014 0.15254237 NA NA 59 0.15254237 0.18076926</span></a>
|
||||
<a class="sourceLine" id="cb4-15" title="15"><span class="co">#> 13 2015 0.27272727 NA NA 55 0.27272727 0.19762493</span></a>
|
||||
<a class="sourceLine" id="cb4-16" title="16"><span class="co">#> 14 2016 0.25000000 NA NA 84 0.25000000 0.21563859</span></a>
|
||||
<a class="sourceLine" id="cb4-17" title="17"><span class="co">#> 15 2017 0.16279070 NA NA 86 0.16279070 0.23481370</span></a>
|
||||
<a class="sourceLine" id="cb4-18" title="18"><span class="co">#> 16 2018 0.25513926 0.2228376 0.2874409 NA NA 0.25513926</span></a>
|
||||
<a class="sourceLine" id="cb4-19" title="19"><span class="co">#> 17 2019 0.27658825 0.2386811 0.3144954 NA NA 0.27658825</span></a>
|
||||
<a class="sourceLine" id="cb4-20" title="20"><span class="co">#> 18 2020 0.29911630 0.2551715 0.3430611 NA NA 0.29911630</span></a>
|
||||
<a class="sourceLine" id="cb4-21" title="21"><span class="co">#> 19 2021 0.32266085 0.2723340 0.3729877 NA NA 0.32266085</span></a>
|
||||
<a class="sourceLine" id="cb4-22" title="22"><span class="co">#> 20 2022 0.34714076 0.2901847 0.4040968 NA NA 0.34714076</span></a>
|
||||
<a class="sourceLine" id="cb4-23" title="23"><span class="co">#> 21 2023 0.37245666 0.3087318 0.4361815 NA NA 0.37245666</span></a>
|
||||
<a class="sourceLine" id="cb4-24" title="24"><span class="co">#> 22 2024 0.39849187 0.3279750 0.4690088 NA NA 0.39849187</span></a>
|
||||
<a class="sourceLine" id="cb4-25" title="25"><span class="co">#> 23 2025 0.42511415 0.3479042 0.5023241 NA NA 0.42511415</span></a>
|
||||
<a class="sourceLine" id="cb4-26" title="26"><span class="co">#> 24 2026 0.45217796 0.3684992 0.5358568 NA NA 0.45217796</span></a>
|
||||
<a class="sourceLine" id="cb4-27" title="27"><span class="co">#> 25 2027 0.47952757 0.3897276 0.5693275 NA NA 0.47952757</span></a>
|
||||
<a class="sourceLine" id="cb4-28" title="28"><span class="co">#> 26 2028 0.50700045 0.4115444 0.6024565 NA NA 0.50700045</span></a>
|
||||
<a class="sourceLine" id="cb4-29" title="29"><span class="co">#> 27 2029 0.53443111 0.4338908 0.6349714 NA NA 0.53443111</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb4-3" title="3"><span class="co">#> 1 2003 0.06250000 NA NA 32 0.06250000 0.06179057</span></a>
|
||||
<a class="sourceLine" id="cb4-4" title="4"><span class="co">#> 2 2004 0.08536585 NA NA 82 0.08536585 0.06846623</span></a>
|
||||
<a class="sourceLine" id="cb4-5" title="5"><span class="co">#> 3 2005 0.10000000 NA NA 60 0.10000000 0.07580483</span></a>
|
||||
<a class="sourceLine" id="cb4-6" title="6"><span class="co">#> 4 2006 0.05084746 NA NA 59 0.05084746 0.08385921</span></a>
|
||||
<a class="sourceLine" id="cb4-7" title="7"><span class="co">#> 5 2007 0.12121212 NA NA 66 0.12121212 0.09268356</span></a>
|
||||
<a class="sourceLine" id="cb4-8" title="8"><span class="co">#> 6 2008 0.04166667 NA NA 72 0.04166667 0.10233276</span></a>
|
||||
<a class="sourceLine" id="cb4-9" title="9"><span class="co">#> 7 2009 0.01639344 NA NA 61 0.01639344 0.11286156</span></a>
|
||||
<a class="sourceLine" id="cb4-10" title="10"><span class="co">#> 8 2010 0.09433962 NA NA 53 0.09433962 0.12432363</span></a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"><span class="co">#> 9 2011 0.18279570 NA NA 93 0.18279570 0.13677030</span></a>
|
||||
<a class="sourceLine" id="cb4-12" title="12"><span class="co">#> 10 2012 0.30769231 NA NA 65 0.30769231 0.15024926</span></a>
|
||||
<a class="sourceLine" id="cb4-13" title="13"><span class="co">#> 11 2013 0.08620690 NA NA 58 0.08620690 0.16480299</span></a>
|
||||
<a class="sourceLine" id="cb4-14" title="14"><span class="co">#> 12 2014 0.15000000 NA NA 60 0.15000000 0.18046706</span></a>
|
||||
<a class="sourceLine" id="cb4-15" title="15"><span class="co">#> 13 2015 0.27272727 NA NA 55 0.27272727 0.19726831</span></a>
|
||||
<a class="sourceLine" id="cb4-16" title="16"><span class="co">#> 14 2016 0.25000000 NA NA 84 0.25000000 0.21522295</span></a>
|
||||
<a class="sourceLine" id="cb4-17" title="17"><span class="co">#> 15 2017 0.16279070 NA NA 86 0.16279070 0.23433471</span></a>
|
||||
<a class="sourceLine" id="cb4-18" title="18"><span class="co">#> 16 2018 0.25459302 0.2223385 0.2868476 NA NA 0.25459302</span></a>
|
||||
<a class="sourceLine" id="cb4-19" title="19"><span class="co">#> 17 2019 0.27597143 0.2381174 0.3138255 NA NA 0.27597143</span></a>
|
||||
<a class="sourceLine" id="cb4-20" title="20"><span class="co">#> 18 2020 0.29842630 0.2545398 0.3423128 NA NA 0.29842630</span></a>
|
||||
<a class="sourceLine" id="cb4-21" title="21"><span class="co">#> 19 2021 0.32189595 0.2716308 0.3721611 NA NA 0.32189595</span></a>
|
||||
<a class="sourceLine" id="cb4-22" title="22"><span class="co">#> 20 2022 0.34630028 0.2894072 0.4031934 NA NA 0.34630028</span></a>
|
||||
<a class="sourceLine" id="cb4-23" title="23"><span class="co">#> 21 2023 0.37154107 0.3078773 0.4352048 NA NA 0.37154107</span></a>
|
||||
<a class="sourceLine" id="cb4-24" title="24"><span class="co">#> 22 2024 0.39750288 0.3270414 0.4679643 NA NA 0.39750288</span></a>
|
||||
<a class="sourceLine" id="cb4-25" title="25"><span class="co">#> 23 2025 0.42405472 0.3468903 0.5012191 NA NA 0.42405472</span></a>
|
||||
<a class="sourceLine" id="cb4-26" title="26"><span class="co">#> 24 2026 0.45105237 0.3674044 0.5347004 NA NA 0.45105237</span></a>
|
||||
<a class="sourceLine" id="cb4-27" title="27"><span class="co">#> 25 2027 0.47834130 0.3885523 0.5681303 NA NA 0.47834130</span></a>
|
||||
<a class="sourceLine" id="cb4-28" title="28"><span class="co">#> 26 2028 0.50576012 0.4102900 0.6012302 NA NA 0.50576012</span></a>
|
||||
<a class="sourceLine" id="cb4-29" title="29"><span class="co">#> 27 2029 0.53314434 0.4325600 0.6337287 NA NA 0.53314434</span></a></code></pre></div>
|
||||
<p>The function <code>plot</code> is available in base R, and can be extended by other packages to depend the output based on the type of input. We extended its function to cope with resistance predictions:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(predict_pita)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(predict_TZP)</a></code></pre></div>
|
||||
<p><img src="resistance_predict_files/figure-html/unnamed-chunk-4-1.png" width="720"></p>
|
||||
<p>This is the fastest way to plot the result. It automatically adds the right axes, error bars, titles, number of available observations and type of model.</p>
|
||||
<p>We also support the <code>ggplot2</code> package with our custom function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> to create more appealing plots:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(predict_pita)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(predict_TZP)</a></code></pre></div>
|
||||
<p><img src="resistance_predict_files/figure-html/unnamed-chunk-5-1.png" width="720"></p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"></a>
|
||||
<a class="sourceLine" id="cb7-2" title="2"><span class="co"># choose for error bars instead of a ribbon</span></a>
|
||||
<a class="sourceLine" id="cb7-3" title="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(predict_pita, <span class="dt">ribbon =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
|
||||
<a class="sourceLine" id="cb7-3" title="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(predict_TZP, <span class="dt">ribbon =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
|
||||
<p><img src="resistance_predict_files/figure-html/unnamed-chunk-5-2.png" width="720"></p>
|
||||
<div id="choosing-the-right-model" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -303,7 +303,7 @@
|
||||
<p>Resistance is not easily predicted; if we look at vancomycin resistance in Gram positives, the spread (i.e. standard error) is enormous:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb8-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(mo) <span class="op">==</span><span class="st"> "Gram positive"</span>) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb8-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"vanc"</span>, <span class="dt">year_min =</span> <span class="dv">2010</span>, <span class="dt">info =</span> <span class="ot">FALSE</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb8-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"VAN"</span>, <span class="dt">year_min =</span> <span class="dv">2010</span>, <span class="dt">info =</span> <span class="ot">FALSE</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb8-4" title="4"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>()</a>
|
||||
<a class="sourceLine" id="cb8-5" title="5"><span class="co">#> </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a></code></pre></div>
|
||||
<p><img src="resistance_predict_files/figure-html/unnamed-chunk-6-1.png" width="720"></p>
|
||||
@@ -348,13 +348,13 @@
|
||||
<p>For the vancomycin resistance in Gram positive bacteria, a linear model might be more appropriate since no (left half of a) binomial distribution is to be expected based on the observed years:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb9-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(mo) <span class="op">==</span><span class="st"> "Gram positive"</span>) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb9-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"vanc"</span>, <span class="dt">year_min =</span> <span class="dv">2010</span>, <span class="dt">info =</span> <span class="ot">FALSE</span>, <span class="dt">model =</span> <span class="st">"linear"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb9-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="dt">col_ab =</span> <span class="st">"VAN"</span>, <span class="dt">year_min =</span> <span class="dv">2010</span>, <span class="dt">info =</span> <span class="ot">FALSE</span>, <span class="dt">model =</span> <span class="st">"linear"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb9-4" title="4"><span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>()</a>
|
||||
<a class="sourceLine" id="cb9-5" title="5"><span class="co">#> </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a></code></pre></div>
|
||||
<p><img src="resistance_predict_files/figure-html/unnamed-chunk-7-1.png" width="720"></p>
|
||||
<p>This seems more likely, doesn’t it?</p>
|
||||
<p>The model itself is also available from the object, as an <code>attribute</code>:</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1">model <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/attributes">attributes</a></span>(predict_pita)<span class="op">$</span>model</a>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1">model <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/attributes">attributes</a></span>(predict_TZP)<span class="op">$</span>model</a>
|
||||
<a class="sourceLine" id="cb10-2" title="2"></a>
|
||||
<a class="sourceLine" id="cb10-3" title="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(model)<span class="op">$</span>family</a>
|
||||
<a class="sourceLine" id="cb10-4" title="4"><span class="co">#> </span></a>
|
||||
@@ -363,8 +363,8 @@
|
||||
<a class="sourceLine" id="cb10-7" title="7"></a>
|
||||
<a class="sourceLine" id="cb10-8" title="8"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(model)<span class="op">$</span>coefficients</a>
|
||||
<a class="sourceLine" id="cb10-9" title="9"><span class="co">#> Estimate Std. Error z value Pr(>|z|)</span></a>
|
||||
<a class="sourceLine" id="cb10-10" title="10"><span class="co">#> (Intercept) -222.9285736 45.93922388 -4.852685 1.218012e-06</span></a>
|
||||
<a class="sourceLine" id="cb10-11" title="11"><span class="co">#> year 0.1099391 0.02283501 4.814500 1.475690e-06</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb10-10" title="10"><span class="co">#> (Intercept) -222.5105288 45.94675125 -4.842791 1.280277e-06</span></a>
|
||||
<a class="sourceLine" id="cb10-11" title="11"><span class="co">#> year 0.1097306 0.02283874 4.804581 1.550761e-06</span></a></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
@@ -78,7 +78,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/atc_property.html">
|
||||
<a href="reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
// Add updated Font Awesome 5.6.3 library
|
||||
$('head').append('<!-- Updated Font Awesome library --><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">');
|
||||
|
||||
// Email template for new GitLab issues
|
||||
//https://stackoverflow.com/a/33190494/4575331
|
||||
//incoming+msberends-amr-9011429-5miwzuo1xo70wbz9r6fwv4dmg-issue@incoming.gitlab.com
|
||||
|
||||
// Edit footer
|
||||
$( document ).ready(function() {
|
||||
|
||||
|
||||
@@ -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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/atc_property.html">
|
||||
<a href="reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -197,7 +197,7 @@
|
||||
<p><em>(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <a href="./articles/AMR.html">continue reading here to get started</a>.</em></p>
|
||||
<hr>
|
||||
<p><code>AMR</code> is a free and open-source <a href="https://www.r-project.org">R package</a> to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any data format, including WHONET/EARS-Net data.</p>
|
||||
<p>After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~65,000 microorganisms</strong></a> and <a href="./reference/antibiotics.html"><strong>~500 antibiotics</strong></a> by name and code, and knows all about valid RSI and MIC values.</p>
|
||||
<p>After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~65,000 microorganisms</strong></a> and <a href="./reference/antibiotics.html"><strong>~450 antibiotics</strong></a> by name and code, and knows all about valid RSI and MIC values.</p>
|
||||
<p><strong>Used to SPSS?</strong> Read our <a href="./articles/SPSS.html">tutorial on how to import data from SPSS, SAS or Stata</a> and learn in which ways R outclasses any of these statistical packages.</p>
|
||||
<p>We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and is free software; you can freely use and distribute it for both personal and commercial (but <strong>not</strong> patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full license <a href="./LICENSE-text.html">here</a>.</p>
|
||||
<p>This package can be used for:</p>
|
||||
@@ -295,7 +295,7 @@
|
||||
<div>
|
||||
<img src="reference/figures/logo_who.png" height="75px" class="logo_img"><p class="logo_txt">WHO Collaborating Centre for Drug Statistics Methodology</p>
|
||||
</div>
|
||||
<p>This package contains <strong>all ~500 antimicrobial drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href="https://www.whocc.no" class="uri">https://www.whocc.no</a>) and the <a href="http://ec.europa.eu/health/documents/community-register/html/atc.htm">Pharmaceuticals Community Register of the European Commission</a>.</p>
|
||||
<p>This package contains <strong>all ~450 antimicrobial drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href="https://www.whocc.no" class="uri">https://www.whocc.no</a>) and the <a href="http://ec.europa.eu/health/documents/community-register/html/atc.htm">Pharmaceuticals Community Register of the European Commission</a>.</p>
|
||||
<p>Read more about the data from WHOCC <a href="./reference/WHOCC.html">in our manual</a>.</p>
|
||||
</div>
|
||||
<div id="whonet--ears-net" class="section level4">
|
||||
@@ -313,10 +313,10 @@
|
||||
<li>
|
||||
<p>It <strong>cleanses existing data</strong> by providing new <em>classes</em> for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). By installing this package, you teach R everything about microbiology that is needed for analysis. These functions all use intelligent rules to guess results that you would expect:</p>
|
||||
<ul>
|
||||
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our <a href="./articles/benchmarks.html">benchmarks</a>. Moreover, it can group <em>Staphylococci</em> into coagulase negative and positive (CoNS and CoPS, see <a href="./reference/as.mo.html#source">source</a>) and can categorise <em>Streptococci</em> into Lancefield groups (like beta-haemolytic <em>Streptococcus</em> Group B, <a href="./reference/as.mo.html#source">source</a>).</li>
|
||||
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get a microbial ID. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our <a href="./articles/benchmarks.html">benchmarks</a>. Moreover, it can group <em>Staphylococci</em> into coagulase negative and positive (CoNS and CoPS, see <a href="./reference/as.mo.html#source">source</a>) and can categorise <em>Streptococci</em> into Lancefield groups (like beta-haemolytic <em>Streptococcus</em> Group B, <a href="./reference/as.mo.html#source">source</a>).</li>
|
||||
<li>Use <code><a href="reference/as.rsi.html">as.rsi()</a></code> to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.</li>
|
||||
<li>Use <code><a href="reference/as.mic.html">as.mic()</a></code> to cleanse your MIC values. It produces a so-called factor (called <em>ordinal</em> in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.</li>
|
||||
<li>Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.</li>
|
||||
<li>Use <code><a href="reference/as.ab.html">as.ab()</a></code> to get a antibiotic ID, which are abbreviations used by EARS-Net whenever available. Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ID of Nitrofurantoine.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
@@ -330,7 +330,7 @@
|
||||
</li>
|
||||
<li>Use <code><a href="reference/mdro.html">mdro()</a></code> (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.</li>
|
||||
<li>The <a href="./reference/microorganisms.html">data set <code>microorganisms</code></a> contains the complete taxonomic tree of ~65,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like <code><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use the same intelligent rules for determination. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.</li>
|
||||
<li>The <a href="./reference/antibiotics.html">data set <code>antibiotics</code></a> contains almost 500 antimicrobial drugs with their ATC code, EARS-Net code, common LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains hundreds of trade names. Use functions like <code><a href="reference/atc_property.html">atc_name()</a></code> and <code><a href="reference/atc_property.html">atc_tradenames()</a></code> to look up values. The <code>atc_*</code> functions use <code><a href="reference/as.atc.html">as.atc()</a></code> internally so they support the same intelligent rules to guess the most probable result. For example, <code><a href="reference/atc_property.html">atc_name("Fluclox")</a></code>, <code><a href="reference/atc_property.html">atc_name("Floxapen")</a></code> and <code><a href="reference/atc_property.html">atc_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
|
||||
<li>The <a href="./reference/antibiotics.html">data set <code>antibiotics</code></a> contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like <code><a href="reference/ab_property.html">ab_name()</a></code>, <code><a href="reference/ab_property.html">ab_group()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="reference/as.ab.html">as.ab()</a></code> internally so they support the same intelligent rules to guess the most probable result. For example, <code><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@@ -78,7 +78,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -237,24 +237,48 @@
|
||||
<a href="#amr-0619001" class="anchor"></a>AMR 0.6.1.9001<small> Unreleased </small>
|
||||
</h1>
|
||||
<p><strong>Note: latest development version</strong></p>
|
||||
<div id="new" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use <code><a href="../reference/as.rsi.html">as.rsi()</a></code> on an MIC value (created with <code><a href="../reference/as.mic.html">as.mic()</a></code>), a disk diffusion value (created with the new <code><a href="../reference/as.disk.html">as.disk()</a></code>) or on a complete date set containing columns with MIC or disk diffusion values.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>
|
||||
<li>Completely reworked the <code>antibiotics</code> data set:
|
||||
<ul>
|
||||
<li>All entries now have 3 different identifiers: a human readable EARS-Net code (<code>ab</code>, used by ECDC and WHONET), an ATC code (<code>atc</code>, used by WHO), and a CID code (<code>cid</code>, Compound ID, used by PubChem)</li>
|
||||
<li>Based on the Compound ID, more than a thousand official brand names have been added from many different countries</li>
|
||||
<li>All references to antibiotics in our package now use EARS-Net codes, like <code>AMX</code> for amoxicillin</li>
|
||||
<li>Functions <code>atc_certe</code>, <code>ab_umcg</code> and <code>atc_trivial_nl</code> have been removed</li>
|
||||
<li>All <code>atc_*</code> functions are superceded by <code>ab_*</code> functions</li>
|
||||
<li>
|
||||
<p>All output will be translated by using an included, local translation file that can be found after install with:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/system.file">system.file</a></span>(<span class="st">"translations.tsv"</span>, <span class="dt">package =</span> <span class="st">"AMR"</span>)</a></code></pre></div>
|
||||
Please create an issue in one of our repositories if you want additions in this file.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Improved intelligence of looking up antibiotic tables in data set using <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>
|
||||
</li>
|
||||
<li>Added ~5,000 more old taxonomic names to the <code>microorganisms.old</code> data set, which leads to better results finding when using the <code><a href="../reference/as.mo.html">as.mo()</a></code> function</li>
|
||||
<li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>, <code>rsi()</code>
|
||||
</li>
|
||||
<li>Frequency tables of microbial IDs speed improvement</li>
|
||||
<li>Removed all hardcoded EUCAST rules and replaced them with a new reference file: <code>./inst/eucast/eucast.tsv</code>.</li>
|
||||
<li>Added ceftazidim intrinsic resistance to <em>Streptococci</em>
|
||||
</li>
|
||||
<li>Changed default settings for <code><a href="../reference/age_groups.html">age_groups()</a></code>, to let groups of fives and tens end with 100+ instead of 120+.</li>
|
||||
<li>Fix for <code><a href="../reference/freq.html">freq()</a></code> for when all values are <code>NA</code>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Support for R 3.6.0</li>
|
||||
<li>Prevented <a href="https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html">staged install</a> in R 3.6.0 and later by adding <code>StagedInstall: false</code> to the DESCRIPTION file</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -283,9 +307,9 @@
|
||||
<li>Contains the complete manual of this package and all of its functions with an explanation of their parameters</li>
|
||||
<li>Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis, import data from WHONET or SPSS and many more.</li>
|
||||
</ul>
|
||||
<div id="new" class="section level4">
|
||||
<div id="new-1" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new" class="anchor"></a>New</h4>
|
||||
<a href="#new-1" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to ‘bactid’. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
|
||||
@@ -312,32 +336,32 @@ This data is updated annually - check the included version with the new function
|
||||
</li>
|
||||
<li>
|
||||
<p>New filters for antimicrobial classes. Use these functions to filter isolates on results in one of more antibiotics from a specific class:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-2" title="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-3" title="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-4" title="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-5" title="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-6" title="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-7" title="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-8" title="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-9" title="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-10" title="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-11" title="11"><span class="kw"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-3" title="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-4" title="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-5" title="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-6" title="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-7" title="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-8" title="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-9" title="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-10" title="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
|
||||
<a class="sourceLine" id="cb2-11" title="11"><span class="kw"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</a></code></pre></div>
|
||||
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
|
||||
<a class="sourceLine" id="cb2-3" title="3">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>, <span class="dt">scope =</span> <span class="st">"all"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-4" title="4"><span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-2" title="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
|
||||
<a class="sourceLine" id="cb3-3" title="3">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>, <span class="dt">scope =</span> <span class="st">"all"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-4" title="4"><span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">ab_property -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_property</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-2" title="2">ab_name -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_name</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-3" title="3">ab_official -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_official</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-4" title="4">ab_trivial_nl -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_trivial_nl</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-5" title="5">ab_certe -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_certe</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-6" title="6">ab_umcg -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_umcg</a></span>()</a>
|
||||
<a class="sourceLine" id="cb3-7" title="7">ab_tradenames -><span class="st"> </span><span class="kw"><a href="../reference/atc_property.html">atc_tradenames</a></span>()</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">ab_property -><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">atc_property</a></span>()</a>
|
||||
<a class="sourceLine" id="cb4-2" title="2">ab_name -><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">atc_name</a></span>()</a>
|
||||
<a class="sourceLine" id="cb4-3" title="3">ab_official -><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">atc_official</a></span>()</a>
|
||||
<a class="sourceLine" id="cb4-4" title="4">ab_trivial_nl -><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">atc_trivial_nl</a></span>()</a>
|
||||
<a class="sourceLine" id="cb4-5" title="5">ab_certe -><span class="st"> </span><span class="kw">atc_certe</span>()</a>
|
||||
<a class="sourceLine" id="cb4-6" title="6">ab_umcg -><span class="st"> </span><span class="kw">atc_umcg</span>()</a>
|
||||
<a class="sourceLine" id="cb4-7" title="7">ab_tradenames -><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">atc_tradenames</a></span>()</a></code></pre></div>
|
||||
These functions use <code><a href="../reference/as.atc.html">as.atc()</a></code> internally. The old <code>atc_property</code> has been renamed <code><a href="../reference/atc_online.html">atc_online_property()</a></code>. This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class <code>atc</code> or must be coerable to this class. Properties of these classes should start with the same class name, analogous to <code><a href="../reference/as.mo.html">as.mo()</a></code> and e.g. <code>mo_genus</code>.</li>
|
||||
<li>New functions <code><a href="../reference/mo_source.html">set_mo_source()</a></code> and <code><a href="../reference/mo_source.html">get_mo_source()</a></code> to use your own predefined MO codes as input for <code><a href="../reference/as.mo.html">as.mo()</a></code> and consequently all <code>mo_*</code> functions</li>
|
||||
<li>Support for the upcoming <a href="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
|
||||
@@ -349,20 +373,20 @@ These functions use <code><a href="../reference/as.atc.html">as.atc()</a></code>
|
||||
<li>New function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
|
||||
<li>
|
||||
<p>New function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">x <-<span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(septic_patients, <span class="dt">col_ab =</span> <span class="st">"amox"</span>)</a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(x)</a>
|
||||
<a class="sourceLine" id="cb4-3" title="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(x)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1">x <-<span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(septic_patients, <span class="dt">col_ab =</span> <span class="st">"amox"</span>)</a>
|
||||
<a class="sourceLine" id="cb5-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(x)</a>
|
||||
<a class="sourceLine" id="cb5-3" title="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(x)</a></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(...)</a>
|
||||
<a class="sourceLine" id="cb5-2" title="2"><span class="co"># or</span></a>
|
||||
<a class="sourceLine" id="cb5-3" title="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients, ...)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(...)</a>
|
||||
<a class="sourceLine" id="cb6-2" title="2"><span class="co"># or</span></a>
|
||||
<a class="sourceLine" id="cb6-3" title="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients, ...)</a></code></pre></div>
|
||||
<p>is equal to:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb6-2" title="2"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb6-3" title="3"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb6-4" title="4"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb7-2" title="2"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb7-3" title="3"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb7-4" title="4"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
|
||||
</li>
|
||||
<li>New function <code><a href="../reference/availability.html">availability()</a></code> to check the number of available (non-empty) results in a <code>data.frame</code>
|
||||
</li>
|
||||
@@ -384,40 +408,40 @@ These functions use <code><a href="../reference/as.atc.html">as.atc()</a></code>
|
||||
<li>Removed data sets <code>microorganisms.oldDT</code>, <code>microorganisms.prevDT</code>, <code>microorganisms.unprevDT</code> and <code>microorganismsDT</code> since they were no longer needed and only contained info already available in the <code>microorganisms</code> data set</li>
|
||||
<li>Added 65 antibiotics to the <code>antibiotics</code> data set, from the <a href="http://ec.europa.eu/health/documents/community-register/html/atc.htm">Pharmaceuticals Community Register</a> of the European Commission</li>
|
||||
<li>Removed columns <code>atc_group1_nl</code> and <code>atc_group2_nl</code> from the <code>antibiotics</code> data set</li>
|
||||
<li>Functions <code><a href="../reference/AMR-deprecated.html">atc_ddd()</a></code> and <code><a href="../reference/AMR-deprecated.html">atc_groups()</a></code> have been renamed <code><a href="../reference/atc_online.html">atc_online_ddd()</a></code> and <code><a href="../reference/atc_online.html">atc_online_groups()</a></code>. The old functions are deprecated and will be removed in a future version.</li>
|
||||
<li>Functions <code>atc_ddd()</code> and <code>atc_groups()</code> have been renamed <code><a href="../reference/atc_online.html">atc_online_ddd()</a></code> and <code><a href="../reference/atc_online.html">atc_online_groups()</a></code>. The old functions are deprecated and will be removed in a future version.</li>
|
||||
<li>Function <code>guess_mo()</code> is now deprecated in favour of <code><a href="../reference/as.mo.html">as.mo()</a></code> and will be removed in future versions</li>
|
||||
<li>Function <code>guess_atc()</code> is now deprecated in favour of <code><a href="../reference/as.atc.html">as.atc()</a></code> and will be removed in future versions</li>
|
||||
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:
|
||||
<ul>
|
||||
<li>
|
||||
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"><span class="co"># mo_fullname() uses as.mo() internally</span></a>
|
||||
<a class="sourceLine" id="cb7-2" title="2"></a>
|
||||
<a class="sourceLine" id="cb7-3" title="3"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Sthafilokockus aaureuz"</span>)</a>
|
||||
<a class="sourceLine" id="cb7-4" title="4"><span class="co">#> [1] "Staphylococcus aureus"</span></a>
|
||||
<a class="sourceLine" id="cb7-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb7-6" title="6"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. klossi"</span>)</a>
|
||||
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#> [1] "Staphylococcus kloosii"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="co"># mo_fullname() uses as.mo() internally</span></a>
|
||||
<a class="sourceLine" id="cb8-2" title="2"></a>
|
||||
<a class="sourceLine" id="cb8-3" title="3"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Sthafilokockus aaureuz"</span>)</a>
|
||||
<a class="sourceLine" id="cb8-4" title="4"><span class="co">#> [1] "Staphylococcus aureus"</span></a>
|
||||
<a class="sourceLine" id="cb8-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb8-6" title="6"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. klossi"</span>)</a>
|
||||
<a class="sourceLine" id="cb8-7" title="7"><span class="co">#> [1] "Staphylococcus kloosii"</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><a href="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="co"># equal:</span></a>
|
||||
<a class="sourceLine" id="cb8-2" title="2"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">TRUE</span>)</a>
|
||||
<a class="sourceLine" id="cb8-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">2</span>)</a>
|
||||
<a class="sourceLine" id="cb8-4" title="4"></a>
|
||||
<a class="sourceLine" id="cb8-5" title="5"><span class="co"># also equal:</span></a>
|
||||
<a class="sourceLine" id="cb8-6" title="6"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">FALSE</span>)</a>
|
||||
<a class="sourceLine" id="cb8-7" title="7"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">0</span>)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="co"># equal:</span></a>
|
||||
<a class="sourceLine" id="cb9-2" title="2"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">TRUE</span>)</a>
|
||||
<a class="sourceLine" id="cb9-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">2</span>)</a>
|
||||
<a class="sourceLine" id="cb9-4" title="4"></a>
|
||||
<a class="sourceLine" id="cb9-5" title="5"><span class="co"># also equal:</span></a>
|
||||
<a class="sourceLine" id="cb9-6" title="6"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">FALSE</span>)</a>
|
||||
<a class="sourceLine" id="cb9-7" title="7"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">0</span>)</a></code></pre></div>
|
||||
Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a></code> could lead to very unreliable results.</li>
|
||||
<li>Implemented the latest publication of Becker <em>et al.</em> (2019), for categorising coagulase-negative <em>Staphylococci</em>
|
||||
</li>
|
||||
<li>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</li>
|
||||
<li>
|
||||
<p>Incoercible results will now be considered ‘unknown’, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="dt">language =</span> <span class="st">"es"</span>)</a>
|
||||
<a class="sourceLine" id="cb9-2" title="2"><span class="co"># Warning: </span></a>
|
||||
<a class="sourceLine" id="cb9-3" title="3"><span class="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
|
||||
<a class="sourceLine" id="cb9-4" title="4"><span class="co">#> [1] "(género desconocido)"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="dt">language =</span> <span class="st">"es"</span>)</a>
|
||||
<a class="sourceLine" id="cb10-2" title="2"><span class="co"># Warning: </span></a>
|
||||
<a class="sourceLine" id="cb10-3" title="3"><span class="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
|
||||
<a class="sourceLine" id="cb10-4" title="4"><span class="co">#> [1] "(género desconocido)"</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>Fix for vector containing only empty values</li>
|
||||
<li>Finds better results when input is in other languages</li>
|
||||
@@ -463,19 +487,19 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
|
||||
<a class="sourceLine" id="cb10-2" title="2"><span class="co"># OLD WAY</span></a>
|
||||
<a class="sourceLine" id="cb10-3" title="3">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb10-4" title="4"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">genus =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo)) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb10-5" title="5"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus)</a>
|
||||
<a class="sourceLine" id="cb10-6" title="6"><span class="co"># NEW WAY</span></a>
|
||||
<a class="sourceLine" id="cb10-7" title="7">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb10-8" title="8"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a>
|
||||
<a class="sourceLine" id="cb10-9" title="9"></a>
|
||||
<a class="sourceLine" id="cb10-10" title="10"><span class="co"># Even supports grouping variables:</span></a>
|
||||
<a class="sourceLine" id="cb10-11" title="11">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb10-12" title="12"><span class="st"> </span><span class="kw">group_by</span>(gender) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb10-13" title="13"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" title="1"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
|
||||
<a class="sourceLine" id="cb11-2" title="2"><span class="co"># OLD WAY</span></a>
|
||||
<a class="sourceLine" id="cb11-3" title="3">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb11-4" title="4"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">genus =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo)) <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb11-5" title="5"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus)</a>
|
||||
<a class="sourceLine" id="cb11-6" title="6"><span class="co"># NEW WAY</span></a>
|
||||
<a class="sourceLine" id="cb11-7" title="7">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb11-8" title="8"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a>
|
||||
<a class="sourceLine" id="cb11-9" title="9"></a>
|
||||
<a class="sourceLine" id="cb11-10" title="10"><span class="co"># Even supports grouping variables:</span></a>
|
||||
<a class="sourceLine" id="cb11-11" title="11">septic_patients <span class="op">%>%</span></a>
|
||||
<a class="sourceLine" id="cb11-12" title="12"><span class="st"> </span><span class="kw">group_by</span>(gender) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb11-13" title="13"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a></code></pre></div>
|
||||
</li>
|
||||
<li>Header info is now available as a list, with the <code>header</code> function</li>
|
||||
<li>The parameter <code>header</code> is now set to <code>TRUE</code> at default, even for markdown</li>
|
||||
@@ -510,9 +534,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-050" class="anchor"></a>AMR 0.5.0<small> 2018-11-30 </small>
|
||||
</h1>
|
||||
<div id="new-1" class="section level4">
|
||||
<div id="new-2" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new-1" class="anchor"></a>New</h4>
|
||||
<a href="#new-2" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>Repository moved to GitLab: <a href="https://gitlab.com/msberends/AMR" class="uri">https://gitlab.com/msberends/AMR</a>
|
||||
</li>
|
||||
@@ -550,10 +574,10 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<li>Fewer than 3 characters as input for <code>as.mo</code> will return NA</li>
|
||||
<li>
|
||||
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" title="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
|
||||
<a class="sourceLine" id="cb11-2" title="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
|
||||
<a class="sourceLine" id="cb11-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
|
||||
<a class="sourceLine" id="cb11-4" title="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
|
||||
<a class="sourceLine" id="cb12-2" title="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
|
||||
<a class="sourceLine" id="cb12-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
|
||||
<a class="sourceLine" id="cb12-4" title="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)</li>
|
||||
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
|
||||
@@ -566,15 +590,15 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for grouping variables, test with:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb12-2" title="2"><span class="st"> </span><span class="kw">group_by</span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb12-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb13-2" title="2"><span class="st"> </span><span class="kw">group_by</span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb13-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for (un)selecting columns:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb13-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb13-3" title="3"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb14-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb14-3" title="3"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>Check for <code><a href="https://www.rdocumentation.org/packages/hms/topics/hms">hms::is.hms</a></code>
|
||||
</li>
|
||||
@@ -637,9 +661,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-040" class="anchor"></a>AMR 0.4.0<small> 2018-10-01 </small>
|
||||
</h1>
|
||||
<div id="new-2" class="section level4">
|
||||
<div id="new-3" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new-2" class="anchor"></a>New</h4>
|
||||
<a href="#new-3" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>The data set <code>microorganisms</code> now contains <strong>all microbial taxonomic data from ITIS</strong> (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via <a href="https://itis.gov" class="uri">https://itis.gov</a>. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set <code>microorganisms.old</code> contains all previously known taxonomic names from those kingdoms.</li>
|
||||
<li>New functions based on the existing function <code>mo_property</code>:
|
||||
@@ -654,18 +678,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
</li>
|
||||
</ul>
|
||||
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||
<a class="sourceLine" id="cb14-2" title="2"><span class="co"># [1] "Gram negative"</span></a>
|
||||
<a class="sourceLine" id="cb14-3" title="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
|
||||
<a class="sourceLine" id="cb14-4" title="4"><span class="co"># [1] "Gramnegativ"</span></a>
|
||||
<a class="sourceLine" id="cb14-5" title="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"es"</span>) <span class="co"># Spanish</span></a>
|
||||
<a class="sourceLine" id="cb14-6" title="6"><span class="co"># [1] "Gram negativo"</span></a>
|
||||
<a class="sourceLine" id="cb14-7" title="7"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span></a>
|
||||
<a class="sourceLine" id="cb14-8" title="8"><span class="co"># [1] "Streptococcus grupo A"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||
<a class="sourceLine" id="cb15-2" title="2"><span class="co"># [1] "Gram negative"</span></a>
|
||||
<a class="sourceLine" id="cb15-3" title="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
|
||||
<a class="sourceLine" id="cb15-4" title="4"><span class="co"># [1] "Gramnegativ"</span></a>
|
||||
<a class="sourceLine" id="cb15-5" title="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"es"</span>) <span class="co"># Spanish</span></a>
|
||||
<a class="sourceLine" id="cb15-6" title="6"><span class="co"># [1] "Gram negativo"</span></a>
|
||||
<a class="sourceLine" id="cb15-7" title="7"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span></a>
|
||||
<a class="sourceLine" id="cb15-8" title="8"><span class="co"># [1] "Streptococcus grupo A"</span></a></code></pre></div>
|
||||
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name:</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)</a>
|
||||
<a class="sourceLine" id="cb15-2" title="2"><span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span></a>
|
||||
<a class="sourceLine" id="cb15-3" title="3"><span class="co"># [1] "Gram negative"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)</a>
|
||||
<a class="sourceLine" id="cb16-2" title="2"><span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span></a>
|
||||
<a class="sourceLine" id="cb16-3" title="3"><span class="co"># [1] "Gram negative"</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates
|
||||
<ul>
|
||||
@@ -676,18 +700,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
</li>
|
||||
<li>
|
||||
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" title="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||
<a class="sourceLine" id="cb16-2" title="2"><span class="co"># [1] B_ESCHR_COL</span></a>
|
||||
<a class="sourceLine" id="cb16-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)</a>
|
||||
<a class="sourceLine" id="cb16-4" title="4"><span class="co"># [1] B_STPHY_AUR</span></a>
|
||||
<a class="sourceLine" id="cb16-5" title="5"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)</a>
|
||||
<a class="sourceLine" id="cb16-6" title="6"><span class="co"># [1] B_STRPTC_GRA</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||
<a class="sourceLine" id="cb17-2" title="2"><span class="co"># [1] B_ESCHR_COL</span></a>
|
||||
<a class="sourceLine" id="cb17-3" title="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)</a>
|
||||
<a class="sourceLine" id="cb17-4" title="4"><span class="co"># [1] B_STPHY_AUR</span></a>
|
||||
<a class="sourceLine" id="cb17-5" title="5"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)</a>
|
||||
<a class="sourceLine" id="cb17-6" title="6"><span class="co"># [1] B_STRPTC_GRA</span></a></code></pre></div>
|
||||
<p>And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1">thousands_of_E_colis <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/rep">rep</a></span>(<span class="st">"E. coli"</span>, <span class="dv">25000</span>)</a>
|
||||
<a class="sourceLine" id="cb17-2" title="2">microbenchmark<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(thousands_of_E_colis), <span class="dt">unit =</span> <span class="st">"s"</span>)</a>
|
||||
<a class="sourceLine" id="cb17-3" title="3"><span class="co"># Unit: seconds</span></a>
|
||||
<a class="sourceLine" id="cb17-4" title="4"><span class="co"># min median max neval</span></a>
|
||||
<a class="sourceLine" id="cb17-5" title="5"><span class="co"># 0.01817717 0.01843957 0.03878077 100</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" title="1">thousands_of_E_colis <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/rep">rep</a></span>(<span class="st">"E. coli"</span>, <span class="dv">25000</span>)</a>
|
||||
<a class="sourceLine" id="cb18-2" title="2">microbenchmark<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(thousands_of_E_colis), <span class="dt">unit =</span> <span class="st">"s"</span>)</a>
|
||||
<a class="sourceLine" id="cb18-3" title="3"><span class="co"># Unit: seconds</span></a>
|
||||
<a class="sourceLine" id="cb18-4" title="4"><span class="co"># min median max neval</span></a>
|
||||
<a class="sourceLine" id="cb18-5" title="5"><span class="co"># 0.01817717 0.01843957 0.03878077 100</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
|
||||
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:
|
||||
@@ -715,12 +739,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
|
||||
<li>
|
||||
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
|
||||
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" title="1"><span class="kw"><a href="../reference/AMR-deprecated.html">ab_official</a></span>(<span class="st">"Bactroban"</span>)</a>
|
||||
<a class="sourceLine" id="cb18-2" title="2"><span class="co"># [1] "Mupirocin"</span></a>
|
||||
<a class="sourceLine" id="cb18-3" title="3"><span class="kw"><a href="../reference/AMR-deprecated.html">ab_name</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||
<a class="sourceLine" id="cb18-4" title="4"><span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span></a>
|
||||
<a class="sourceLine" id="cb18-5" title="5"><span class="kw"><a href="../reference/AMR-deprecated.html">ab_atc</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||
<a class="sourceLine" id="cb18-6" title="6"><span class="co"># [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</span></a></code></pre></div>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" title="1"><span class="kw"><a href="../reference/AMR-deprecated.html">ab_official</a></span>(<span class="st">"Bactroban"</span>)</a>
|
||||
<a class="sourceLine" id="cb19-2" title="2"><span class="co"># [1] "Mupirocin"</span></a>
|
||||
<a class="sourceLine" id="cb19-3" title="3"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||
<a class="sourceLine" id="cb19-4" title="4"><span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span></a>
|
||||
<a class="sourceLine" id="cb19-5" title="5"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||
<a class="sourceLine" id="cb19-6" title="6"><span class="co"># [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</span></a></code></pre></div>
|
||||
</li>
|
||||
<li>For <code>first_isolate</code>, rows will be ignored when there’s no species available</li>
|
||||
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
|
||||
@@ -731,13 +755,13 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw">select</span>(amox, cipr) <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>()</a>
|
||||
<a class="sourceLine" id="cb19-2" title="2"><span class="co"># which is the same as:</span></a>
|
||||
<a class="sourceLine" id="cb19-3" title="3">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>(amox, cipr)</a>
|
||||
<a class="sourceLine" id="cb19-4" title="4"></a>
|
||||
<a class="sourceLine" id="cb19-5" title="5">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl)</a>
|
||||
<a class="sourceLine" id="cb19-6" title="6">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent)</a>
|
||||
<a class="sourceLine" id="cb19-7" title="7">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent, pita)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" title="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw">select</span>(amox, cipr) <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>()</a>
|
||||
<a class="sourceLine" id="cb20-2" title="2"><span class="co"># which is the same as:</span></a>
|
||||
<a class="sourceLine" id="cb20-3" title="3">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>(amox, cipr)</a>
|
||||
<a class="sourceLine" id="cb20-4" title="4"></a>
|
||||
<a class="sourceLine" id="cb20-5" title="5">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl)</a>
|
||||
<a class="sourceLine" id="cb20-6" title="6">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent)</a>
|
||||
<a class="sourceLine" id="cb20-7" title="7">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent, pita)</a></code></pre></div>
|
||||
</li>
|
||||
<li>Edited <code>ggplot_rsi</code> and <code>geom_rsi</code> so they can cope with <code>count_df</code>. The new <code>fun</code> parameter has value <code>portion_df</code> at default, but can be set to <code>count_df</code>.</li>
|
||||
<li>Fix for <code>ggplot_rsi</code> when the <code>ggplot2</code> package was not loaded</li>
|
||||
@@ -751,12 +775,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for types (classes) list and matrix for <code>freq</code></p>
|
||||
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" title="1">my_matrix =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/with">with</a></span>(septic_patients, <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/matrix">matrix</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(age, gender), <span class="dt">ncol =</span> <span class="dv">2</span>))</a>
|
||||
<a class="sourceLine" id="cb20-2" title="2"><span class="kw"><a href="../reference/freq.html">freq</a></span>(my_matrix)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" title="1">my_matrix =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/with">with</a></span>(septic_patients, <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/matrix">matrix</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(age, gender), <span class="dt">ncol =</span> <span class="dv">2</span>))</a>
|
||||
<a class="sourceLine" id="cb21-2" title="2"><span class="kw"><a href="../reference/freq.html">freq</a></span>(my_matrix)</a></code></pre></div>
|
||||
<p>For lists, subsetting is possible:</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" title="1">my_list =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">age =</span> septic_patients<span class="op">$</span>age, <span class="dt">gender =</span> septic_patients<span class="op">$</span>gender)</a>
|
||||
<a class="sourceLine" id="cb21-2" title="2">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age)</a>
|
||||
<a class="sourceLine" id="cb21-3" title="3">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" title="1">my_list =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">age =</span> septic_patients<span class="op">$</span>age, <span class="dt">gender =</span> septic_patients<span class="op">$</span>gender)</a>
|
||||
<a class="sourceLine" id="cb22-2" title="2">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age)</a>
|
||||
<a class="sourceLine" id="cb22-3" title="3">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -772,9 +796,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-030" class="anchor"></a>AMR 0.3.0<small> 2018-08-14 </small>
|
||||
</h1>
|
||||
<div id="new-3" class="section level4">
|
||||
<div id="new-4" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new-3" class="anchor"></a>New</h4>
|
||||
<a href="#new-4" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>BREAKING</strong>: <code>rsi_df</code> was removed in favour of new functions <code>portion_R</code>, <code>portion_IR</code>, <code>portion_I</code>, <code>portion_SI</code> and <code>portion_S</code> to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old <code>rsi</code> function. The old function still works, but is deprecated.
|
||||
@@ -877,7 +901,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
</li>
|
||||
<li>Now possible to coerce MIC values with a space between operator and value, i.e. <code><a href="../reference/as.mic.html">as.mic("<= 0.002")</a></code> now works</li>
|
||||
<li>Classes <code>rsi</code> and <code>mic</code> do not add the attribute <code>package.version</code> anymore</li>
|
||||
<li>Added <code>"groups"</code> option for <code><a href="../reference/atc_property.html">atc_property(..., property)</a></code>. It will return a vector of the ATC hierarchy as defined by the <a href="https://www.whocc.no/atc/structure_and_principles/">WHO</a>. The new function <code>atc_groups</code> is a convenient wrapper around this.</li>
|
||||
<li>Added <code>"groups"</code> option for <code><a href="../reference/AMR-deprecated.html">atc_property(..., property)</a></code>. It will return a vector of the ATC hierarchy as defined by the <a href="https://www.whocc.no/atc/structure_and_principles/">WHO</a>. The new function <code>atc_groups</code> is a convenient wrapper around this.</li>
|
||||
<li>Build-in host check for <code>atc_property</code> as it requires the host set by <code>url</code> to be responsive</li>
|
||||
<li>Improved <code>first_isolate</code> algorithm to exclude isolates where bacteria ID or genus is unavailable</li>
|
||||
<li>Fix for warning <em>hybrid evaluation forced for row_number</em> (<a href="https://github.com/tidyverse/dplyr/commit/924b62"><code>924b62</code></a>) from the <code>dplyr</code> package v0.7.5 and above</li>
|
||||
@@ -909,9 +933,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-020" class="anchor"></a>AMR 0.2.0<small> 2018-05-03 </small>
|
||||
</h1>
|
||||
<div id="new-4" class="section level4">
|
||||
<div id="new-5" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#new-4" class="anchor"></a>New</h4>
|
||||
<a href="#new-5" class="anchor"></a>New</h4>
|
||||
<ul>
|
||||
<li>Full support for Windows, Linux and macOS</li>
|
||||
<li>Full support for old R versions, only R-3.0.0 (April 2013) or later is needed (needed packages may have other dependencies)</li>
|
||||
|
||||
@@ -7,7 +7,7 @@ articles:
|
||||
G_test: G_test.html
|
||||
SPSS: SPSS.html
|
||||
WHONET: WHONET.html
|
||||
atc_property: atc_property.html
|
||||
ab_property: ab_property.html
|
||||
benchmarks: benchmarks.html
|
||||
freq: freq.html
|
||||
mo_property: mo_property.html
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -243,25 +243,19 @@
|
||||
|
||||
<pre class="usage"><span class='fu'>ratio</span>(<span class='no'>x</span>, <span class='no'>ratio</span>)
|
||||
|
||||
<span class='fu'>ab_property</span>(<span class='no'>...</span>)
|
||||
<span class='fu'>abname</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_atc</span>(<span class='no'>...</span>)
|
||||
<span class='fu'>atc_property</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>atc_official</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_official</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_name</span>(<span class='no'>...</span>)
|
||||
<span class='fu'>atc_name</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_trivial_nl</span>(<span class='no'>...</span>)
|
||||
<span class='fu'>atc_trivial_nl</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_certe</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_umcg</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_tradenames</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>atc_ddd</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>atc_groups</span>(<span class='no'>...</span>)</pre>
|
||||
<span class='fu'>atc_tradenames</span>(<span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Property of an antibiotic — ab_property" />
|
||||
|
||||
<meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set, based on their ATC code. Get such a code with as.atc." />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
@@ -80,7 +80,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="Released version">0.5.0.9012</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -110,12 +110,26 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/Predict.html">
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/WHONET.html">
|
||||
<span class="fa fa-globe-americas"></span>
|
||||
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
@@ -124,14 +138,14 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/mo_property.html">
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/ab_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -223,52 +237,89 @@
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Use these functions to return a specific property of an antibiotic from the <code><a href='antibiotics.html'>antibiotics</a></code> data set, based on their ATC code. Get such a code with <code><a href='as.atc.html'>as.atc</a></code>.</p>
|
||||
<p>Use these functions to return a specific property of an antibiotic from the <code><a href='antibiotics.html'>antibiotics</a></code> data set. All input values will be evaluated internally with <code><a href='as.ab.html'>as.ab</a></code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ab_property</span>(<span class='no'>x</span>, <span class='kw'>property</span> <span class='kw'>=</span> <span class='st'>"official"</span>)
|
||||
<pre class="usage"><span class='fu'>ab_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>tolower</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_atc</span>(<span class='no'>x</span>)
|
||||
<span class='fu'>ab_atc</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_official</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
|
||||
<span class='fu'>ab_cid</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
|
||||
<span class='fu'>ab_synonyms</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_trivial_nl</span>(<span class='no'>x</span>)
|
||||
<span class='fu'>ab_tradenames</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_certe</span>(<span class='no'>x</span>)
|
||||
<span class='fu'>ab_group</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_umcg</span>(<span class='no'>x</span>)
|
||||
<span class='fu'>ab_atc_group1</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_tradenames</span>(<span class='no'>x</span>)</pre>
|
||||
<span class='fu'>ab_atc_group2</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_ddd</span>(<span class='no'>x</span>, <span class='kw'>administration</span> <span class='kw'>=</span> <span class='st'>"oral"</span>, <span class='kw'>units</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ab_property</span>(<span class='no'>x</span>, <span class='kw'>property</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>a (vector of a) valid <code><a href='as.atc.html'>atc</a></code> code or any text that can be coerced to a valid atc with <code><a href='as.atc.html'>as.atc</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>property</th>
|
||||
<td><p>one of the column names of one of the <code><a href='antibiotics.html'>antibiotics</a></code> data set, like <code>"atc"</code> and <code>"official"</code></p></td>
|
||||
<td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.ab.html'>as.ab</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>language of the returned text, defaults to English (<code>"en"</code>) and can be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Either one of <code>"en"</code> (English) or <code>"nl"</code> (Dutch).</p></td>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tolower</th>
|
||||
<td><p>logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>other parameters passed on to <code><a href='as.ab.html'>as.ab</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>administration</th>
|
||||
<td><p>way of administration, either <code>"oral"</code> or <code>"iv"</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>units</th>
|
||||
<td><p>a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>property</th>
|
||||
<td><p>one of the column names of one of the <code><a href='antibiotics.html'>antibiotics</a></code> data set</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A vector of values. In case of <code>ab_tradenames</code>, if <code>x</code> is of length one, a vector will be returned. Otherwise a <code><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></code>, with <code>x</code> as names.</p>
|
||||
|
||||
<ul>
|
||||
<li><p>An <code>integer</code> in case of <code>ab_cid</code></p></li>
|
||||
<li><p>A named <code>list</code> in case of multiple <code>ab_synonyms</code></p></li>
|
||||
<li><p>A <code>double</code> in case of <code>ab_ddd</code></p></li>
|
||||
<li><p>A <code>character</code> in all other cases</p></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>All output will be <a href='translate.html'>translate</a>d where possible.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
|
||||
|
||||
|
||||
<p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p>
|
||||
<p>WHONET 2019 software: <a href='http://www.whonet.org/software.html'>http://www.whonet.org/software.html</a></p>
|
||||
<p>European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a></p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
<p><img src='figures/logo.png' height=40px style=margin-bottom:5px /> <br />
|
||||
On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a omprehensive tutorial</a> about how to conduct AMR analysis and find <a href='https://msberends.gitlab.io/AMR/reference'>the complete documentation of all functions</a>, which reads a lot easier than in R.</p>
|
||||
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
|
||||
|
||||
@@ -277,12 +328,33 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='fu'>ab_atc</span>(<span class='st'>"amcl"</span>) <span class='co'># J01CR02</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"amcl"</span>) <span class='co'># Amoxicillin and beta-lactamase inhibitor</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"amcl"</span>, <span class='st'>"nl"</span>) <span class='co'># Amoxicilline met enzymremmer</span>
|
||||
<span class='fu'>ab_trivial_nl</span>(<span class='st'>"amcl"</span>) <span class='co'># Amoxicilline/clavulaanzuur</span>
|
||||
<span class='fu'>ab_certe</span>(<span class='st'>"amcl"</span>) <span class='co'># amcl</span>
|
||||
<span class='fu'>ab_umcg</span>(<span class='st'>"amcl"</span>) <span class='co'># AMCL</span>
|
||||
<span class='co'># all properties:</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"AMX"</span>) <span class='co'># "Amoxicillin"</span>
|
||||
<span class='fu'>ab_atc</span>(<span class='st'>"AMX"</span>) <span class='co'># J01CA04 (ATC code from the WHO)</span>
|
||||
<span class='fu'>ab_cid</span>(<span class='st'>"AMX"</span>) <span class='co'># 33613 (Compound ID from PubChem)</span>
|
||||
|
||||
<span class='fu'>ab_synonyms</span>(<span class='st'>"AMX"</span>) <span class='co'># a list with brand names of amoxicillin</span>
|
||||
<span class='fu'>ab_tradenames</span>(<span class='st'>"AMX"</span>) <span class='co'># same</span>
|
||||
|
||||
<span class='fu'>ab_group</span>(<span class='st'>"AMX"</span>) <span class='co'># "Beta-lactams/penicillins"</span>
|
||||
<span class='fu'>ab_atc_group1</span>(<span class='st'>"AMX"</span>) <span class='co'># "Beta-lactam antibacterials, penicillins"</span>
|
||||
<span class='fu'>ab_atc_group2</span>(<span class='st'>"AMX"</span>) <span class='co'># "Penicillins with extended spectrum"</span>
|
||||
|
||||
<span class='fu'>ab_name</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"AMC"</span>, <span class='st'>"PLB"</span>)) <span class='co'># "Amoxicillin/clavulanic acid" "Polymyxin B"</span>
|
||||
<span class='fu'>ab_name</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"AMC"</span>, <span class='st'>"PLB"</span>),
|
||||
<span class='kw'>tolower</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='co'># "amoxicillin/clavulanic acid" "polymyxin B"</span>
|
||||
|
||||
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"oral"</span>) <span class='co'># 1</span>
|
||||
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"oral"</span>, <span class='kw'>units</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='co'># "g"</span>
|
||||
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"iv"</span>) <span class='co'># 1</span>
|
||||
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"iv"</span>, <span class='kw'>units</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='co'># "g"</span>
|
||||
|
||||
<span class='co'># all ab_* functions use as.ab() internally:</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"Fluclox"</span>) <span class='co'># "Flucloxacillin"</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"fluklox"</span>) <span class='co'># "Flucloxacillin"</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"floxapen"</span>) <span class='co'># "Flucloxacillin"</span>
|
||||
<span class='fu'>ab_name</span>(<span class='fl'>21319</span>) <span class='co'># "Flucloxacillin" (using CID)</span>
|
||||
<span class='fu'>ab_name</span>(<span class='st'>"J01CF05"</span>) <span class='co'># "Flucloxacillin" (using ATC)</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
@@ -292,6 +364,10 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#source">Source</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -252,7 +252,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>split_at</th>
|
||||
<td><p>values to split <code>x</code> at, defaults to age groups 0-11, 12-24, 26-54, 55-74 and 75+. See Details.</p></td>
|
||||
<td><p>values to split <code>x</code> at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
|
||||
<p>To split ages, the input can be:</p><ul>
|
||||
<li><p>A numeric vector. A vector of e.g. <code><a href='https://www.rdocumentation.org/packages/base/topics/c'>c(10, 20)</a></code> will split on 0-9, 10-19 and 20+. A value of only <code>50</code> will split on 0-49 and 50+.
|
||||
The default is to split on young children (0-11), youth (12-24), young adults (26-54), middle-aged adults (55-74) and elderly (75+).</p></li>
|
||||
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).</p></li>
|
||||
<li><p>A character:</p><ul>
|
||||
<li><p><code>"children"</code>, equivalent of: <code><a href='https://www.rdocumentation.org/packages/base/topics/c'>c(0, 1, 2, 4, 6, 13, 18)</a></code>. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.</p></li>
|
||||
<li><p><code>"elderly"</code> or <code>"seniors"</code>, equivalent of: <code><a href='https://www.rdocumentation.org/packages/base/topics/c'>c(65, 75, 85)</a></code>. This will split on 0-64, 65-74, 75-84, 85+.</p></li>
|
||||
@@ -314,7 +314,7 @@
|
||||
<span class='no'>mo</span> <span class='kw'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='kw'>age_group</span> <span class='kw'>=</span> <span class='fu'>age_groups</span>(<span class='no'>age</span>)) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>age_group</span>,
|
||||
<span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='ggplot_rsi.html'>ggplot_rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"age_group"</span>)
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Data set with ~500 antibiotics — antibiotics • AMR (for R)</title>
|
||||
<title>Data set with ~450 antibiotics — antibiotics • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Data set with ~500 antibiotics — antibiotics" />
|
||||
<meta property="og:title" content="Data set with ~450 antibiotics — antibiotics" />
|
||||
|
||||
<meta property="og:description" content="A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source." />
|
||||
<meta property="og:description" content="A data set containing all antibiotics. Use as.ab or one of the ab_property functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (ab, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc) as defined by the WHO, and a Compound ID (cid) as found in PubChem. Other properties in this data set are derived from one or more of these codes." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -230,14 +230,14 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Data set with ~500 antibiotics</h1>
|
||||
<h1>Data set with ~450 antibiotics</h1>
|
||||
|
||||
<div class="hidden name"><code>antibiotics.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source.</p>
|
||||
<p>A data set containing all antibiotics. Use <code><a href='as.ab.html'>as.ab</a></code> or one of the <code><a href='ab_property.html'>ab_property</a></code> functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (<code>ab</code>, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (<code>atc</code>) as defined by the WHO, and a Compound ID (<code>cid</code>) as found in PubChem. Other properties in this data set are derived from one or more of these codes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -245,33 +245,33 @@
|
||||
|
||||
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
|
||||
|
||||
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 488 observations and 17 variables:</p><dl class='dl-horizontal'>
|
||||
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical), like <code>J01CR02</code></p></dd>
|
||||
<dt><code>ears_net</code></dt><dd><p>EARS-Net code (European Antimicrobial Resistance Surveillance Network), like <code>AMC</code></p></dd>
|
||||
<dt><code>certe</code></dt><dd><p>Certe code, like <code>amcl</code></p></dd>
|
||||
<dt><code>umcg</code></dt><dd><p>UMCG code, like <code>AMCL</code></p></dd>
|
||||
<dt><code>abbr</code></dt><dd><p>Abbreviation as used by many countries, used internally by <code><a href='as.atc.html'>as.atc</a></code></p></dd>
|
||||
<dt><code>official</code></dt><dd><p>Official name by the WHO, like <code>"Amoxicillin and beta-lactamase inhibitor"</code></p></dd>
|
||||
<dt><code>official_nl</code></dt><dd><p>Official name in the Netherlands, like <code>"Amoxicilline met enzymremmer"</code></p></dd>
|
||||
<dt><code>trivial_nl</code></dt><dd><p>Trivial name in Dutch, like <code>"Amoxicilline/clavulaanzuur"</code></p></dd>
|
||||
<dt><code>trade_name</code></dt><dd><p>Trade name as used by many countries (a total of 294), used internally by <code><a href='as.atc.html'>as.atc</a></code></p></dd>
|
||||
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 455 observations and 13 variables:</p><dl class='dl-horizontal'>
|
||||
<dt><code>ab</code></dt><dd><p>Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></dd>
|
||||
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like <code>J01CR02</code></p></dd>
|
||||
<dt><code>cid</code></dt><dd><p>Compound ID as found in PubChem</p></dd>
|
||||
<dt><code>name</code></dt><dd><p>Official name as used by WHONET/EARS-Net or the WHO</p></dd>
|
||||
<dt><code>group</code></dt><dd><p>A short and concise group name, based on WHONET and WHOCC definitions</p></dd>
|
||||
<dt><code>atc_group1</code></dt><dd><p>Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like <code>"Macrolides, lincosamides and streptogramins"</code></p></dd>
|
||||
<dt><code>atc_group2</code></dt><dd><p>Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like <code>"Macrolides"</code></p></dd>
|
||||
<dt><code>abbr</code></dt><dd><p>List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)</p></dd>
|
||||
<dt><code>synonyms</code></dt><dd><p>Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID</p></dd>
|
||||
<dt><code>oral_ddd</code></dt><dd><p>Defined Daily Dose (DDD), oral treatment</p></dd>
|
||||
<dt><code>oral_units</code></dt><dd><p>Units of <code>ddd_units</code></p></dd>
|
||||
<dt><code>iv_ddd</code></dt><dd><p>Defined Daily Dose (DDD), parenteral treatment</p></dd>
|
||||
<dt><code>iv_units</code></dt><dd><p>Units of <code>iv_ddd</code></p></dd>
|
||||
<dt><code>atc_group1</code></dt><dd><p>ATC group, like <code>"Macrolides, lincosamides and streptogramins"</code></p></dd>
|
||||
<dt><code>atc_group2</code></dt><dd><p>Subgroup of <code>atc_group1</code>, like <code>"Macrolides"</code></p></dd>
|
||||
<dt><code>useful_gramnegative</code></dt><dd><p><code>FALSE</code> if not useful according to EUCAST, <code>NA</code> otherwise (see Source)</p></dd>
|
||||
<dt><code>useful_grampositive</code></dt><dd><p><code>FALSE</code> if not useful according to EUCAST, <code>NA</code> otherwise (see Source)</p></dd>
|
||||
</dl>
|
||||
|
||||
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
|
||||
|
||||
<p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p>
|
||||
<p>Table antibiotic coding EARSS (from WHONET 5.3): <a href='http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf'>http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf</a></p>
|
||||
<p>EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: <a href='http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf'>http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf</a></p>
|
||||
<p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p>
|
||||
<p>WHONET 2019 software: <a href='http://www.whonet.org/software.html'>http://www.whonet.org/software.html</a></p>
|
||||
<p>European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a></p>
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Properties that are based on an ATC code are only available when an ATC is available. These properties are: <code>atc_group1</code>, <code>atc_group2</code>, <code>oral_ddd</code>, <code>oral_units</code>, <code>iv_ddd</code> and <code>iv_units</code></p>
|
||||
<p>Synonyms (i.e. trade names) are derived from the Compound ID (<code>cid</code>) and consequently only available where a CID is available.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="whocc"><a class="anchor" href="#whocc"></a>WHOCC</h2>
|
||||
|
||||
|
||||
@@ -299,6 +299,8 @@ This package contains <strong>all ~500 antimicrobial drugs</strong> and their An
|
||||
|
||||
<li><a href="#source">Source</a></li>
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#whocc">WHOCC</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
365
docs/reference/as.ab.html
Normal file
@@ -0,0 +1,365 @@
|
||||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Transform to antibiotic ID — as.ab • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
<!-- docsearch -->
|
||||
<script src="../docsearch.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
|
||||
<link href="../docsearch.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Transform to antibiotic ID — as.ab" />
|
||||
|
||||
<meta property="og:description" content="Use this function to determine the antibiotic code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and synonyms (brand names)." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</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="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home"></span>
|
||||
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<span class="fa fa-question-circle"></span>
|
||||
|
||||
How to
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/AMR.html">
|
||||
<span class="fa fa-directions"></span>
|
||||
|
||||
Conduct AMR analysis
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/WHONET.html">
|
||||
<span class="fa fa-globe-americas"></span>
|
||||
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
|
||||
Apply EUCAST rules
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/freq.html">
|
||||
<span class="fa fa-sort-amount-down"></span>
|
||||
|
||||
Create frequency tables
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/G_test.html">
|
||||
<span class="fa fa-clipboard-check"></span>
|
||||
|
||||
Use the G-test
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/benchmarks.html">
|
||||
<span class="fa fa-shipping-fast"></span>
|
||||
|
||||
Other: benchmarks
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/">
|
||||
<span class="fa fa-book-open"></span>
|
||||
|
||||
Manual
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../authors.html">
|
||||
<span class="fa fa-users"></span>
|
||||
|
||||
Authors
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../news/">
|
||||
<span class="far fa far fa-newspaper"></span>
|
||||
|
||||
Changelog
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://gitlab.com/msberends/AMR">
|
||||
<span class="fab fa fab fa-gitlab"></span>
|
||||
|
||||
Source Code
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../LICENSE-text.html">
|
||||
<span class="fa fa-book"></span>
|
||||
|
||||
Licence
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="form-group">
|
||||
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Transform to antibiotic ID</h1>
|
||||
|
||||
<div class="hidden name"><code>as.ab.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Use this function to determine the antibiotic code of one or more antibiotics. The data set <code><a href='antibiotics.html'>antibiotics</a></code> will be searched for abbreviations, official names and synonyms (brand names).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.ab</span>(<span class='no'>x</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>character vector to determine to antibiotic ID</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>Character (vector) with class <code>"act"</code>. Unknown values will return <code>NA</code>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Use the <code><a href='ab_property.html'>ab_property</a></code> functions to get properties based on the returned ATC code, see Examples.</p>
|
||||
<p>In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
|
||||
Source: <a href='https://www.whocc.no/atc/structure_and_principles/'>https://www.whocc.no/atc/structure_and_principles/</a></p>
|
||||
|
||||
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
|
||||
|
||||
|
||||
<p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p>
|
||||
<p>WHONET 2019 software: <a href='http://www.whonet.org/software.html'>http://www.whonet.org/software.html</a></p>
|
||||
<p>European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a></p>
|
||||
|
||||
<h2 class="hasAnchor" id="whocc"><a class="anchor" href="#whocc"></a>WHOCC</h2>
|
||||
|
||||
|
||||
<p><img src='figures/logo_who.png' height=60px style=margin-bottom:5px /> <br />
|
||||
This package contains <strong>all ~500 antimicrobial drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p>
|
||||
<p>These have become the gold standard for international drug utilisation monitoring and research.</p>
|
||||
<p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
|
||||
|
||||
<div class='dont-index'><p><code><a href='antibiotics.html'>antibiotics</a></code> for the dataframe that is being used to determine ATCs.</p></div>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='co'># These examples all return "ERY", the ID of Erythromycin:</span>
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"J01FA01"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"J 01 FA 01"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"Erythromycin"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"eryt"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>" eryt 123"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"ERYT"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"ERY"</span>)
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"erytromicine"</span>) <span class='co'># spelled wrong</span>
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"Erythrocin"</span>) <span class='co'># trade name</span>
|
||||
<span class='fu'>as.ab</span>(<span class='st'>"Romycin"</span>) <span class='co'># trade name</span>
|
||||
|
||||
<span class='co'># Use ab_* functions to get a specific properties (see ?ab_property);</span>
|
||||
<span class='co'># they use as.ab() internally:</span>
|
||||
<span class='fu'><a href='ab_property.html'>ab_name</a></span>(<span class='st'>"J01FA01"</span>) <span class='co'># "Erythromycin"</span>
|
||||
<span class='fu'><a href='ab_property.html'>ab_name</a></span>(<span class='st'>"eryt"</span>) <span class='co'># "Erythromycin"</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#source">Source</a></li>
|
||||
|
||||
<li><a href="#whocc">WHOCC</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
|
||||
|
||||
apiKey: 'f737050abfd4d726c63938e18f8c496e',
|
||||
indexName: 'amr',
|
||||
inputSelector: 'input#search-input.form-control',
|
||||
transformData: function(hits) {
|
||||
return hits.map(function (hit) {
|
||||
hit.url = updateHitURL(hit);
|
||||
return hit;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Transform to ATC code — as.atc • AMR (for R)</title>
|
||||
<title>Transform to ATC code — is.ab • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Transform to ATC code — as.atc" />
|
||||
<meta property="og:title" content="Transform to ATC code — is.ab" />
|
||||
|
||||
<meta property="og:description" content="Use this function to determine the ATC code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and trade names." />
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -241,7 +241,9 @@
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.atc</span>(<span class='no'>x</span>)
|
||||
<pre class="usage"><span class='fu'>is.ab</span>(<span class='no'>x</span>)
|
||||
|
||||
<span class='fu'>as.atc</span>(<span class='no'>x</span>)
|
||||
|
||||
<span class='fu'>is.atc</span>(<span class='no'>x</span>)</pre>
|
||||
|
||||
@@ -260,7 +262,7 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Use the <code><a href='AMR-deprecated.html'>ab_property</a></code> functions to get properties based on the returned ATC code, see Examples.</p>
|
||||
<p>Use the <code><a href='ab_property.html'>ab_property</a></code> functions to get properties based on the returned ATC code, see Examples.</p>
|
||||
<p>In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
|
||||
Source: <a href='https://www.whocc.no/atc/structure_and_principles/'>https://www.whocc.no/atc/structure_and_principles/</a></p>
|
||||
|
||||
@@ -291,14 +293,6 @@ This package contains <strong>all ~500 antimicrobial drugs</strong> and their An
|
||||
<span class='fu'>as.atc</span>(<span class='st'>" eryt 123"</span>)
|
||||
<span class='fu'>as.atc</span>(<span class='st'>"ERYT"</span>)
|
||||
<span class='fu'>as.atc</span>(<span class='st'>"ERY"</span>)
|
||||
<span class='fu'>as.atc</span>(<span class='st'>"Erythrocin"</span>) <span class='co'># Trade name</span>
|
||||
<span class='fu'>as.atc</span>(<span class='st'>"Eryzole"</span>) <span class='co'># Trade name</span>
|
||||
<span class='fu'>as.atc</span>(<span class='st'>"Pediamycin"</span>) <span class='co'># Trade name</span>
|
||||
|
||||
<span class='co'># Use ab_* functions to get a specific property based on an ATC code</span>
|
||||
<span class='no'>Cipro</span> <span class='kw'><-</span> <span class='fu'>as.atc</span>(<span class='st'>"cipro"</span>) <span class='co'># returns `J01MA02`</span>
|
||||
<span class='fu'><a href='atc_property.html'>atc_official</a></span>(<span class='no'>Cipro</span>) <span class='co'># returns "Ciprofloxacin"</span>
|
||||
<span class='fu'><a href='atc_property.html'>atc_umcg</a></span>(<span class='no'>Cipro</span>) <span class='co'># returns "CIPR", the code used in the UMCG</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
|
||||
343
docs/reference/as.disk.html
Normal file
@@ -0,0 +1,343 @@
|
||||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Class 'disk' — as.disk • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
<!-- docsearch -->
|
||||
<script src="../docsearch.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
|
||||
<link href="../docsearch.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Class 'disk' — as.disk" />
|
||||
|
||||
<meta property="og:description" content="This transforms a vector to a new class disk, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</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="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home"></span>
|
||||
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<span class="fa fa-question-circle"></span>
|
||||
|
||||
How to
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/AMR.html">
|
||||
<span class="fa fa-directions"></span>
|
||||
|
||||
Conduct AMR analysis
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/WHONET.html">
|
||||
<span class="fa fa-globe-americas"></span>
|
||||
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
|
||||
Apply EUCAST rules
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/freq.html">
|
||||
<span class="fa fa-sort-amount-down"></span>
|
||||
|
||||
Create frequency tables
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/G_test.html">
|
||||
<span class="fa fa-clipboard-check"></span>
|
||||
|
||||
Use the G-test
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/benchmarks.html">
|
||||
<span class="fa fa-shipping-fast"></span>
|
||||
|
||||
Other: benchmarks
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/">
|
||||
<span class="fa fa-book-open"></span>
|
||||
|
||||
Manual
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../authors.html">
|
||||
<span class="fa fa-users"></span>
|
||||
|
||||
Authors
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../news/">
|
||||
<span class="far fa far fa-newspaper"></span>
|
||||
|
||||
Changelog
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://gitlab.com/msberends/AMR">
|
||||
<span class="fab fa fab fa-gitlab"></span>
|
||||
|
||||
Source Code
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../LICENSE-text.html">
|
||||
<span class="fa fa-book"></span>
|
||||
|
||||
Licence
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="form-group">
|
||||
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Class 'disk'</h1>
|
||||
|
||||
<div class="hidden name"><code>as.disk.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>This transforms a vector to a new class <code>disk</code>, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.disk</span>(<span class='no'>x</span>, <span class='kw'>na.rm</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
<span class='fu'>is.disk</span>(<span class='no'>x</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>vector</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>na.rm</th>
|
||||
<td><p>a logical indicating whether missing values should be removed</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>Ordered integer factor with new class <code>disk</code></p>
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Interpret disk values as RSI values with <code><a href='as.rsi.html'>as.rsi</a></code>. It supports guidelines from EUCAST and CLSI.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
|
||||
|
||||
<div class='dont-index'><p><code><a href='as.rsi.html'>as.rsi</a></code></p></div>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='co'># interpret disk values</span>
|
||||
<span class='fu'><a href='as.rsi.html'>as.rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fl'>12</span>,
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>)
|
||||
<span class='fu'><a href='as.rsi.html'>as.rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fl'>12</span>,
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"CLSI"</span>)
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
|
||||
|
||||
apiKey: 'f737050abfd4d726c63938e18f8c496e',
|
||||
indexName: 'amr',
|
||||
inputSelector: 'input#search-input.form-control',
|
||||
transformData: function(hits) {
|
||||
return hits.map(function (hit) {
|
||||
hit.url = updateHitURL(hit);
|
||||
return hit;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -262,6 +262,10 @@
|
||||
|
||||
<p>Ordered factor with new class <code>mic</code></p>
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Interpret MIC values as RSI values with <code><a href='as.rsi.html'>as.rsi</a></code>. It supports guidelines from EUCAST and CLSI.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
@@ -280,6 +284,16 @@
|
||||
<span class='co'># this can also coerce combined MIC/RSI values:</span>
|
||||
<span class='fu'>as.mic</span>(<span class='st'>"<=0.002; S"</span>) <span class='co'># will return <=0.002</span>
|
||||
|
||||
<span class='co'># interpret MIC values</span>
|
||||
<span class='fu'><a href='as.rsi.html'>as.rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'>as.mic</span>(<span class='fl'>2</span>),
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>)
|
||||
<span class='fu'><a href='as.rsi.html'>as.rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'>as.mic</span>(<span class='fl'>4</span>),
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>)
|
||||
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>mic_data</span>)
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/barplot'>barplot</a></span>(<span class='no'>mic_data</span>)
|
||||
<span class='fu'><a href='freq.html'>freq</a></span>(<span class='no'>mic_data</span>)
|
||||
@@ -292,6 +306,8 @@
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
<li><a href="#see-also">See also</a></li>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -351,7 +351,7 @@ The intelligent rules takes into account microbial prevalence of pathogens in hu
|
||||
|
||||
|
||||
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870–926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p>
|
||||
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong>. 2019. Clin Microbiol Infect. 2019 Mar 11. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
|
||||
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
|
||||
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
|
||||
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Class 'rsi' — as.rsi" />
|
||||
|
||||
<meta property="og:description" content="This transforms a vector to a new class rsi, which is an ordered factor with levels S &lt; I &lt; R. Invalid antimicrobial interpretations will be translated as NA with a warning." />
|
||||
<meta property="og:description" content="Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class rsi, which is an ordered factor with levels S &lt; I &lt; R. Invalid antimicrobial interpretations will be translated as NA with a warning." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -237,11 +237,21 @@
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>This transforms a vector to a new class <code>rsi</code>, which is an ordered factor with levels <code>S < I < R</code>. Invalid antimicrobial interpretations will be translated as <code>NA</code> with a warning.</p>
|
||||
<p>Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class <code>rsi</code>, which is an ordered factor with levels <code>S < I < R</code>. Invalid antimicrobial interpretations will be translated as <code>NA</code> with a warning.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.rsi</span>(<span class='no'>x</span>)
|
||||
<pre class="usage"><span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='co'># S3 method for mic</span>
|
||||
<span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>mo</span>, <span class='no'>ab</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='co'># S3 method for disk</span>
|
||||
<span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>mo</span>, <span class='no'>ab</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='co'># S3 method for data.frame</span>
|
||||
<span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>,
|
||||
<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>is.rsi</span>(<span class='no'>x</span>)
|
||||
|
||||
@@ -252,7 +262,27 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>vector</p></td>
|
||||
<td><p>vector of values (for class <code>mic</code>: an MIC value in mg/L, for class <code>disk</code>: a disk diffusion radius in millimeters)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>parameters passed on to methods</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mo</th>
|
||||
<td><p>a microorganism code, generated with <code><a href='as.mo.html'>as.mo</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ab</th>
|
||||
<td><p>an antibiotic code, generated with <code><a href='as.ab.html'>as.ab</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>guideline</th>
|
||||
<td><p>defaults to the latest included EUCAST guideline, run <code><a href='https://www.rdocumentation.org/packages/base/topics/unique'>unique(AMR::rsi_translation$guideline)</a></code> for all options</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_mo</th>
|
||||
<td><p>column name of the unique IDs of the microorganisms (see <code><a href='as.mo.html'>mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>threshold</th>
|
||||
@@ -266,8 +296,9 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p><strong>NOTE:</strong> This function does not translate MIC values to RSI values. If more than 50% of the input resembles MIC values, it will warn about this.<br /> You can use <code><a href='eucast_rules.html'>eucast_rules</a></code> to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
|
||||
<p>The function <code>is.rsi.eligible</code> returns <code>TRUE</code> when a columns contains only valid antimicrobial interpretations (S and/or I and/or R), and <code>FALSE</code> otherwise.</p>
|
||||
<p>Run <code><a href='https://www.rdocumentation.org/packages/base/topics/unique'>unique(AMR::rsi_translation$guideline)</a></code> for a list of all supported guidelines.</p>
|
||||
<p>After using <code>as.rsi</code>, you can use <code><a href='eucast_rules.html'>eucast_rules</a></code> to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
|
||||
<p>The function <code>is.rsi.eligible</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> parameter.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
@@ -288,6 +319,16 @@
|
||||
<span class='co'># this can also coerce combined MIC/RSI values:</span>
|
||||
<span class='fu'>as.rsi</span>(<span class='st'>"<= 0.002; S"</span>) <span class='co'># will return S</span>
|
||||
|
||||
<span class='co'># interpret MIC values</span>
|
||||
<span class='fu'>as.rsi</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='as.mic.html'>as.mic</a></span>(<span class='fl'>2</span>),
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>)
|
||||
<span class='fu'>as.rsi</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='as.mic.html'>as.mic</a></span>(<span class='fl'>4</span>),
|
||||
<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"S. pneumoniae"</span>),
|
||||
<span class='kw'>ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>)
|
||||
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>rsi_data</span>) <span class='co'># for percentages</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/barplot'>barplot</a></span>(<span class='no'>rsi_data</span>) <span class='co'># for frequencies</span>
|
||||
<span class='fu'><a href='freq.html'>freq</a></span>(<span class='no'>rsi_data</span>) <span class='co'># frequency table with informative header</span>
|
||||
@@ -295,7 +336,7 @@
|
||||
<span class='co'># using dplyr's mutate</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>dplyr</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_at</a></span>(<span class='fu'><a href='https://dplyr.tidyverse.org/reference/vars.html'>vars</a></span>(<span class='no'>peni</span>:<span class='no'>rifa</span>), <span class='no'>as.rsi</span>)
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_at</a></span>(<span class='fu'><a href='https://dplyr.tidyverse.org/reference/vars.html'>vars</a></span>(<span class='no'>PEN</span>:<span class='no'>RIF</span>), <span class='no'>as.rsi</span>)
|
||||
|
||||
|
||||
<span class='co'># fastest way to transform all columns with already valid AB results to class `rsi`:</span>
|
||||
@@ -305,7 +346,7 @@
|
||||
|
||||
<span class='co'># default threshold of `is.rsi.eligible` is 5%.</span>
|
||||
<span class='fu'>is.rsi.eligible</span>(<span class='no'>WHONET</span>$<span class='no'>`First name`</span>) <span class='co'># fails, >80% is invalid</span>
|
||||
<span class='fu'>is.rsi.eligible</span>(<span class='no'>WHONET</span>$<span class='no'>`First name`</span>, <span class='kw'>threshold</span> <span class='kw'>=</span> <span class='fl'>0.9</span>) <span class='co'># succeeds</span>
|
||||
<span class='fu'>is.rsi.eligible</span>(<span class='no'>WHONET</span>$<span class='no'>`First name`</span>, <span class='kw'>threshold</span> <span class='kw'>=</span> <span class='fl'>0.99</span>) <span class='co'># succeeds</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -81,7 +81,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
|
||||
</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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -146,7 +146,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -257,8 +257,8 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
|
||||
|
||||
<span class='fu'>n_rsi</span>(<span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>count_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a></span>(<span class='st'>"get_antibiotic_names"</span>,
|
||||
<span class='st'>"official"</span>), <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
<span class='fu'>count_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
|
||||
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@@ -277,7 +277,11 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
|
||||
</tr>
|
||||
<tr>
|
||||
<th>translate_ab</th>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='abname.html'>abname</a></code>. This can be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("get_antibiotic_names")</code>.</p></td>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>combine_IR</th>
|
||||
@@ -315,55 +319,55 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
|
||||
?<span class='no'>septic_patients</span>
|
||||
|
||||
<span class='co'># Count resistant isolates</span>
|
||||
<span class='fu'>count_R</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_R</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'>count_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='co'># Or susceptible isolates</span>
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_SI</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'>count_SI</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='co'># Count all available isolates</span>
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>n_rsi</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'>n_rsi</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='co'># Since n_rsi counts available isolates, you can</span>
|
||||
<span class='co'># calculate back to count e.g. non-susceptible isolates.</span>
|
||||
<span class='co'># This results in the same:</span>
|
||||
<span class='fu'>count_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>) * <span class='fu'>n_rsi</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>count_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>) * <span class='fu'>n_rsi</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>dplyr</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>R</span> <span class='kw'>=</span> <span class='fu'>count_R</span>(<span class='no'>cipr</span>),
|
||||
<span class='kw'>I</span> <span class='kw'>=</span> <span class='fu'>count_I</span>(<span class='no'>cipr</span>),
|
||||
<span class='kw'>S</span> <span class='kw'>=</span> <span class='fu'>count_S</span>(<span class='no'>cipr</span>),
|
||||
<span class='kw'>n1</span> <span class='kw'>=</span> <span class='fu'>count_all</span>(<span class='no'>cipr</span>), <span class='co'># the actual total; sum of all three</span>
|
||||
<span class='kw'>n2</span> <span class='kw'>=</span> <span class='fu'>n_rsi</span>(<span class='no'>cipr</span>), <span class='co'># same - analogous to n_distinct</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>R</span> <span class='kw'>=</span> <span class='fu'>count_R</span>(<span class='no'>CIP</span>),
|
||||
<span class='kw'>I</span> <span class='kw'>=</span> <span class='fu'>count_I</span>(<span class='no'>CIP</span>),
|
||||
<span class='kw'>S</span> <span class='kw'>=</span> <span class='fu'>count_S</span>(<span class='no'>CIP</span>),
|
||||
<span class='kw'>n1</span> <span class='kw'>=</span> <span class='fu'>count_all</span>(<span class='no'>CIP</span>), <span class='co'># the actual total; sum of all three</span>
|
||||
<span class='kw'>n2</span> <span class='kw'>=</span> <span class='fu'>n_rsi</span>(<span class='no'>CIP</span>), <span class='co'># same - analogous to n_distinct</span>
|
||||
<span class='kw'>total</span> <span class='kw'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <span class='co'># NOT the number of tested isolates!</span>
|
||||
|
||||
<span class='co'># Count co-resistance between amoxicillin/clav acid and gentamicin,</span>
|
||||
<span class='co'># so we can see that combination therapy does a lot more than mono therapy.</span>
|
||||
<span class='co'># Please mind that `portion_S` calculates percentages right away instead.</span>
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>amcl</span>) <span class='co'># S = 1342 (71.4%)</span>
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>amcl</span>) <span class='co'># n = 1879</span>
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>AMC</span>) <span class='co'># S = 1342 (71.4%)</span>
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>AMC</span>) <span class='co'># n = 1879</span>
|
||||
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>gent</span>) <span class='co'># S = 1372 (74.0%)</span>
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>gent</span>) <span class='co'># n = 1855</span>
|
||||
<span class='fu'>count_S</span>(<span class='no'>septic_patients</span>$<span class='no'>GEN</span>) <span class='co'># S = 1372 (74.0%)</span>
|
||||
<span class='fu'>count_all</span>(<span class='no'>septic_patients</span>$<span class='no'>GEN</span>) <span class='co'># n = 1855</span>
|
||||
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/with'>with</a></span>(<span class='no'>septic_patients</span>,
|
||||
<span class='fu'>count_S</span>(<span class='no'>amcl</span>, <span class='no'>gent</span>)) <span class='co'># S = 1660 (92.3%)</span>
|
||||
<span class='fu'>count_S</span>(<span class='no'>AMC</span>, <span class='no'>GEN</span>)) <span class='co'># S = 1660 (92.3%)</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/with'>with</a></span>(<span class='no'>septic_patients</span>, <span class='co'># n = 1798</span>
|
||||
<span class='fu'>n_rsi</span>(<span class='no'>amcl</span>, <span class='no'>gent</span>))
|
||||
<span class='fu'>n_rsi</span>(<span class='no'>AMC</span>, <span class='no'>GEN</span>))
|
||||
|
||||
<span class='co'># Get portions S/I/R immediately of all rsi columns</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>count_df</span>(<span class='kw'>translate</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
<span class='co'># It also supports grouping variables</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>amox</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>AMX</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>count_df</span>(<span class='kw'>translate</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -242,38 +242,7 @@
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>eucast_rules</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>rules</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"breakpoints"</span>,
|
||||
<span class='st'>"expert"</span>, <span class='st'>"other"</span>, <span class='st'>"all"</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>amcl</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>amik</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>amox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>ampi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>azit</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>azlo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>aztr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cefa</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfep</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cfot</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cfra</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfta</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cftr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfur</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>chlo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cipr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>clar</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>clin</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>clox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>coli</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>czol</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>dapt</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>doxy</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>erta</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>eryt</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>fosf</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>fusi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>gent</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>imip</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>kana</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>levo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>linc</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>line</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>mero</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>mezl</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>mino</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>moxi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>nali</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>neom</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>neti</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>nitr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>norf</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>novo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>oflo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>oxac</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>peni</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>pipe</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>pita</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>poly</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>pris</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>qida</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>rifa</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>roxi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>siso</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>teic</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>tetr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>tica</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>tige</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>tobr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>trim</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>trsu</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>vanc</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='no'>...</span>)
|
||||
<span class='st'>"expert"</span>, <span class='st'>"other"</span>, <span class='st'>"all"</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>eucast_rules_file</span>()</pre>
|
||||
|
||||
@@ -282,7 +251,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>data with antibiotic columns, like e.g. <code>amox</code> and <code>amcl</code></p></td>
|
||||
<td><p>data with antibiotic columns, like e.g. <code>AMX</code> and <code>AMC</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_mo</th>
|
||||
@@ -300,13 +269,9 @@
|
||||
<th>verbose</th>
|
||||
<td><p>a logical to indicate whether extensive info should be returned as a <code>data.frame</code> with info about which rows and columns are effected. It runs all EUCAST rules, but will not be applied to an output - only an informative <code>data.frame</code> with changes will be returned as output.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>amcl, amik, amox, ampi, azit, azlo, aztr, cefa, cfep, cfot, cfox, cfra, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli, czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana, levo, linc, line, mero, mezl, mino, moxi, nali, neom, neti, nitr, norf, novo, oflo, oxac, peni, pipe, pita, poly, pris, qida, rifa, roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>parameters that are passed on to <code>eucast_rules</code></p></td>
|
||||
<td><p>column name of an antibiotic, see section Antibiotics</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -321,7 +286,7 @@
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. <br />
|
||||
<a href='http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx'>http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx</a></p></li>
|
||||
</ul>
|
||||
<p>For editing the reference file (which is available with <code>eucast_rules_file</code>), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like amcl. They can be separated by comma: <code>"amcl, fluoroquinolones"</code>. The mo_property can be any column name from the <code><a href='microorganisms.html'>microorganisms</a></code> data set, or <code>genus_species</code> or <code>gramstain</code>. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).</p>
|
||||
<p>For editing the reference file (which is available with <code>eucast_rules_file</code>), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: <code>"AMC, fluoroquinolones"</code>. The mo_property can be any column name from the <code><a href='microorganisms.html'>microorganisms</a></code> data set, or <code>genus_species</code> or <code>gramstain</code>. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).</p>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
@@ -329,79 +294,81 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p><strong>NOTE:</strong> This function does not translate MIC values to RSI values. It only applies (1) inferred susceptibility and resistance based on results of other antibiotics and (2) intrinsic resistance based on taxonomic properties of a microorganism.</p>
|
||||
<p>The file used for applying all EUCAST rules can be retrieved with <code>eucast_rules_file()</code>. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by this function can be found when running this command: <br />
|
||||
<p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi</a></code> for that. <br />
|
||||
<strong>Note:</strong> When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p>
|
||||
<p>The file used for applying all EUCAST rules can be retrieved with <code>eucast_rules_file()</code>. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by <code>eucast_rules()</code> can be found by running this command: <br />
|
||||
<code>AMR::EUCAST_RULES_FILE_LOCATION</code> (without brackets).</p>
|
||||
<p>In the source code it is located under <a href='https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv'><code>./inst/eucast/eucast_rules.tsv</code></a>.</p>
|
||||
<p><strong>Note:</strong> When ampicillin (J01CA01) is not available but amoxicillin (J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p>
|
||||
<p>In the source code the file containing all rules is located <a href='https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv'>here</a>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>
|
||||
|
||||
|
||||
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive) or use <code>NULL</code> to skip a column (e.g. <code>tica = NULL</code>). Non-existing columns will anyway be skipped with a warning.</p>
|
||||
<p>Abbrevations of the column containing antibiotics in the form: <strong>abbreviation</strong>: generic name (<em>ATC code</em>)</p>
|
||||
<p><strong>amcl</strong>: amoxicillin+clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),
|
||||
<strong>amik</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
|
||||
<strong>amox</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
|
||||
<strong>ampi</strong>: ampicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA01'>J01CA01</a>),
|
||||
<strong>azit</strong>: azithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA10'>J01FA10</a>),
|
||||
<strong>azlo</strong>: azlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA09'>J01CA09</a>),
|
||||
<strong>aztr</strong>: aztreonam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DF01'>J01DF01</a>),
|
||||
<strong>cefa</strong>: cefaloridine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB02'>J01DB02</a>),
|
||||
<strong>cfep</strong>: cefepime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DE01'>J01DE01</a>),
|
||||
<strong>cfot</strong>: cefotaxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD01'>J01DD01</a>),
|
||||
<strong>cfox</strong>: cefoxitin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC01'>J01DC01</a>),
|
||||
<strong>cfra</strong>: cefradine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB09'>J01DB09</a>),
|
||||
<strong>cfta</strong>: ceftazidime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD02'>J01DD02</a>),
|
||||
<strong>cftr</strong>: ceftriaxone (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD04'>J01DD04</a>),
|
||||
<strong>cfur</strong>: cefuroxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC02'>J01DC02</a>),
|
||||
<strong>chlo</strong>: chloramphenicol (<a href='https://www.whocc.no/atc_ddd_index/?code=J01BA01'>J01BA01</a>),
|
||||
<strong>cipr</strong>: ciprofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA02'>J01MA02</a>),
|
||||
<strong>clar</strong>: clarithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA09'>J01FA09</a>),
|
||||
<strong>clin</strong>: clindamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF01'>J01FF01</a>),
|
||||
<strong>clox</strong>: flucloxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CF05'>J01CF05</a>),
|
||||
<strong>coli</strong>: colistin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB01'>J01XB01</a>),
|
||||
<strong>czol</strong>: cefazolin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB04'>J01DB04</a>),
|
||||
<strong>dapt</strong>: daptomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX09'>J01XX09</a>),
|
||||
<strong>doxy</strong>: doxycycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA02'>J01AA02</a>),
|
||||
<strong>erta</strong>: ertapenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH03'>J01DH03</a>),
|
||||
<strong>eryt</strong>: erythromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA01'>J01FA01</a>),
|
||||
<strong>fosf</strong>: fosfomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX01'>J01XX01</a>),
|
||||
<strong>fusi</strong>: fusidic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XC01'>J01XC01</a>),
|
||||
<strong>gent</strong>: gentamicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB03'>J01GB03</a>),
|
||||
<strong>imip</strong>: imipenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH51'>J01DH51</a>),
|
||||
<strong>kana</strong>: kanamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB04'>J01GB04</a>),
|
||||
<strong>levo</strong>: levofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA12'>J01MA12</a>),
|
||||
<strong>linc</strong>: lincomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF02'>J01FF02</a>),
|
||||
<strong>line</strong>: linezolid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX08'>J01XX08</a>),
|
||||
<strong>mero</strong>: meropenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH02'>J01DH02</a>),
|
||||
<strong>mezl</strong>: mezlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA10'>J01CA10</a>),
|
||||
<strong>mino</strong>: minocycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA08'>J01AA08</a>),
|
||||
<strong>moxi</strong>: moxifloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01MA14</a>),
|
||||
<strong>nali</strong>: nalidixic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MB02'>J01MB02</a>),
|
||||
<strong>neom</strong>: neomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB05'>J01GB05</a>),
|
||||
<strong>neti</strong>: netilmicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB07'>J01GB07</a>),
|
||||
<strong>nitr</strong>: nitrofurantoin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XE01'>J01XE01</a>),
|
||||
<strong>norf</strong>: norfloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA06'>J01MA06</a>),
|
||||
<strong>novo</strong>: novobiocin (an ATCvet code: <a href='https://www.whocc.no/atc_ddd_index/?code=QJ01XX95'>QJ01XX95</a>),
|
||||
<strong>oflo</strong>: ofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01MA01</a>),
|
||||
<strong>peni</strong>: (benzyl)penicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CE01'>J01CE01</a>),
|
||||
<strong>pipe</strong>: piperacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA12'>J01CA12</a>),
|
||||
<strong>pita</strong>: piperacillin+tazobactam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR05'>J01CR05</a>),
|
||||
<strong>poly</strong>: polymyxin B (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB02'>J01XB02</a>),
|
||||
<strong>pris</strong>: pristinamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG01'>J01FG01</a>),
|
||||
<strong>qida</strong>: quinupristin/dalfopristin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG02'>J01FG02</a>),
|
||||
<strong>rifa</strong>: rifampicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J04AB02'>J04AB02</a>),
|
||||
<strong>roxi</strong>: roxithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA06'>J01FA06</a>),
|
||||
<strong>siso</strong>: sisomicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB08'>J01GB08</a>),
|
||||
<strong>teic</strong>: teicoplanin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA02'>J01XA02</a>),
|
||||
<strong>tetr</strong>: tetracycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA07'>J01AA07</a>),
|
||||
<strong>tica</strong>: ticarcillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA13'>J01CA13</a>),
|
||||
<strong>tige</strong>: tigecycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA12'>J01AA12</a>),
|
||||
<strong>tobr</strong>: tobramycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB01'>J01GB01</a>),
|
||||
<strong>trim</strong>: trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EA01'>J01EA01</a>),
|
||||
<strong>trsu</strong>: sulfamethoxazole and trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EE01'>J01EE01</a>),
|
||||
<strong>vanc</strong>: vancomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA01'>J01XA01</a>).</p>
|
||||
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p>
|
||||
<p>Available abbrevations of the column containing antibiotics in the form '<strong>antimicrobial ID</strong>: name (<em>ATC code</em>)':</p>
|
||||
<p><strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),
|
||||
<strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
|
||||
<strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
|
||||
<strong>AMP</strong>: ampicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA01'>J01CA01</a>),
|
||||
<strong>AZM</strong>: azithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA10'>J01FA10</a>),
|
||||
<strong>AZL</strong>: azlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA09'>J01CA09</a>),
|
||||
<strong>ATM</strong>: aztreonam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DF01'>J01DF01</a>),
|
||||
<strong>RID</strong>: cefaloridine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB02'>J01DB02</a>),
|
||||
<strong>FEP</strong>: cefepime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DE01'>J01DE01</a>),
|
||||
<strong>CTX</strong>: cefotaxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD01'>J01DD01</a>),
|
||||
<strong>FOX</strong>: cefoxitin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC01'>J01DC01</a>),
|
||||
<strong>CED</strong>: cefradine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB09'>J01DB09</a>),
|
||||
<strong>CAZ</strong>: ceftazidime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD02'>J01DD02</a>),
|
||||
<strong>CRO</strong>: ceftriaxone (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD04'>J01DD04</a>),
|
||||
<strong>CXM</strong>: cefuroxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC02'>J01DC02</a>),
|
||||
<strong>CHL</strong>: chloramphenicol (<a href='https://www.whocc.no/atc_ddd_index/?code=J01BA01'>J01BA01</a>),
|
||||
<strong>CIP</strong>: ciprofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA02'>J01MA02</a>),
|
||||
<strong>CLR</strong>: clarithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA09'>J01FA09</a>),
|
||||
<strong>CLI</strong>: clindamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF01'>J01FF01</a>),
|
||||
<strong>FLC</strong>: flucloxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CF05'>J01CF05</a>),
|
||||
<strong>COL</strong>: colistin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB01'>J01XB01</a>),
|
||||
<strong>CZO</strong>: cefazolin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB04'>J01DB04</a>),
|
||||
<strong>DAP</strong>: daptomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX09'>J01XX09</a>),
|
||||
<strong>DOX</strong>: doxycycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA02'>J01AA02</a>),
|
||||
<strong>ETP</strong>: ertapenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH03'>J01DH03</a>),
|
||||
<strong>ERY</strong>: erythromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA01'>J01FA01</a>),
|
||||
<strong>FOS</strong>: fosfomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX01'>J01XX01</a>),
|
||||
<strong>FUS</strong>: fusidic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XC01'>J01XC01</a>),
|
||||
<strong>GEN</strong>: gentamicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB03'>J01GB03</a>),
|
||||
<strong>IPM</strong>: imipenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH51'>J01DH51</a>),
|
||||
<strong>KAN</strong>: kanamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB04'>J01GB04</a>),
|
||||
<strong>LVX</strong>: levofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA12'>J01MA12</a>),
|
||||
<strong>LIN</strong>: lincomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF02'>J01FF02</a>),
|
||||
<strong>LNZ</strong>: linezolid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX08'>J01XX08</a>),
|
||||
<strong>MEM</strong>: meropenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH02'>J01DH02</a>),
|
||||
<strong>MEZ</strong>: mezlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA10'>J01CA10</a>),
|
||||
<strong>MNO</strong>: minocycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA08'>J01AA08</a>),
|
||||
<strong>MFX</strong>: moxifloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01MA14</a>),
|
||||
<strong>MTR</strong>: metronidazole (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01XD01</a>),
|
||||
<strong>NAL</strong>: nalidixic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MB02'>J01MB02</a>),
|
||||
<strong>NEO</strong>: neomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB05'>J01GB05</a>),
|
||||
<strong>NET</strong>: netilmicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB07'>J01GB07</a>),
|
||||
<strong>NIT</strong>: nitrofurantoin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XE01'>J01XE01</a>),
|
||||
<strong>NOR</strong>: norfloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA06'>J01MA06</a>),
|
||||
<strong>NOV</strong>: novobiocin (an ATCvet code: <a href='https://www.whocc.no/atc_ddd_index/?code=QJ01XX95'>QJ01XX95</a>),
|
||||
<strong>OFX</strong>: ofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01MA01</a>),
|
||||
<strong>OXA</strong>: oxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01CF04</a>),
|
||||
<strong>PEN</strong>: penicillin G (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CE01'>J01CE01</a>),
|
||||
<strong>PIP</strong>: piperacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA12'>J01CA12</a>),
|
||||
<strong>TZP</strong>: piperacillin/tazobactam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR05'>J01CR05</a>),
|
||||
<strong>PLB</strong>: polymyxin B (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB02'>J01XB02</a>),
|
||||
<strong>PRI</strong>: pristinamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG01'>J01FG01</a>),
|
||||
<strong>QDA</strong>: quinupristin/dalfopristin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG02'>J01FG02</a>),
|
||||
<strong>RIF</strong>: rifampicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J04AB02'>J04AB02</a>),
|
||||
<strong>RXT</strong>: roxithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA06'>J01FA06</a>),
|
||||
<strong>SIS</strong>: sisomicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB08'>J01GB08</a>),
|
||||
<strong>TEC</strong>: teicoplanin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA02'>J01XA02</a>),
|
||||
<strong>TCY</strong>: tetracycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA07'>J01AA07</a>),
|
||||
<strong>TIC</strong>: ticarcillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA13'>J01CA13</a>),
|
||||
<strong>TGC</strong>: tigecycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA12'>J01AA12</a>),
|
||||
<strong>TOB</strong>: tobramycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB01'>J01GB01</a>),
|
||||
<strong>TMP</strong>: trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EA01'>J01EA01</a>),
|
||||
<strong>SXT</strong>: trimethoprim/sulfamethoxazole (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EE01'>J01EE01</a>),
|
||||
<strong>VAN</strong>: vancomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA01'>J01XA01</a>).</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
@@ -418,17 +385,17 @@
|
||||
<span class='st'>"Escherichia coli"</span>,
|
||||
<span class='st'>"Klebsiella pneumoniae"</span>,
|
||||
<span class='st'>"Pseudomonas aeruginosa"</span>),
|
||||
<span class='kw'>vanc</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Vancomycin</span>
|
||||
<span class='kw'>amox</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Amoxicillin</span>
|
||||
<span class='kw'>coli</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Colistin</span>
|
||||
<span class='kw'>cfta</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Ceftazidime</span>
|
||||
<span class='kw'>cfur</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Cefuroxime</span>
|
||||
<span class='kw'>peni</span> <span class='kw'>=</span> <span class='st'>"S"</span>, <span class='co'># Benzylpenicillin</span>
|
||||
<span class='kw'>cfox</span> <span class='kw'>=</span> <span class='st'>"S"</span>, <span class='co'># Cefoxitin</span>
|
||||
<span class='kw'>VAN</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Vancomycin</span>
|
||||
<span class='kw'>AMX</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Amoxicillin</span>
|
||||
<span class='kw'>COL</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Colistin</span>
|
||||
<span class='kw'>CAZ</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Ceftazidime</span>
|
||||
<span class='kw'>CXM</span> <span class='kw'>=</span> <span class='st'>"-"</span>, <span class='co'># Cefuroxime</span>
|
||||
<span class='kw'>PEN</span> <span class='kw'>=</span> <span class='st'>"S"</span>, <span class='co'># Penicillin G</span>
|
||||
<span class='kw'>FOX</span> <span class='kw'>=</span> <span class='st'>"S"</span>, <span class='co'># Cefoxitin</span>
|
||||
<span class='kw'>stringsAsFactors</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
<span class='no'>a</span>
|
||||
<span class='co'># mo vanc amox coli cfta cfur peni cfox</span>
|
||||
<span class='co'># mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class='co'># 1 Staphylococcus aureus - - - - - S S</span>
|
||||
<span class='co'># 2 Enterococcus faecalis - - - - - S S</span>
|
||||
<span class='co'># 3 Escherichia coli - - - - - S S</span>
|
||||
@@ -440,7 +407,7 @@
|
||||
<span class='no'>b</span> <span class='kw'><-</span> <span class='fu'>eucast_rules</span>(<span class='no'>a</span>)
|
||||
|
||||
<span class='no'>b</span>
|
||||
<span class='co'># mo vanc amox coli cfta cfur peni cfox</span>
|
||||
<span class='co'># mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class='co'># 1 Staphylococcus aureus - S R R S S S</span>
|
||||
<span class='co'># 2 Enterococcus faecalis - - R R R S R</span>
|
||||
<span class='co'># 3 Escherichia coli R - - - - R S</span>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -302,9 +302,9 @@
|
||||
<span class='co'># filter on isolates that have any result for any aminoglycoside</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>filter_aminoglycosides</span>()
|
||||
|
||||
<span class='co'># this is essentially the same as:</span>
|
||||
<span class='co'># this is essentially the same as (but without determination of column names):</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter_all.html'>filter_at</a></span>(<span class='kw'>.vars</span> <span class='kw'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/vars.html'>vars</a></span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"gent"</span>, <span class='st'>"tobr"</span>, <span class='st'>"amik"</span>, <span class='st'>"kana"</span>)),
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter_all.html'>filter_at</a></span>(<span class='kw'>.vars</span> <span class='kw'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/vars.html'>vars</a></span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"GEN"</span>, <span class='st'>"TOB"</span>, <span class='st'>"AMK"</span>, <span class='st'>"KAN"</span>)),
|
||||
<span class='kw'>.vars_predicate</span> <span class='kw'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/all_vars.html'>any_vars</a></span>(<span class='no'>.</span> <span class='kw'>%in%</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"S"</span>, <span class='st'>"I"</span>, <span class='st'>"R"</span>)))
|
||||
|
||||
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -397,14 +397,14 @@ To conduct an analysis of antimicrobial resistance, you should only include the
|
||||
<span class='co'># Now let's see if first isolates matter:</span>
|
||||
<span class='no'>A</span> <span class='kw'><-</span> <span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>count</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>gent</span>), <span class='co'># gentamicin availability</span>
|
||||
<span class='kw'>resistance</span> <span class='kw'>=</span> <span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>gent</span>)) <span class='co'># gentamicin resistance</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>count</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>GEN</span>), <span class='co'># gentamicin availability</span>
|
||||
<span class='kw'>resistance</span> <span class='kw'>=</span> <span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>GEN</span>)) <span class='co'># gentamicin resistance</span>
|
||||
|
||||
<span class='no'>B</span> <span class='kw'><-</span> <span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'>filter_first_weighted_isolate</span>() <span class='kw'>%>%</span> <span class='co'># the 1st isolate filter</span>
|
||||
<span class='fu'>filter_first_weighted_isolate</span>() <span class='kw'>%>%</span> <span class='co'># the 1st isolate filter</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>count</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>gent</span>), <span class='co'># gentamicin availability</span>
|
||||
<span class='kw'>resistance</span> <span class='kw'>=</span> <span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>gent</span>)) <span class='co'># gentamicin resistance</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>count</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>GEN</span>), <span class='co'># gentamicin availability</span>
|
||||
<span class='kw'>resistance</span> <span class='kw'>=</span> <span class='fu'><a href='portion.html'>portion_IR</a></span>(<span class='no'>GEN</span>)) <span class='co'># gentamicin resistance</span>
|
||||
|
||||
<span class='co'># Have a look at A and B.</span>
|
||||
<span class='co'># B is more reliable because every isolate is only counted once.</span>
|
||||
|
||||
@@ -81,7 +81,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co
|
||||
</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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -146,7 +146,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -487,8 +487,8 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co
|
||||
|
||||
|
||||
<span class='co'># check differences between frequency tables</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/diff'>diff</a></span>(<span class='fu'>freq</span>(<span class='no'>septic_patients</span>$<span class='no'>trim</span>),
|
||||
<span class='fu'>freq</span>(<span class='no'>septic_patients</span>$<span class='no'>trsu</span>))
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/diff'>diff</a></span>(<span class='fu'>freq</span>(<span class='no'>septic_patients</span>$<span class='no'>TMP</span>),
|
||||
<span class='fu'>freq</span>(<span class='no'>septic_patients</span>$<span class='no'>SXT</span>))
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -243,13 +243,13 @@
|
||||
|
||||
<pre class="usage"><span class='fu'>ggplot_rsi</span>(<span class='no'>data</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Antibiotic"</span>,
|
||||
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>facet</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>),
|
||||
<span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"official"</span>, <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>,
|
||||
<span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>,
|
||||
<span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"grey15"</span>, <span class='no'>...</span>)
|
||||
<span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
|
||||
<span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>, <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
|
||||
<span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"grey15"</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>geom_rsi</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"Antibiotic"</span>, <span class='st'>"Interpretation"</span>),
|
||||
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"official"</span>, <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>,
|
||||
<span class='no'>...</span>)
|
||||
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
|
||||
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>facet_rsi</span>(<span class='kw'>facet</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"Interpretation"</span>, <span class='st'>"Antibiotic"</span>), <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
|
||||
|
||||
@@ -295,7 +295,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>translate_ab</th>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations into, using <code><a href='abname.html'>abname</a></code>. Default behaviour is to translate to official names according to the WHO. Use <code>translate_ab = FALSE</code> to disable translation.</p></td>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations into, using <code><a href='ab_property.html'>ab_name</a></code>. Default behaviour is to translate to official names according to the WHO. Use <code>translate_ab = FALSE</code> to disable translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>the language used for translation of antibiotic names</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fun</th>
|
||||
@@ -325,7 +329,7 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>At default, the names of antibiotics will be shown on the plots using <code><a href='abname.html'>abname</a></code>. This can be set with the option <code>get_antibiotic_names</code> (a logical value), so change it e.g. to <code>FALSE</code> with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>options(get_antibiotic_names = FALSE)</a></code>.</p>
|
||||
<p>At default, the names of antibiotics will be shown on the plots using <code><a href='ab_property.html'>ab_name</a></code>. This can be set with the option <code>get_antibiotic_names</code> (a logical value), so change it e.g. to <code>FALSE</code> with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>options(get_antibiotic_names = FALSE)</a></code>.</p>
|
||||
<p><strong>The functions</strong><br />
|
||||
<code>geom_rsi</code> will take any variable from the data that has an <code>rsi</code> class (created with <code><a href='as.rsi.html'>as.rsi</a></code>) using <code>fun</code> (<code><a href='count.html'>count_df</a></code> at default, can also be <code><a href='portion.html'>portion_df</a></code>) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.</p>
|
||||
<p><code>facet_rsi</code> creates 2d plots (at default based on S/I/R) using <code><a href='https://www.rdocumentation.org/packages/ggplot2/topics/facet_wrap'>facet_wrap</a></code>.</p>
|
||||
@@ -347,11 +351,11 @@
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>ggplot2</span>)
|
||||
|
||||
<span class='co'># get antimicrobial results for drugs against a UTI:</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/ggplot2/topics/ggplot'>ggplot</a></span>(<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>)) +
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/ggplot2/topics/ggplot'>ggplot</a></span>(<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>)) +
|
||||
<span class='fu'>geom_rsi</span>()
|
||||
|
||||
<span class='co'># prettify the plot using some additional functions:</span>
|
||||
<span class='no'>df</span> <span class='kw'><-</span> <span class='no'>septic_patients</span>[, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"amox"</span>, <span class='st'>"nitr"</span>, <span class='st'>"fosf"</span>, <span class='st'>"trim"</span>, <span class='st'>"cipr"</span>)]
|
||||
<span class='no'>df</span> <span class='kw'><-</span> <span class='no'>septic_patients</span>[, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"AMX"</span>, <span class='st'>"NIT"</span>, <span class='st'>"FOS"</span>, <span class='st'>"TMP"</span>, <span class='st'>"CIP"</span>)]
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/ggplot2/topics/ggplot'>ggplot</a></span>(<span class='no'>df</span>) +
|
||||
<span class='fu'>geom_rsi</span>() +
|
||||
<span class='fu'>scale_y_percent</span>() +
|
||||
@@ -361,17 +365,17 @@
|
||||
|
||||
<span class='co'># or better yet, simplify this using the wrapper function - a single command:</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>()
|
||||
|
||||
<span class='co'># get only portions and no counts:</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>(<span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>portion_df</span>)
|
||||
|
||||
<span class='co'># add other ggplot2 parameters as you like:</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>(<span class='kw'>width</span> <span class='kw'>=</span> <span class='fl'>0.5</span>,
|
||||
<span class='kw'>colour</span> <span class='kw'>=</span> <span class='st'>"black"</span>,
|
||||
<span class='kw'>size</span> <span class='kw'>=</span> <span class='fl'>1</span>,
|
||||
@@ -386,18 +390,18 @@
|
||||
<span class='co'># `age_group` is also a function of this package:</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='kw'>age_group</span> <span class='kw'>=</span> <span class='fu'><a href='age_groups.html'>age_groups</a></span>(<span class='no'>age</span>)) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>age_group</span>,
|
||||
<span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"age_group"</span>)
|
||||
<span class='co'># }</span><span class='co'># NOT RUN {</span>
|
||||
<span class='co'># for colourblind mode, use divergent colours from the viridis package:</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>() + <span class='fu'><a href='https://www.rdocumentation.org/packages/ggplot2/topics/scale_viridis'>scale_fill_viridis_d</a></span>()
|
||||
|
||||
|
||||
<span class='co'># it also supports groups (don't forget to use the group var on `x` or `facet`):</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>amox</span>, <span class='no'>nitr</span>, <span class='no'>fosf</span>, <span class='no'>trim</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>AMX</span>, <span class='no'>NIT</span>, <span class='no'>FOS</span>, <span class='no'>TMP</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ggplot_rsi</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='no'>hospital_id</span>,
|
||||
<span class='kw'>facet</span> <span class='kw'>=</span> <span class='no'>Antibiotic</span>,
|
||||
@@ -421,7 +425,7 @@
|
||||
<span class='co'># get short MO names (like "E. coli")</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span>(<span class='kw'>mo</span> <span class='kw'>=</span> <span class='fu'><a href='mo_property.html'>mo_shortname</a></span>(<span class='no'>mo</span>, <span class='kw'>Becker</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)) <span class='kw'>%>%</span>
|
||||
<span class='co'># select this short name and some antiseptic drugs</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>mo</span>, <span class='no'>cfur</span>, <span class='no'>gent</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>mo</span>, <span class='no'>CXM</span>, <span class='no'>GEN</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='co'># group by MO</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>mo</span>) <span class='kw'>%>%</span>
|
||||
<span class='co'># plot the thing, putting MOs on the facet</span>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -273,7 +273,7 @@
|
||||
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='st'>"amoxicillin"</span>)
|
||||
<span class='co'># [1] "amox"</span>
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='st'>"J01AA07"</span>) <span class='co'># ATC code of Tetracycline</span>
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='st'>"J01AA07"</span>) <span class='co'># ATC code of tetracycline</span>
|
||||
<span class='co'># [1] "tetr"</span>
|
||||
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='st'>"J01AA07"</span>, <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
|
||||
@@ -287,7 +287,7 @@
|
||||
<span class='co'># [1] "AMP_ND10"</span>
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='st'>"J01CR02"</span>)
|
||||
<span class='co'># [1] "AMC_ED20"</span>
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='fu'><a href='as.atc.html'>as.atc</a></span>(<span class='st'>"augmentin"</span>))
|
||||
<span class='fu'>guess_ab_col</span>(<span class='no'>df</span>, <span class='fu'><a href='as.ab.html'>as.ab</a></span>(<span class='st'>"augmentin"</span>))
|
||||
<span class='co'># [1] "AMC_ED20"</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
|
||||
@@ -78,7 +78,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -281,11 +281,23 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.atc.html">as.atc()</a></code> <code><a href="as.atc.html">is.atc()</a></code> </p>
|
||||
<p><code><a href="as.ab.html">as.ab()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform to antibiotic ID</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.atc.html">is.ab()</a></code> <code><a href="as.atc.html">as.atc()</a></code> <code><a href="as.atc.html">is.atc()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform to ATC code</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.disk.html">as.disk()</a></code> <code><a href="as.disk.html">is.disk()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Class 'disk'</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.mic.html">as.mic()</a></code> <code><a href="as.mic.html">is.mic()</a></code> </p>
|
||||
</td>
|
||||
@@ -316,6 +328,12 @@
|
||||
<td><p>EUCAST rules</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="rsi_translation.html">rsi_translation</a></code> </p>
|
||||
</td>
|
||||
<td><p>Data set for RSI interpretation</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="guess_ab_col.html">guess_ab_col()</a></code> </p>
|
||||
</td>
|
||||
@@ -361,23 +379,11 @@
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="atc_property.html">atc_property()</a></code> <code><a href="atc_property.html">atc_official()</a></code> <code><a href="atc_property.html">atc_name()</a></code> <code><a href="atc_property.html">atc_trivial_nl()</a></code> <code><a href="atc_property.html">atc_certe()</a></code> <code><a href="atc_property.html">atc_umcg()</a></code> <code><a href="atc_property.html">atc_tradenames()</a></code> </p>
|
||||
<p><code><a href="ab_property.html">ab_name()</a></code> <code><a href="ab_property.html">ab_atc()</a></code> <code><a href="ab_property.html">ab_cid()</a></code> <code><a href="ab_property.html">ab_synonyms()</a></code> <code><a href="ab_property.html">ab_tradenames()</a></code> <code><a href="ab_property.html">ab_group()</a></code> <code><a href="ab_property.html">ab_atc_group1()</a></code> <code><a href="ab_property.html">ab_atc_group2()</a></code> <code><a href="ab_property.html">ab_ddd()</a></code> <code><a href="ab_property.html">ab_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Property of an antibiotic</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="atc_online.html">atc_online_property()</a></code> <code><a href="atc_online.html">atc_online_groups()</a></code> <code><a href="atc_online.html">atc_online_ddd()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get ATC properties from WHOCC website</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="abname.html">abname()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Name of an antibiotic</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="age.html">age()</a></code> </p>
|
||||
</td>
|
||||
@@ -400,6 +406,12 @@
|
||||
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Join a table with <code>microorganisms</code></p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="atc_online.html">atc_online_property()</a></code> <code><a href="atc_online.html">atc_online_groups()</a></code> <code><a href="atc_online.html">atc_online_ddd()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get ATC properties from WHOCC website</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
@@ -464,12 +476,6 @@
|
||||
<td><p>Predict antimicrobial resistance</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="rsi.html">rsi()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Calculate resistance of isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="skewness.html">skewness()</a></code> </p>
|
||||
</td>
|
||||
@@ -487,7 +493,7 @@
|
||||
<td>
|
||||
<p><code><a href="antibiotics.html">antibiotics</a></code> </p>
|
||||
</td>
|
||||
<td><p>Data set with ~500 antibiotics</p></td>
|
||||
<td><p>Data set with ~450 antibiotics</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
@@ -529,9 +535,9 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="get_locale.html">get_locale()</a></code> </p>
|
||||
<p><code><a href="translate.html">get_locale()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get language for AMR</p></td>
|
||||
<td><p>Translate strings from AMR package</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
@@ -549,7 +555,7 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="AMR-deprecated.html">ratio()</a></code> <code><a href="AMR-deprecated.html">ab_property()</a></code> <code><a href="AMR-deprecated.html">ab_atc()</a></code> <code><a href="AMR-deprecated.html">ab_official()</a></code> <code><a href="AMR-deprecated.html">ab_name()</a></code> <code><a href="AMR-deprecated.html">ab_trivial_nl()</a></code> <code><a href="AMR-deprecated.html">ab_certe()</a></code> <code><a href="AMR-deprecated.html">ab_umcg()</a></code> <code><a href="AMR-deprecated.html">ab_tradenames()</a></code> <code><a href="AMR-deprecated.html">atc_ddd()</a></code> <code><a href="AMR-deprecated.html">atc_groups()</a></code> </p>
|
||||
<p><code><a href="AMR-deprecated.html">ratio()</a></code> <code><a href="AMR-deprecated.html">abname()</a></code> <code><a href="AMR-deprecated.html">atc_property()</a></code> <code><a href="AMR-deprecated.html">atc_official()</a></code> <code><a href="AMR-deprecated.html">ab_official()</a></code> <code><a href="AMR-deprecated.html">atc_name()</a></code> <code><a href="AMR-deprecated.html">atc_trivial_nl()</a></code> <code><a href="AMR-deprecated.html">atc_tradenames()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Deprecated functions</p></td>
|
||||
</tr>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -242,19 +242,19 @@
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>key_antibiotics</span>(<span class='no'>tbl</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>universal_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"amox"</span>), <span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"amcl"</span>),
|
||||
<span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"cfur"</span>),
|
||||
<span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"pita"</span>),
|
||||
<span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"cipr"</span>),
|
||||
<span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"trsu"</span>),
|
||||
<span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"vanc"</span>), <span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"teic"</span>), <span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"tetr"</span>),
|
||||
<span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"eryt"</span>), <span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"oxac"</span>), <span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"rifa"</span>),
|
||||
<span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"gent"</span>), <span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"tobr"</span>), <span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"coli"</span>),
|
||||
<span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"cfot"</span>), <span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"cfta"</span>), <span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"mero"</span>), <span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)
|
||||
<span class='st'>"AMX"</span>), <span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"AMC"</span>),
|
||||
<span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"CXM"</span>),
|
||||
<span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"TZP"</span>),
|
||||
<span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"CIP"</span>),
|
||||
<span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"SXT"</span>), <span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"VAN"</span>), <span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"TEC"</span>),
|
||||
<span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"TCY"</span>), <span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"ERY"</span>), <span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"OXA"</span>),
|
||||
<span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"RIF"</span>), <span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"GEN"</span>), <span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"TOB"</span>),
|
||||
<span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"COL"</span>), <span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>,
|
||||
<span class='st'>"CTX"</span>), <span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"CAZ"</span>),
|
||||
<span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>tbl</span>, <span class='st'>"MEM"</span>), <span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>key_antibiotics_equal</span>(<span class='no'>x</span>, <span class='no'>y</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"keyantibiotics"</span>, <span class='st'>"points"</span>),
|
||||
<span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -241,50 +241,21 @@
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>mdro</span>(<span class='no'>tbl</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
|
||||
<span class='kw'>amcl</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>amik</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>amox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>ampi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>azit</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>aztr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cefa</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfra</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cfep</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfot</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cfox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfta</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>cftr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cfur</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>chlo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>cipr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>clar</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>clin</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>clox</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>coli</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>czol</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>dapt</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>doxy</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>erta</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>eryt</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>fosf</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>fusi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>gent</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>imip</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>kana</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>levo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>linc</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>line</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>mero</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>metr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>mino</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>moxi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>nali</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>neom</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>neti</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>nitr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>novo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>norf</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>oflo</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>peni</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>pipe</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>pita</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>poly</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>qida</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>rifa</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>roxi</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>siso</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>teic</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>tetr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>tica</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>tige</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>tobr</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>trim</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(),
|
||||
<span class='kw'>trsu</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>vanc</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
<pre class="usage"><span class='fu'>mdro</span>(<span class='no'>x</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
|
||||
<span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>brmo</span>(<span class='no'>...</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='st'>"nl"</span>)
|
||||
|
||||
<span class='fu'>mrgn</span>(<span class='no'>tbl</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='st'>"de"</span>, <span class='no'>...</span>)
|
||||
<span class='fu'>mrgn</span>(<span class='no'>x</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='st'>"de"</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>eucast_exceptional_phenotypes</span>(<span class='no'>tbl</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)</pre>
|
||||
<span class='fu'>eucast_exceptional_phenotypes</span>(<span class='no'>x</span>, <span class='kw'>country</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>tbl</th>
|
||||
<td><p>table with antibiotic columns, like e.g. <code>amox</code> and <code>amcl</code></p></td>
|
||||
<th>x</th>
|
||||
<td><p>table with antibiotic columns, like e.g. <code>AMX</code> and <code>AMC</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>country</th>
|
||||
@@ -298,253 +269,13 @@
|
||||
<th>info</th>
|
||||
<td><p>print progress</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>amcl</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>amik</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>amox</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ampi</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>azit</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>aztr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cefa</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfra</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfep</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfot</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfox</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfta</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cftr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cfur</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>chlo</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>cipr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>clar</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>clin</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>clox</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>coli</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>czol</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>dapt</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>doxy</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>erta</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>eryt</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fosf</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fusi</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>gent</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>imip</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>kana</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>levo</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>linc</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>line</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mero</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>metr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mino</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>moxi</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>nali</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>neom</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>neti</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>nitr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>novo</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>norf</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>oflo</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>peni</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>pipe</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>pita</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>poly</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>qida</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>rifa</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>roxi</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>siso</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>teic</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tetr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tica</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tige</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tobr</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>trim</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>trsu</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>vanc</th>
|
||||
<td><p>column name of an antibiotic, see Antibiotics</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>verbose</th>
|
||||
<td><p>print additional info: missing antibiotic columns per parameter</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>parameters that are passed on to methods</p></td>
|
||||
<td><p>column name of an antibiotic, see section Antibiotics</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -559,70 +290,72 @@
|
||||
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>
|
||||
|
||||
|
||||
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive) or use <code>NULL</code> to skip a column (e.g. <code>tica = NULL</code>). Non-existing columns will anyway be skipped with a warning.</p>
|
||||
<p>Abbrevations of the column containing antibiotics in the form: <strong>abbreviation</strong>: generic name (<em>ATC code</em>)</p>
|
||||
<p><strong>amcl</strong>: amoxicillin+clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),
|
||||
<strong>amik</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
|
||||
<strong>amox</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
|
||||
<strong>ampi</strong>: ampicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA01'>J01CA01</a>),
|
||||
<strong>azit</strong>: azithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA10'>J01FA10</a>),
|
||||
<strong>azlo</strong>: azlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA09'>J01CA09</a>),
|
||||
<strong>aztr</strong>: aztreonam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DF01'>J01DF01</a>),
|
||||
<strong>cefa</strong>: cefaloridine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB02'>J01DB02</a>),
|
||||
<strong>cfep</strong>: cefepime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DE01'>J01DE01</a>),
|
||||
<strong>cfot</strong>: cefotaxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD01'>J01DD01</a>),
|
||||
<strong>cfox</strong>: cefoxitin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC01'>J01DC01</a>),
|
||||
<strong>cfra</strong>: cefradine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB09'>J01DB09</a>),
|
||||
<strong>cfta</strong>: ceftazidime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD02'>J01DD02</a>),
|
||||
<strong>cftr</strong>: ceftriaxone (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD04'>J01DD04</a>),
|
||||
<strong>cfur</strong>: cefuroxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC02'>J01DC02</a>),
|
||||
<strong>chlo</strong>: chloramphenicol (<a href='https://www.whocc.no/atc_ddd_index/?code=J01BA01'>J01BA01</a>),
|
||||
<strong>cipr</strong>: ciprofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA02'>J01MA02</a>),
|
||||
<strong>clar</strong>: clarithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA09'>J01FA09</a>),
|
||||
<strong>clin</strong>: clindamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF01'>J01FF01</a>),
|
||||
<strong>clox</strong>: flucloxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CF05'>J01CF05</a>),
|
||||
<strong>coli</strong>: colistin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB01'>J01XB01</a>),
|
||||
<strong>czol</strong>: cefazolin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB04'>J01DB04</a>),
|
||||
<strong>dapt</strong>: daptomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX09'>J01XX09</a>),
|
||||
<strong>doxy</strong>: doxycycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA02'>J01AA02</a>),
|
||||
<strong>erta</strong>: ertapenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH03'>J01DH03</a>),
|
||||
<strong>eryt</strong>: erythromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA01'>J01FA01</a>),
|
||||
<strong>fosf</strong>: fosfomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX01'>J01XX01</a>),
|
||||
<strong>fusi</strong>: fusidic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XC01'>J01XC01</a>),
|
||||
<strong>gent</strong>: gentamicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB03'>J01GB03</a>),
|
||||
<strong>imip</strong>: imipenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH51'>J01DH51</a>),
|
||||
<strong>kana</strong>: kanamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB04'>J01GB04</a>),
|
||||
<strong>levo</strong>: levofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA12'>J01MA12</a>),
|
||||
<strong>linc</strong>: lincomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF02'>J01FF02</a>),
|
||||
<strong>line</strong>: linezolid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX08'>J01XX08</a>),
|
||||
<strong>mero</strong>: meropenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH02'>J01DH02</a>),
|
||||
<strong>mezl</strong>: mezlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA10'>J01CA10</a>),
|
||||
<strong>mino</strong>: minocycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA08'>J01AA08</a>),
|
||||
<strong>moxi</strong>: moxifloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01MA14</a>),
|
||||
<strong>nali</strong>: nalidixic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MB02'>J01MB02</a>),
|
||||
<strong>neom</strong>: neomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB05'>J01GB05</a>),
|
||||
<strong>neti</strong>: netilmicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB07'>J01GB07</a>),
|
||||
<strong>nitr</strong>: nitrofurantoin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XE01'>J01XE01</a>),
|
||||
<strong>norf</strong>: norfloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA06'>J01MA06</a>),
|
||||
<strong>novo</strong>: novobiocin (an ATCvet code: <a href='https://www.whocc.no/atc_ddd_index/?code=QJ01XX95'>QJ01XX95</a>),
|
||||
<strong>oflo</strong>: ofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01MA01</a>),
|
||||
<strong>peni</strong>: (benzyl)penicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CE01'>J01CE01</a>),
|
||||
<strong>pipe</strong>: piperacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA12'>J01CA12</a>),
|
||||
<strong>pita</strong>: piperacillin+tazobactam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR05'>J01CR05</a>),
|
||||
<strong>poly</strong>: polymyxin B (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB02'>J01XB02</a>),
|
||||
<strong>pris</strong>: pristinamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG01'>J01FG01</a>),
|
||||
<strong>qida</strong>: quinupristin/dalfopristin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG02'>J01FG02</a>),
|
||||
<strong>rifa</strong>: rifampicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J04AB02'>J04AB02</a>),
|
||||
<strong>roxi</strong>: roxithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA06'>J01FA06</a>),
|
||||
<strong>siso</strong>: sisomicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB08'>J01GB08</a>),
|
||||
<strong>teic</strong>: teicoplanin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA02'>J01XA02</a>),
|
||||
<strong>tetr</strong>: tetracycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA07'>J01AA07</a>),
|
||||
<strong>tica</strong>: ticarcillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA13'>J01CA13</a>),
|
||||
<strong>tige</strong>: tigecycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA12'>J01AA12</a>),
|
||||
<strong>tobr</strong>: tobramycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB01'>J01GB01</a>),
|
||||
<strong>trim</strong>: trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EA01'>J01EA01</a>),
|
||||
<strong>trsu</strong>: sulfamethoxazole and trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EE01'>J01EE01</a>),
|
||||
<strong>vanc</strong>: vancomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA01'>J01XA01</a>).</p>
|
||||
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p>
|
||||
<p>Available abbrevations of the column containing antibiotics in the form '<strong>antimicrobial ID</strong>: name (<em>ATC code</em>)':</p>
|
||||
<p><strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),
|
||||
<strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
|
||||
<strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
|
||||
<strong>AMP</strong>: ampicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA01'>J01CA01</a>),
|
||||
<strong>AZM</strong>: azithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA10'>J01FA10</a>),
|
||||
<strong>AZL</strong>: azlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA09'>J01CA09</a>),
|
||||
<strong>ATM</strong>: aztreonam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DF01'>J01DF01</a>),
|
||||
<strong>RID</strong>: cefaloridine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB02'>J01DB02</a>),
|
||||
<strong>FEP</strong>: cefepime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DE01'>J01DE01</a>),
|
||||
<strong>CTX</strong>: cefotaxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD01'>J01DD01</a>),
|
||||
<strong>FOX</strong>: cefoxitin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC01'>J01DC01</a>),
|
||||
<strong>CED</strong>: cefradine (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB09'>J01DB09</a>),
|
||||
<strong>CAZ</strong>: ceftazidime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD02'>J01DD02</a>),
|
||||
<strong>CRO</strong>: ceftriaxone (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DD04'>J01DD04</a>),
|
||||
<strong>CXM</strong>: cefuroxime (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DC02'>J01DC02</a>),
|
||||
<strong>CHL</strong>: chloramphenicol (<a href='https://www.whocc.no/atc_ddd_index/?code=J01BA01'>J01BA01</a>),
|
||||
<strong>CIP</strong>: ciprofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA02'>J01MA02</a>),
|
||||
<strong>CLR</strong>: clarithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA09'>J01FA09</a>),
|
||||
<strong>CLI</strong>: clindamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF01'>J01FF01</a>),
|
||||
<strong>FLC</strong>: flucloxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CF05'>J01CF05</a>),
|
||||
<strong>COL</strong>: colistin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB01'>J01XB01</a>),
|
||||
<strong>CZO</strong>: cefazolin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DB04'>J01DB04</a>),
|
||||
<strong>DAP</strong>: daptomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX09'>J01XX09</a>),
|
||||
<strong>DOX</strong>: doxycycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA02'>J01AA02</a>),
|
||||
<strong>ETP</strong>: ertapenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH03'>J01DH03</a>),
|
||||
<strong>ERY</strong>: erythromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA01'>J01FA01</a>),
|
||||
<strong>FOS</strong>: fosfomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX01'>J01XX01</a>),
|
||||
<strong>FUS</strong>: fusidic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XC01'>J01XC01</a>),
|
||||
<strong>GEN</strong>: gentamicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB03'>J01GB03</a>),
|
||||
<strong>IPM</strong>: imipenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH51'>J01DH51</a>),
|
||||
<strong>KAN</strong>: kanamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB04'>J01GB04</a>),
|
||||
<strong>LVX</strong>: levofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA12'>J01MA12</a>),
|
||||
<strong>LIN</strong>: lincomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FF02'>J01FF02</a>),
|
||||
<strong>LNZ</strong>: linezolid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XX08'>J01XX08</a>),
|
||||
<strong>MEM</strong>: meropenem (<a href='https://www.whocc.no/atc_ddd_index/?code=J01DH02'>J01DH02</a>),
|
||||
<strong>MEZ</strong>: mezlocillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA10'>J01CA10</a>),
|
||||
<strong>MNO</strong>: minocycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA08'>J01AA08</a>),
|
||||
<strong>MFX</strong>: moxifloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01MA14</a>),
|
||||
<strong>MTR</strong>: metronidazole (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA14'>J01XD01</a>),
|
||||
<strong>NAL</strong>: nalidixic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MB02'>J01MB02</a>),
|
||||
<strong>NEO</strong>: neomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB05'>J01GB05</a>),
|
||||
<strong>NET</strong>: netilmicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB07'>J01GB07</a>),
|
||||
<strong>NIT</strong>: nitrofurantoin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XE01'>J01XE01</a>),
|
||||
<strong>NOR</strong>: norfloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA06'>J01MA06</a>),
|
||||
<strong>NOV</strong>: novobiocin (an ATCvet code: <a href='https://www.whocc.no/atc_ddd_index/?code=QJ01XX95'>QJ01XX95</a>),
|
||||
<strong>OFX</strong>: ofloxacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01MA01</a>),
|
||||
<strong>OXA</strong>: oxacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01MA01'>J01CF04</a>),
|
||||
<strong>PEN</strong>: penicillin G (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CE01'>J01CE01</a>),
|
||||
<strong>PIP</strong>: piperacillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA12'>J01CA12</a>),
|
||||
<strong>TZP</strong>: piperacillin/tazobactam (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR05'>J01CR05</a>),
|
||||
<strong>PLB</strong>: polymyxin B (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XB02'>J01XB02</a>),
|
||||
<strong>PRI</strong>: pristinamycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG01'>J01FG01</a>),
|
||||
<strong>QDA</strong>: quinupristin/dalfopristin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FG02'>J01FG02</a>),
|
||||
<strong>RIF</strong>: rifampicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J04AB02'>J04AB02</a>),
|
||||
<strong>RXT</strong>: roxithromycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01FA06'>J01FA06</a>),
|
||||
<strong>SIS</strong>: sisomicin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB08'>J01GB08</a>),
|
||||
<strong>TEC</strong>: teicoplanin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA02'>J01XA02</a>),
|
||||
<strong>TCY</strong>: tetracycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA07'>J01AA07</a>),
|
||||
<strong>TIC</strong>: ticarcillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA13'>J01CA13</a>),
|
||||
<strong>TGC</strong>: tigecycline (<a href='https://www.whocc.no/atc_ddd_index/?code=J01AA12'>J01AA12</a>),
|
||||
<strong>TOB</strong>: tobramycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB01'>J01GB01</a>),
|
||||
<strong>TMP</strong>: trimethoprim (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EA01'>J01EA01</a>),
|
||||
<strong>SXT</strong>: trimethoprim/sulfamethoxazole (<a href='https://www.whocc.no/atc_ddd_index/?code=J01EE01'>J01EE01</a>),
|
||||
<strong>VAN</strong>: vancomycin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01XA01'>J01XA01</a>).</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -241,29 +241,29 @@
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>mo_fullname</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<pre class="usage"><span class='fu'>mo_fullname</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_shortname</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_shortname</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_subspecies</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_subspecies</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_species</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_species</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_genus</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_genus</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_family</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_family</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_order</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_order</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_class</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_class</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_phylum</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_phylum</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_kingdom</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_kingdom</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_type</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_type</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_gramstain</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_gramstain</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_ref</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
@@ -273,11 +273,11 @@
|
||||
|
||||
<span class='fu'>mo_rank</span>(<span class='no'>x</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_taxonomy</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
<span class='fu'>mo_taxonomy</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_url</span>(<span class='no'>x</span>, <span class='kw'>open</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>mo_property</span>(<span class='no'>x</span>, <span class='kw'>property</span> <span class='kw'>=</span> <span class='st'>"fullname"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)</pre>
|
||||
<span class='fu'>mo_property</span>(<span class='no'>x</span>, <span class='kw'>property</span> <span class='kw'>=</span> <span class='st'>"fullname"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@@ -288,7 +288,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='get_locale.html'>get_locale</a></code>) and can also be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
@@ -323,13 +323,9 @@
|
||||
<li><p><code>mo_ref("Chlamydophila psittaci")</code> will return <code>"Everett et al., 1999"</code> (without a warning)</p></li>
|
||||
</ul>
|
||||
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>.</p>
|
||||
<p>All output will be <a href='translate.html'>translate</a>d where possible.</p>
|
||||
<p>The function <code>mo_url()</code> will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="supported-languages"><a class="anchor" href="#supported-languages"></a>Supported languages</h2>
|
||||
|
||||
|
||||
<p>Supported languages are <code>"en"</code> (English), <code>"de"</code> (German), <code>"nl"</code> (Dutch), <code>"es"</code> (Spanish), <code>"it"</code> (Italian), <code>"fr"</code> (French), and <code>"pt"</code> (Portuguese).</p>
|
||||
|
||||
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
|
||||
|
||||
|
||||
@@ -341,7 +337,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
|
||||
|
||||
|
||||
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870–926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p>
|
||||
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong>. 2019. Clin Microbiol Infect. 2019 Mar 11. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
|
||||
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
|
||||
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
|
||||
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
|
||||
|
||||
@@ -375,7 +371,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
|
||||
<span class='fu'>mo_gramstain</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Gram negative"</span>
|
||||
<span class='fu'>mo_type</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Bacteria" (equal to kingdom)</span>
|
||||
<span class='fu'>mo_rank</span>(<span class='st'>"E. coli"</span>) <span class='co'># "species"</span>
|
||||
<span class='fu'>mo_url</span>(<span class='st'>"E. coli"</span>) <span class='co'># get the direct url to the Catalogue of Life</span>
|
||||
<span class='fu'>mo_url</span>(<span class='st'>"E. coli"</span>) <span class='co'># get the direct url to the online database entry</span>
|
||||
|
||||
<span class='co'>## scientific reference</span>
|
||||
<span class='fu'>mo_ref</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Castellani et al., 1919"</span>
|
||||
@@ -433,7 +429,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
|
||||
<span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"nl"</span>) <span class='co'># "Streptococcus groep A"</span>
|
||||
|
||||
|
||||
<span class='co'># get a list with the complete taxonomy (kingdom to subspecies)</span>
|
||||
<span class='co'># get a list with the complete taxonomy (from kingdom to subspecies)</span>
|
||||
<span class='fu'>mo_taxonomy</span>(<span class='st'>"E. coli"</span>)
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
@@ -446,8 +442,6 @@ This package contains the complete taxonomic tree of almost all microorganisms (
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#supported-languages">Supported languages</a></li>
|
||||
|
||||
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
|
||||
|
||||
<li><a href="#source">Source</a></li>
|
||||
|
||||
@@ -81,7 +81,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
</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="Released version">0.6.1.9002</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -146,7 +146,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -258,8 +258,8 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
<span class='fu'>portion_S</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
|
||||
<span class='kw'>also_single_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
<span class='fu'>portion_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a></span>(<span class='st'>"get_antibiotic_names"</span>,
|
||||
<span class='st'>"official"</span>), <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
<span class='fu'>portion_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
|
||||
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@@ -286,7 +286,11 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
</tr>
|
||||
<tr>
|
||||
<th>translate_ab</th>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='abname.html'>abname</a></code>. This can be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("get_antibiotic_names")</code>.</p></td>
|
||||
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>combine_IR</th>
|
||||
@@ -307,8 +311,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
|
||||
<p><strong>Remember that you should filter your table to let it contain only first isolates!</strong> Use <code><a href='first_isolate.html'>first_isolate</a></code> to determine them in your data set.</p>
|
||||
<p>These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the <code><a href='count.html'>count</a></code> functions to count isolates. <em>Low counts can infuence the outcome - these <code>portion</code> functions may camouflage this, since they only return the portion albeit being dependent on the <code>minimum</code> parameter.</em></p>
|
||||
<p><code>portion_df</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><a href='as.rsi.html'>as.rsi</a></code>) and calculates the portions R, I and S. The resulting <em>tidy data</em> (see Source) <code>data.frame</code> will have three rows (S/I/R) and a column for each variable with class <code>"rsi"</code>.</p>
|
||||
<p>The old <code><a href='rsi.html'>rsi</a></code> function is still available for backwards compatibility but is deprecated.
|
||||
<p><code>portion_df</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><a href='as.rsi.html'>as.rsi</a></code>) and calculates the portions R, I and S. The resulting <em>tidy data</em> (see Source) <code>data.frame</code> will have three rows (S/I/R) and a column for each variable with class <code>"rsi"</code>.
|
||||
<br /><br />
|
||||
To calculate the probability (<em>p</em>) of susceptibility of one antibiotic, we use this formula:
|
||||
<div style="text-align: center;"><img src='figures/combi_therapy_2.png' alt='' /></div>
|
||||
@@ -338,63 +341,63 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
?<span class='no'>septic_patients</span>
|
||||
|
||||
<span class='co'># Calculate resistance</span>
|
||||
<span class='fu'>portion_R</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>portion_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>portion_R</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'>portion_IR</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='co'># Or susceptibility</span>
|
||||
<span class='fu'>portion_S</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>portion_SI</span>(<span class='no'>septic_patients</span>$<span class='no'>amox</span>)
|
||||
<span class='fu'>portion_S</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
<span class='fu'>portion_SI</span>(<span class='no'>septic_patients</span>$<span class='no'>AMX</span>)
|
||||
|
||||
<span class='co'># Do the above with pipes:</span>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>dplyr</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_R</span>(<span class='no'>amox</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_IR</span>(<span class='no'>amox</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>amox</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_SI</span>(<span class='no'>amox</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_R</span>(<span class='no'>AMX</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_IR</span>(<span class='no'>AMX</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>AMX</span>)
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_SI</span>(<span class='no'>AMX</span>)
|
||||
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>cipr</span>),
|
||||
<span class='kw'>n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>cipr</span>)) <span class='co'># n_rsi works like n_distinct in dplyr</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>CIP</span>),
|
||||
<span class='kw'>n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>CIP</span>)) <span class='co'># n_rsi works like n_distinct in dplyr</span>
|
||||
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>R</span> <span class='kw'>=</span> <span class='fu'>portion_R</span>(<span class='no'>cipr</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>I</span> <span class='kw'>=</span> <span class='fu'>portion_I</span>(<span class='no'>cipr</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>S</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>cipr</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>n1</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>cipr</span>), <span class='co'># the actual total; sum of all three</span>
|
||||
<span class='kw'>n2</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>cipr</span>), <span class='co'># same - analogous to n_distinct</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>R</span> <span class='kw'>=</span> <span class='fu'>portion_R</span>(<span class='no'>CIP</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>I</span> <span class='kw'>=</span> <span class='fu'>portion_I</span>(<span class='no'>CIP</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>S</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>CIP</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>n1</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>CIP</span>), <span class='co'># the actual total; sum of all three</span>
|
||||
<span class='kw'>n2</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>n_rsi</a></span>(<span class='no'>CIP</span>), <span class='co'># same - analogous to n_distinct</span>
|
||||
<span class='kw'>total</span> <span class='kw'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <span class='co'># NOT the number of tested isolates!</span>
|
||||
|
||||
<span class='co'># Calculate co-resistance between amoxicillin/clav acid and gentamicin,</span>
|
||||
<span class='co'># so we can see that combination therapy does a lot more than mono therapy:</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>amcl</span>) <span class='co'># S = 71.4%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>amcl</span>) <span class='co'># n = 1879</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>AMC</span>) <span class='co'># S = 71.4%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>AMC</span>) <span class='co'># n = 1879</span>
|
||||
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>gent</span>) <span class='co'># S = 74.0%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>gent</span>) <span class='co'># n = 1855</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>GEN</span>) <span class='co'># S = 74.0%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>GEN</span>) <span class='co'># n = 1855</span>
|
||||
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>amcl</span>, <span class='no'>gent</span>) <span class='co'># S = 92.3%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>amcl</span>, <span class='no'>gent</span>) <span class='co'># n = 1798</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'>portion_S</span>(<span class='no'>AMC</span>, <span class='no'>GEN</span>) <span class='co'># S = 92.3%</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>AMC</span>, <span class='no'>GEN</span>) <span class='co'># n = 1798</span>
|
||||
|
||||
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>cipro_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>cipr</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>cipro_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>cipr</span>),
|
||||
<span class='kw'>genta_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>gent</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>genta_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>gent</span>),
|
||||
<span class='kw'>combination_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>cipr</span>, <span class='no'>gent</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>combination_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>cipr</span>, <span class='no'>gent</span>))
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>cipro_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>CIP</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>cipro_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>CIP</span>),
|
||||
<span class='kw'>genta_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>GEN</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>genta_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>GEN</span>),
|
||||
<span class='kw'>combination_p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>CIP</span>, <span class='no'>GEN</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
|
||||
<span class='kw'>combination_n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>CIP</span>, <span class='no'>GEN</span>))
|
||||
|
||||
<span class='co'># Get portions S/I/R immediately of all rsi columns</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>amox</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>AMX</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>portion_df</span>(<span class='kw'>translate</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
<span class='co'># It also supports grouping variables</span>
|
||||
<span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>amox</span>, <span class='no'>cipr</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>hospital_id</span>, <span class='no'>AMX</span>, <span class='no'>CIP</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='no'>hospital_id</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>portion_df</span>(<span class='kw'>translate</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
|
||||
|
||||
@@ -404,8 +407,8 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
|
||||
<span class='no'>my_table</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='no'>first_isolate</span> <span class='kw'>==</span> <span class='fl'>TRUE</span>,
|
||||
<span class='no'>genus</span> <span class='kw'>==</span> <span class='st'>"Helicobacter"</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>amox</span>, <span class='no'>metr</span>), <span class='co'># amoxicillin with metronidazole</span>
|
||||
<span class='kw'>n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>amox</span>, <span class='no'>metr</span>))
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(<span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'>portion_S</span>(<span class='no'>AMX</span>, <span class='no'>MTR</span>), <span class='co'># amoxicillin with metronidazole</span>
|
||||
<span class='kw'>n</span> <span class='kw'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>(<span class='no'>AMX</span>, <span class='no'>MTR</span>))
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
|
||||
@@ -80,7 +80,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="Released version">0.6.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/atc_property.html">
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
@@ -357,7 +357,7 @@
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='no'>x</span> <span class='kw'><-</span> <span class='fu'>resistance_predict</span>(<span class='no'>septic_patients</span>, <span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"amox"</span>, <span class='kw'>year_min</span> <span class='kw'>=</span> <span class='fl'>2010</span>)
|
||||
<span class='no'>x</span> <span class='kw'><-</span> <span class='fu'>resistance_predict</span>(<span class='no'>septic_patients</span>, <span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>, <span class='kw'>year_min</span> <span class='kw'>=</span> <span class='fl'>2010</span>)
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>x</span>)
|
||||
<span class='fu'>ggplot_rsi_predict</span>(<span class='no'>x</span>)
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
<span class='no'>x</span> <span class='kw'><-</span> <span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='first_isolate.html'>filter_first_isolate</a></span>() <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='no'>mo</span>) <span class='kw'>==</span> <span class='st'>"Staphylococcus"</span>) <span class='kw'>%>%</span>
|
||||
<span class='fu'>resistance_predict</span>(<span class='st'>"peni"</span>)
|
||||
<span class='fu'>resistance_predict</span>(<span class='st'>"PEN"</span>)
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>x</span>)
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
|
||||
<span class='no'>data</span> <span class='kw'><-</span> <span class='no'>septic_patients</span> <span class='kw'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='no'>mo</span> <span class='kw'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)) <span class='kw'>%>%</span>
|
||||
<span class='fu'>resistance_predict</span>(<span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"amox"</span>,
|
||||
<span class='fu'>resistance_predict</span>(<span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
|
||||
<span class='kw'>col_date</span> <span class='kw'>=</span> <span class='st'>"date"</span>,
|
||||
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
|
||||
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>15</span>)
|
||||
|
||||
311
docs/reference/rsi_translation.html
Normal file
@@ -0,0 +1,311 @@
|
||||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Data set for RSI interpretation — rsi_translation • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
<!-- docsearch -->
|
||||
<script src="../docsearch.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
|
||||
<link href="../docsearch.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Data set for RSI interpretation — rsi_translation" />
|
||||
|
||||
<meta property="og:description" content="Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use as.rsi to transform MICs or disks measurements to RSI values." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</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="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home"></span>
|
||||
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<span class="fa fa-question-circle"></span>
|
||||
|
||||
How to
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/AMR.html">
|
||||
<span class="fa fa-directions"></span>
|
||||
|
||||
Conduct AMR analysis
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/WHONET.html">
|
||||
<span class="fa fa-globe-americas"></span>
|
||||
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
|
||||
Apply EUCAST rules
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/freq.html">
|
||||
<span class="fa fa-sort-amount-down"></span>
|
||||
|
||||
Create frequency tables
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/G_test.html">
|
||||
<span class="fa fa-clipboard-check"></span>
|
||||
|
||||
Use the G-test
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/benchmarks.html">
|
||||
<span class="fa fa-shipping-fast"></span>
|
||||
|
||||
Other: benchmarks
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/">
|
||||
<span class="fa fa-book-open"></span>
|
||||
|
||||
Manual
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../authors.html">
|
||||
<span class="fa fa-users"></span>
|
||||
|
||||
Authors
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../news/">
|
||||
<span class="far fa far fa-newspaper"></span>
|
||||
|
||||
Changelog
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://gitlab.com/msberends/AMR">
|
||||
<span class="fab fa fab fa-gitlab"></span>
|
||||
|
||||
Source Code
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../LICENSE-text.html">
|
||||
<span class="fa fa-book"></span>
|
||||
|
||||
Licence
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="form-group">
|
||||
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Data set for RSI interpretation</h1>
|
||||
|
||||
<div class="hidden name"><code>rsi_translation.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use <code><a href='as.rsi.html'>as.rsi</a></code> to transform MICs or disks measurements to RSI values.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='no'>rsi_translation</span></pre>
|
||||
|
||||
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
|
||||
|
||||
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 11,559 observations and 9 variables:</p><dl class='dl-horizontal'>
|
||||
<dt><code>guideline</code></dt><dd><p>Name of the guideline</p></dd>
|
||||
<dt><code>mo</code></dt><dd><p>Microbial ID, see <code><a href='as.mo.html'>as.mo</a></code></p></dd>
|
||||
<dt><code>ab</code></dt><dd><p>Antibiotic ID, see <code><a href='as.ab.html'>as.ab</a></code></p></dd>
|
||||
<dt><code>ref_tbl</code></dt><dd><p>Info about where the guideline rule can be found</p></dd>
|
||||
<dt><code>S_mic</code></dt><dd><p>Lowest MIC value that leads to "S"</p></dd>
|
||||
<dt><code>R_mic</code></dt><dd><p>Highest MIC value that leads to "R"</p></dd>
|
||||
<dt><code>dose_disk</code></dt><dd><p>Dose of the used disk diffusion method</p></dd>
|
||||
<dt><code>S_disk</code></dt><dd><p>Lowest number of millimeters that leads to "S"</p></dd>
|
||||
<dt><code>R_disk</code></dt><dd><p>Highest number of millimeters that leads to "R"</p></dd>
|
||||
</dl>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
|
||||
<li><a href="#format">Format</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
|
||||
|
||||
apiKey: 'f737050abfd4d726c63938e18f8c496e',
|
||||
indexName: 'amr',
|
||||
inputSelector: 'input#search-input.form-control',
|
||||
transformData: function(hits) {
|
||||
return hits.map(function (hit) {
|
||||
hit.url = updateHitURL(hit);
|
||||
return hit;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
336
docs/reference/translate.html
Normal file
@@ -0,0 +1,336 @@
|
||||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Translate strings from AMR package — translate • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
<!-- docsearch -->
|
||||
<script src="../docsearch.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
|
||||
<link href="../docsearch.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
<meta property="og:title" content="Translate strings from AMR package — translate" />
|
||||
|
||||
<meta property="og:description" content="For language-dependent output of AMR functions, like mo_fullname and mo_type." />
|
||||
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</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="Released version">0.6.1.9003</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home"></span>
|
||||
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<span class="fa fa-question-circle"></span>
|
||||
|
||||
How to
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/AMR.html">
|
||||
<span class="fa fa-directions"></span>
|
||||
|
||||
Conduct AMR analysis
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/resistance_predict.html">
|
||||
<span class="fa fa-dice"></span>
|
||||
|
||||
Predict antimicrobial resistance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/WHONET.html">
|
||||
<span class="fa fa-globe-americas"></span>
|
||||
|
||||
Work with WHONET data
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/SPSS.html">
|
||||
<span class="fa fa-file-upload"></span>
|
||||
|
||||
Import data from SPSS/SAS/Stata
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/EUCAST.html">
|
||||
<span class="fa fa-exchange-alt"></span>
|
||||
|
||||
Apply EUCAST rules
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/mo_property.html">
|
||||
<span class="fa fa-bug"></span>
|
||||
|
||||
Get properties of a microorganism
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/ab_property.html">
|
||||
<span class="fa fa-capsules"></span>
|
||||
|
||||
Get properties of an antibiotic
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/freq.html">
|
||||
<span class="fa fa-sort-amount-down"></span>
|
||||
|
||||
Create frequency tables
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/G_test.html">
|
||||
<span class="fa fa-clipboard-check"></span>
|
||||
|
||||
Use the G-test
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../articles/benchmarks.html">
|
||||
<span class="fa fa-shipping-fast"></span>
|
||||
|
||||
Other: benchmarks
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/">
|
||||
<span class="fa fa-book-open"></span>
|
||||
|
||||
Manual
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../authors.html">
|
||||
<span class="fa fa-users"></span>
|
||||
|
||||
Authors
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../news/">
|
||||
<span class="far fa far fa-newspaper"></span>
|
||||
|
||||
Changelog
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://gitlab.com/msberends/AMR">
|
||||
<span class="fab fa fab fa-gitlab"></span>
|
||||
|
||||
Source Code
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../LICENSE-text.html">
|
||||
<span class="fa fa-book"></span>
|
||||
|
||||
Licence
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="form-group">
|
||||
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Translate strings from AMR package</h1>
|
||||
|
||||
<div class="hidden name"><code>translate.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>For language-dependent output of AMR functions, like <code><a href='mo_property.html'>mo_fullname</a></code> and <code><a href='mo_property.html'>mo_type</a></code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>get_locale</span>()</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running:</p>
|
||||
<p><code><a href='https://www.rdocumentation.org/packages/base/topics/system.file'>system.file("translations.tsv", package = "AMR")</a></code></p>
|
||||
<p>This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property</a></code> functions (<code><a href='mo_property.html'>mo_fullname</a></code>, <code><a href='mo_property.html'>mo_type</a></code>, etc.). Please suggest your own translations <a href='https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation suggestion'>by creating a new issue on our repository</a>.</p>
|
||||
<p>The system language will be used at default, if supported, using <code>get_locale</code>. The system language can be overwritten with <code><a href='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='co'># The 'language' parameter of below functions</span>
|
||||
<span class='co'># will be set automatically to your system language</span>
|
||||
<span class='co'># with get_locale()</span>
|
||||
|
||||
<span class='co'># English</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"en"</span>)
|
||||
<span class='co'>#> "Coagulase-negative Staphylococcus (CoNS)"</span>
|
||||
|
||||
<span class='co'># German</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"de"</span>)
|
||||
<span class='co'>#> "Koagulase-negative Staphylococcus (KNS)"</span>
|
||||
|
||||
<span class='co'># Dutch</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"nl"</span>)
|
||||
<span class='co'>#> "Coagulase-negatieve Staphylococcus (CNS)"</span>
|
||||
|
||||
<span class='co'># Spanish</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"es"</span>)
|
||||
<span class='co'>#> "Staphylococcus coagulasa negativo (SCN)"</span>
|
||||
|
||||
<span class='co'># Italian</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"it"</span>)
|
||||
<span class='co'>#> "Staphylococcus negativo coagulasi (CoNS)"</span>
|
||||
|
||||
<span class='co'># Portuguese</span>
|
||||
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"CoNS"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='st'>"pt"</span>)
|
||||
<span class='co'>#> "Staphylococcus coagulase negativo (CoNS)"</span>
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
|
||||
<li><a href="#details">Details</a></li>
|
||||
|
||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
|
||||
|
||||
apiKey: 'f737050abfd4d726c63938e18f8c496e',
|
||||
indexName: 'amr',
|
||||
inputSelector: 'input#search-input.form-control',
|
||||
transformData: function(hits) {
|
||||
return hits.map(function (hit) {
|
||||
hit.url = updateHitURL(hit);
|
||||
return hit;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/WHONET.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/abname.html</loc>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/ab_property.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/age.html</loc>
|
||||
@@ -27,9 +27,15 @@
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/antibiotics.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/as.ab.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/as.atc.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/as.disk.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/as.mic.html</loc>
|
||||
</url>
|
||||
@@ -42,9 +48,6 @@
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/atc_online.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/atc_property.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/availability.html</loc>
|
||||
</url>
|
||||
@@ -72,9 +75,6 @@
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/g.test.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/get_locale.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/ggplot_rsi.html</loc>
|
||||
</url>
|
||||
@@ -124,7 +124,7 @@
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/resistance_predict.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/rsi.html</loc>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/rsi_translation.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/septic_patients.html</loc>
|
||||
@@ -132,6 +132,9 @@
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/skewness.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/reference/translate.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/articles/AMR.html</loc>
|
||||
</url>
|
||||
@@ -148,7 +151,7 @@
|
||||
<loc>https://msberends.gitlab.io/AMR/articles/WHONET.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/articles/atc_property.html</loc>
|
||||
<loc>https://msberends.gitlab.io/AMR/articles/ab_property.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://msberends.gitlab.io/AMR/articles/benchmarks.html</loc>
|
||||
|
||||
10
index.md
@@ -6,7 +6,7 @@
|
||||
|
||||
`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any data format, including WHONET/EARS-Net data.
|
||||
|
||||
After installing this package, R knows [**~65,000 microorganisms**](./reference/microorganisms.html) and [**~500 antibiotics**](./reference/antibiotics.html) by name and code, and knows all about valid RSI and MIC values.
|
||||
After installing this package, R knows [**~65,000 microorganisms**](./reference/microorganisms.html) and [**~450 antibiotics**](./reference/antibiotics.html) by name and code, and knows all about valid RSI and MIC values.
|
||||
|
||||
**Used to SPSS?** Read our [tutorial on how to import data from SPSS, SAS or Stata](./articles/SPSS.html) and learn in which ways R outclasses any of these statistical packages.
|
||||
|
||||
@@ -114,7 +114,7 @@ Read more about the data from the Catalogue of Life [in our manual](./reference/
|
||||
|
||||
<div><img src="reference/figures/logo_who.png" height="75px" class="logo_img"><p class="logo_txt">WHO Collaborating Centre for Drug Statistics Methodology</p></div>
|
||||
|
||||
This package contains **all ~500 antimicrobial drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the [Pharmaceuticals Community Register of the European Commission](http://ec.europa.eu/health/documents/community-register/html/atc.htm).
|
||||
This package contains **all ~450 antimicrobial drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the [Pharmaceuticals Community Register of the European Commission](http://ec.europa.eu/health/documents/community-register/html/atc.htm).
|
||||
|
||||
Read more about the data from WHOCC [in our manual](./reference/WHOCC.html).
|
||||
|
||||
@@ -132,10 +132,10 @@ The `AMR` package basically does four important things:
|
||||
|
||||
1. It **cleanses existing data** by providing new *classes* for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). By installing this package, you teach R everything about microbiology that is needed for analysis. These functions all use intelligent rules to guess results that you would expect:
|
||||
|
||||
* Use `as.mo()` to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of *Klebsiella pneumoniae* is "B_KLBSL_PNE" (B stands for Bacteria) and the ID of *S. aureus* is "B_STPHY_AUR". The function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" or "esccol" and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our [benchmarks](./articles/benchmarks.html). Moreover, it can group *Staphylococci* into coagulase negative and positive (CoNS and CoPS, see [source](./reference/as.mo.html#source)) and can categorise *Streptococci* into Lancefield groups (like beta-haemolytic *Streptococcus* Group B, [source](./reference/as.mo.html#source)).
|
||||
* Use `as.mo()` to get a microbial ID. The IDs are human readable for the trained eye - the ID of *Klebsiella pneumoniae* is "B_KLBSL_PNE" (B stands for Bacteria) and the ID of *S. aureus* is "B_STPHY_AUR". The function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" or "esccol" and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our [benchmarks](./articles/benchmarks.html). Moreover, it can group *Staphylococci* into coagulase negative and positive (CoNS and CoPS, see [source](./reference/as.mo.html#source)) and can categorise *Streptococci* into Lancefield groups (like beta-haemolytic *Streptococcus* Group B, [source](./reference/as.mo.html#source)).
|
||||
* Use `as.rsi()` to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like "<=0.002; S" (combined MIC/RSI) will result in "S".
|
||||
* Use `as.mic()` to cleanse your MIC values. It produces a so-called factor (called *ordinal* in SPSS) with valid MIC values as levels. A value like "<=0.002; S" (combined MIC/RSI) will result in "<=0.002".
|
||||
* Use `as.atc()` to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values "Furabid", "Furadantin", "nitro" all return the ATC code of Nitrofurantoine.
|
||||
* Use `as.ab()` to get a antibiotic ID, which are abbreviations used by EARS-Net whenever available. Use `as.atc()` to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values "Furabid", "Furadantin", "nitro" all return the ID of Nitrofurantoine.
|
||||
|
||||
2. It **enhances existing data** and **adds new data** from data sets included in this package.
|
||||
|
||||
@@ -144,7 +144,7 @@ The `AMR` package basically does four important things:
|
||||
* You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
|
||||
* Use `mdro()` (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.
|
||||
* The [data set `microorganisms`](./reference/microorganisms.html) contains the complete taxonomic tree of ~65,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus()`, `mo_family()`, `mo_gramstain()` or even `mo_phylum()`. As they use `as.mo()` internally, they also use the same intelligent rules for determination. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
|
||||
* The [data set `antibiotics`](./reference/antibiotics.html) contains almost 500 antimicrobial drugs with their ATC code, EARS-Net code, common LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains hundreds of trade names. Use functions like `atc_name()` and `atc_tradenames()` to look up values. The `atc_*` functions use `as.atc()` internally so they support the same intelligent rules to guess the most probable result. For example, `atc_name("Fluclox")`, `atc_name("Floxapen")` and `atc_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data.
|
||||
* The [data set `antibiotics`](./reference/antibiotics.html) contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like `ab_name()`, `ab_group()` and `ab_tradenames()` to look up values. The `ab_*` functions use `as.ab()` internally so they support the same intelligent rules to guess the most probable result. For example, `ab_name("Fluclox")`, `ab_name("Floxapen")` and `ab_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data.
|
||||
|
||||
3. It **analyses the data** with convenient functions that use well-known methods.
|
||||
|
||||
|
||||
@@ -1,182 +1,182 @@
|
||||
if_mo_property like_is_one_of this_value and_these_antibiotics have_these_values then_change_these_antibiotics to_value reference.rule reference.rule_group
|
||||
order is Enterobacteriales ampi S amox S Enterobacteriales (Order) Breakpoints
|
||||
order is Enterobacteriales ampi I amox I Enterobacteriales (Order) Breakpoints
|
||||
order is Enterobacteriales ampi R amox R Enterobacteriales (Order) Breakpoints
|
||||
genus is Staphylococcus peni, cfox S ampi, amox, pipe, tica S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus peni, cfox R, S oxac, clox S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus cfox R all_betalactams R Staphylococcus Breakpoints
|
||||
genus_species is Staphylococcus saprophyticus ampi S amox, amcl, pipe, pita S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus cfox S carbapenems, cephalosporins_without_cfta S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus cfox I carbapenems, cephalosporins_without_cfta I Staphylococcus Breakpoints
|
||||
genus is Staphylococcus cfox R carbapenems, cephalosporins_without_cfta R Staphylococcus Breakpoints
|
||||
genus is Staphylococcus norf S cipr, levo, moxi, oflo S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus eryt S azit, clar, roxi S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus eryt I azit, clar, roxi I Staphylococcus Breakpoints
|
||||
genus is Staphylococcus eryt R azit, clar, roxi R Staphylococcus Breakpoints
|
||||
genus is Staphylococcus tetr S doxy, mino S Staphylococcus Breakpoints
|
||||
genus_species is Enterococcus faecium ampi R all_betalactams R Enterococcus Breakpoints
|
||||
genus is Enterococcus ampi S amox, amcl, pipe, pita S Enterococcus Breakpoints
|
||||
genus is Enterococcus ampi I amox, amcl, pipe, pita I Enterococcus Breakpoints
|
||||
genus is Enterococcus ampi R amox, amcl, pipe, pita R Enterococcus Breakpoints
|
||||
genus is Enterococcus norf S cipr, levo S Enterococcus Breakpoints
|
||||
genus is Enterococcus norf I cipr, levo I Enterococcus Breakpoints
|
||||
genus is Enterococcus norf R cipr, levo R Enterococcus Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ peni S aminopenicillins, ureidopenicillins, cephalosporins, carbapenems, clox, amcl S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ peni I aminopenicillins, ureidopenicillins, cephalosporins, carbapenems, clox, amcl I Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ peni R aminopenicillins, ureidopenicillins, cephalosporins, carbapenems, clox, amcl R Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ norf S levo, moxi S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ eryt S azit, clar, roxi S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ eryt I azit, clar, roxi I Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ eryt R azit, clar, roxi R Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ tetr S doxy, mino S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species is Streptococcus pneumoniae peni S ampi, amox, amcl, pipe, pita S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ampi S amox, amcl, pipe, pita S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ampi I amox, amcl, pipe, pita I Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ampi R amox, amcl, pipe, pita R Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae norf S levo, moxi S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae eryt S azit, clar, roxi S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae eryt I azit, clar, roxi I Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae eryt R azit, clar, roxi R Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae tetr S doxy, mino S Streptococcus pneumoniae Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ peni S ampi, amox, amcl, pipe, pita S Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ ampi S amox, amcl, pipe, pita S Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ ampi I amox, amcl, pipe, pita I Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ ampi R amox, amcl, pipe, pita R Viridans group streptococci Breakpoints
|
||||
genus_species is Haemophilus influenzae ampi S amox, pipe S Haemophilus influenzae Breakpoints
|
||||
genus_species is ^Haemophilus influenzae ampi I amox, pipe I Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae ampi R amox, pipe R Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae peni S ampi, amox, amcl, pipe, pita S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae amcl S pita S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae amcl I pita I Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae amcl R pita R Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae nali S cipr, levo, moxi, oflo S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae tetr S doxy, mino S Haemophilus influenzae Breakpoints
|
||||
genus_species is Moraxella catarrhalis amcl S pita S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis amcl I pita I Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis amcl R pita R Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis nali S cipr, levo, moxi, oflo S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis eryt S azit, clar, roxi S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis eryt I azit, clar, roxi I Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis eryt R azit, clar, roxi R Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis tetr S doxy, mino S Moraxella catarrhalis Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus , Propionibacterium peni S ampi, amox, pipe, pita, tica S Anaerobic Gram positives Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus , Propionibacterium peni I ampi, amox, pipe, pita, tica I Anaerobic Gram positives Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus , Propionibacterium peni R ampi, amox, pipe, pita, tica R Anaerobic Gram positives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella peni S ampi, amox, pipe, pita, tica S Anaerobic Gram negatives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella peni I ampi, amox, pipe, pita, tica I Anaerobic Gram negatives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella peni R ampi, amox, pipe, pita, tica R Anaerobic Gram negatives Breakpoints
|
||||
genus_species is Pasteurella multocida peni S ampi, amox S Pasteurella multocida Breakpoints
|
||||
genus_species is Pasteurella multocida peni I ampi, amox I Pasteurella multocida Breakpoints
|
||||
genus_species is Pasteurella multocida peni R ampi, amox R Pasteurella multocida Breakpoints
|
||||
genus_species is Campylobacter coli eryt S azit, clar S Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli eryt I azit, clar I Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli eryt R azit, clar R Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli tetr S doxy S Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli tetr I doxy I Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli tetr R doxy R Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter jejuni eryt S azit, clar S Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni eryt I azit, clar I Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni eryt R azit, clar R Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni tetr S doxy S Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni tetr I doxy I Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni tetr R doxy R Campylobacter jejuni Breakpoints
|
||||
genus_species is Aerococcus sanguinicola norf S fluoroquinolones S Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola norf I fluoroquinolones I Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola norf R fluoroquinolones R Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola cipr S levo S Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola cipr I levo I Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola cipr R levo R Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae norf S fluoroquinolones S Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae norf I fluoroquinolones I Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae norf R fluoroquinolones R Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae cipr S levo S Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae cipr I levo I Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae cipr R levo R Aerococcus urinae Breakpoints
|
||||
genus_species is Kingella kingae peni S ampi, amox S Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae peni I ampi, amox I Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae peni R ampi, amox R Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae eryt S azit, clar S Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae eryt I azit, clar I Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae eryt R azit, clar R Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae tetr S doxy S Kingella kingae Breakpoints
|
||||
family is Enterobacteriaceae peni, glycopeptides, fusi, macrolides, linc, streptogramins, rifa, dapt, line R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
fullname like ^Citrobacter (koseri|amalonaticus|sedlakii|farmeri|rodentium) aminopenicillins, tica R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
fullname like ^Citrobacter (freundii|braakii|murliniae|werkmanii|youngae) aminopenicillins, amcl, czol, cfox R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Enterobacter cloacae aminopenicillins, amcl, czol, cfox R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Enterobacter aerogenes aminopenicillins, amcl, czol, cfox R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Escherichia hermanni aminopenicillins, tica R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Hafnia alvei aminopenicillins, amcl, czol, cfox R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus is Klebsiella aminopenicillins, tica R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Morganella morganii aminopenicillins, amcl, czol, tetracyclines, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus mirabilis tetracyclines, tige, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus penneri aminopenicillins, czol, cfur, tetracyclines, tige, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus vulgaris aminopenicillins, czol, cfur, tetracyclines, tige, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Providencia rettgeri aminopenicillins, amcl, czol, cfur, tetracyclines, tige, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Providencia stuartii aminopenicillins, amcl, czol, cfur, tetracyclines, tige, polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus is Raoultella aminopenicillins, tica R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Serratia marcescens aminopenicillins, amcl, czol, cfox, cfur, tetracyclines[tetracyclines != na.rm(mino)], polymyxins, nitr R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Yersinia enterocolitica aminopenicillins, amcl, tica, czol, cfox R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Yersinia pseudotuberculosis poly, coli R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus one_of Achromobacter, Acinetobacter, Alcaligenes, Bordatella, Burkholderia, Elizabethkingia, Flavobacterium, Ochrobactrum, Pseudomonas, Stenotrophomonas peni, cfox, cfur, glycopeptides, fusi, macrolides, linc, streptogramins, rifa, dapt, line R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter baumannii aminopenicillins, amcl, czol, cfot, cftr, aztr, erta, trim, fosf, doxy, tetr R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter pittii aminopenicillins, amcl, czol, cfot, cftr, aztr, erta, trim, fosf, doxy, tetr R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter nosocomialis aminopenicillins, amcl, czol, cfot, cftr, aztr, erta, trim, fosf, doxy, tetr R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter calcoaceticus aminopenicillins, amcl, czol, cfot, cftr, aztr, erta, trim, fosf, doxy, tetr R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Achromobacter xylosoxidans aminopenicillins, czol, cfot, cftr, erta R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
fullname like ^Burkholderia (cepacia|multivorans|cenocepacia|stabilis|vietnamiensis|dolosa|ambifaria|anthina|pyrrocinia|ubonensis) aminopenicillins, amcl, tica, pipe, pita, czol, cfot, cftr, aztr, erta, cipr, chlo, aminoglycosides, trim, fosf, polymyxins R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Elizabethkingia meningoseptica aminopenicillins, amcl, tica, czol, cfot, cftr, cfta, cfep, aztr, erta, imip, mero, polymyxins R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Ochrobactrum anthropi aminopenicillins, amcl, tica, pipe, pita, czol, cfot, cftr, cfta, cfep, aztr, erta R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Pseudomonas aeruginosa aminopenicillins, amcl, czol, cfot, cftr, erta, chlo, kana, neom, trim, trsu, tetracyclines, tige R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Stenotrophomonas maltophilia aminopenicillins, amcl, tica, pipe, pita, czol, cfot, cftr, cfta, aztr, erta, imip, mero, aminoglycosides, trim, fosf, tetr R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus one_of Haemophilus, Moraxella, Neisseria, Campylobacter glycopeptides, linc, dapt, line R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Haemophilus influenzae fusi, streptogramins R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Moraxella catarrhalis trim R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus is Neisseria trim R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter fetus fusi, streptogramins, trim, nali R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter jejuni fusi, streptogramins, trim R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter coli fusi, streptogramins, trim R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
gramstain is Gram positive aztr, polymyxins, nali R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus saprophyticus fusi, cfta, fosf, novo R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus cohnii cfta, novo R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus xylosus cfta, novo R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus capitis cfta, fosf R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus aureus cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus epidermidis cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus coagulase-negative cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus hominis cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus haemolyticus cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus intermedius cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus pseudintermedius cfta R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Streptococcus fusi, cfta, aminoglycosides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus faecalis fusi, cfta, cephalosporins_without_cfta, aminoglycosides, macrolides, clin, qida, trim, trsu R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus gallinarum fusi, cfta, cephalosporins_without_cfta, aminoglycosides, macrolides, clin, qida, vanc, trim, trsu R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus casseliflavus fusi, cfta, cephalosporins_without_cfta, aminoglycosides, macrolides, clin, qida, vanc, trim, trsu R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus faecium fusi, cfta, cephalosporins_without_cfta, aminoglycosides, macrolides, trim, trsu R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Corynebacterium fosf R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
order is Enterobacteriales AMP S AMX S Enterobacteriales (Order) Breakpoints
|
||||
order is Enterobacteriales AMP I AMX I Enterobacteriales (Order) Breakpoints
|
||||
order is Enterobacteriales AMP R AMX R Enterobacteriales (Order) Breakpoints
|
||||
genus is Staphylococcus PEN, FOX S AMP, AMX, PIP, TIC S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus PEN, FOX R, S OXA, FLC S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus FOX R all_betalactams R Staphylococcus Breakpoints
|
||||
genus_species is Staphylococcus saprophyticus AMP S AMX, AMC, PIP, TZP S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus FOX S carbapenems, cephalosporins_without_CAZ S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus FOX I carbapenems, cephalosporins_without_CAZ I Staphylococcus Breakpoints
|
||||
genus is Staphylococcus FOX R carbapenems, cephalosporins_without_CAZ R Staphylococcus Breakpoints
|
||||
genus is Staphylococcus NOR S CIP, LVX, MFX, OFX S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus ERY S AZM, CLR, RXT S Staphylococcus Breakpoints
|
||||
genus is Staphylococcus ERY I AZM, CLR, RXT I Staphylococcus Breakpoints
|
||||
genus is Staphylococcus ERY R AZM, CLR, RXT R Staphylococcus Breakpoints
|
||||
genus is Staphylococcus TCY S DOX, MNO S Staphylococcus Breakpoints
|
||||
genus_species is Enterococcus faecium AMP R all_betalactams R Enterococcus Breakpoints
|
||||
genus is Enterococcus AMP S AMX, AMC, PIP, TZP S Enterococcus Breakpoints
|
||||
genus is Enterococcus AMP I AMX, AMC, PIP, TZP I Enterococcus Breakpoints
|
||||
genus is Enterococcus AMP R AMX, AMC, PIP, TZP R Enterococcus Breakpoints
|
||||
genus is Enterococcus NOR S CIP, LVX S Enterococcus Breakpoints
|
||||
genus is Enterococcus NOR I CIP, LVX I Enterococcus Breakpoints
|
||||
genus is Enterococcus NOR R CIP, LVX R Enterococcus Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN S aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN I aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC I Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN R aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC R Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ NOR S LVX, MFX S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY S AZM, CLR, RXT S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY I AZM, CLR, RXT I Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY R AZM, CLR, RXT R Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ TCY S DOX, MNO S Streptococcus groups A, B, C, G Breakpoints
|
||||
genus_species is Streptococcus pneumoniae PEN S AMP, AMX, AMC, PIP, TZP S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae AMP S AMX, AMC, PIP, TZP S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae AMP I AMX, AMC, PIP, TZP I Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae AMP R AMX, AMC, PIP, TZP R Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae NOR S LVX, MFX S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ERY S AZM, CLR, RXT S Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ERY I AZM, CLR, RXT I Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae ERY R AZM, CLR, RXT R Streptococcus pneumoniae Breakpoints
|
||||
genus_species is Streptococcus pneumoniae TCY S DOX, MNO S Streptococcus pneumoniae Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ PEN S AMP, AMX, AMC, PIP, TZP S Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ AMP S AMX, AMC, PIP, TZP S Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ AMP I AMX, AMC, PIP, TZP I Viridans group streptococci Breakpoints
|
||||
genus_species like ^Streptococcus (australis|bovis|constellatus|cristatus|gallolyticus|gordonii|infantarius|infantis|mitis|mutans|oligofermentans|oralis|peroris|pseudopneumoniae|salivarius|sinensis|sobrinus|thermophilus|vestibularis|anginosus|equinus|intermedius|parasanguinis|sanguinis)$ AMP R AMX, AMC, PIP, TZP R Viridans group streptococci Breakpoints
|
||||
genus_species is Haemophilus influenzae AMP S AMX, PIP S Haemophilus influenzae Breakpoints
|
||||
genus_species is ^Haemophilus influenzae AMP I AMX, PIP I Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae AMP R AMX, PIP R Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae PEN S AMP, AMX, AMC, PIP, TZP S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae AMC S TZP S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae AMC I TZP I Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae AMC R TZP R Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae NAL S CIP, LVX, MFX, OFX S Haemophilus influenzae Breakpoints
|
||||
genus_species is Haemophilus influenzae TCY S DOX, MNO S Haemophilus influenzae Breakpoints
|
||||
genus_species is Moraxella catarrhalis AMC S TZP S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis AMC I TZP I Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis AMC R TZP R Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis NAL S CIP, LVX, MFX, OFX S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis ERY S AZM, CLR, RXT S Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis ERY I AZM, CLR, RXT I Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis ERY R AZM, CLR, RXT R Moraxella catarrhalis Breakpoints
|
||||
genus_species is Moraxella catarrhalis TCY S DOX, MNO S Moraxella catarrhalis Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram positives Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram positives Breakpoints
|
||||
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram positives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram negatives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram negatives Breakpoints
|
||||
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram negatives Breakpoints
|
||||
genus_species is Pasteurella multocida PEN S AMP, AMX S Pasteurella multocida Breakpoints
|
||||
genus_species is Pasteurella multocida PEN I AMP, AMX I Pasteurella multocida Breakpoints
|
||||
genus_species is Pasteurella multocida PEN R AMP, AMX R Pasteurella multocida Breakpoints
|
||||
genus_species is Campylobacter coli ERY S AZM, CLR S Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli ERY I AZM, CLR I Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli ERY R AZM, CLR R Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli TCY S DOX S Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli TCY I DOX I Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter coli TCY R DOX R Campylobacter coli Breakpoints
|
||||
genus_species is Campylobacter jejuni ERY S AZM, CLR S Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni ERY I AZM, CLR I Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni ERY R AZM, CLR R Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni TCY S DOX S Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni TCY I DOX I Campylobacter jejuni Breakpoints
|
||||
genus_species is Campylobacter jejuni TCY R DOX R Campylobacter jejuni Breakpoints
|
||||
genus_species is Aerococcus sanguinicola NOR S fluoroquinolones S Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola NOR I fluoroquinolones I Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola NOR R fluoroquinolones R Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola CIP S LVX S Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola CIP I LVX I Aerococcus sanguinicola Breakpoints
|
||||
genus_species is Aerococcus sanguinicola CIP R LVX R Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae NOR S fluoroquinolones S Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae NOR I fluoroquinolones I Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae NOR R fluoroquinolones R Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae CIP S LVX S Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae CIP I LVX I Aerococcus urinae Breakpoints
|
||||
genus_species is Aerococcus urinae CIP R LVX R Aerococcus urinae Breakpoints
|
||||
genus_species is Kingella kingae PEN S AMP, AMX S Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae PEN I AMP, AMX I Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae PEN R AMP, AMX R Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae ERY S AZM, CLR S Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae ERY I AZM, CLR I Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae ERY R AZM, CLR R Kingella kingae Breakpoints
|
||||
genus_species is Kingella kingae TCY S DOX S Kingella kingae Breakpoints
|
||||
family is Enterobacteriaceae PEN, glycopeptides, FUS, macrolides, LIN, streptogramins, RIF, DAP, LNZ R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
fullname like ^Citrobacter (koseri|amalonaticus|sedlakii|farmeri|rodentium) aminopenicillins, TIC R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
fullname like ^Citrobacter (freundii|braakii|murliniae|werkmanii|youngae) aminopenicillins, AMC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Enterobacter cloacae aminopenicillins, AMC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Enterobacter aerogenes aminopenicillins, AMC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Escherichia hermanni aminopenicillins, TIC R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Hafnia alvei aminopenicillins, AMC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus is Klebsiella aminopenicillins, TIC R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Morganella morganii aminopenicillins, AMC, CZO, tetracyclines, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus mirabilis tetracyclines, TGC, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus penneri aminopenicillins, CZO, CXM, tetracyclines, TGC, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Proteus vulgaris aminopenicillins, CZO, CXM, tetracyclines, TGC, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Providencia rettgeri aminopenicillins, AMC, CZO, CXM, tetracyclines, TGC, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Providencia stuartii aminopenicillins, AMC, CZO, CXM, tetracyclines, TGC, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus is Raoultella aminopenicillins, TIC R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Serratia marcescens aminopenicillins, AMC, CZO, FOX, CXM, DOX, TCY, polymyxins, NIT R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Yersinia enterocolitica aminopenicillins, AMC, TIC, CZO, FOX R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus_species is Yersinia pseudotuberculosis poly, COL R Table 01: Intrinsic resistance in Enterobacteriaceae Expert Rules
|
||||
genus one_of Achromobacter, Acinetobacter, Alcaligenes, Bordatella, Burkholderia, Elizabethkingia, Flavobacterium, Ochrobactrum, Pseudomonas, Stenotrophomonas PEN, FOX, CXM, glycopeptides, FUS, macrolides, LIN, streptogramins, RIF, DAP, LNZ R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter baumannii aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter pittii aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter nosocomialis aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Acinetobacter calcoaceticus aminopenicillins, AMC, CZO, CTX, CRO, ATM, ETP, TMP, FOS, DOX, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Achromobacter xylosoxidans aminopenicillins, CZO, CTX, CRO, ETP R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
fullname like ^Burkholderia (cepacia|multivorans|cenocepacia|stabilis|vietnamiensis|dolosa|ambifaria|anthina|pyrrocinia|ubonensis) aminopenicillins, AMC, TIC, PIP, TZP, CZO, CTX, CRO, ATM, ETP, CIP, CHL, aminoglycosides, TMP, FOS, polymyxins R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Elizabethkingia meningoseptica aminopenicillins, AMC, TIC, CZO, CTX, CRO, CAZ, FEP, ATM, ETP, IPM, MEM, polymyxins R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Ochrobactrum anthropi aminopenicillins, AMC, TIC, PIP, TZP, CZO, CTX, CRO, CAZ, FEP, ATM, ETP R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Pseudomonas aeruginosa aminopenicillins, AMC, CZO, CTX, CRO, ETP, CHL, KAN, NEO, TMP, SXT, tetracyclines, TGC R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus_species is Stenotrophomonas maltophilia aminopenicillins, AMC, TIC, PIP, TZP, CZO, CTX, CRO, CAZ, ATM, ETP, IPM, MEM, aminoglycosides, TMP, FOS, TCY R Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria Expert Rules
|
||||
genus one_of Haemophilus, Moraxella, Neisseria, Campylobacter glycopeptides, LIN, DAP, LNZ R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Haemophilus influenzae FUS, streptogramins R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Moraxella catarrhalis TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus is Neisseria TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter fetus FUS, streptogramins, TMP, NAL R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter jejuni FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
genus_species is Campylobacter coli FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
|
||||
gramstain is Gram positive ATM, polymyxins, NAL R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus saprophyticus FUS, CAZ, FOS, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus cohnii CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus xylosus CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus capitis CAZ, FOS R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus aureus CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus epidermidis CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus coagulase-negative CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus hominis CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus haemolyticus CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus intermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Staphylococcus pseudintermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Streptococcus FUS, CAZ, aminoglycosides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus faecalis FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus gallinarum FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus casseliflavus FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Enterococcus faecium FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Corynebacterium FOS R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Listeria monocytogenes cephalosporins R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Leuconostoc, Pediococcus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus is Lactobacillus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Clostridium ramosum vanc R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Clostridium innocuum vanc R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G) peni S aminopenicillins, cephalosporins, carbapenems S Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
genus is Enterococcus ampi R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
genus is Enterococcus amox R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
family is Enterobacteriaceae tica, pipe R, S pipe R Table 09: Interpretive rules for B-lactam agents and Gram-negative rods Expert Rules
|
||||
genus is .* eryt S azit, clar S Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is .* eryt I azit, clar I Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is .* eryt R azit, clar R Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is Staphylococcus tobr R kana, amik R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
genus is Staphylococcus gent R aminoglycosides R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
family is Enterobacteriaceae gent, tobr I, S gent R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
family is Enterobacteriaceae gent, tobr R, I tobr R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
genus is Staphylococcus moxi R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus_species is Streptococcus pneumoniae moxi R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
family is Enterobacteriaceae cipr R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus_species is Neisseria gonorrhoeae cipr R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus is .* amcl R ampi, amox R Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R Other rules
|
||||
genus is .* pita R pipe R Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R Other rules
|
||||
genus is .* trsu R trim R Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R Other rules
|
||||
genus is .* ampi S amcl S Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S Other rules
|
||||
genus is .* amox S amcl S Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S Other rules
|
||||
genus is .* pipe S pita S Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S Other rules
|
||||
genus is .* trim S trsu S Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S Other rules
|
||||
genus_species is Clostridium ramosum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species is Clostridium innocuum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
|
||||
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G) PEN S aminopenicillins, cephalosporins_without_CAZ, carbapenems S Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
genus is Enterococcus AMP R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
genus is Enterococcus AMX R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
|
||||
family is Enterobacteriaceae TIC, PIP R, S PIP R Table 09: Interpretive rules for B-lactam agents and Gram-negative rods Expert Rules
|
||||
genus is .* ERY S AZM, CLR S Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is .* ERY I AZM, CLR I Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is .* ERY R AZM, CLR R Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins Expert Rules
|
||||
genus is Staphylococcus TOB R KAN, amik R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
genus is Staphylococcus GEN R aminoglycosides R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
family is Enterobacteriaceae GEN, TOB I, S GEN R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
family is Enterobacteriaceae GEN, TOB R, I TOB R Table 12: Interpretive rules for aminoglycosides Expert Rules
|
||||
genus is Staphylococcus MFX R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus_species is Streptococcus pneumoniae MFX R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
family is Enterobacteriaceae CIP R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus_species is Neisseria gonorrhoeae CIP R fluoroquinolones R Table 13: Interpretive rules for quinolones Expert Rules
|
||||
genus is .* AMC R AMP, AMX R Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R Other rules
|
||||
genus is .* TZP R PIP R Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R Other rules
|
||||
genus is .* SXT R TMP R Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R Other rules
|
||||
genus is .* AMP S AMC S Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S Other rules
|
||||
genus is .* AMX S AMC S Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S Other rules
|
||||
genus is .* PIP S TZP S Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S Other rules
|
||||
genus is .* TMP S SXT S Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S Other rules
|
||||
|
||||
|
@@ -1,24 +1,3 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://gitlab.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
Name: Insert %in%
|
||||
Binding: addin_insert_in
|
||||
Interactive: false
|
||||
|
||||
456
inst/translations.tsv
Normal file
@@ -0,0 +1,456 @@
|
||||
lang pattern replacement fixed ignore.case
|
||||
de Coagulase-negative Staphylococcus Koagulase-negative Staphylococcus FALSE FALSE
|
||||
de Coagulase-positive Staphylococcus Koagulase-positive Staphylococcus FALSE FALSE
|
||||
de Beta-haemolytic Streptococcus Beta-hämolytischer Streptococcus FALSE FALSE
|
||||
de unknown Gram negatives unbekannte Gramnegativen FALSE FALSE
|
||||
de unknown Gram positives unbekannte Grampositiven FALSE FALSE
|
||||
de unknown name unbekannte Name FALSE FALSE
|
||||
de unknown kingdom unbekanntes Reich FALSE FALSE
|
||||
de unknown phylum unbekannter Stamm FALSE FALSE
|
||||
de unknown class unbekannte Klasse FALSE FALSE
|
||||
de unknown order unbekannte Ordnung FALSE FALSE
|
||||
de unknown family unbekannte Familie FALSE FALSE
|
||||
de unknown genus unbekannte Gattung FALSE FALSE
|
||||
de unknown species unbekannte Art FALSE FALSE
|
||||
de unknown subspecies unbekannte Unterart FALSE FALSE
|
||||
de unknown rank unbekannter Rang FALSE FALSE
|
||||
de (CoNS) (KNS) TRUE FALSE
|
||||
de (CoPS) (KPS) TRUE FALSE
|
||||
de Gram negative Gramnegativ FALSE FALSE
|
||||
de Gram positive Grampositiv FALSE FALSE
|
||||
de Bacteria Bakterien FALSE FALSE
|
||||
de Fungi Hefen/Pilze FALSE FALSE
|
||||
de Protozoa Protozoen FALSE FALSE
|
||||
de biogroup Biogruppe FALSE FALSE
|
||||
de biotype Biotyp FALSE FALSE
|
||||
de vegetative vegetativ FALSE FALSE
|
||||
de ([([ ]*?)group \\1Gruppe FALSE FALSE
|
||||
de ([([ ]*?)Group \\1Gruppe FALSE FALSE
|
||||
nl Coagulase-negative Staphylococcus Coagulase-negatieve Staphylococcus FALSE FALSE
|
||||
nl Coagulase-positive Staphylococcus Coagulase-positieve Staphylococcus FALSE FALSE
|
||||
nl Beta-haemolytic Streptococcus Beta-hemolytische Streptococcus FALSE FALSE
|
||||
nl unknown Gram negatives onbekende Gram-negatieven FALSE FALSE
|
||||
nl unknown Gram positives onbekende Gram-positieven FALSE FALSE
|
||||
nl unknown name onbekende naam FALSE FALSE
|
||||
nl unknown kingdom onbekend koninkrijk FALSE FALSE
|
||||
nl unknown phylum onbekend fylum FALSE FALSE
|
||||
nl unknown class onbekende klasse FALSE FALSE
|
||||
nl unknown order onbekende orde FALSE FALSE
|
||||
nl unknown family onbekende familie FALSE FALSE
|
||||
nl unknown genus onbekend geslacht FALSE FALSE
|
||||
nl unknown species onbekende soort FALSE FALSE
|
||||
nl unknown subspecies onbekende ondersoort FALSE FALSE
|
||||
nl unknown rank onbekende rang FALSE FALSE
|
||||
nl (CoNS) (CNS) TRUE FALSE
|
||||
nl (CoPS) (CPS) TRUE FALSE
|
||||
nl Gram negative Gram-negatief FALSE FALSE
|
||||
nl Gram positive Gram-positief FALSE FALSE
|
||||
nl Bacteria Bacteriën FALSE FALSE
|
||||
nl Fungi Schimmels/gisten FALSE FALSE
|
||||
nl Protozoa protozoën FALSE FALSE
|
||||
nl biogroup biogroep FALSE FALSE
|
||||
nl vegetative vegetatief FALSE FALSE
|
||||
nl ([([ ]*?)group \\1groep FALSE FALSE
|
||||
nl ([([ ]*?)Group \\1Groep FALSE FALSE
|
||||
es Coagulase-negative Staphylococcus Staphylococcus coagulasa negativo FALSE FALSE
|
||||
es Coagulase-positive Staphylococcus Staphylococcus coagulasa positivo FALSE FALSE
|
||||
es Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
|
||||
es unknown Gram negatives Gram negativos desconocidos FALSE FALSE
|
||||
es unknown Gram positives Gram positivos desconocidos FALSE FALSE
|
||||
es unknown name nombre desconocido FALSE FALSE
|
||||
es unknown kingdom reino desconocido FALSE FALSE
|
||||
es unknown phylum filo desconocido FALSE FALSE
|
||||
es unknown class clase desconocida FALSE FALSE
|
||||
es unknown order orden desconocido FALSE FALSE
|
||||
es unknown family familia desconocida FALSE FALSE
|
||||
es unknown genus género desconocido FALSE FALSE
|
||||
es unknown species especie desconocida FALSE FALSE
|
||||
es unknown subspecies subespecie desconocida FALSE FALSE
|
||||
es unknown rank rango desconocido FALSE FALSE
|
||||
es (CoNS) (SCN) TRUE FALSE
|
||||
es (CoPS) (SCP) TRUE FALSE
|
||||
es Gram negative Gram negativo FALSE FALSE
|
||||
es Gram positive Gram positivo FALSE FALSE
|
||||
es Bacteria Bacterias FALSE FALSE
|
||||
es Fungi Hongos FALSE FALSE
|
||||
es Protozoa Protozoarios FALSE FALSE
|
||||
es biogroup biogrupo FALSE FALSE
|
||||
es biotype biotipo FALSE FALSE
|
||||
es vegetative vegetativo FALSE FALSE
|
||||
es ([([ ]*?)group \\1grupo FALSE FALSE
|
||||
es ([([ ]*?)Group \\1Grupo FALSE FALSE
|
||||
it Coagulase-negative Staphylococcus Staphylococcus negativo coagulasi FALSE FALSE
|
||||
it Coagulase-positive Staphylococcus Staphylococcus positivo coagulasi FALSE FALSE
|
||||
it Beta-haemolytic Streptococcus Streptococcus Beta-emolitico FALSE FALSE
|
||||
it unknown Gram negatives Gram negativi sconosciuti FALSE FALSE
|
||||
it unknown Gram positives Gram positivi sconosciuti FALSE FALSE
|
||||
it unknown name nome sconosciuto FALSE FALSE
|
||||
it unknown kingdom regno sconosciuto FALSE FALSE
|
||||
it unknown phylum phylum sconosciuto FALSE FALSE
|
||||
it unknown class classe sconosciuta FALSE FALSE
|
||||
it unknown order ordine sconosciuto FALSE FALSE
|
||||
it unknown family famiglia sconosciuta FALSE FALSE
|
||||
it unknown genus genere sconosciuto FALSE FALSE
|
||||
it unknown species specie sconosciute FALSE FALSE
|
||||
it unknown subspecies sottospecie sconosciute FALSE FALSE
|
||||
it unknown rank grado sconosciuto FALSE FALSE
|
||||
it Gram negative Gram negativo FALSE FALSE
|
||||
it Gram positive Gram positivo FALSE FALSE
|
||||
it Bacteria Batteri FALSE FALSE
|
||||
it Fungi Fungo FALSE FALSE
|
||||
it Protozoa Protozoi FALSE FALSE
|
||||
it biogroup biogruppo FALSE FALSE
|
||||
it biotype biotipo FALSE FALSE
|
||||
it vegetative vegetativo FALSE FALSE
|
||||
it ([([ ]*?)group \\1gruppo FALSE FALSE
|
||||
it ([([ ]*?)Group \\1Gruppo FALSE FALSE
|
||||
fr Coagulase-negative Staphylococcus Staphylococcus à coagulase négative FALSE FALSE
|
||||
fr Coagulase-positive Staphylococcus Staphylococcus à coagulase positif FALSE FALSE
|
||||
fr Beta-haemolytic Streptococcus Streptococcus Bêta-hémolytique FALSE FALSE
|
||||
fr unknown Gram negatives Gram négatifs inconnus FALSE FALSE
|
||||
fr unknown Gram positives Gram positifs inconnus FALSE FALSE
|
||||
fr unknown name nom inconnu FALSE FALSE
|
||||
fr unknown kingdom règme inconnu FALSE FALSE
|
||||
fr unknown phylum embranchement inconnu FALSE FALSE
|
||||
fr unknown class classe inconnue FALSE FALSE
|
||||
fr unknown order ordre inconnu FALSE FALSE
|
||||
fr unknown family famille inconnue FALSE FALSE
|
||||
fr unknown genus genre inconnu FALSE FALSE
|
||||
fr unknown species espèce inconnue FALSE FALSE
|
||||
fr unknown subspecies sous-espèce inconnue FALSE FALSE
|
||||
fr unknown rank rang inconnu FALSE FALSE
|
||||
fr Gram negative Gram négatif FALSE FALSE
|
||||
fr Gram positive Gram positif FALSE FALSE
|
||||
fr Bacteria Bactéries FALSE FALSE
|
||||
fr Fungi Champignons FALSE FALSE
|
||||
fr Protozoa Protozoaires FALSE FALSE
|
||||
fr biogroup biogroupe FALSE FALSE
|
||||
fr vegetative végétatif FALSE FALSE
|
||||
fr ([([ ]*?)group \\1groupe FALSE FALSE
|
||||
fr ([([ ]*?)Group \\1Groupe FALSE FALSE
|
||||
pt Coagulase-negative Staphylococcus Staphylococcus coagulase negativo FALSE FALSE
|
||||
pt Coagulase-positive Staphylococcus Staphylococcus coagulase positivo FALSE FALSE
|
||||
pt Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
|
||||
pt unknown Gram negatives Gram negativos desconhecidos FALSE FALSE
|
||||
pt unknown Gram positives Gram positivos desconhecidos FALSE FALSE
|
||||
pt unknown name nome desconhecido FALSE FALSE
|
||||
pt unknown kingdom reino desconhecido FALSE FALSE
|
||||
pt unknown phylum filo desconhecido FALSE FALSE
|
||||
pt unknown class classe desconhecida FALSE FALSE
|
||||
pt unknown order ordem desconhecido FALSE FALSE
|
||||
pt unknown family família desconhecida FALSE FALSE
|
||||
pt unknown genus gênero desconhecido FALSE FALSE
|
||||
pt unknown species espécies desconhecida FALSE FALSE
|
||||
pt unknown subspecies subespécies desconhecida FALSE FALSE
|
||||
pt unknown rank classificação desconhecido FALSE FALSE
|
||||
pt Gram negative Gram negativo FALSE FALSE
|
||||
pt Gram positive Gram positivo FALSE FALSE
|
||||
pt Bacteria Bactérias FALSE FALSE
|
||||
pt Fungi Fungos FALSE FALSE
|
||||
pt Protozoa Protozoários FALSE FALSE
|
||||
pt biogroup biogrupo FALSE FALSE
|
||||
pt biotype biótipo FALSE FALSE
|
||||
pt vegetative vegetativo FALSE FALSE
|
||||
pt ([([ ]*?)group \\1grupo FALSE FALSE
|
||||
pt ([([ ]*?)Group \\1Grupo FALSE FALSE
|
||||
|
||||
nl 4-aminosalicylic acid aminosalicylzuur
|
||||
nl adefovir dipivoxil adefovir
|
||||
nl aldesulfone sodium aldesulfon
|
||||
nl amikacin amikacine
|
||||
nl amoxicillin amoxicilline
|
||||
nl amoxicillin and beta-lactamase inhibitor amoxicilline met enzymremmer
|
||||
nl amphotericin B amfotericine B
|
||||
nl ampicillin ampicilline
|
||||
nl ampicillin and beta-lactamase inhibitor ampicilline met enzymremmer
|
||||
nl ampicillin, combinations ampicilline, combinatiepreparaten
|
||||
nl anidulafungin anidulafungine
|
||||
nl anthrax antigen anthrax-antigeen
|
||||
nl anti-d (rh) immunoglobulin rhesus(d)immunoglobuline
|
||||
nl azidocillin azidocilline
|
||||
nl azithromycin azitromycine
|
||||
nl azlocillin azlocilline
|
||||
nl bacampicillin bacampicilline
|
||||
nl bacitracin bacitracine
|
||||
nl benzathine benzylpenicillin benzylpenicillinebenzathine
|
||||
nl benzathine phenoxymethylpenicillin fenoxymethylpenicillinebenzathine
|
||||
nl benzylpenicillin benzylpenicilline
|
||||
nl botulinum antitoxin serum tegen botulisme
|
||||
nl brucella antigen brucella-antigeen
|
||||
nl calcium aminosalicylate aminosalicylzuur
|
||||
nl capreomycin capreomycine
|
||||
nl carbenicillin carbenicilline
|
||||
nl carindacillin carindacilline
|
||||
nl caspofungin caspofungine
|
||||
nl cefacetrile cefacetril
|
||||
nl cefalexin cefalexine
|
||||
nl cefalotin cefalotine
|
||||
nl cefamandole cefamandol
|
||||
nl cefapirin cefapirine
|
||||
nl cefazedone cefazedon
|
||||
nl cefazolin cefazoline
|
||||
nl cefepime cefepim
|
||||
nl cefixime cefixim
|
||||
nl cefmenoxime cefmenoxim
|
||||
nl cefmetazole cefmetazol
|
||||
nl cefodizime cefodizim
|
||||
nl cefonicid cefonicide
|
||||
nl cefoperazone cefoperazon
|
||||
nl cefoperazone and beta-lactamase inhibitor cefoperazon combinatiepreparaten
|
||||
nl cefotaxime cefotaxim
|
||||
nl cefoxitin cefoxitine
|
||||
nl cefpirome cefpirom
|
||||
nl cefpodoxime cefpodoxim
|
||||
nl cefsulodin cefsulodine
|
||||
nl ceftazidime ceftazidim
|
||||
nl ceftezole ceftezol
|
||||
nl ceftizoxime ceftizoxim
|
||||
nl ceftriaxone ceftriaxon
|
||||
nl ceftriaxone, combinations ceftriaxon, combinatiepreparaten
|
||||
nl cefuroxime cefuroxim
|
||||
nl cefuroxime and metronidazole cefuroxim met andere antibacteriele middelen
|
||||
nl chloramphenicol chlooramfenicol
|
||||
nl chlortetracycline chloortetracycline
|
||||
nl cholera, combinations with typhoid vaccine, inactivated, whole cell choleravaccin met tyfusvaccin, geinactiveerd, hele cel
|
||||
nl cholera, inactivated, whole cell cholera, geinactiveerd, hele cel
|
||||
nl cholera, live attenuated cholera, levend verzwakt
|
||||
nl cinoxacin cinoxacine
|
||||
nl ciprofloxacin ciprofloxacine
|
||||
nl clarithromycin claritromycine
|
||||
nl clavulanic acid clavulaanzuur
|
||||
nl clindamycin clindamycine
|
||||
nl clometocillin clometocilline
|
||||
nl clotrimazole clotrimazol
|
||||
nl cloxacillin cloxacilline
|
||||
nl colistin colistine
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations combinatiepreparaten
|
||||
nl combinations of penicillins combinatiepreparaten
|
||||
nl combinations of tetracyclines tetracycline combinatiepreparaten
|
||||
nl cytomegalovirus immunoglobulin cytomegalie-immunoglobuline
|
||||
nl dapsone dapson
|
||||
nl daptomycin daptomycine
|
||||
nl dibekacin dibekacine
|
||||
nl dicloxacillin dicloxacilline
|
||||
nl diphtheria antitoxin serum tegen difterie
|
||||
nl diphtheria immunoglobulin difterie-immunoglobuline
|
||||
nl diphtheria toxoid difterietoxoide
|
||||
nl diphtheria-hemophilus influenzae b-pertussis-poliomyelitis-tetanus difterie-haemophilus-kinkhoest-poliomyelitis-tetanus
|
||||
nl diphtheria-hemophilus influenzae b-pertussis-poliomyelitis-tetanus-hepatitis B difterie-haemophilus-kinkhoest-polio-tetanus-hepatitis B
|
||||
nl diphtheria-hemophilus influenzae b-pertussis-tetanus-hepatitis B difterie-haemophilus-kinkhoest-tetanus-hepatitis B
|
||||
nl diphtheria-hepatitis b-pertussis-tetanus difterie-hepatitis b-kinkhoest-tetanus
|
||||
nl diphtheria-hepatitis b-tetanus difterie-hepatitis b-tetanus
|
||||
nl diphtheria-pertussis-poliomyelitis-tetanus difterie-kinkhoest-poliomyelitis-tetanus
|
||||
nl diphtheria-pertussis-poliomyelitis-tetanus-hepatitis B difterie-kinkhoest-poliomyelitis-tetanus-hepatitis B
|
||||
nl diphtheria-poliomyelitis-tetanus difterie-poliomyelitis-tetanus
|
||||
nl diphtheria-rubella-tetanus difterie-rubella-tetanus
|
||||
nl dirithromycin diritromycine
|
||||
nl econazole econazol
|
||||
nl encephalitis, japanese, inactivated, whole virus japanse-encefalitis, geinactiveerd, intact virus
|
||||
nl encephalitis, tick borne immunoglobulin teken-encephalitis-immunoglobuline
|
||||
nl encephalitis, tick borne, inactivated, whole virus tekenencefalitis, geinactiveerd, intact virus
|
||||
nl enoxacin enoxacine
|
||||
nl epicillin epicilline
|
||||
nl erythromycin erytromycine
|
||||
nl ethambutol and isoniazid ethambutol met isoniazide
|
||||
nl fleroxacin fleroxacine
|
||||
nl flucloxacillin flucloxacilline
|
||||
nl fluconazole fluconazol
|
||||
nl flucytosine fluorocytosine
|
||||
nl flurithromycin fluritromycine
|
||||
nl fosfomycin fosfomycine
|
||||
nl fusidic acid fusidinezuur
|
||||
nl gas-gangrene sera serum tegen gasgangreen
|
||||
nl gatifloxacin gatifloxacine
|
||||
nl gemifloxacin gemifloxacine
|
||||
nl gentamicin gentamicine
|
||||
nl grepafloxacin grepafloxacine
|
||||
nl hachimycin hachimycine
|
||||
nl hemophilus influenzae B and hepatitis B haemophilus influenzae b-hepatitis B
|
||||
nl hemophilus influenzae B and poliomyelitis haemophilus influenzae b-poliomyelitis
|
||||
nl hemophilus influenzae B, combinations with pertussis and toxoids haemophilus influenzae B met kinkhoest en toxoiden
|
||||
nl hemophilus influenzae B, combinations with toxoids haemophilus influenzae B met toxoiden
|
||||
nl hemophilus influenzae B, purified antigen conjugated haemophilus influenzae B, gezuiverd geconjugeerd antigeen
|
||||
nl hepatitis A immunoglobulin hepatitis a-immunoglobuline
|
||||
nl hepatitis A, inactivated, whole virus hepatitis A, geinactiveerd, intact virus
|
||||
nl hepatitis B immunoglobulin hepatitis b-immunoglobuline
|
||||
nl hepatitis B, purified antigen hepatitis B, gezuiverd antigeen
|
||||
nl hetacillin hetacilline
|
||||
nl imipenem and cilastatin imipenem met enzymremmer
|
||||
nl immunoglobulins, normal human, for extravascular adm, immunoglobuline, normaal, extravasculair
|
||||
nl immunoglobulins, normal human, for intravascular adm, immunoglobuline, normaal, intravasculair
|
||||
nl influenza, inactivated, split virus or surface antigen influenza, gezuiverd antigeen
|
||||
nl influenza, inactivated, whole virus influenza, geinactiveerd, intact virus
|
||||
nl inosine pranobex inosiplex
|
||||
nl isepamicin isepamicine
|
||||
nl isoconazole isoconazol
|
||||
nl isoniazid isoniazide
|
||||
nl isoniazid, combinations isoniazide, combinatiepreparaten
|
||||
nl itraconazole itraconazol
|
||||
nl josamycin josamycine
|
||||
nl kanamycin kanamycine
|
||||
nl ketoconazole ketoconazol
|
||||
nl levofloxacin levofloxacine
|
||||
nl lincomycin lincomycine
|
||||
nl lomefloxacin lomefloxacine
|
||||
nl lysozyme lysozym
|
||||
nl mandelic acid amandelzuur
|
||||
nl measles immunoglobulin mazelenimmunoglobuline
|
||||
nl measles, combinations with mumps and rubella, live attenuated mazelen met bof en rubella, levend verzwakt
|
||||
nl measles, combinations with mumps, live attenuated mazelen met bof, levend verzwakt
|
||||
nl measles, combinations with mumps, rubella and varicella, live attenuated mazelen met bof, rubella en varicella, levend verzwakt
|
||||
nl measles, combinations with rubella, live attenuated mazelen met rubella, levend verzwakt
|
||||
nl measles, live attenuated mazelen, levend verzwakt
|
||||
nl meningococcus A, purified polysaccharides antigen meningokok A, gezuiverd polysaccharidenantigeen
|
||||
nl meningococcus A,c, bivalent purified polysaccharides antigen meningokok, 2 typen, gezuiverd polysaccharidenantigeen
|
||||
nl meningococcus A,c,y,w-135, tetravalent purified polysaccharides antigen meningokok, 4 typen, gezuiverd polysaccharidenantigeen
|
||||
nl meningococcus B, outer membrane vesicle vaccine meningokok B, buitenmembraanvaccin
|
||||
nl meningococcus C, purified polysaccharides antigen conjugated meningokok C, gezuiverd saccharidenantigeen geconjugeerd
|
||||
nl metampicillin metampicilline
|
||||
nl meticillin meticilline
|
||||
nl metisazone metisazon
|
||||
nl metronidazole metronidazol
|
||||
nl mezlocillin mezlocilline
|
||||
nl micafungin micafungine
|
||||
nl miconazole miconazol
|
||||
nl midecamycin midecamycine
|
||||
nl miocamycin miocamycine
|
||||
nl moxifloxacin moxifloxacine
|
||||
nl mumps immunoglobulin bofimmunoglobuline
|
||||
nl mumps, live attenuated bof, levend verzwakt
|
||||
nl mupirocin mupirocine
|
||||
nl nalidixic acid nalidixinezuur
|
||||
nl neomycin neomycine
|
||||
nl netilmicin netilmicine
|
||||
nl nitrofurantoin nitrofurantoine
|
||||
nl norfloxacin norfloxacine
|
||||
nl novobiocin novobiocine
|
||||
nl nystatin nystatine
|
||||
nl ofloxacin ofloxacine
|
||||
nl oleandomycin oleandomycine
|
||||
nl ornidazole ornidazol
|
||||
nl other meningococcal monovalent purified polysaccharides antigen meningokok, 1 type, gezuiverd polysaccaridenantigeen
|
||||
nl other meningococcal polyvalent purified polysaccharides antigen meningokok, meer typen, gezuiverd polysaccharidenantigeen
|
||||
nl oxacillin oxacilline
|
||||
nl oxolinic acid oxolinezuur
|
||||
nl oxytetracycline, combinations oxytetracycline, combinatiepreparaten
|
||||
nl pazufloxacin pazufloxacine
|
||||
nl pefloxacin pefloxacine
|
||||
nl penamecillin penamecilline
|
||||
nl penicillins, combinations with other antibacterials penicillines met andere antibacteriele middelen
|
||||
nl pertussis immunoglobulin kinkhoestimmunoglobuline
|
||||
nl pertussis, inactivated, whole cell pertussis, geinactiveerd, hele cel
|
||||
nl pertussis, inactivated, whole cell, combinations with toxoids pertussis, geinactiveerd hele cel, met toxoiden
|
||||
nl pertussis, purified antigen pertussis, gezuiverd antigeen
|
||||
nl pertussis, purified antigen, combinations with toxoids pertussis, gezuiverd antigeen, met toxoiden
|
||||
nl pheneticillin feneticilline
|
||||
nl phenoxymethylpenicillin fenoxymethylpenicilline
|
||||
nl pipemidic acid pipemidinezuur
|
||||
nl piperacillin piperacilline
|
||||
nl piperacillin and beta-lactamase inhibitor piperacilline met enzymremmer
|
||||
nl piromidic acid piromidinezuur
|
||||
nl pivampicillin pivampicilline
|
||||
nl plague, inactivated, whole cell yersinia pestis, geinactiveerd, hele cel
|
||||
nl pneumococcus, purified polysaccharides antigen pneumokok, gezuiverd polysaccharidenantigeen
|
||||
nl pneumococcus, purified polysaccharides antigen conjugated pneumokok, gezuiverd geconjugeerd polysaccharidenantigeen
|
||||
nl poliomyelitis oral, monovalent, live attenuated poliomyelitis, oraal, 1 type, levend verzwakt
|
||||
nl poliomyelitis oral, trivalent, live attenuated poliomyelitis, oraal, 3 typen, levend verzwakt
|
||||
nl poliomyelitis, trivalent, inactivated, whole virus poliomyelitis, 3 typen, geinactiveerd, intact virus
|
||||
nl polymyxin B polymyxine B
|
||||
nl posaconazole posaconazol
|
||||
nl pristinamycin pristinamycine
|
||||
nl procaine benzylpenicillin benzylpenicillineprocaine
|
||||
nl propicillin propicilline
|
||||
nl prulifloxacin prulifloxacine
|
||||
nl quinupristin/dalfopristin quinupristine/dalfopristine
|
||||
nl rabies immunoglobulin rabiesimmunoglobuline
|
||||
nl rabies serum serum tegen rabies
|
||||
nl rabies, inactivated, whole virus rabies, geinactiveerd, intact virus
|
||||
nl ribostamycin ribostamycine
|
||||
nl rifabutin rifabutine
|
||||
nl rifampicin rifampicine
|
||||
nl rifampicin and isoniazid rifampicine met isoniazide
|
||||
nl rifampicin, pyrazinamide and isoniazid rifampicine met pyrazinamide en isoniazide
|
||||
nl rifampicin, pyrazinamide, ethambutol and isoniazid rifampicine met pyrazinamide, ethambutol en isoniazide
|
||||
nl rifamycin rifamycine
|
||||
nl rifaximin rifaximine
|
||||
nl rokitamycin rokitamycine
|
||||
nl rosoxacin rosoxacine
|
||||
nl rota virus, live attenuated rotavirus, levend verzwakt
|
||||
nl roxithromycin roxitromycine
|
||||
nl rubella immunoglobulin rubella-immunoglobuline
|
||||
nl rubella, combinations with mumps, live attenuated rubella met bof, levend verzwakt
|
||||
nl rubella, live attenuated rubella, levend verzwakt
|
||||
nl rufloxacin rufloxacine
|
||||
nl sisomicin sisomicine
|
||||
nl snake venom antiserum serum tegen slangebeet
|
||||
nl sodium aminosalicylate aminosalicylzuur,4- (na-zout)
|
||||
nl sparfloxacin sparfloxacine
|
||||
nl spectinomycin spectinomycine
|
||||
nl spiramycin spiramycine
|
||||
nl spiramycin and metronidazole spiramycine met andere antibacteriele middelen
|
||||
nl staphylococcus immunoglobulin stafylokokkenimmunoglobuline
|
||||
nl streptoduocin streptoduocine
|
||||
nl streptomycin streptomycine
|
||||
nl streptomycin and isoniazid streptomycine met isoniazide
|
||||
nl sulbenicillin sulbenicilline
|
||||
nl sulfadiazine and tetroxoprim sulfadiazine met tetroxoprim
|
||||
nl sulfadiazine and trimethoprim sulfadiazine met trimethoprim
|
||||
nl sulfadimidine and trimethoprim sulfadimidine met trimethoprim
|
||||
nl sulfafurazole sulfafurazol
|
||||
nl sulfaisodimidine sulfisomidine
|
||||
nl sulfalene sulfaleen
|
||||
nl sulfamazone sulfamazon
|
||||
nl sulfamerazine and trimethoprim sulfamerazine met trimethoprim
|
||||
nl sulfamethizole sulfamethizol
|
||||
nl sulfamethoxazole sulfamethoxazol
|
||||
nl sulfamethoxazole and trimethoprim sulfamethoxazol met trimethoprim
|
||||
nl sulfametoxydiazine sulfamethoxydiazine
|
||||
nl sulfametrole and trimethoprim sulfametrol met trimethoprim
|
||||
nl sulfamoxole sulfamoxol
|
||||
nl sulfamoxole and trimethoprim sulfamoxol met trimethoprim
|
||||
nl sulfaperin sulfaperine
|
||||
nl sulfaphenazole sulfafenazol
|
||||
nl sulfathiazole sulfathiazol
|
||||
nl sulfathiourea sulfathioureum
|
||||
nl sulfonamides, combinations with other antibacterials (excl, trimethoprim) sulfonamiden met andere antibacteriele middelen (exc trim)
|
||||
nl sultamicillin sultamicilline
|
||||
nl talampicillin talampicilline
|
||||
nl teicoplanin teicoplanine
|
||||
nl telithromycin telitromycine
|
||||
nl temafloxacin temafloxacine
|
||||
nl temocillin temocilline
|
||||
nl tenofovir disoproxil tenofovir
|
||||
nl terizidone terizidon
|
||||
nl tetanus antitoxin serum tegen tetanus
|
||||
nl tetanus immunoglobulin tetanusimmunoglobuline
|
||||
nl tetanus toxoid tetanustoxoide
|
||||
nl tetanus toxoid, combinations with diphtheria toxoid tetanustoxoide met difterietoxoide
|
||||
nl tetanus toxoid, combinations with tetanus immunoglobulin tetanustoxoide met tetanusimmunoglobuline
|
||||
nl thiamphenicol thiamfenicol
|
||||
nl thiamphenicol, combinations thiamfenicol combinatiepreparaten
|
||||
nl thioacetazone and isoniazid thioacetazon met isoniazide
|
||||
nl ticarcillin ticarcilline
|
||||
nl ticarcillin and beta-lactamase inhibitor ticarcilline met enzymremmer
|
||||
nl tinidazole tinidazol
|
||||
nl tobramycin tobramycine
|
||||
nl troleandomycin troleandomycine
|
||||
nl trovafloxacin trovafloxacine
|
||||
nl tuberculosis, live attenuated bacillus calmette guerin, levend verzwakt
|
||||
nl typhoid, combinations with paratyphi types buiktyfus met paratyfus-typen
|
||||
nl typhoid, inactivated, whole cell buiktyfus, geinactiveerd, hele cel
|
||||
nl typhoid, oral, live attenuated buiktyfus, oraal, levend verzwakt
|
||||
nl typhoid, purified polysaccharide antigen buiktyfus, gezuiverd polysaccharidenantigeen
|
||||
nl typhoid-hepatitis A buiktyfus-hepatitis A
|
||||
nl typhus exanthematicus, inactivated, whole cell vlektyfus, geinactiveerd, hele cel
|
||||
nl vaccinia immunoglobulin vaccinia-immunoglobuline
|
||||
nl vancomycin vancomycine
|
||||
nl varicella, live attenuated varicella, levend verzwakt
|
||||
nl varicella/zoster immunoglobulin varicella-zoster-immunoglobuline
|
||||
nl voriconazole voriconazol
|
||||
nl yellow fever, live attenuated gele koorts, levend verzwakt
|
||||
|
Can't render this file because it has a wrong number of fields in line 157.
|
@@ -3,39 +3,30 @@
|
||||
\name{AMR-deprecated}
|
||||
\alias{AMR-deprecated}
|
||||
\alias{ratio}
|
||||
\alias{ab_property}
|
||||
\alias{ab_atc}
|
||||
\alias{abname}
|
||||
\alias{atc_property}
|
||||
\alias{atc_official}
|
||||
\alias{ab_official}
|
||||
\alias{ab_name}
|
||||
\alias{ab_trivial_nl}
|
||||
\alias{ab_certe}
|
||||
\alias{ab_umcg}
|
||||
\alias{ab_tradenames}
|
||||
\alias{atc_ddd}
|
||||
\alias{atc_groups}
|
||||
\alias{atc_name}
|
||||
\alias{atc_trivial_nl}
|
||||
\alias{atc_tradenames}
|
||||
\title{Deprecated functions}
|
||||
\usage{
|
||||
ratio(x, ratio)
|
||||
|
||||
ab_property(...)
|
||||
abname(...)
|
||||
|
||||
ab_atc(...)
|
||||
atc_property(...)
|
||||
|
||||
atc_official(...)
|
||||
|
||||
ab_official(...)
|
||||
|
||||
ab_name(...)
|
||||
atc_name(...)
|
||||
|
||||
ab_trivial_nl(...)
|
||||
atc_trivial_nl(...)
|
||||
|
||||
ab_certe(...)
|
||||
|
||||
ab_umcg(...)
|
||||
|
||||
ab_tradenames(...)
|
||||
|
||||
atc_ddd(...)
|
||||
|
||||
atc_groups(...)
|
||||
atc_tradenames(...)
|
||||
}
|
||||
\description{
|
||||
These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).
|
||||
|
||||
110
man/ab_property.Rd
Normal file
@@ -0,0 +1,110 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/ab_property.R
|
||||
\name{ab_property}
|
||||
\alias{ab_property}
|
||||
\alias{ab_name}
|
||||
\alias{ab_atc}
|
||||
\alias{ab_cid}
|
||||
\alias{ab_synonyms}
|
||||
\alias{ab_tradenames}
|
||||
\alias{ab_group}
|
||||
\alias{ab_atc_group1}
|
||||
\alias{ab_atc_group2}
|
||||
\alias{ab_ddd}
|
||||
\title{Property of an antibiotic}
|
||||
\usage{
|
||||
ab_name(x, language = get_locale(), tolower = FALSE, ...)
|
||||
|
||||
ab_atc(x, ...)
|
||||
|
||||
ab_cid(x, ...)
|
||||
|
||||
ab_synonyms(x, ...)
|
||||
|
||||
ab_tradenames(x, ...)
|
||||
|
||||
ab_group(x, ...)
|
||||
|
||||
ab_atc_group1(x, ...)
|
||||
|
||||
ab_atc_group2(x, ...)
|
||||
|
||||
ab_ddd(x, administration = "oral", units = FALSE, ...)
|
||||
|
||||
ab_property(x, property = "name", language = get_locale(), ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}}}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".}
|
||||
|
||||
\item{...}{other parameters passed on to \code{\link{as.ab}}}
|
||||
|
||||
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}
|
||||
|
||||
\item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples}
|
||||
|
||||
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set}
|
||||
}
|
||||
\value{
|
||||
\itemize{
|
||||
\item{An \code{integer} in case of \code{ab_cid}}
|
||||
\item{A named \code{list} in case of multiple \code{ab_synonyms}}
|
||||
\item{A \code{double} in case of \code{ab_ddd}}
|
||||
\item{A \code{character} in all other cases}
|
||||
}
|
||||
}
|
||||
\description{
|
||||
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}.
|
||||
}
|
||||
\details{
|
||||
All output will be \link{translate}d where possible.
|
||||
}
|
||||
\section{Source}{
|
||||
|
||||
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
|
||||
|
||||
WHONET 2019 software: \url{http://www.whonet.org/software.html}
|
||||
|
||||
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
||||
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
|
||||
}
|
||||
|
||||
\examples{
|
||||
# all properties:
|
||||
ab_name("AMX") # "Amoxicillin"
|
||||
ab_atc("AMX") # J01CA04 (ATC code from the WHO)
|
||||
ab_cid("AMX") # 33613 (Compound ID from PubChem)
|
||||
|
||||
ab_synonyms("AMX") # a list with brand names of amoxicillin
|
||||
ab_tradenames("AMX") # same
|
||||
|
||||
ab_group("AMX") # "Beta-lactams/penicillins"
|
||||
ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
|
||||
ab_atc_group2("AMX") # "Penicillins with extended spectrum"
|
||||
|
||||
ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
|
||||
ab_name(x = c("AMC", "PLB"),
|
||||
tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
|
||||
|
||||
ab_ddd("AMX", "oral") # 1
|
||||
ab_ddd("AMX", "oral", units = TRUE) # "g"
|
||||
ab_ddd("AMX", "iv") # 1
|
||||
ab_ddd("AMX", "iv", units = TRUE) # "g"
|
||||
|
||||
# all ab_* functions use as.ab() internally:
|
||||
ab_name("Fluclox") # "Flucloxacillin"
|
||||
ab_name("fluklox") # "Flucloxacillin"
|
||||
ab_name("floxapen") # "Flucloxacillin"
|
||||
ab_name(21319) # "Flucloxacillin" (using CID)
|
||||
ab_name("J01CF05") # "Flucloxacillin" (using ATC)
|
||||
}
|
||||
\seealso{
|
||||
\code{\link{antibiotics}}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/abname.R
|
||||
\name{abname}
|
||||
\alias{abname}
|
||||
\title{Name of an antibiotic}
|
||||
\source{
|
||||
\code{\link{antibiotics}}
|
||||
}
|
||||
\usage{
|
||||
abname(abcode, from = c("guess", "atc", "certe", "umcg"),
|
||||
to = "official", textbetween = " + ", tolower = FALSE)
|
||||
}
|
||||
\arguments{
|
||||
\item{abcode}{a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}}
|
||||
|
||||
\item{from, to}{type to transform from and to. See \code{\link{antibiotics}} for its column names. WIth \code{from = "guess"} the from will be guessed from \code{"atc"}, \code{"certe"} and \code{"umcg"}. When using \code{to = "atc"}, the ATC code will be searched using \code{\link{as.atc}}.}
|
||||
|
||||
\item{textbetween}{text to put between multiple returned texts}
|
||||
|
||||
\item{tolower}{return output as lower case with function \code{\link{tolower}}.}
|
||||
}
|
||||
\description{
|
||||
Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from \code{\link{antibiotics}}.
|
||||
}
|
||||
\details{
|
||||
\strong{The \code{\link{ab_property}} functions are faster and more concise}, but do not support concatenated strings, like \code{abname("AMCL+GENT"}.
|
||||
}
|
||||
\section{WHOCC}{
|
||||
|
||||
\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
|
||||
This package contains \strong{all ~500 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}).
|
||||
|
||||
These have become the gold standard for international drug utilisation monitoring and research.
|
||||
|
||||
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
||||
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
|
||||
}
|
||||
|
||||
\examples{
|
||||
abname("AMCL")
|
||||
# "Amoxicillin and beta-lactamase inhibitor"
|
||||
|
||||
# It is quite flexible at default (having `from = "guess"`)
|
||||
abname(c("amox", "J01CA04", "Trimox", "dispermox", "Amoxil"))
|
||||
# "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin"
|
||||
|
||||
# Multiple antibiotics can be combined with "+".
|
||||
# The second antibiotic will be set to lower case when `tolower` was not set:
|
||||
abname("AMCL+GENT", textbetween = "/")
|
||||
# "amoxicillin and enzyme inhibitor/gentamicin"
|
||||
|
||||
abname(c("AMCL", "GENT"))
|
||||
# "Amoxicillin and beta-lactamase inhibitor" "Gentamicin"
|
||||
|
||||
abname("AMCL", to = "trivial_nl")
|
||||
# "Amoxicilline/clavulaanzuur"
|
||||
|
||||
abname("AMCL", to = "atc")
|
||||
# "J01CR02"
|
||||
|
||||
# specific codes for University Medical Center Groningen (UMCG):
|
||||
abname("J01CR02", from = "atc", to = "umcg")
|
||||
# "AMCL"
|
||||
|
||||
# specific codes for Certe:
|
||||
abname("J01CR02", from = "atc", to = "certe")
|
||||
# "amcl"
|
||||
}
|
||||
\keyword{ab}
|
||||
\keyword{antibiotics}
|
||||