(v1.1.0.9015) new default eucast_rules

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-05-20 12:00:17 +02:00
parent 5216d2b520
commit 743f9a5364
48 changed files with 389 additions and 389 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 1.1.0.9014
Date: 2020-05-19
Version: 1.1.0.9015
Date: 2020-05-20
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

14
NEWS.md
View File

@ -1,18 +1,18 @@
# AMR 1.1.0.9014
## <small>Last updated: 19-May-2020</small>
# AMR 1.1.0.9015
## <small>Last updated: 20-May-2020</small>
### Breaking
* Removed code dependency on all other R packages: `cleaner`, `crayon`, `data.table`, `dplyr`, `ggplot2`, `knitr`, `microbenchmark`, `pillar`, `R6`, `rlang`, `tidyr` and `vctrs`. This is a major code change, but will probably not be noticeable by most users.
* Removed code dependency on all other R packages, making this package fully independent on the development process of others. This is a major code change, but will probably not be noticeable by most users.
Making this package independent on especially the tidyverse tremendously increases sustainability on the long term, since tidyverse functions change quite often. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.
Making this package independent on especially the tidyverse tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.
Negative effects of this change are:
* Function `freq()` that was borrowed from the `cleaner` package was removed. Use `cleaner::freq()`, or run `library("cleaner")` before you use `freq()`.
* Printing values of class `mo` or `ab` in a tibble will no longer be in colour.
* Printing values of class `mo` or `ab` in a tibble will no longer be in colour and printing `rsi` in a tibble will show the class `<ord>`, not `<rsi>` anymore. This is purely a visual effect.
* All functions from the `mo_*` family (like `mo_name()` and `mo_gramstain()`) are noticeably slower when running on hundreds of thousands of rows.
* For developers: classes `mo` and `ab` now both also inherit class `character`, to support any data transformation. This change invalidates code that checks for class length == 1.
### Changed
* The EUCAST rules function (`eucast_rules()`) at default no longer applies "other" rules that are made available by this package (like setting ampicillin = R when ampicillin + enzym inhibitor = R). The default input value for `rules` is now `c("breakpoints", "expert")` instead of `"all"`, but this can be changed by the user. To return to the old behaviour, set `options(AMR.eucast_rules = "all")`.
* Small fix for some text input that could not be coerced as valid MIC values
* Fix for cases where some functions of newer versions of the `dplyr` package (such as `bind_rows()`) would not preserve the right class for microorganisms (class `mo`) and antibiotics (class `ab`)
* Fixed interpretation of generic CLSI interpretation rules (thanks to Anthony Underwood)
@ -20,7 +20,7 @@
### Other
* Removed previously deprecated function `p.symbol()` - it was replaced with `p_symbol()`
* Removed function `read.4d()`, that was only useful for reading from an old test database.
* Removed function `read.4d()`, that was only useful for reading data from an old test database.
# AMR 1.1.0

View File

@ -26,13 +26,13 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' Apply EUCAST rules
#'
#' @description
#' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <http://eucast.org>), see *Source*. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
#' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <http://eucast.org>), see *Source*. This includes (1) expert rules and intrinsic resistance and (2) inferred resistance as defined in their breakpoint tables.
#'
#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.
#' @inheritSection lifecycle Maturing lifecycle
#' @param x data with antibiotic columns, like e.g. `AMX` and `AMC`
#' @param info print progress
#' @param rules a character vector that specifies which rules should be applied - one or more of `c("breakpoints", "expert", "other", "all")`
#' @param rules a character vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expert"`, `"other"`, `"all"`, and defaults to `c("breakpoints", "expert")`. The default value can be set to another value using e.g. `options(AMR.eucast_rules = "all")`.
#' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way.
#' @param ... column name of an antibiotic, please see section *Antibiotics* below
#' @inheritParams first_isolate
@ -40,7 +40,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' **Note:** This function does not translate MIC values to RSI values. Use [as.rsi()] for that. \cr
#' **Note:** When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
#'
#' Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:
#' Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:
#' - Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
#' - Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;
#' - Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;
@ -50,7 +50,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' - Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
#' - Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
#'
#' To *not* use these rules, please use `eucast_rules(..., rules = c("breakpoints", "expert"))`.
#' These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use `eucast_rules(..., rules = "all")`, or set the default behaviour of the `[eucast_rules()]` function with `options(AMR.eucast_rules = "all")` (or any other valid input value(s) to the `rules` parameter).
#'
#' The file containing all EUCAST rules is located here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.
#'
@ -195,7 +195,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
eucast_rules <- function(x,
col_mo = NULL,
info = interactive(),
rules = c("breakpoints", "expert", "other", "all"),
rules = getOption("AMR.eucast_rules", default = c("breakpoints", "expert")),
verbose = FALSE,
...) {
@ -231,7 +231,7 @@ eucast_rules <- function(x,
}
if (!all(rules %in% c("breakpoints", "expert", "other", "all"))) {
stop("`rules` must be one or more of: 'breakpoints', 'expert', 'other', 'all'.")
stop('`rules` must be one or more of: "breakpoints", "expert", "other", "all".')
}
if (is.null(col_mo)) {
@ -599,6 +599,10 @@ eucast_rules <- function(x,
}
}
if (!any(c("other", "all") %in% rules, na.rm = TRUE)) {
cat(font_red("\nSkipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.\nUse eucast_rules(..., rules = \"all\") to also apply those rules.\n"))
}
eucast_notification_shown <- FALSE
eucast_rules_df <- eucast_rules_file # internal data file
no_added <- 0
@ -658,7 +662,7 @@ eucast_rules <- function(x,
rule_group_current %like% "expert",
paste0("\nEUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (",
font_red(paste0("v", EUCAST_VERSION_EXPERT_RULES)), ")\n"),
"\nOther rules by this AMR package (turn on/off with 'rules' parameter)\n"))))
"\nOther rules by this AMR package\n"))))
}
# Print rule -------------------------------------------------------------
if (rule_current != rule_previous) {

View File

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

View File

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

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -186,7 +186,7 @@
<h1 data-toc-skip>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">19 May 2020</h4>
<h4 class="date">20 May 2020</h4>
<small class="dont-index">Source: <a href="https://gitlab.com/msberends/AMR/blob/master/vignettes/AMR.Rmd"><code>vignettes/AMR.Rmd</code></a></small>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -195,7 +195,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 19 May 2020.</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 20 May 2020.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -226,21 +226,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2020-05-19</td>
<td align="center">2020-05-20</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">2020-05-19</td>
<td align="center">2020-05-20</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">2020-05-19</td>
<td align="center">2020-05-20</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -336,42 +336,42 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2017-01-17</td>
<td align="center">W7</td>
<td align="center">2013-03-27</td>
<td align="center">L8</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">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-01-15</td>
<td align="center">S1</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</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>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2015-12-30</td>
<td align="center">K1</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">M</td>
</tr>
<tr class="odd">
<td align="center">2014-03-03</td>
<td align="center">F8</td>
<td align="center">2016-06-06</td>
<td align="center">D3</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">M</td>
</tr>
<tr class="even">
<td align="center">2011-07-04</td>
<td align="center">H10</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</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">2013-10-12</td>
<td align="center">K3</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
@ -380,27 +380,27 @@
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2017-07-30</td>
<td align="center">Y4</td>
<td align="center">2012-04-12</td>
<td align="center">M3</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">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2011-01-18</td>
<td align="center">B4</td>
<td align="center">Hospital C</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">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-03-06</td>
<td align="center">S4</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>
</tbody>
</table>
<p>Now, lets start the cleaning and the analysis!</p>
@ -432,16 +432,16 @@ Longest: 1</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">M</td>
<td align="right">10,336</td>
<td align="right">51.68%</td>
<td align="right">10,336</td>
<td align="right">51.68%</td>
<td align="right">10,319</td>
<td align="right">51.60%</td>
<td align="right">10,319</td>
<td align="right">51.60%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">F</td>
<td align="right">9,664</td>
<td align="right">48.32%</td>
<td align="right">9,681</td>
<td align="right">48.41%</td>
<td align="right">20,000</td>
<td align="right">100.00%</td>
</tr>
@ -456,7 +456,11 @@ Longest: 1</p>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_at</a></span>(<span class="fu"><a href="https://dplyr.tidyverse.org/reference/vars.html">vars</a></span>(<span class="no">AMX</span>:<span class="no">GEN</span>), <span class="no">as.rsi</span>)</pre></body></html></div>
<p>Finally, we will apply <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST rules</a> on our antimicrobial results. In Europe, most medical microbiological laboratories already apply these rules. Our package features their latest insights on intrinsic resistance and exceptional phenotypes. Moreover, the <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> function can also apply additional rules, like forcing <help title="ATC: J01CA01">ampicillin</help> = R when <help title="ATC: J01CR02">amoxicillin/clavulanic acid</help> = R.</p>
<p>Because the amoxicillin (column <code>AMX</code>) and amoxicillin/clavulanic acid (column <code>AMC</code>) in our data were generated randomly, some rows will undoubtedly contain AMX = S and AMC = R, which is technically impossible. The <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> fixes this:</p>
<div class="sourceCode" id="cb13"><html><body><pre class="r"><span class="no">data</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="no">data</span>, <span class="kw">col_mo</span> <span class="kw">=</span> <span class="st">"bacteria"</span>)</pre></body></html></div>
<div class="sourceCode" id="cb13"><html><body><pre class="r"><span class="no">data</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="no">data</span>, <span class="kw">col_mo</span> <span class="kw">=</span> <span class="st">"bacteria"</span>)
<span class="co"># [31m</span>
<span class="co"># Skipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.</span>
<span class="co"># Use eucast_rules(..., rules = "all") to also apply those rules.</span>
<span class="co"># [39m</span></pre></body></html></div>
</div>
<div id="adding-new-variables" class="section level1">
<h1 class="hasAnchor">
@ -481,7 +485,7 @@ Longest: 1</p>
<span class="co"># [34mNOTE: Using column `[1mbacteria[22m` as input for `col_mo`.[39m</span>
<span class="co"># [34mNOTE: Using column `[1mdate[22m` as input for `col_date`.[39m</span>
<span class="co"># [34mNOTE: Using column `[1mpatient_id[22m` as input for `col_patient_id`.[39m</span></pre></body></html></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>
<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>
<div class="sourceCode" id="cb16"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="no">first</span> <span class="kw">==</span> <span class="fl">TRUE</span>)</pre></body></html></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>
@ -491,7 +495,7 @@ Longest: 1</p>
<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 T4, 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 S1, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -507,19 +511,19 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-02-08</td>
<td align="center">T4</td>
<td align="center">2010-02-10</td>
<td align="center">S1</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">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-03-28</td>
<td align="center">T4</td>
<td align="center">2010-02-27</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -529,95 +533,95 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-15</td>
<td align="center">T4</td>
<td align="center">2010-03-05</td>
<td align="center">S1</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">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-07-21</td>
<td align="center">T4</td>
<td align="center">2010-04-03</td>
<td align="center">S1</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>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-20</td>
<td align="center">T4</td>
<td align="center">2010-05-22</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-04-24</td>
<td align="center">T4</td>
<td align="center">2010-07-19</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">I</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>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-06-20</td>
<td align="center">T4</td>
<td align="center">2010-07-19</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-06-23</td>
<td align="center">T4</td>
<td align="center">2010-08-28</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</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">9</td>
<td align="center">2011-09-20</td>
<td align="center">T4</td>
<td align="center">2010-09-09</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</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>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-10-08</td>
<td align="center">T4</td>
<td align="center">2010-09-20</td>
<td align="center">S1</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>
</tr>
</tbody>
</table>
<p>Only 2 isolates are marked as first according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>Only 1 isolates are marked as first according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>If a column exists with a name like key(…)ab the <code><a href="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
<div class="sourceCode" id="cb18"><html><body><pre class="r"><span class="no">data</span> <span class="kw">&lt;-</span> <span class="no">data</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="kw">keyab</span> <span class="kw">=</span> <span class="fu"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(<span class="no">.</span>)) <span class="kw">%&gt;%</span>
@ -643,20 +647,20 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-02-08</td>
<td align="center">T4</td>
<td align="center">2010-02-10</td>
<td align="center">S1</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">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-03-28</td>
<td align="center">T4</td>
<td align="center">2010-02-27</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -667,35 +671,35 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-15</td>
<td align="center">T4</td>
<td align="center">2010-03-05</td>
<td align="center">S1</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">R</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-07-21</td>
<td align="center">T4</td>
<td align="center">2010-04-03</td>
<td align="center">S1</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>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-20</td>
<td align="center">T4</td>
<td align="center">2010-05-22</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -703,71 +707,71 @@ Longest: 1</p>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-04-24</td>
<td align="center">T4</td>
<td align="center">2010-07-19</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">I</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="odd">
<td align="center">7</td>
<td align="center">2011-06-20</td>
<td align="center">T4</td>
<td align="center">2010-07-19</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-06-23</td>
<td align="center">T4</td>
<td align="center">2010-08-28</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</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>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-09-20</td>
<td align="center">T4</td>
<td align="center">2010-09-09</td>
<td align="center">S1</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</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>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-10-08</td>
<td align="center">T4</td>
<td align="center">2010-09-20</td>
<td align="center">S1</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>
</tr>
</tbody>
</table>
<p>Instead of 2, now 10 isolates are flagged. In total, 75.2% 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 1, now 10 isolates are flagged. In total, 78.4% of all isolates are marked first weighted - 49.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>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="cb19"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</pre></body></html></div>
<p>So we end up with 15,048 isolates for analysis.</p>
<p>So we end up with 15,684 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb20"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">&lt;-</span> <span class="no">data_1st</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(-<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="no">first</span>, <span class="no">keyab</span>))</pre></body></html></div>
@ -793,46 +797,46 @@ Longest: 1</p>
<tbody>
<tr class="odd">
<td>1</td>
<td align="center">2017-01-17</td>
<td align="center">W7</td>
<td align="center">2013-03-27</td>
<td align="center">L8</td>
<td align="center">Hospital B</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">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>
<tr class="even">
<td>2</td>
<td align="center">2015-12-30</td>
<td align="center">K1</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">F</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>2</td>
<td align="center">2017-01-15</td>
<td align="center">S1</td>
<td align="center">Hospital A</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">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="odd">
<td>3</td>
<td align="center">2014-03-03</td>
<td align="center">F8</td>
<td align="center">Hospital D</td>
<td align="center">2016-06-06</td>
<td align="center">D3</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">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
@ -840,16 +844,16 @@ Longest: 1</p>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>5</td>
<td align="center">2017-07-30</td>
<td align="center">Y4</td>
<td align="center">Hospital B</td>
<td>4</td>
<td align="center">2011-07-04</td>
<td align="center">H10</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</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>
@ -857,34 +861,34 @@ Longest: 1</p>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2011-01-18</td>
<td align="center">B4</td>
<td align="center">2017-03-06</td>
<td align="center">S4</td>
<td align="center">Hospital C</td>
<td align="center">B_STPHY_AURS</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">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</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>7</td>
<td align="center">2013-05-01</td>
<td align="center">G7</td>
<td align="center">Hospital B</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">I</td>
<td align="center">I</td>
<td align="center">2014-08-08</td>
<td align="center">C5</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</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">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -906,8 +910,8 @@ Longest: 1</p>
<div class="sourceCode" id="cb23"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="no">genus</span>, <span class="no">species</span>)</pre></body></html></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,048<br>
Available: 15,048 (100%, NA: 0 = 0%)<br>
Length: 15,684<br>
Available: 15,684 (100%, NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -924,33 +928,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,376</td>
<td align="right">49.02%</td>
<td align="right">7,376</td>
<td align="right">49.02%</td>
<td align="right">7,819</td>
<td align="right">49.85%</td>
<td align="right">7,819</td>
<td align="right">49.85%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,819</td>
<td align="right">25.38%</td>
<td align="right">11,195</td>
<td align="right">74.40%</td>
<td align="right">3,992</td>
<td align="right">25.45%</td>
<td align="right">11,811</td>
<td align="right">75.31%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,330</td>
<td align="right">15.48%</td>
<td align="right">13,525</td>
<td align="right">89.88%</td>
<td align="right">2,332</td>
<td align="right">14.87%</td>
<td align="right">14,143</td>
<td align="right">90.17%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,523</td>
<td align="right">10.12%</td>
<td align="right">15,048</td>
<td align="right">1,541</td>
<td align="right">9.83%</td>
<td align="right">15,684</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -962,7 +966,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="cb24"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span>(<span class="no">AMX</span>)
<span class="co"># [1] 0.4628522</span></pre></body></html></div>
<span class="co"># [1] 0.4410227</span></pre></body></html></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="cb25"><html><body><pre class="r"><span class="no">data_1st</span> <span class="kw">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="no">hospital</span>) <span class="kw">%&gt;%</span>
@ -975,19 +979,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4566180</td>
<td align="center">0.4448217</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4606292</td>
<td align="center">0.4476345</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4775330</td>
<td align="center">0.4299828</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4650083</td>
<td align="center">0.4317450</td>
</tr>
</tbody>
</table>
@ -1005,23 +1009,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4566180</td>
<td align="center">4518</td>
<td align="center">0.4448217</td>
<td align="center">4712</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4606292</td>
<td align="center">5245</td>
<td align="center">0.4476345</td>
<td align="center">5538</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4775330</td>
<td align="center">2270</td>
<td align="center">0.4299828</td>
<td align="center">2328</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4650083</td>
<td align="center">3015</td>
<td align="center">0.4317450</td>
<td align="center">3106</td>
</tr>
</tbody>
</table>
@ -1041,27 +1045,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.9197397</td>
<td align="center">0.8889642</td>
<td align="center">0.9940347</td>
<td align="center">0.8199258</td>
<td align="center">0.8988362</td>
<td align="center">0.9842691</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.9277741</td>
<td align="center">0.8929744</td>
<td align="center">0.9954038</td>
<td align="center">0.8189487</td>
<td align="center">0.8916288</td>
<td align="center">0.9857236</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.9316575</td>
<td align="center">0.9279916</td>
<td align="center">0.9963341</td>
<td align="center">0.8166333</td>
<td align="center">0.9170842</td>
<td align="center">0.9857214</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.6253219</td>
<td align="center">0.6170669</td>
<td align="center">0.0000000</td>
<td align="center">0.6253219</td>
<td align="center">0.6170669</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

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -186,7 +186,7 @@
<h1 data-toc-skip>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">15 April 2020</h4>
<h4 class="date">20 May 2020</h4>
<small class="dont-index">Source: <a href="https://gitlab.com/msberends/AMR/blob/master/vignettes/EUCAST.Rmd"><code>vignettes/EUCAST.Rmd</code></a></small>
<div class="hidden name"><code>EUCAST.Rmd</code></div>
@ -208,7 +208,7 @@
<h2 class="hasAnchor">
<a href="#examples" class="anchor"></a>Examples</h2>
<p>These rules can be used to discard impossible bug-drug combinations in your data. For example, <em>Klebsiella</em> produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, practically every strain of <em>Klebsiella</em> is resistant to ampicillin.</p>
<p>Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, <em>Klebsiella</em>). EUCAST expert rules solve this, that can be used with <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:</p>
<p>Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, <em>Klebsiella</em>). EUCAST expert rules solve this, that can be applied using <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:</p>
<div class="sourceCode" id="cb1"><html><body><pre class="r"><span class="no">oops</span> <span class="kw">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(<span class="kw">mo</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Klebsiella"</span>,
<span class="st">"Escherichia"</span>),
<span class="kw">ampicillin</span> <span class="kw">=</span> <span class="st">"S"</span>)
@ -218,6 +218,10 @@
<span class="co"># 2 Escherichia S</span>
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="no">oops</span>, <span class="kw">info</span> <span class="kw">=</span> <span class="fl">FALSE</span>)
<span class="co"># [31m</span>
<span class="co"># Skipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.</span>
<span class="co"># Use eucast_rules(..., rules = "all") to also apply those rules.</span>
<span class="co"># [39m</span>
<span class="co"># mo ampicillin</span>
<span class="co"># 1 Klebsiella R</span>
<span class="co"># 2 Escherichia S</span></pre></body></html></div>
@ -301,6 +305,10 @@
</tbody>
</table>
<div class="sourceCode" id="cb4"><html><body><pre class="r"><span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="no">data</span>)</pre></body></html></div>
<pre><code># [31m
# Skipping inheritance rules defined by this package, such as setting trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R.
# Use eucast_rules(..., rules = "all") to also apply those rules.
# [39m</code></pre>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>
@ -383,7 +391,7 @@
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.0.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
</div>
</footer>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -186,7 +186,7 @@
<h1 data-toc-skip>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">19 May 2020</h4>
<h4 class="date">20 May 2020</h4>
<small class="dont-index">Source: <a href="https://gitlab.com/msberends/AMR/blob/master/vignettes/MDR.Rmd"><code>vignettes/MDR.Rmd</code></a></small>
<div class="hidden name"><code>MDR.Rmd</code></div>
@ -302,18 +302,18 @@ Unique: 2</p>
<p>The data set now looks like this:</p>
<div class="sourceCode" id="cb5"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(<span class="no">my_TB_data</span>)
<span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span>
<span class="co"># 1 R R R R S R</span>
<span class="co"># 2 I S R R S R</span>
<span class="co"># 3 S R R R I S</span>
<span class="co"># 4 R R R R R R</span>
<span class="co"># 5 S R I R R R</span>
<span class="co"># 6 S R R S R S</span>
<span class="co"># 1 R R R R S S</span>
<span class="co"># 2 S S S I R S</span>
<span class="co"># 3 S R S I S I</span>
<span class="co"># 4 S R S S S R</span>
<span class="co"># 5 R S R S S R</span>
<span class="co"># 6 I S R R R R</span>
<span class="co"># kanamycin</span>
<span class="co"># 1 S</span>
<span class="co"># 1 I</span>
<span class="co"># 2 S</span>
<span class="co"># 3 S</span>
<span class="co"># 4 S</span>
<span class="co"># 5 R</span>
<span class="co"># 3 R</span>
<span class="co"># 4 I</span>
<span class="co"># 5 I</span>
<span class="co"># 6 S</span></pre></body></html></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb6"><html><body><pre class="r"><span class="fu"><a href="../reference/mdro.html">mdro</a></span>(<span class="no">my_TB_data</span>, <span class="kw">guideline</span> <span class="kw">=</span> <span class="st">"TB"</span>)</pre></body></html></div>
@ -343,40 +343,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3294</td>
<td align="right">65.88%</td>
<td align="right">3294</td>
<td align="right">65.88%</td>
<td align="right">3288</td>
<td align="right">65.76%</td>
<td align="right">3288</td>
<td align="right">65.76%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">613</td>
<td align="right">12.26%</td>
<td align="right">3907</td>
<td align="right">78.14%</td>
<td align="right">631</td>
<td align="right">12.62%</td>
<td align="right">3919</td>
<td align="right">78.38%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">572</td>
<td align="right">11.44%</td>
<td align="right">4479</td>
<td align="right">89.58%</td>
<td align="right">582</td>
<td align="right">11.64%</td>
<td align="right">4501</td>
<td align="right">90.02%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">312</td>
<td align="right">6.24%</td>
<td align="right">4791</td>
<td align="right">95.82%</td>
<td align="right">298</td>
<td align="right">5.96%</td>
<td align="right">4799</td>
<td align="right">95.98%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">209</td>
<td align="right">4.18%</td>
<td align="right">201</td>
<td align="right">4.02%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -186,7 +186,7 @@
<h1 data-toc-skip>How to work with WHONET data</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">19 May 2020</h4>
<h4 class="date">20 May 2020</h4>
<small class="dont-index">Source: <a href="https://gitlab.com/msberends/AMR/blob/master/vignettes/WHONET.Rmd"><code>vignettes/WHONET.Rmd</code></a></small>
<div class="hidden name"><code>WHONET.Rmd</code></div>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -186,7 +186,7 @@
<h1 data-toc-skip>Benchmarks</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 May 2020</h4>
<h4 class="date">20 May 2020</h4>
<small class="dont-index">Source: <a href="https://gitlab.com/msberends/AMR/blob/master/vignettes/benchmarks.Rmd"><code>vignettes/benchmarks.Rmd</code></a></small>
<div class="hidden name"><code>benchmarks.Rmd</code></div>
@ -221,36 +221,21 @@
<span class="kw">times</span> <span class="kw">=</span> <span class="fl">10</span>)
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">S.aureus</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">2</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max</span>
<span class="co"># as.mo("sau") 7.5 9.0 21.0 11.0 37.0 43.0</span>
<span class="co"># as.mo("stau") 130.0 130.0 170.0 170.0 180.0 280.0</span>
<span class="co"># as.mo("STAU") 130.0 140.0 150.0 150.0 170.0 180.0</span>
<span class="co"># as.mo("staaur") 7.3 9.7 13.0 11.0 11.0 37.0</span>
<span class="co"># as.mo("STAAUR") 7.3 9.2 13.0 9.8 10.0 45.0</span>
<span class="co"># as.mo("S. aureus") 10.0 11.0 23.0 12.0 12.0 120.0</span>
<span class="co"># as.mo("S aureus") 9.9 12.0 23.0 13.0 40.0 43.0</span>
<span class="co"># as.mo("Staphylococcus aureus") 5.7 6.4 7.4 7.2 8.8 9.5</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 850.0 860.0 870.0 870.0 880.0 910.0</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 330.0 350.0 360.0 360.0 370.0 390.0</span>
<span class="co"># as.mo("MRSA") 7.7 9.2 12.0 9.7 11.0 39.0</span>
<span class="co"># as.mo("VISA") 19.0 21.0 25.0 22.0 24.0 55.0</span>
<span class="co"># as.mo("VRSA") 18.0 22.0 30.0 25.0 26.0 57.0</span>
<span class="co"># as.mo(22242419) 140.0 150.0 170.0 150.0 190.0 210.0</span>
<span class="co"># neval</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
<span class="co"># 10</span></pre></body></html></div>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># as.mo("sau") 8.7 9.4 13.0 9.5 11 39.0 10</span>
<span class="co"># as.mo("stau") 140.0 150.0 160.0 170.0 180 180.0 10</span>
<span class="co"># as.mo("STAU") 140.0 140.0 160.0 150.0 170 180.0 10</span>
<span class="co"># as.mo("staaur") 8.7 9.6 16.0 11.0 11 41.0 10</span>
<span class="co"># as.mo("STAAUR") 8.7 9.2 13.0 10.0 11 37.0 10</span>
<span class="co"># as.mo("S. aureus") 10.0 12.0 23.0 13.0 39 41.0 10</span>
<span class="co"># as.mo("S aureus") 9.4 10.0 11.0 11.0 12 12.0 10</span>
<span class="co"># as.mo("Staphylococcus aureus") 7.5 7.5 8.3 8.4 9 9.3 10</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 890.0 930.0 940.0 940.0 950 980.0 10</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 370.0 390.0 420.0 400.0 440 510.0 10</span>
<span class="co"># as.mo("MRSA") 8.0 8.9 15.0 10.0 11 39.0 10</span>
<span class="co"># as.mo("VISA") 20.0 21.0 36.0 25.0 53 60.0 10</span>
<span class="co"># as.mo("VRSA") 19.0 22.0 29.0 24.0 26 53.0 10</span>
<span class="co"># as.mo(22242419) 150.0 150.0 170.0 150.0 160 290.0 10</span></pre></body></html></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="562.5"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second.</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside of this is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Methanosarcina semesiae</em> (<code>B_MTHNSR_SEMS</code>), a bug probably never found before in humans:</p>
@ -263,17 +248,17 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">M.semesiae</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">4</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq</span>
<span class="co"># as.mo("metsem") 146.500 150.900 173.300 183.300 191.800</span>
<span class="co"># as.mo("METSEM") 145.700 153.400 169.300 172.300 185.300</span>
<span class="co"># as.mo("M. semesiae") 8.586 8.790 9.909 10.140 10.250</span>
<span class="co"># as.mo("M. semesiae") 8.613 8.719 12.350 9.756 10.210</span>
<span class="co"># as.mo("Methanosarcina semesiae") 6.153 6.357 9.325 6.729 7.826</span>
<span class="co"># max neval</span>
<span class="co"># 193.60 10</span>
<span class="co"># 187.40 10</span>
<span class="co"># 12.52 10</span>
<span class="co"># 38.46 10</span>
<span class="co"># 31.48 10</span></pre></body></html></div>
<span class="co"># as.mo("metsem") 163.900 165.300 180.600 176.600 192.600</span>
<span class="co"># as.mo("METSEM") 153.500 156.100 177.300 176.000 200.400</span>
<span class="co"># as.mo("M. semesiae") 9.155 10.250 15.980 10.800 12.790</span>
<span class="co"># as.mo("M. semesiae") 9.498 10.160 16.700 10.560 11.050</span>
<span class="co"># as.mo("Methanosarcina semesiae") 7.006 7.345 7.993 7.814 8.413</span>
<span class="co"># max neval</span>
<span class="co"># 206.600 10</span>
<span class="co"># 206.800 10</span>
<span class="co"># 38.630 10</span>
<span class="co"># 46.810 10</span>
<span class="co"># 9.659 10</span></pre></body></html></div>
<p>Looking up arbitrary codes of less prevalent microorganisms costs the most time. Full names (like <em>Methanosarcina semesiae</em>) are always very fast and only take some thousands of seconds to coerce - they are the most probable input from most data sets.</p>
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Methanosarcina semesiae</em> (which is uncommon):</p>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-6-1.png" width="900"></p>
@ -308,8 +293,8 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">run_it</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># mo_name(x) 1660 1700 1760 1750 1810 1910 10</span></pre></body></html></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 1.75 seconds. You only lose time on your unique input values.</p>
<span class="co"># mo_name(x) 1690 1710 1770 1760 1810 1870 10</span></pre></body></html></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 1.76 seconds. You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -321,10 +306,10 @@
<span class="kw">times</span> <span class="kw">=</span> <span class="fl">10</span>)
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">run_it</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 5.650 6.030 6.36 6.430 6.660 7.130 10</span>
<span class="co"># B 9.860 9.890 14.20 10.900 11.200 46.300 10</span>
<span class="co"># C 0.232 0.237 0.30 0.302 0.355 0.369 10</span></pre></body></html></div>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 6.240 6.490 6.860 6.910 7.15 7.510 10</span>
<span class="co"># B 10.500 10.600 15.300 12.000 12.10 49.300 10</span>
<span class="co"># C 0.198 0.243 0.266 0.278 0.29 0.322 10</span></pre></body></html></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0003 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb7"><html><body><pre class="r"><span class="no">run_it</span> <span class="kw">&lt;-</span> <span class="fu">microbenchmark</span>(<span class="kw">A</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),
<span class="kw">B</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),
@ -338,14 +323,14 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">run_it</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 0.209 0.214 0.229 0.221 0.229 0.299 10</span>
<span class="co"># B 0.199 0.206 0.225 0.209 0.214 0.373 10</span>
<span class="co"># C 0.201 0.207 0.217 0.213 0.222 0.247 10</span>
<span class="co"># D 0.200 0.203 0.214 0.206 0.222 0.266 10</span>
<span class="co"># E 0.200 0.200 0.213 0.209 0.216 0.264 10</span>
<span class="co"># F 0.195 0.205 0.216 0.207 0.217 0.284 10</span>
<span class="co"># G 0.191 0.194 0.206 0.203 0.206 0.261 10</span>
<span class="co"># H 0.190 0.195 0.205 0.198 0.209 0.256 10</span></pre></body></html></div>
<span class="co"># A 0.248 0.253 0.266 0.256 0.271 0.323 10</span>
<span class="co"># B 0.248 0.254 0.272 0.255 0.257 0.420 10</span>
<span class="co"># C 0.245 0.259 0.265 0.268 0.271 0.286 10</span>
<span class="co"># D 0.248 0.252 0.268 0.261 0.278 0.323 10</span>
<span class="co"># E 0.250 0.256 0.265 0.261 0.268 0.312 10</span>
<span class="co"># F 0.237 0.238 0.249 0.243 0.246 0.317 10</span>
<span class="co"># G 0.239 0.242 0.252 0.245 0.245 0.319 10</span>
<span class="co"># H 0.233 0.241 0.262 0.256 0.272 0.347 10</span></pre></body></html></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> anyway, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
@ -372,13 +357,13 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="no">run_it</span>, <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"ms"</span>, <span class="kw">signif</span> <span class="kw">=</span> <span class="fl">4</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># en 20.58 21.00 24.57 21.31 21.81 65.96 100</span>
<span class="co"># de 21.28 21.81 25.34 22.15 22.73 62.52 100</span>
<span class="co"># nl 25.15 25.68 32.14 26.03 27.25 167.40 100</span>
<span class="co"># es 21.35 21.78 27.39 22.14 23.29 67.97 100</span>
<span class="co"># it 21.42 21.83 26.19 22.31 22.84 71.71 100</span>
<span class="co"># fr 21.43 21.82 27.43 22.25 23.39 69.29 100</span>
<span class="co"># pt 21.42 21.92 28.71 22.23 22.89 187.40 100</span></pre></body></html></div>
<span class="co"># en 20.99 21.59 26.64 22.35 22.94 69.49 100</span>
<span class="co"># de 22.02 22.54 26.83 22.98 23.87 63.13 100</span>
<span class="co"># nl 25.78 26.55 34.69 27.25 28.22 182.90 100</span>
<span class="co"># es 21.92 22.67 26.97 23.26 24.01 62.68 100</span>
<span class="co"># it 21.96 22.58 25.11 22.90 23.50 66.81 100</span>
<span class="co"># fr 21.82 22.76 27.53 23.26 23.84 66.75 100</span>
<span class="co"># pt 21.76 22.56 25.84 23.13 23.90 63.63 100</span></pre></body></html></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

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

View File

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

View File

@ -65,7 +65,7 @@ footer p {
#read-more-on-our-website-,
#read-more-on-our-website- + p,
li a[href="#read-more-on-our-website-"] {
display: none;
display: none !important;
}
/* make colour darker and better readable for links */

View File

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

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -229,25 +229,24 @@
<small>Source: <a href='https://gitlab.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="amr-1-1-0-9014" class="section level1">
<h1 class="page-header" data-toc-text="1.1.0.9014">
<a href="#amr-1-1-0-9014" class="anchor"></a>AMR 1.1.0.9014<small> Unreleased </small>
<div id="amr-1-1-0-9015" class="section level1">
<h1 class="page-header" data-toc-text="1.1.0.9015">
<a href="#amr-1-1-0-9015" class="anchor"></a>AMR 1.1.0.9015<small> Unreleased </small>
</h1>
<div id="last-updated-19-may-2020" class="section level2">
<div id="last-updated-20-may-2020" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-19-may-2020" class="anchor"></a><small>Last updated: 19-May-2020</small>
<a href="#last-updated-20-may-2020" class="anchor"></a><small>Last updated: 20-May-2020</small>
</h2>
<div id="breaking" class="section level3">
<h3 class="hasAnchor">
<a href="#breaking" class="anchor"></a>Breaking</h3>
<ul>
<li>
<p>Removed code dependency on all other R packages: <code>cleaner</code>, <code>crayon</code>, <code>data.table</code>, <code>dplyr</code>, <code>ggplot2</code>, <code>knitr</code>, <code>microbenchmark</code>, <code>pillar</code>, <code>R6</code>, <code>rlang</code>, <code>tidyr</code> and <code>vctrs</code>. This is a major code change, but will probably not be noticeable by most users.</p>
<p>Making this package independent on especially the tidyverse tremendously increases sustainability on the long term, since tidyverse functions change quite often. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.</p>
Negative effects of this change are:
<p>Removed code dependency on all other R packages, making this package fully independent on the development process of others. This is a major code change, but will probably not be noticeable by most users.</p>
Making this package independent on especially the tidyverse tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings. Negative effects of this change are:
<ul>
<li>Function <code>freq()</code> that was borrowed from the <code>cleaner</code> package was removed. Use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><a href="https://rdrr.io/pkg/cleaner/man">library("cleaner")</a></code> before you use <code>freq()</code>.</li>
<li>Printing values of class <code>mo</code> or <code>ab</code> in a tibble will no longer be in colour.</li>
<li>Printing values of class <code>mo</code> or <code>ab</code> in a tibble will no longer be in colour and printing <code>rsi</code> in a tibble will show the class <code>&lt;ord&gt;</code>, not <code>&lt;rsi&gt;</code> anymore. This is purely a visual effect.</li>
<li>All functions from the <code>mo_*</code> family (like <code><a href="../reference/mo_property.html">mo_name()</a></code> and <code><a href="../reference/mo_property.html">mo_gramstain()</a></code>) are noticeably slower when running on hundreds of thousands of rows.</li>
<li>For developers: classes <code>mo</code> and <code>ab</code> now both also inherit class <code>character</code>, to support any data transformation. This change invalidates code that checks for class length == 1.</li>
</ul>
@ -258,6 +257,7 @@ Negative effects of this change are:
<h3 class="hasAnchor">
<a href="#changed" class="anchor"></a>Changed</h3>
<ul>
<li>The EUCAST rules function (<code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>) at default no longer applies “other” rules that are made available by this package (like setting ampicillin = R when ampicillin + enzym inhibitor = R). The default input value for <code>rules</code> is now <code><a href="https://rdrr.io/r/base/c.html">c("breakpoints", "expert")</a></code> instead of <code>"all"</code>, but this can be changed by the user. To return to the old behaviour, set <code><a href="https://rdrr.io/r/base/options.html">options(AMR.eucast_rules = "all")</a></code>.</li>
<li>Small fix for some text input that could not be coerced as valid MIC values</li>
<li>Fix for cases where some functions of newer versions of the <code>dplyr</code> package (such as <code><a href="https://dplyr.tidyverse.org/reference/bind.html">bind_rows()</a></code>) would not preserve the right class for microorganisms (class <code>mo</code>) and antibiotics (class <code>ab</code>)</li>
<li>Fixed interpretation of generic CLSI interpretation rules (thanks to Anthony Underwood)</li>
@ -271,7 +271,7 @@ Negative effects of this change are:
<ul>
<li>Removed previously deprecated function <code>p.symbol()</code> - it was replaced with <code><a href="../reference/p_symbol.html">p_symbol()</a></code>
</li>
<li>Removed function <code>read.4d()</code>, that was only useful for reading from an old test database.</li>
<li>Removed function <code>read.4d()</code>, that was only useful for reading data from an old test database.</li>
</ul>
</div>
</div>

View File

@ -10,7 +10,7 @@ articles:
WHONET: WHONET.html
benchmarks: benchmarks.html
resistance_predict: resistance_predict.html
last_built: 2020-05-19T12:15Z
last_built: 2020-05-20T09:55Z
urls:
reference: https://msberends.gitlab.io/AMR/reference
article: https://msberends.gitlab.io/AMR/articles

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,7 +83,7 @@ This function requires an internet connection." />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>

View File

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

View File

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

View File

@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>

View File

@ -49,7 +49,7 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Apply EUCAST rules — eucast_rules" />
<meta property="og:description" content="Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, http://eucast.org), see Source. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
<meta property="og:description" content="Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, http://eucast.org), see Source. This includes (1) expert rules and intrinsic resistance and (2) inferred resistance as defined in their breakpoint tables.
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.svg" />
@ -83,7 +83,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">1.1.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -233,7 +233,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</div>
<div class="ref-description">
<p>Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <a href='http://eucast.org'>http://eucast.org</a>), see <em>Source</em>. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.</p>
<p>Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <a href='http://eucast.org'>http://eucast.org</a>), see <em>Source</em>. This includes (1) expert rules and intrinsic resistance and (2) inferred resistance as defined in their breakpoint tables.</p>
<p>To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.</p>
</div>
@ -241,7 +241,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<span class='no'>x</span>,
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/interactive.html'>interactive</a></span>(),
<span class='kw'>rules</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"breakpoints"</span>, <span class='st'>"expert"</span>, <span class='st'>"other"</span>, <span class='st'>"all"</span>),
<span class='kw'>rules</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span>(<span class='st'>"AMR.eucast_rules"</span>, <span class='kw'>default</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"breakpoints"</span>, <span class='st'>"expert"</span>)),
<span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)</pre>
@ -263,7 +263,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</tr>
<tr>
<th>rules</th>
<td><p>a character vector that specifies which rules should be applied - one or more of <code><a href='https://rdrr.io/r/base/c.html'>c("breakpoints", "expert", "other", "all")</a></code></p></td>
<td><p>a character vector that specifies which rules should be applied. Must be one or more of <code>"breakpoints"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"all"</code>, and defaults to <code><a href='https://rdrr.io/r/base/c.html'>c("breakpoints", "expert")</a></code>. The default value can be set to another value using e.g. <code><a href='https://rdrr.io/r/base/options.html'>options(AMR.eucast_rules = "all")</a></code>.</p></td>
</tr>
<tr>
<th>verbose</th>
@ -295,7 +295,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
<p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi()</a></code> for that. <br />
<strong>Note:</strong> When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p>
<p>Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:</p><ul>
<p>Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:</p><ul>
<li><p>Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;</p></li>
<li><p>Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;</p></li>
<li><p>Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;</p></li>
@ -306,7 +306,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
<li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.</p></li>
</ul>
<p>To <em>not</em> use these rules, please use <code>eucast_rules(..., rules = c("breakpoints", "expert"))</code>.</p>
<p>These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use <code>eucast_rules(..., rules = "all")</code>, or set the default behaviour of the <code>[eucast_rules()]</code> function with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR.eucast_rules = "all")</a></code> (or any other valid input value(s) to the <code>rules</code> parameter).</p>
<p>The file containing all EUCAST rules is located here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv</a>.</p>
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>
@ -461,7 +461,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.0.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
</div>
</footer>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>
@ -308,7 +308,6 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='co'># get isolates whose name start with 'Ent' or 'ent'</span>
<span class='kw'>if</span> (<span class='fl'>FALSE</span>) {
<span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>dplyr</span>)
<span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>cleaner</span>)
<span class='no'>example_isolates</span> <span class='kw'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='no'>mo</span>) <span class='kw'>%like%</span> <span class='st'>"^ent"</span>)
}</pre>

View File

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

View File

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

View File

@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9015</span>
</span>
</div>

View File

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

View File

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

View File

@ -20,7 +20,7 @@ eucast_rules(
x,
col_mo = NULL,
info = interactive(),
rules = c("breakpoints", "expert", "other", "all"),
rules = getOption("AMR.eucast_rules", default = c("breakpoints", "expert")),
verbose = FALSE,
...
)
@ -32,7 +32,7 @@ eucast_rules(
\item{info}{print progress}
\item{rules}{a character vector that specifies which rules should be applied - one or more of \code{c("breakpoints", "expert", "other", "all")}}
\item{rules}{a character vector that specifies which rules should be applied. Must be one or more of \code{"breakpoints"}, \code{"expert"}, \code{"other"}, \code{"all"}, and defaults to \code{c("breakpoints", "expert")}. The default value can be set to another value using e.g. \code{options(AMR.eucast_rules = "all")}.}
\item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way.}
@ -42,7 +42,7 @@ eucast_rules(
The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{\link{data.frame}} with all original and new values of the affected bug-drug combinations.
}
\description{
Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules and intrinsic resistance and (2) inferred resistance as defined in their breakpoint tables.
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.
}
@ -50,7 +50,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
\strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link[=as.rsi]{as.rsi()}} for that. \cr
\strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:
Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:
\itemize{
\item Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
\item Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;
@ -62,7 +62,7 @@ Before further processing, some non-EUCAST rules are applied to improve the effi
\item Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
}
To \emph{not} use these rules, please use \code{eucast_rules(..., rules = c("breakpoints", "expert"))}.
These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use \code{eucast_rules(..., rules = "all")}, or set the default behaviour of the \verb{[eucast_rules()]} function with \code{options(AMR.eucast_rules = "all")} (or any other valid input value(s) to the \code{rules} parameter).
The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}.
}

View File

@ -65,7 +65,7 @@ footer p {
#read-more-on-our-website-,
#read-more-on-our-website- + p,
li a[href="#read-more-on-our-website-"] {
display: none;
display: none !important;
}
/* make colour darker and better readable for links */

View File

@ -36,7 +36,7 @@ In Europe, a lot of medical microbiological laboratories already apply these rul
These rules can be used to discard impossible bug-drug combinations in your data. For example, *Klebsiella* produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, practically every strain of *Klebsiella* is resistant to ampicillin.
Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, *Klebsiella*). EUCAST expert rules solve this, that can be used with `eucast_rules()`:
Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, *Klebsiella*). EUCAST expert rules solve this, that can be applied using `eucast_rules()`:
```{r, warning = FALSE, message = FALSE}
oops <- data.frame(mo = c("Klebsiella",