1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-24 04:06:12 +01:00

(v0.8.0.9034) add cid to antivirals

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-11-23 12:39:57 +01:00
parent 267320f15f
commit e53cc4990c
37 changed files with 460 additions and 449 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 0.8.0.9033
Date: 2019-11-18
Version: 0.8.0.9034
Date: 2019-11-23
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

View File

@ -1,5 +1,5 @@
# AMR 0.8.0.9033
## <small>Last updated: 18-Nov-2019</small>
# AMR 0.8.0.9034
## <small>Last updated: 23-Nov-2019</small>
### Breaking
* Adopted Adeolu *et al.* (2016), [PMID 27620848](https://www.ncbi.nlm.nih.gov/pubmed/27620848) for the `microorganisms` data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like *Morganellaceae* and *Yersiniaceae*). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with `mdro()` will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family.

View File

@ -19,10 +19,11 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
#' Data set with ~450 antibiotics
#' Data sets with ~550 antimicrobials
#'
#' 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 453 observations and 13 variables:
#' Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from the \code{antibiotics} 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
#' \strong{For the \code{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:}
#' \describe{
#' \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}}
@ -38,7 +39,20 @@
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
#' \item{\code{iv_units}}{Units of \code{iv_ddd}}
#' }
#' @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}
#'
#' \strong{For the \code{antivirals} data set: a \code{\link{data.frame}} with 102 observations and 9 variables:}
#' \describe{
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC}
#' \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{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC}
#' \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{oral_ddd}}
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
#' \item{\code{iv_units}}{Units of \code{iv_ddd}}
#' }
#' @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}.
#'
#' 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/}
@ -48,26 +62,10 @@
#' 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{antivirals}} \code{\link{microorganisms}}
#' @seealso \code{\link{microorganisms}}
"antibiotics"
#' Data set with ~100 antivirals
#'
#' A data set containing all antivirals, according to the ATC code group 'J05' (Antivirals for systemic use).
#' @format A \code{\link{data.frame}} with 102 observations and 7 variables:
#' \describe{
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC}
#' \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO}
#' \item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC}
#' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment}
#' \item{\code{oral_units}}{Units of \code{oral_ddd}}
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
#' \item{\code{iv_units}}{Units of \code{iv_ddd}}
#' }
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
#' @inheritSection WHOCC WHOCC
#' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{antibiotics}} \code{\link{microorganisms}}
#' @rdname antibiotics
"antivirals"
#' Data set with ~70,000 microorganisms

View File

@ -29,6 +29,14 @@ addin_insert_like <- function() {
rstudioapi::insertText(" %like% ")
}
load_AMR_package <- function() {
if (!"package:AMR" %in% base::search()) {
require(AMR)
# check onLoad() in R/zzz.R: data tables are created there.
}
base::invisible()
}
#' @importFrom crayon blue bold red
#' @importFrom dplyr %>% pull
search_type_in_df <- function(x, type) {

18
R/mo.R
View File

@ -183,11 +183,14 @@
#' df <- df %>%
#' mutate(mo = as.mo(paste(genus, species)))
#' }
as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, reference_df = get_mo_source(), ...) {
if (!"AMR" %in% base::.packages()) {
require("AMR")
# check onLoad() in R/zzz.R: data tables are created there.
}
as.mo <- function(x,
Becker = FALSE,
Lancefield = FALSE,
allow_uncertain = TRUE,
reference_df = get_mo_source(),
...) {
load_AMR_package()
# WHONET: xxx = no growth
x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_
@ -293,10 +296,7 @@ exec_as.mo <- function(x,
debug = FALSE,
reference_data_to_use = microorganismsDT) {
if (!"AMR" %in% base::.packages()) {
require("AMR")
# check onLoad() in R/zzz.R: data tables are created there.
}
load_AMR_package()
# WHONET: xxx = no growth
x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_

View File

@ -396,6 +396,8 @@ mo_property <- function(x, property = "fullname", language = get_locale(), ...)
}
mo_validate <- function(x, property, ...) {
load_AMR_package()
dots <- list(...)
Becker <- dots$Becker
@ -407,11 +409,6 @@ mo_validate <- function(x, property, ...) {
Lancefield <- FALSE
}
if (!"AMR" %in% base::.packages()) {
require("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::microorganisms[1, property],

View File

@ -155,14 +155,10 @@ reference:
'like' function can be useful: `if (x %like% y) {...}`.
contents:
- "`get_locale`"
- "`like`"
- title: Extended functions
desc: >
These functions are extensions of functions in other packages.
contents:
- "`extended-functions`"
- "`like`"
- "`reexports`"
- title: functions
- title: Deprecated functions
desc: >
These functions are deprecated, meaning that they will still
work but show a warning with every use and will be removed

View File

@ -57,6 +57,33 @@ for (i in 2:length(atc_groups)) {
antivirals <- rbind(antivirals, get_atc_table(atc_groups[i]))
}
# arrange on name, untibble it and save
# arrange on name, untibble it
antivirals <- antivirals %>% arrange(name) %>% as.data.frame(stringsAsFactors = FALSE)
# add PubChem Compound ID (cid) and their trade names - functions are in file to create `antibiotics` data set
CIDs <- get_CID(antivirals$name)
# these could not be found:
antivirals[is.na(CIDs),] %>% View()
# get brand names from PubChem
synonyms <- get_synonyms(CIDs)
synonyms <- lapply(synonyms,
function(x) {
if (length(x) == 0 | all(is.na(x))) {
""
} else {
x
}})
antivirals <- antivirals %>%
transmute(atc,
cid = CIDs,
name,
atc_group,
synonyms = unname(synonyms),
oral_ddd,
oral_units,
iv_ddd,
iv_units)
# save it
usethis::use_data(antivirals, overwrite = TRUE)

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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>

View File

@ -41,7 +41,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>
@ -187,7 +187,7 @@
<h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 November 2019</h4>
<h4 class="date">23 November 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -196,7 +196,7 @@
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 18 November 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 23 November 2019.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -212,21 +212,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2019-11-18</td>
<td align="center">2019-11-23</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="center">2019-11-18</td>
<td align="center">2019-11-23</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
</tr>
<tr class="odd">
<td align="center">2019-11-18</td>
<td align="center">2019-11-23</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -321,71 +321,71 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2011-03-27</td>
<td align="center">O9</td>
<td align="center">2016-08-29</td>
<td align="center">I4</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2016-04-25</td>
<td align="center">U3</td>
<td align="center">Hospital A</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2013-06-29</td>
<td align="center">W2</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2011-12-21</td>
<td align="center">D5</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2016-10-19</td>
<td align="center">G6</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-08-29</td>
<td align="center">Y5</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2015-09-08</td>
<td align="center">U5</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2014-09-10</td>
<td align="center">L5</td>
<td align="center">Hospital C</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2011-07-28</td>
<td align="center">D7</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2013-04-12</td>
<td align="center">N6</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-03-29</td>
<td align="center">F1</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
</tbody>
</table>
<p>Now, lets start the cleaning and the analysis!</p>
@ -406,8 +406,8 @@
#
# Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- -------------
# 1 M 10,413 52.06% 10,413 52.06%
# 2 F 9,587 47.94% 20,000 100.00%</code></pre>
# 1 M 10,451 52.26% 10,451 52.26%
# 2 F 9,549 47.75% 20,000 100.00%</code></pre>
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didnt already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -422,8 +422,8 @@
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="co"># Other rules by this AMR package</span></a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,986 values changed)</span></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (176 values changed)</span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,952 values changed)</span></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (155 values changed)</span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<a class="sourceLine" id="cb14-9" data-line-number="9"><span class="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb14-10" data-line-number="10"><span class="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
@ -448,14 +448,14 @@
<a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Pasteurella multocida (no changes)</span></a>
<a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Staphylococcus (no changes)</span></a>
<a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (1,015 values changed)</span></a>
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (984 values changed)</span></a>
<a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Viridans group streptococci (no changes)</span></a>
<a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,284 values changed)</span></a>
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,309 values changed)</span></a>
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,796 values changed)</span></a>
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,719 values changed)</span></a>
<a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -463,15 +463,15 @@
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,569 out of 20,000 rows, making a total of 8,257 edits</span></a>
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,464 out of 20,000 rows, making a total of 8,119 edits</span></a>
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># =&gt; changed 8,257 test results</span></a>
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 123 test results changed from S to I</span></a>
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,779 test results changed from S to R</span></a>
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,134 test results changed from I to S</span></a>
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 369 test results changed from I to R</span></a>
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,852 test results changed from R to S</span></a>
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># =&gt; changed 8,119 test results</span></a>
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 109 test results changed from S to I</span></a>
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,710 test results changed from S to R</span></a>
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,166 test results changed from I to S</span></a>
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 348 test results changed from I to R</span></a>
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,786 test results changed from R to S</span></a>
<a class="sourceLine" id="cb14-56" data-line-number="56"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-57" data-line-number="57"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-58" data-line-number="58"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -499,8 +499,8 @@
<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb16-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,699 first isolates (28.5% of total)</span></a></code></pre></div>
<p>So only 28.5% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,669 first isolates (28.3% of total)</span></a></code></pre></div>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -510,7 +510,7 @@
<div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient X7, sorted on date:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient T6, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -526,19 +526,19 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-03-18</td>
<td align="center">X7</td>
<td align="center">2010-02-28</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-04-28</td>
<td align="center">X7</td>
<td align="center">2010-03-01</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -548,32 +548,32 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-26</td>
<td align="center">X7</td>
<td align="center">2010-05-20</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-08-06</td>
<td align="center">X7</td>
<td align="center">2010-06-21</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-31</td>
<td align="center">X7</td>
<td align="center">2010-09-24</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -581,19 +581,19 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-15</td>
<td align="center">X7</td>
<td align="center">2010-11-18</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-11-19</td>
<td align="center">X7</td>
<td align="center">2011-02-07</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -603,30 +603,30 @@
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-01-20</td>
<td align="center">X7</td>
<td align="center">2011-03-09</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-03-23</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-04-10</td>
<td align="center">X7</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-12</td>
<td align="center">X7</td>
<td align="center">2011-04-01</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -647,7 +647,7 @@
<a class="sourceLine" id="cb19-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb19-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,085 first weighted isolates (75.4% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,096 first weighted isolates (75.5% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -664,68 +664,56 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-03-18</td>
<td align="center">X7</td>
<td align="center">2010-02-28</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-04-28</td>
<td align="center">X7</td>
<td align="center">2010-03-01</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-26</td>
<td align="center">X7</td>
<td align="center">2010-05-20</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-08-06</td>
<td align="center">X7</td>
<td align="center">2010-06-21</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-08-31</td>
<td align="center">X7</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-15</td>
<td align="center">X7</td>
<td align="center">2010-09-24</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -734,61 +722,73 @@
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-11-18</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-11-19</td>
<td align="center">X7</td>
<td align="center">2011-02-07</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-01-20</td>
<td align="center">X7</td>
<td align="center">2011-03-09</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-04-10</td>
<td align="center">X7</td>
<td align="center">2011-03-23</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-04-12</td>
<td align="center">X7</td>
<td align="center">2011-04-01</td>
<td align="center">T6</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 6 isolates are flagged. In total, 75.4% of all isolates are marked first weighted - 46.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 2, now 10 isolates are flagged. In total, 75.5% of all isolates are marked first weighted - 47.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 15,085 isolates for analysis.</p>
<p>So we end up with 15,096 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
@ -814,44 +814,12 @@
<tbody>
<tr class="odd">
<td>1</td>
<td align="center">2011-03-27</td>
<td align="center">O9</td>
<td align="center">2016-08-29</td>
<td align="center">I4</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>4</td>
<td align="center">2011-07-28</td>
<td align="center">D7</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>8</td>
<td align="center">2015-08-23</td>
<td align="center">M1</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
@ -861,31 +829,31 @@
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>9</td>
<td align="center">2017-03-08</td>
<td align="center">G2</td>
<td align="center">Hospital B</td>
<td align="center">B_KLBSL_PNMN</td>
<td>2</td>
<td align="center">2016-04-25</td>
<td align="center">U3</td>
<td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>10</td>
<td align="center">2013-11-09</td>
<td align="center">Q8</td>
<td align="center">Hospital A</td>
<td>3</td>
<td align="center">2013-06-29</td>
<td align="center">W2</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
@ -893,21 +861,53 @@
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>16</td>
<td align="center">2010-06-08</td>
<td align="center">O4</td>
<td align="center">Hospital A</td>
<td>5</td>
<td align="center">2016-10-19</td>
<td align="center">G6</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2017-08-29</td>
<td align="center">Y5</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>10</td>
<td align="center">2016-02-16</td>
<td align="center">L3</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Time for the analysis!</p>
@ -927,7 +927,7 @@
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,085 (of which NA: 0 = 0%)<br>
Length: 15,096 (of which NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -944,33 +944,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,426</td>
<td align="right">49.23%</td>
<td align="right">7,426</td>
<td align="right">49.23%</td>
<td align="right">7,646</td>
<td align="right">50.65%</td>
<td align="right">7,646</td>
<td align="right">50.65%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,769</td>
<td align="right">24.99%</td>
<td align="right">11,195</td>
<td align="right">74.21%</td>
<td align="right">3,610</td>
<td align="right">23.91%</td>
<td align="right">11,256</td>
<td align="right">74.56%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,340</td>
<td align="right">15.51%</td>
<td align="right">13,535</td>
<td align="right">89.72%</td>
<td align="right">2,315</td>
<td align="right">15.34%</td>
<td align="right">13,571</td>
<td align="right">89.90%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,550</td>
<td align="right">10.28%</td>
<td align="right">15,085</td>
<td align="right">1,525</td>
<td align="right">10.10%</td>
<td align="right">15,096</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -982,7 +982,7 @@ Longest: 24</p>
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX)</a>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4684123</span></a></code></pre></div>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4690647</span></a></code></pre></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -995,19 +995,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4666964</td>
<td align="center">0.4740061</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4711845</td>
<td align="center">0.4707669</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4627451</td>
<td align="center">0.4640934</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4704102</td>
<td align="center">0.4622766</td>
</tr>
</tbody>
</table>
@ -1025,23 +1025,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4666964</td>
<td align="center">4489</td>
<td align="center">0.4740061</td>
<td align="center">4578</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4711845</td>
<td align="center">5327</td>
<td align="center">0.4707669</td>
<td align="center">5268</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4627451</td>
<td align="center">2295</td>
<td align="center">0.4640934</td>
<td align="center">2228</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4704102</td>
<td align="center">2974</td>
<td align="center">0.4622766</td>
<td align="center">3022</td>
</tr>
</tbody>
</table>
@ -1061,27 +1061,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.9243200</td>
<td align="center">0.8955023</td>
<td align="center">0.9934016</td>
<td align="center">0.9193042</td>
<td align="center">0.8966780</td>
<td align="center">0.9935914</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.9174194</td>
<td align="center">0.9019355</td>
<td align="center">0.9967742</td>
<td align="center">0.9285246</td>
<td align="center">0.8878689</td>
<td align="center">0.9940984</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.9193420</td>
<td align="center">0.9211993</td>
<td align="center">0.9936323</td>
<td align="center">0.9166205</td>
<td align="center">0.9171745</td>
<td align="center">0.9919668</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.6128205</td>
<td align="center">0.6241901</td>
<td align="center">0.0000000</td>
<td align="center">0.6128205</td>
<td align="center">0.6241901</td>
</tr>
</tbody>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -41,7 +41,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>
@ -187,7 +187,7 @@
<h1>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 November 2019</h4>
<h4 class="date">23 November 2019</h4>
<div class="hidden name"><code>MDR.Rmd</code></div>
@ -307,19 +307,19 @@ Unique: 2</p>
<p>The data set now looks like this:</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="https://rdrr.io/r/utils/head.html">head</a></span>(my_TB_data)</a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># 1 S R S S S S</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co"># 2 S S S S R S</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co"># 3 S R R S S R</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># 4 S R S S I S</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># 5 R S S I R S</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># 6 R R S S R R</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># 1 S R I S I S</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co"># 2 S I S S R R</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co"># 3 R I R R R I</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># 4 S S S R R R</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># 5 I S R S R I</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># 6 R S R R S R</span></a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># kanamycin</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># 1 R</span></a>
<a class="sourceLine" id="cb5-11" data-line-number="11"><span class="co"># 2 R</span></a>
<a class="sourceLine" id="cb5-12" data-line-number="12"><span class="co"># 3 R</span></a>
<a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co"># 4 S</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># 1 S</span></a>
<a class="sourceLine" id="cb5-11" data-line-number="11"><span class="co"># 2 S</span></a>
<a class="sourceLine" id="cb5-12" data-line-number="12"><span class="co"># 3 S</span></a>
<a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co"># 4 R</span></a>
<a class="sourceLine" id="cb5-14" data-line-number="14"><span class="co"># 5 S</span></a>
<a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co"># 6 S</span></a></code></pre></div>
<a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co"># 6 R</span></a></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</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/mdro.html">mdro</a></span>(my_TB_data, <span class="dt">guideline =</span> <span class="st">"TB"</span>)</a></code></pre></div>
<p>or its shortcut <code><a href="../reference/mdro.html">mdr_tb()</a></code>:</p>
@ -336,7 +336,7 @@ Unique: 2</p>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># Author: WHO (World Health Organization)</span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/</span></a>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># </span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># =&gt; Found 4341 MDROs out of 5000 tested isolates (86.8%)</span></a></code></pre></div>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># =&gt; Found 4367 MDROs out of 5000 tested isolates (87.3%)</span></a></code></pre></div>
<p>Create a frequency table of the results:</p>
<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="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(my_TB_data<span class="op">$</span>mdr)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
@ -357,40 +357,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3281</td>
<td align="right">65.62%</td>
<td align="right">3281</td>
<td align="right">65.62%</td>
<td align="right">3272</td>
<td align="right">65.44%</td>
<td align="right">3272</td>
<td align="right">65.44%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">659</td>
<td align="right">13.18%</td>
<td align="right">3940</td>
<td align="right">78.80%</td>
<td align="right">633</td>
<td align="right">12.66%</td>
<td align="right">3905</td>
<td align="right">78.10%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">571</td>
<td align="right">11.42%</td>
<td align="right">4511</td>
<td align="right">90.22%</td>
<td align="right">584</td>
<td align="right">11.68%</td>
<td align="right">4489</td>
<td align="right">89.78%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">278</td>
<td align="right">5.56%</td>
<td align="right">4789</td>
<td align="right">95.78%</td>
<td align="right">293</td>
<td align="right">5.86%</td>
<td align="right">4782</td>
<td align="right">95.64%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">211</td>
<td align="right">4.22%</td>
<td align="right">218</td>
<td align="right">4.36%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>

BIN
docs/countries.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB

View File

@ -41,6 +41,11 @@
width: 19%;
min-width: 125px;
}
.countries_map {
float: left;
padding: 0 10px 10px 0;
max-width: 25%;
}
@media only screen and (max-width: 992px) {
.footer_logo {
float: left;

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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>
@ -200,10 +200,15 @@ A methods paper about this package has been preprinted at bioRxiv. It was update
<div id="what-is-amr-for-r" class="section level3">
<h3 class="hasAnchor">
<a href="#what-is-amr-for-r" class="anchor"></a>What is <code>AMR</code> (for R)?</h3>
<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. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 70 countries <small>(source: <a href="https://cran-logs.rstudio.com">CRAN logs, 2019</a>)</small>.</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, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.</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 properties by using evidence-based methods. 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, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
<p>We created this package for both routine 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>
<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>.</p>
<div class="main-content">
<p>
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used in over 70 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 74 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
<br><br>
</div>
<div id="partners" class="section level4">
<h4 class="hasAnchor">
<a href="#partners" class="anchor"></a>Partners</h4>

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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>
@ -231,13 +231,13 @@
</div>
<div id="amr-0-8-0-9033" class="section level1">
<div id="amr-0-8-0-9034" class="section level1">
<h1 class="page-header">
<a href="#amr-0-8-0-9033" class="anchor"></a>AMR 0.8.0.9033<small> Unreleased </small>
<a href="#amr-0-8-0-9034" class="anchor"></a>AMR 0.8.0.9034<small> Unreleased </small>
</h1>
<div id="last-updated-18-nov-2019" class="section level2">
<div id="last-updated-23-nov-2019" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-18-nov-2019" class="anchor"></a><small>Last updated: 18-Nov-2019</small>
<a href="#last-updated-23-nov-2019" class="anchor"></a><small>Last updated: 23-Nov-2019</small>
</h2>
<div id="breaking" class="section level3">
<h3 class="hasAnchor">
@ -1391,7 +1391,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-8-0-9033">0.8.0.9033</a></li>
<li><a href="#amr-0-8-0-9034">0.8.0.9034</a></li>
<li><a href="#amr-0-8-0">0.8.0</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li>
<li><a href="#amr-0-7-0">0.7.0</a></li>

View File

@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>

View File

@ -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 ~450 antibiotics — antibiotics • AMR (for R)</title>
<title>Data sets with ~550 antimicrobials — antibiotics • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@ -50,8 +50,8 @@
<link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script>
<meta property="og:title" content="Data set with ~450 antibiotics — antibiotics" />
<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:title" content="Data sets with ~550 antimicrobials — antibiotics" />
<meta property="og:description" content="Two data sets containing all antibiotics/antimycotics and antivirals. Use as.ab or one of the ab_property functions to retrieve values from the antibiotics 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" />
@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>
@ -228,21 +228,23 @@
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Data set with ~450 antibiotics</h1>
<h1>Data sets with ~550 antimicrobials</h1>
<div class="hidden name"><code>antibiotics.Rd</code></div>
</div>
<div class="ref-description">
<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>
<p>Two data sets containing all antibiotics/antimycotics and antivirals. 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 the <code>antibiotics</code> 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>
<pre class="usage"><span class='no'>antibiotics</span></pre>
<pre class="usage"><span class='no'>antibiotics</span>
<span class='no'>antivirals</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 453 observations and 13 variables:</p><dl class='dl-horizontal'>
<p><strong>For the <code>antibiotics</code> data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 452 observations and 13 variables:</strong></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>
@ -257,6 +259,19 @@
<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>
</dl>
<p><strong>For the <code>antivirals</code> data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 102 observations and 9 variables:</strong></p><dl class='dl-horizontal'>
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC</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>atc_group</code></dt><dd><p>Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC</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>oral_ddd</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>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
@ -265,7 +280,7 @@
<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>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>
@ -283,7 +298,7 @@ This package contains <strong>all ~550 antibiotic, antimycotic and antiviral dru
<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 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>antivirals</code> <code><a href='microorganisms.html'>microorganisms</a></code></p></div>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code></p></div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>

View File

@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>

View File

@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</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.8.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9034</span>
</span>
</div>
@ -452,15 +452,9 @@
<tr>
<td>
<p><code><a href="antibiotics.html">antibiotics</a></code> </p>
<p><code><a href="antibiotics.html">antibiotics</a></code> <code><a href="antibiotics.html">antivirals</a></code> </p>
</td>
<td><p>Data set with ~450 antibiotics</p></td>
</tr><tr>
<td>
<p><code><a href="antivirals.html">antivirals</a></code> </p>
</td>
<td><p>Data set with ~100 antivirals</p></td>
<td><p>Data sets with ~550 antimicrobials</p></td>
</tr><tr>
<td>
@ -539,26 +533,18 @@
<td><p>Translate strings from AMR package</p></td>
</tr><tr>
<td>
<p><code><a href="like.html">like()</a></code> <code><a href="like.html">`%like%`</a></code> <code><a href="like.html">`%like_case%`</a></code> </p>
</td>
<td><p>Pattern Matching</p></td>
</tr>
</tbody><tbody>
<tr>
<th colspan="2">
<h2 id="section-extended-functions" class="hasAnchor"><a href="#section-extended-functions" class="anchor"></a>Extended functions</h2>
<p class="section-desc"><p>These functions are extensions of functions in other packages.</p></p>
</th>
</tr>
<tr>
<td>
<p><code><a href="extended-functions.html">scale_type.mo()</a></code> <code><a href="extended-functions.html">scale_type.ab()</a></code> </p>
</td>
<td><p>Extended functions</p></td>
</tr><tr>
<td>
<p><code><a href="like.html">like()</a></code> <code><a href="like.html">`%like%`</a></code> <code><a href="like.html">`%like_case%`</a></code> </p>
</td>
<td><p>Pattern Matching</p></td>
</tr><tr>
<td>
<p><code><a href="reexports.html">reexports</a></code> </p>
</td>
@ -567,7 +553,7 @@
</tbody><tbody>
<tr>
<th colspan="2">
<h2 id="section-functions" class="hasAnchor"><a href="#section-functions" class="anchor"></a>functions</h2>
<h2 id="section-deprecated-functions" class="hasAnchor"><a href="#section-deprecated-functions" class="anchor"></a>Deprecated functions</h2>
<p class="section-desc"><p>These functions are deprecated, meaning that they will still work but show a warning with every use and will be removed in a future version.</p></p>
</th>
</tr>
@ -591,8 +577,7 @@
<li><a href="#section-included-data-sets">Included data sets</a></li>
<li><a href="#section-background-information">Background information</a></li>
<li><a href="#section-other-functions">Other functions</a></li>
<li><a href="#section-extended-functions">Extended functions</a></li>
<li><a href="#section-functions">functions</a></li>
<li><a href="#section-deprecated-functions">Deprecated functions</a></li>
</ul>
</div>
</div>

View File

@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>

View File

@ -85,7 +85,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.8.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span>
</span>
</div>

View File

@ -27,9 +27,6 @@
<url>
<loc>https://msberends.gitlab.io/AMR/reference/antibiotics.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/antivirals.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/as.ab.html</loc>
</url>

View File

@ -10,13 +10,16 @@
### What is `AMR` (for R)?
`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. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 70 countries <small>(source: [CRAN logs, 2019](https://cran-logs.rstudio.com))</small>.
After installing this package, R knows [**~70,000 distinct microbial species**](./reference/microorganisms.html) and all [**~550 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
`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. After installing this package, R knows [**~70,000 distinct microbial species**](./reference/microorganisms.html) and all [**~550 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
We created this package for both routine 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 & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is [actively maintained](./news) and is free software (see [Copyright](#copyright)).
**Used to SPSS?** Read our [tutorial on how to import data from SPSS, SAS or Stata](./articles/SPSS.html).
<div class="main-content">
<p>
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used in over 70 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 74 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
</div>
#### Partners

View File

@ -3,8 +3,9 @@
\docType{data}
\name{antibiotics}
\alias{antibiotics}
\title{Data set with ~450 antibiotics}
\format{A \code{\link{data.frame}} with 453 observations and 13 variables:
\alias{antivirals}
\title{Data sets with ~550 antimicrobials}
\format{\strong{For the \code{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:}
\describe{
\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}}
@ -19,6 +20,19 @@
\item{\code{oral_units}}{Units of \code{oral_ddd}}
\item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
\item{\code{iv_units}}{Units of \code{iv_ddd}}
}
\strong{For the \code{antivirals} data set: a \code{\link{data.frame}} with 102 observations and 9 variables:}
\describe{
\item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC}
\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{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC}
\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{oral_ddd}}
\item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
\item{\code{iv_units}}{Units of \code{iv_ddd}}
}}
\source{
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
@ -29,12 +43,14 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt
}
\usage{
antibiotics
antivirals
}
\description{
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.
Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from the \code{antibiotics} 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.
}
\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}
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}.
Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
}
@ -56,6 +72,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
}
\seealso{
\code{\link{antivirals}} \code{\link{microorganisms}}
\code{\link{microorganisms}}
}
\keyword{datasets}

View File

@ -1,46 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{antivirals}
\alias{antivirals}
\title{Data set with ~100 antivirals}
\format{A \code{\link{data.frame}} with 102 observations and 7 variables:
\describe{
\item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC}
\item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO}
\item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC}
\item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment}
\item{\code{oral_units}}{Units of \code{oral_ddd}}
\item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}
\item{\code{iv_units}}{Units of \code{iv_ddd}}
}}
\source{
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
}
\usage{
antivirals
}
\description{
A data set containing all antivirals, according to the ATC code group 'J05' (Antivirals for systemic use).
}
\section{WHOCC}{
\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains \strong{all ~550 antibiotic, antimycotic and antiviral 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.
\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.}
}
\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 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}.
}
\seealso{
\code{\link{antibiotics}} \code{\link{microorganisms}}
}
\keyword{datasets}

View File

@ -41,6 +41,11 @@
width: 19%;
min-width: 125px;
}
.countries_map {
float: left;
padding: 0 10px 10px 0;
max-width: 25%;
}
@media only screen and (max-width: 992px) {
.footer_logo {
float: left;

BIN
pkgdown/logos/countries.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB