(v0.9.0.9016) Support SNOMED codes

pull/67/head
dr. M.S. (Matthijs) Berends 2020-01-27 19:14:23 +01:00
parent 42b079cdb7
commit a13c62e6e8
31 changed files with 456 additions and 342 deletions

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 0.9.0.9015
Version: 0.9.0.9016
Date: 2020-01-27
Title: Antimicrobial Resistance Analysis
Authors@R: c(

View File

@ -157,6 +157,7 @@ export(mo_rank)
export(mo_ref)
export(mo_renamed)
export(mo_shortname)
export(mo_snomed)
export(mo_species)
export(mo_subspecies)
export(mo_synonyms)

32
NEWS.md
View File

@ -1,17 +1,27 @@
# AMR 0.9.0.9015
# AMR 0.9.0.9016
## <small>Last updated: 27-Jan-2020</small>
### New
* Support for LOINC codes in the `antibiotics` data set. Use `ab_loinc()` to retrieve LOINC codes, or use a LOINC code for input in any `ab_*` function:
```r
ab_loinc("ampicillin")
#> [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"
ab_name("21066-6")
#> [1] "Ampicillin"
ab_atc("21066-6")
#> [1] "J01CA01"
```
* The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This **allows machine reading these guidelines**, which is currently almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
* Support for LOINC and SNOMED codes
* Support for LOINC codes in the `antibiotics` data set. Use `ab_loinc()` to retrieve LOINC codes, or use a LOINC code for input in any `ab_*` function:
```r
ab_loinc("ampicillin")
#> [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"
ab_name("21066-6")
#> [1] "Ampicillin"
ab_atc("21066-6")
#> [1] "J01CA01"
```
* Support for SNOMED CT codes in the `microorganisms` data set. Use `mo_snomed()` to retrieve SNOMED codes, or use a SNOMED code for input in any `mo_*` function:
```r
mo_snomed("S. aureus")
#> [1] 115329001 3092008 113961008
mo_name(115329001)
#> [1] "Staphylococcus aureus"
mo_gramstain(115329001)
#> [1] "Gram-positive"
```
* The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This **allows for machine reading these guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
### Changes
* Bugfix for some WHONET microorganism codes that were not interpreted correctly when using `as.rsi()`

View File

@ -69,7 +69,7 @@
#'
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using [as.mo()].
#' @inheritSection catalogue_of_life Catalogue of Life
#' @format A [`data.frame`] with 69,447 observations and 16 variables:
#' @format A [`data.frame`] with 69,447 observations and 17 variables:
#' - `mo`\cr ID of microorganism as used by this package
#' - `col_id`\cr Catalogue of Life ID
#' - `fullname`\cr Full name, like `"Escherichia coli"`
@ -79,6 +79,7 @@
#' - `species_id`\cr ID of the species as used by the Catalogue of Life
#' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added"
#' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
#' - `snomed`\cr SNOMED code of the microorganism. Use [mo_snomed()] to retrieve it quickly, see [mo_property()].
#' @details Manually added were:
#' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
@ -145,7 +146,7 @@ catalogue_of_life <- list(
#' - `gender`\cr gender of the patient
#' - `patient_id`\cr ID of the patient
#' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms]
#' - `PEN:RIF`\cr 40 different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in [antibiotics] data set and can be translated with [ab_name()]
#' - `PEN:RIF`\cr 40 different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in the [antibiotics] data set and can be translated with [ab_name()]
#' @inheritSection AMR Read more on our website!
"example_isolates"
@ -182,9 +183,9 @@ catalogue_of_life <- list(
#' @inheritSection AMR Read more on our website!
"WHONET"
#' Data set for RSI interpretation
#' Data set for R/SI interpretation
#'
#' 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.
#' Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use [as.rsi()] to transform MICs or disks measurements to R/SI values.
#' @format A [`data.frame`] with 13,975 observations and 9 variables:
#' - `guideline`\cr Name of the guideline
#' - `method`\cr Either "MIC" or "DISK"
@ -195,32 +196,7 @@ catalogue_of_life <- list(
#' - `disk_dose`\cr Dose of the used disk diffusion method
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimeters that leads to "S"
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimeters that leads to "R"
#' @details The repository of this `AMR` package contains a file comprising this exact data set: [https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt]. This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
#' @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) {
iconv(vect, from = "UTF-8", to = "ASCII//TRANSLIT")
}
df <- as.data.frame(df, stringsAsFactors = FALSE)
for (i in seq_len(NCOL(df))) {
col <- df[, i]
if (is.list(col)) {
for (j in seq_len(length(col))) {
col[[j]] <- trans(col[[j]])
}
df[, i] <- list(col)
} else {
if (is.factor(col)) {
levels(col) <- trans(levels(col))
} else if (is.character(col)) {
col <- trans(col)
} else {
col
}
df[, i] <- col
}
}
df
}

View File

@ -144,3 +144,31 @@ class_integrity_check <- function(value, type, check_vector) {
}
value
}
# transforms data set to data.frame with only ASCII values, to comply with CRAN policies
dataset_UTF8_to_ASCII <- function(df) {
trans <- function(vect) {
iconv(vect, from = "UTF-8", to = "ASCII//TRANSLIT")
}
df <- as.data.frame(df, stringsAsFactors = FALSE)
for (i in seq_len(NCOL(df))) {
col <- df[, i]
if (is.list(col)) {
col <- lapply(col, function(j) trans(j))
# for (j in seq_len(length(col))) {
# col[[j]] <- trans(col[[j]])
# }
df[, i] <- list(col)
} else {
if (is.factor(col)) {
levels(col) <- trans(levels(col))
} else if (is.character(col)) {
col <- trans(col)
} else {
col
}
df[, i] <- col
}
}
df
}

66
R/mo.R
View File

@ -132,11 +132,12 @@
#' as.mo("Staphylococcus aureus")
#' as.mo("Staphylococcus aureus (MRSA)")
#' as.mo("Zthafilokkoockus oureuz") # handles incorrect spelling
#' as.mo("MRSA") # Methicillin Resistant S. aureus
#' as.mo("VISA") # Vancomycin Intermediate S. aureus
#' as.mo("VRSA") # Vancomycin Resistant S. aureus
#' as.mo(22242419) # Catalogue of Life ID
#'
#' as.mo("MRSA") # Methicillin Resistant S. aureus
#' as.mo("VISA") # Vancomycin Intermediate S. aureus
#' as.mo("VRSA") # Vancomycin Resistant S. aureus
#' as.mo(22242419) # Catalogue of Life ID
#' as.mo(115329001) # SNOMED CT code
#'
#' # Dyslexia is no problem - these all work:
#' as.mo("Ureaplasma urealyticum")
#' as.mo("Ureaplasma urealyticus")
@ -567,11 +568,29 @@ exec_as.mo <- function(x,
cat(paste0(blue("x_trimmed_without_group"), ' "', x_trimmed_without_group, '"\n'))
}
progress <- progress_estimated(n = length(x), min_time = 3)
if (initial_search == TRUE) {
progress <- progress_estimated(n = length(x), min_time = 3)
# before we start, omit the ones that are obvious - MO codes and full names
skip_vect <- rep(FALSE, length(x))
skip_vect[toupper(x_backup) %in% reference_data_to_use$mo] <- TRUE
skip_vect[tolower(x_backup) %in% reference_data_to_use$fullname_lower] <- TRUE
x[toupper(x_backup) %in% reference_data_to_use$mo] <- reference_data_to_use[data.table(mo = toupper(x_backup[toupper(x_backup) %in% reference_data_to_use$mo])),
on = "mo",
..property][[1]]
x[tolower(x_backup) %in% reference_data_to_use$fullname_lower] <- reference_data_to_use[data.table(fullname_lower = tolower(x_backup[tolower(x_backup) %in% reference_data_to_use$fullname_lower])),
on = "fullname_lower",
..property][[1]]
}
for (i in seq_len(length(x))) {
progress$tick()$print()
if (initial_search == TRUE) {
progress$tick()$print()
if (isTRUE(skip_vect[i])) {
next
}
}
mo_hist <- get_mo_history(x_backup[i], uncertainty_level, force = force_mo_history, disable = disable_mo_history)
if (initial_search == TRUE & !any(is.na(mo_hist))) {
@ -633,10 +652,27 @@ exec_as.mo <- function(x,
next
}
# exact SNOMED code
if (x_backup[i] %like% "^[0-9]+$") {
snomed_found <- unlist(lapply(reference_data_to_use$snomed,
function(s) if (x_backup[i] %in% s) {
TRUE
} else {
FALSE
}))
found <- reference_data_to_use[snomed_found == TRUE,
..property][[1]]
if (length(found) > 0) {
x[i] <- found[1L]
# don't save to history, as all items are already in microorganisms
next
}
}
# very probable: is G. species
found <- reference_data_to_use[g_species %in% gsub("[^a-z0-9/ \\-]+", "",
tolower(c(x_backup[i], x_backup_without_spp[i]))),
..property][[1]]
# very probable: is G. species
if (length(found) > 0) {
x[i] <- found[1L]
if (initial_search == TRUE) {
@ -1634,6 +1670,7 @@ exec_as.mo <- function(x,
msg <- paste0(msg, ": ", paste('"', unique(failures), '"', sep = "", collapse = ", "))
}
msg <- paste0(msg, ". Use mo_failures() to review ", plural[2], ". Edit the `allow_uncertain` parameter if needed (see ?as.mo).")
cat("\n")
warning(red(msg),
call. = FALSE,
immediate. = TRUE) # thus will always be shown, even if >= warnings
@ -1646,8 +1683,9 @@ exec_as.mo <- function(x,
if (NROW(uncertainties) > 1) {
plural <- c("s", "them", "were")
}
msg <- paste0("\nResult", plural[1], " of ", nr2char(NROW(uncertainties)), " value", plural[1],
msg <- paste0("Result", plural[1], " of ", nr2char(NROW(uncertainties)), " value", plural[1],
" ", plural[3], " guessed with uncertainty. Use mo_uncertainties() to review ", plural[2], ".")
cat("\n")
warning(red(msg),
call. = FALSE,
immediate. = TRUE) # thus will always be shown, even if >= warnings
@ -2036,6 +2074,14 @@ unregex <- function(x) {
get_mo_code <- function(x, property) {
if (property == "mo") {
unique(x)
} else if (property == "snomed") {
found <- unlist(lapply(microorganismsDT$snomed,
function(s) if (any(x %in% s, na.rm = TRUE)) {
TRUE
} else {
FALSE
}))
microorganismsDT$mo[found == TRUE]
} else {
microorganismsDT[get(property) == x, "mo"][[1]]
}

View File

@ -45,6 +45,7 @@
#' - An [`integer`] in case of [mo_year()]
#' - A [`list`] in case of [mo_taxonomy()] and [mo_info()]
#' - A named [`character`] in case of [mo_url()]
#' - A [`double`] in case of [mo_snomed()]
#' - A [`character`] in all other cases
#' @export
#' @seealso [microorganisms]
@ -62,11 +63,12 @@
#'
#' # colloquial properties ----------------------------------------------------
#' mo_name("E. coli") # "Escherichia coli"
#' mo_fullname("E. coli") # "Escherichia coli", same as mo_name()
#' mo_fullname("E. coli") # "Escherichia coli" - same as mo_name()
#' mo_shortname("E. coli") # "E. coli"
#'
#' # other properties ---------------------------------------------------------
#' mo_gramstain("E. coli") # "Gram-negative"
#' mo_snomed("E. coli") # 112283007, 116395006, ... (SNOMED codes)
#' mo_type("E. coli") # "Bacteria" (equal to kingdom, but may be translated)
#' mo_rank("E. coli") # "species"
#' mo_url("E. coli") # get the direct url to the online database entry
@ -249,6 +251,12 @@ mo_gramstain <- function(x, language = get_locale(), ...) {
translate_AMR(x, language = language, only_unknown = FALSE)
}
#' @rdname mo_property
#' @export
mo_snomed <- function(x, ...) {
mo_validate(x = x, property = "snomed", ...)
}
#' @rdname mo_property
#' @export
mo_ref <- function(x, ...) {
@ -428,6 +436,8 @@ mo_validate <- function(x, property, ...) {
return(to_class_mo(x))
} else if (property == "col_id") {
return(as.integer(x))
} else if (property == "snomed") {
return(as.double(eval(parse(text = x))))
} else {
return(x)
}

View File

@ -21,8 +21,6 @@
#' @importFrom data.table as.data.table setkey
.onLoad <- function(libname, pkgname) {
# packageStartupMessage("Loading taxonomic reference data")
# get new functions not available in older versions of R
backports::import(pkgname)

View File

@ -20,7 +20,36 @@
# ==================================================================== #
library(AMR)
library(dplyr)
library(tidyverse)
# go to https://www.nictiz.nl/standaardisatie/terminologiecentrum/referentielijsten/micro-organismen/
# read the table from clipboard
snomed <- clipr::read_clip_tbl()
# snomed <- snomed %>%
# transmute(fullname = trimws(gsub("^genus", "", Omschrijving, ignore.case = TRUE)),
# snomed = as.integer(Id))
snomed <- snomed %>%
transmute(fullname = mo_name(Omschrijving),
snomed = as.integer(Id)) %>%
filter(!fullname %like% "unknown")
snomed_trans <- snomed %>%
group_by(fullname) %>%
mutate(snomed_list = list(snomed)) %>%
ungroup() %>%
select(fullname, snomed = snomed_list) %>%
distinct(fullname, .keep_all = TRUE)
microorganisms <- AMR::microorganisms %>%
left_join(snomed_trans)
# remove the NULLs, set to NA
microorganisms$snomed <- lapply(microorganisms$snomed, function(x) if (length(x) == 0) NA else x)
microorganisms <- dataset_UTF8_to_ASCII(microorganisms)
usethis::use_data(microorganisms, overwrite = TRUE)
rm(microorganisms)
# OLD ---------------------------------------------------------------------
baseUrl <- 'https://browser.ihtsdotools.org/snowstorm/snomed-ct'
edition <- 'MAIN'

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9016</span>
</span>
</div>
@ -200,7 +200,7 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<a href="#what-is-amr-for-r" class="anchor"></a>What is <code>AMR</code> (for R)?</h3>
<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>
<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 data and properties, by using evidence-based methods. <strong>Our aim is to provide a standard</strong> for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.</p>
<p>After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <a href="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code (including ATC and LOINC), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
<p>After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <a href="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code (including ATC, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
<p>We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology &amp; Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is <a href="./news">actively maintained</a> and is free software (see <a href="#copyright">Copyright</a>).</p>
<div class="main-content">
<p>
@ -238,35 +238,25 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<li>Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) (<a href="./reference/ab_property.html">manual</a>)</li>
<li>Plotting antimicrobial resistance (<a href="./articles/AMR.html">tutorial</a>)</li>
<li>Applying EUCAST expert rules (<a href="./reference/eucast_rules.html">manual</a>)</li>
<li>Getting SNOMED codes of a microorganism, or get its name associated with a SNOMED code (<a href="./reference/mo_property.html">manual</a>)</li>
<li>Getting LOINC codes of an antibiotic, or get its name associated with a LOINC code (<a href="./reference/ab_property.html">manual</a>)</li>
<li>Machine reading the EUCAST and CLSI guidelines from 2011-2019 to translate MIC values and disk diffusion diameters to R/SI (<a href="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt">link</a>)</li>
</ul>
<p>This package is ready-to-use for a professional environment by specialists in the following fields:</p>
<p>Medical Microbiology</p>
<p>This package is ready-to-use for specialists in many fields:</p>
<ul>
<li>Epidemiologists (both clinical microbiological and research)</li>
<li>Research Microbiologists</li>
<li>(Research) Microbiologists</li>
<li>Biomedical Researchers</li>
<li>Research Pharmacologists</li>
<li>Data Scientists / Data Analysts</li>
</ul>
<p>Veterinary Microbiology</p>
<ul>
<li>Statisticians</li>
<li>Bioinformaticians</li>
<li>Research Veterinarians</li>
<li>Veterinary Epidemiologists</li>
</ul>
<p>Microbial Ecology</p>
<ul>
<li>Soil Microbiologists</li>
<li>Extremophile Researchers</li>
<li>Astrobiologists</li>
</ul>
<p>Developers</p>
<ul>
<li>Package developers for R</li>
<li>Software developers</li>
<li>Web application / Shiny developers</li>
</ul>
</div>
<div id="get-this-package" class="section level3">
<h3 class="hasAnchor">
@ -338,8 +328,8 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
</ul>
</li>
<li>Use <code><a href="reference/mdro.html">mdro()</a></code> to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos <em>et al.</em> (2012, <a href="https://www.ncbi.nlm.nih.gov/pubmed/?term=21793988">PMID 21793988</a>), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.</li>
<li>The <a href="./reference/microorganisms.html">data set microorganisms</a> contains the complete taxonomic tree of ~70,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 antibiotics</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>, <code><a href="reference/ab_property.html">ab_atc()</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>
<li>The <a href="./reference/microorganisms.html">data set microorganisms</a> contains the complete taxonomic tree of ~70,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>. Use <code><a href="reference/mo_property.html">mo_snomed()</a></code> to look up any SNOMED CT code associated with a microorganism. As all these function 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 antibiotics</a> contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, LOINC code, 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>, <code><a href="reference/ab_property.html">ab_atc()</a></code>, <code><a href="reference/ab_property.html">ab_loinc()</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>

View File

@ -84,7 +84,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9016</span>
</span>
</div>
@ -231,9 +231,9 @@
</div>
<div id="amr-0-9-0-9015" class="section level1">
<div id="amr-0-9-0-9016" class="section level1">
<h1 class="page-header">
<a href="#amr-0-9-0-9015" class="anchor"></a>AMR 0.9.0.9015<small> Unreleased </small>
<a href="#amr-0-9-0-9016" class="anchor"></a>AMR 0.9.0.9016<small> Unreleased </small>
</h1>
<div id="last-updated-27-jan-2020" class="section level2">
<h2 class="hasAnchor">
@ -243,6 +243,8 @@
<h3 class="hasAnchor">
<a href="#new" class="anchor"></a>New</h3>
<ul>
<li>Support for LOINC and SNOMED codes
<ul>
<li>
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><a href="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use a LOINC code for input in any <code>ab_*</code> function:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="../reference/ab_property.html">ab_loinc</a></span>(<span class="st">"ampicillin"</span>)</a>
@ -252,7 +254,18 @@
<a class="sourceLine" id="cb1-5" data-line-number="5"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="st">"21066-6"</span>)</a>
<a class="sourceLine" id="cb1-6" data-line-number="6"><span class="co">#&gt; [1] "J01CA01"</span></a></code></pre></div>
</li>
<li><p>The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: <a href="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt" class="uri">https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt</a>. This <strong>allows machine reading these guidelines</strong>, which is currently almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.</p></li>
<li>
<p>Support for SNOMED CT codes in the <code>microorganisms</code> data set. Use <code><a href="../reference/mo_property.html">mo_snomed()</a></code> to retrieve SNOMED codes, or use a SNOMED code for input in any <code>mo_*</code> function:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_snomed</a></span>(<span class="st">"S. aureus"</span>)</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co">#&gt; [1] 115329001 3092008 113961008</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="dv">115329001</span>)</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="co">#&gt; [1] "Staphylococcus aureus"</span></a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="dv">115329001</span>)</a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="co">#&gt; [1] "Gram-positive"</span></a></code></pre></div>
</li>
</ul>
</li>
<li>The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: <a href="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt" class="uri">https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt</a>. This <strong>allows for machine reading these guidelines</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.</li>
</ul>
</div>
<div id="changes" class="section level3">
@ -299,9 +312,9 @@
<ul>
<li>
<p>If you were dependent on the old Enterobacteriaceae family e.g. by using in your code:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacteriaceae"</span>) ...</a></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacteriaceae"</span>) ...</a></code></pre></div>
<p>then please adjust this to:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacterales"</span>) ...</a></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacterales"</span>) ...</a></code></pre></div>
</li>
</ul>
</li>
@ -313,12 +326,12 @@
<ul>
<li>
<p>Functions <code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> as aliases of <code><a href="../reference/proportion.html">proportion_SI()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb4-2" data-line-number="2">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="dt">bug =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(mo)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxicillin =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX),</a>
<a class="sourceLine" id="cb4-5" data-line-number="5"> <span class="dt">amox_clav =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMC)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amoxicillin) <span class="op">|</span><span class="st"> </span><span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amox_clav))</a></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb5-2" data-line-number="2">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="dt">bug =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(mo)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxicillin =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX),</a>
<a class="sourceLine" id="cb5-5" data-line-number="5"> <span class="dt">amox_clav =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMC)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amoxicillin) <span class="op">|</span><span class="st"> </span><span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amox_clav))</a></code></pre></div>
</li>
<li>Support for a new MDRO guideline: Magiorakos AP, Srinivasan A <em>et al.</em> “Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance.” Clinical Microbiology and Infection (2012).
<ul>
@ -339,16 +352,16 @@
<li>More intelligent way of coping with some consonants like “l” and “r”</li>
<li>
<p>Added a score (a certainty percentage) to <code><a href="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a>:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,</a>
<a class="sourceLine" id="cb5-2" data-line-number="2"> <span class="st">"staphylokok aureuz"</span>))</a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co">#&gt; Warning: </span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co">#&gt; Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co">#&gt; Class 'mo'</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co">#&gt; [1] B_STPHY_AURS B_STPHY_AURS</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="kw"><a href="../reference/as.mo.html">mo_uncertainties</a></span>()</a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co">#&gt; "Stafylococcus aureus" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 95.2%)</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co">#&gt; "staphylokok aureuz" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 85.7%)</span></a></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"> <span class="st">"staphylokok aureuz"</span>))</a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="co">#&gt; Warning: </span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="co">#&gt; Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<a class="sourceLine" id="cb6-5" data-line-number="5"><span class="co">#&gt; Class 'mo'</span></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="co">#&gt; [1] B_STPHY_AURS B_STPHY_AURS</span></a>
<a class="sourceLine" id="cb6-7" data-line-number="7"></a>
<a class="sourceLine" id="cb6-8" data-line-number="8"><span class="kw"><a href="../reference/as.mo.html">mo_uncertainties</a></span>()</a>
<a class="sourceLine" id="cb6-9" data-line-number="9"><span class="co">#&gt; "Stafylococcus aureus" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 95.2%)</span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co">#&gt; "staphylokok aureuz" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 85.7%)</span></a></code></pre></div>
</li>
</ul>
</li>
@ -396,21 +409,21 @@
<ul>
<li>
<p>Determination of first isolates now <strong>excludes</strong> all unknown microorganisms at default, i.e. microbial code <code>"UNKNOWN"</code>. They can be included with the new parameter <code>include_unknown</code>:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(..., <span class="dt">include_unknown =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(..., <span class="dt">include_unknown =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of unknown microorganisms that were included or excluded.</li>
<li>
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="co"># how it works in base R:</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2">x &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(<span class="st">"A"</span>)</a>
<a class="sourceLine" id="cb7-3" data-line-number="3">x[<span class="dv">1</span>] &lt;-<span class="st"> "B"</span></a>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="co">#&gt; invalid factor level, NA generated</span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6"></a>
<a class="sourceLine" id="cb7-7" data-line-number="7"><span class="co"># how it now works similarly for classes 'mo' and 'ab':</span></a>
<a class="sourceLine" id="cb7-8" data-line-number="8">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb7-9" data-line-number="9">x[<span class="dv">1</span>] &lt;-<span class="st"> "testvalue"</span></a>
<a class="sourceLine" id="cb7-10" data-line-number="10"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co">#&gt; invalid microorganism code, NA generated</span></a></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="co"># how it works in base R:</span></a>
<a class="sourceLine" id="cb8-2" data-line-number="2">x &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(<span class="st">"A"</span>)</a>
<a class="sourceLine" id="cb8-3" data-line-number="3">x[<span class="dv">1</span>] &lt;-<span class="st"> "B"</span></a>
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="co">#&gt; invalid factor level, NA generated</span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="co"># how it now works similarly for classes 'mo' and 'ab':</span></a>
<a class="sourceLine" id="cb8-8" data-line-number="8">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb8-9" data-line-number="9">x[<span class="dv">1</span>] &lt;-<span class="st"> "testvalue"</span></a>
<a class="sourceLine" id="cb8-10" data-line-number="10"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb8-11" data-line-number="11"><span class="co">#&gt; invalid microorganism code, NA generated</span></a></code></pre></div>
This is important, because a value like <code>"testvalue"</code> could never be understood by e.g. <code><a href="../reference/mo_property.html">mo_name()</a></code>, although the class would suggest a valid microbial code.</li>
<li>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <a href="https://github.com/msberends/clean"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
@ -422,55 +435,55 @@ This is important, because a value like <code>"testvalue"</code> could never be
<ul>
<li>
<p>Function <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><a href="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates)</a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb8-3" data-line-number="3">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="co">#&gt; 1 A. baumannii AMC 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"><span class="co">#&gt; 2 A. baumannii AMK 0 0 0 0</span></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="co">#&gt; 3 A. baumannii AMP 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-8" data-line-number="8"><span class="co">#&gt; 4 A. baumannii AMX 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-9" data-line-number="9"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<a class="sourceLine" id="cb8-10" data-line-number="10"></a>
<a class="sourceLine" id="cb8-11" data-line-number="11"><span class="co"># change the transformation with the FUN argument to anything you like:</span></a>
<a class="sourceLine" id="cb8-12" data-line-number="12">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates, <span class="dt">FUN =</span> mo_gramstain)</a>
<a class="sourceLine" id="cb8-13" data-line-number="13"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb8-14" data-line-number="14">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb8-15" data-line-number="15"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb8-16" data-line-number="16"><span class="co">#&gt; 1 Gram-negative AMC 469 89 174 732</span></a>
<a class="sourceLine" id="cb8-17" data-line-number="17"><span class="co">#&gt; 2 Gram-negative AMK 251 0 2 253</span></a>
<a class="sourceLine" id="cb8-18" data-line-number="18"><span class="co">#&gt; 3 Gram-negative AMP 227 0 405 632</span></a>
<a class="sourceLine" id="cb8-19" data-line-number="19"><span class="co">#&gt; 4 Gram-negative AMX 227 0 405 632</span></a>
<a class="sourceLine" id="cb8-20" data-line-number="20"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates)</a>
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb9-3" data-line-number="3">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="co">#&gt; 1 A. baumannii AMC 0 0 3 3</span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="co">#&gt; 2 A. baumannii AMK 0 0 0 0</span></a>
<a class="sourceLine" id="cb9-7" data-line-number="7"><span class="co">#&gt; 3 A. baumannii AMP 0 0 3 3</span></a>
<a class="sourceLine" id="cb9-8" data-line-number="8"><span class="co">#&gt; 4 A. baumannii AMX 0 0 3 3</span></a>
<a class="sourceLine" id="cb9-9" data-line-number="9"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<a class="sourceLine" id="cb9-10" data-line-number="10"></a>
<a class="sourceLine" id="cb9-11" data-line-number="11"><span class="co"># change the transformation with the FUN argument to anything you like:</span></a>
<a class="sourceLine" id="cb9-12" data-line-number="12">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates, <span class="dt">FUN =</span> mo_gramstain)</a>
<a class="sourceLine" id="cb9-13" data-line-number="13"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb9-14" data-line-number="14">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb9-15" data-line-number="15"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb9-16" data-line-number="16"><span class="co">#&gt; 1 Gram-negative AMC 469 89 174 732</span></a>
<a class="sourceLine" id="cb9-17" data-line-number="17"><span class="co">#&gt; 2 Gram-negative AMK 251 0 2 253</span></a>
<a class="sourceLine" id="cb9-18" data-line-number="18"><span class="co">#&gt; 3 Gram-negative AMP 227 0 405 632</span></a>
<a class="sourceLine" id="cb9-19" data-line-number="19"><span class="co">#&gt; 4 Gram-negative AMX 227 0 405 632</span></a>
<a class="sourceLine" id="cb9-20" data-line-number="20"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<p>You can format this to a printable format, ready for reporting or exporting to e.g. Excel with the base R <code><a href="https://rdrr.io/r/base/format.html">format()</a></code> function:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/format.html">format</a></span>(x, <span class="dt">combine_IR =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/format.html">format</a></span>(x, <span class="dt">combine_IR =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
</li>
<li>
<p>Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="co"># --------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="co"># only_all_tested = FALSE only_all_tested = TRUE</span></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="co"># ----------------------- -----------------------</span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="co"># Drug A Drug B include as include as include as include as</span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="co"># numerator denominator numerator denominator</span></a>
<a class="sourceLine" id="cb10-6" data-line-number="6"><span class="co"># -------- -------- ---------- ----------- ---------- -----------</span></a>
<a class="sourceLine" id="cb10-7" data-line-number="7"><span class="co"># S or I S or I X X X X</span></a>
<a class="sourceLine" id="cb10-8" data-line-number="8"><span class="co"># R S or I X X X X</span></a>
<a class="sourceLine" id="cb10-9" data-line-number="9"><span class="co"># &lt;NA&gt; S or I X X - -</span></a>
<a class="sourceLine" id="cb10-10" data-line-number="10"><span class="co"># S or I R X X X X</span></a>
<a class="sourceLine" id="cb10-11" data-line-number="11"><span class="co"># R R - X - X</span></a>
<a class="sourceLine" id="cb10-12" data-line-number="12"><span class="co"># &lt;NA&gt; R - - - -</span></a>
<a class="sourceLine" id="cb10-13" data-line-number="13"><span class="co"># S or I &lt;NA&gt; X X - -</span></a>
<a class="sourceLine" id="cb10-14" data-line-number="14"><span class="co"># R &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb10-15" data-line-number="15"><span class="co"># &lt;NA&gt; &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb10-16" data-line-number="16"><span class="co"># --------------------------------------------------------------------</span></a></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="co"># --------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="co"># only_all_tested = FALSE only_all_tested = TRUE</span></a>
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="co"># ----------------------- -----------------------</span></a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="co"># Drug A Drug B include as include as include as include as</span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="co"># numerator denominator numerator denominator</span></a>
<a class="sourceLine" id="cb11-6" data-line-number="6"><span class="co"># -------- -------- ---------- ----------- ---------- -----------</span></a>
<a class="sourceLine" id="cb11-7" data-line-number="7"><span class="co"># S or I S or I X X X X</span></a>
<a class="sourceLine" id="cb11-8" data-line-number="8"><span class="co"># R S or I X X X X</span></a>
<a class="sourceLine" id="cb11-9" data-line-number="9"><span class="co"># &lt;NA&gt; S or I X X - -</span></a>
<a class="sourceLine" id="cb11-10" data-line-number="10"><span class="co"># S or I R X X X X</span></a>
<a class="sourceLine" id="cb11-11" data-line-number="11"><span class="co"># R R - X - X</span></a>
<a class="sourceLine" id="cb11-12" data-line-number="12"><span class="co"># &lt;NA&gt; R - - - -</span></a>
<a class="sourceLine" id="cb11-13" data-line-number="13"><span class="co"># S or I &lt;NA&gt; X X - -</span></a>
<a class="sourceLine" id="cb11-14" data-line-number="14"><span class="co"># R &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb11-15" data-line-number="15"><span class="co"># &lt;NA&gt; &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb11-16" data-line-number="16"><span class="co"># --------------------------------------------------------------------</span></a></code></pre></div>
Since this is a major change, usage of the old <code>also_single_tested</code> will throw an informative error that it has been replaced by <code>only_all_tested</code>.</li>
<li>
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code> <code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="co"># (run this on your own console, as this page does not support colour printing)</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb11-3" data-line-number="3">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(mo<span class="op">:</span>AMC) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/reexports.html">as_tibble</a></span>()</a></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="co"># (run this on your own console, as this page does not support colour printing)</span></a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb12-3" data-line-number="3">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb12-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(mo<span class="op">:</span>AMC) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb12-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/reexports.html">as_tibble</a></span>()</a></code></pre></div>
</li>
</ul>
</div>
@ -547,14 +560,14 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<ul>
<li>
<p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb12-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a>
<a class="sourceLine" id="cb12-4" data-line-number="4"><span class="co"># antibiotic interpretation value isolates</span></a>
<a class="sourceLine" id="cb12-5" data-line-number="5"><span class="co"># 1 Amoxicillin SI 0.4442636 546</span></a>
<a class="sourceLine" id="cb12-6" data-line-number="6"><span class="co"># 2 Amoxicillin R 0.5557364 683</span></a>
<a class="sourceLine" id="cb12-7" data-line-number="7"><span class="co"># 3 Ciprofloxacin SI 0.8381831 1181</span></a>
<a class="sourceLine" id="cb12-8" data-line-number="8"><span class="co"># 4 Ciprofloxacin R 0.1618169 228</span></a></code></pre></div>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a>
<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="co"># antibiotic interpretation value isolates</span></a>
<a class="sourceLine" id="cb13-5" data-line-number="5"><span class="co"># 1 Amoxicillin SI 0.4442636 546</span></a>
<a class="sourceLine" id="cb13-6" data-line-number="6"><span class="co"># 2 Amoxicillin R 0.5557364 683</span></a>
<a class="sourceLine" id="cb13-7" data-line-number="7"><span class="co"># 3 Ciprofloxacin SI 0.8381831 1181</span></a>
<a class="sourceLine" id="cb13-8" data-line-number="8"><span class="co"># 4 Ciprofloxacin R 0.1618169 228</span></a></code></pre></div>
</li>
<li>
<p>Support for all scientifically published pathotypes of <em>E. coli</em> to date (that we could find). Supported are:</p>
@ -572,12 +585,12 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<li>UPEC (Uropathogenic <em>E. coli</em>)</li>
</ul>
<p>All these lead to the microbial ID of <em>E. coli</em>:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="co"># B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="co"># "Escherichia coli"</span></a>
<a class="sourceLine" id="cb13-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"EHEC"</span>)</a>
<a class="sourceLine" id="cb13-6" data-line-number="6"><span class="co"># "Gram-negative"</span></a></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="co"># B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># "Escherichia coli"</span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"EHEC"</span>)</a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># "Gram-negative"</span></a></code></pre></div>
</li>
<li>Function <code><a href="../reference/mo_property.html">mo_info()</a></code> as an analogy to <code><a href="../reference/ab_property.html">ab_info()</a></code>. The <code><a href="../reference/mo_property.html">mo_info()</a></code> prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism</li>
<li><p>Function <code><a href="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
@ -676,14 +689,14 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra
<li>when all values are unique it now shows a message instead of a warning</li>
<li>
<p>support for boxplots:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># grouped boxplots:</span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</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" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"><span class="co"># grouped boxplots:</span></a>
<a class="sourceLine" id="cb15-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb15-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a></code></pre></div>
</li>
</ul>
</li>
@ -768,32 +781,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="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
<a class="sourceLine" id="cb15-3" data-line-number="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-5" data-line-number="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-6" data-line-number="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-7" data-line-number="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-8" data-line-number="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
<a class="sourceLine" id="cb15-9" data-line-number="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
<a class="sourceLine" id="cb15-10" data-line-number="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
<a class="sourceLine" id="cb15-11" data-line-number="11"><span class="kw"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</a></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
<a class="sourceLine" id="cb16-2" data-line-number="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb16-5" data-line-number="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb16-7" data-line-number="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb16-8" data-line-number="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
<a class="sourceLine" id="cb16-9" data-line-number="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
<a class="sourceLine" id="cb16-10" data-line-number="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
<a class="sourceLine" id="cb16-11" data-line-number="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="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1">septic_patients <span class="op">%&gt;%</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="cb16-2" data-line-number="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<a class="sourceLine" id="cb16-3" data-line-number="3">septic_patients <span class="op">%&gt;%</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="cb16-4" data-line-number="4"><span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">septic_patients <span class="op">%&gt;%</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="cb17-2" data-line-number="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<a class="sourceLine" id="cb17-3" data-line-number="3">septic_patients <span class="op">%&gt;%</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="cb17-4" data-line-number="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="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">ab_property -&gt;<span class="st"> </span><span class="kw">atc_property</span>()</a>
<a class="sourceLine" id="cb17-2" data-line-number="2">ab_name -&gt;<span class="st"> </span><span class="kw">atc_name</span>()</a>
<a class="sourceLine" id="cb17-3" data-line-number="3">ab_official -&gt;<span class="st"> </span><span class="kw">atc_official</span>()</a>
<a class="sourceLine" id="cb17-4" data-line-number="4">ab_trivial_nl -&gt;<span class="st"> </span><span class="kw">atc_trivial_nl</span>()</a>
<a class="sourceLine" id="cb17-5" data-line-number="5">ab_certe -&gt;<span class="st"> </span><span class="kw">atc_certe</span>()</a>
<a class="sourceLine" id="cb17-6" data-line-number="6">ab_umcg -&gt;<span class="st"> </span><span class="kw">atc_umcg</span>()<<