Browse Source

(v1.1.0.9015) new default eucast_rules

new-mo-algorithm
parent
commit
743f9a5364
  1. 4
      DESCRIPTION
  2. 14
      NEWS.md
  3. 18
      R/eucast_rules.R
  4. 2
      docs/404.html
  5. 2
      docs/LICENSE-text.html
  6. 402
      docs/articles/AMR.html
  7. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  8. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  9. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  10. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  11. 16
      docs/articles/EUCAST.html
  12. 60
      docs/articles/MDR.html
  13. 4
      docs/articles/WHONET.html
  14. 113
      docs/articles/benchmarks.html
  15. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png
  16. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-6-1.png
  17. 2
      docs/articles/index.html
  18. 2
      docs/authors.html
  19. 2
      docs/extra.css
  20. 2
      docs/index.html
  21. 22
      docs/news/index.html
  22. 2
      docs/pkgdown.yml
  23. 2
      docs/reference/AMR-deprecated.html
  24. 2
      docs/reference/as.disk.html
  25. 2
      docs/reference/as.mic.html
  26. 2
      docs/reference/as.mo.html
  27. 2
      docs/reference/as.rsi.html
  28. 2
      docs/reference/atc_online.html
  29. 2
      docs/reference/availability.html
  30. 2
      docs/reference/catalogue_of_life_version.html
  31. 2
      docs/reference/count.html
  32. 16
      docs/reference/eucast_rules.html
  33. 2
      docs/reference/filter_ab_class.html
  34. 2
      docs/reference/first_isolate.html
  35. 2
      docs/reference/ggplot_pca.html
  36. 2
      docs/reference/ggplot_rsi.html
  37. 2
      docs/reference/index.html
  38. 2
      docs/reference/join.html
  39. 2
      docs/reference/key_antibiotics.html
  40. 3
      docs/reference/like.html
  41. 2
      docs/reference/mdro.html
  42. 2
      docs/reference/pca.html
  43. 2
      docs/reference/proportion.html
  44. 2
      docs/reference/resistance_predict.html
  45. 2
      docs/reference/translate.html
  46. 10
      man/eucast_rules.Rd
  47. 2
      pkgdown/extra.css
  48. 2
      vignettes/EUCAST.Rmd

4
DESCRIPTION

@ -1,6 +1,6 @@ @@ -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

@ -1,18 +1,18 @@ @@ -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 @@ @@ -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

18
R/eucast_rules.R

@ -26,13 +26,13 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" @@ -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" @@ -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" @@ -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" @@ -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, @@ -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, @@ -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, @@ -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) {

2
docs/404.html

@ -81,7 +81,7 @@ @@ -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>

2
docs/LICENSE-text.html

@ -81,7 +81,7 @@ @@ -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>

402
docs/articles/AMR.html

@ -39,7 +39,7 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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">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">2017-01-15</td>
<td align="center">S1</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<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">F</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">Hospital D</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">R</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">2013-10-12</td>
<td align="center">K3</td>
<td align="center">Hospital B</td>
<td align="center">2011-07-04</td>
<td align="center">H10</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
@ -380,26 +380,26 @@ @@ -380,26 +380,26 @@
<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">Staphylococcus aureus</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">M</td>
</tr>
<tr class="even">
<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">Staphylococcus aureus</td>
<td align="center">Escherichia 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">S</td>
<td align="center">F</td>
</tr>
</tbody>
</table>
@ -432,16 +432,16 @@ Longest: 1</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> @@ -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> @@ -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> @@ -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> @@ -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">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-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> @@ -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> @@ -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">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-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> @@ -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> @@ -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>, there’s 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,45 +797,45 @@ Longest: 1</p> @@ -793,45 +797,45 @@ 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_STPHY_AURS</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</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">F</td>
<td align="center">R</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">Streptococcus</td>
<td align="center">pneumoniae</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">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">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</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="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">R</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>
@ -840,16 +844,16 @@ Longest: 1</p> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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>

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

16
docs/articles/EUCAST.html

@ -39,7 +39,7 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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.