mirror of
https://github.com/msberends/AMR.git
synced 2026-02-09 09:12:59 +01:00
Built site for AMR@3.0.1.9019: ba4c159
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -64,7 +64,7 @@
|
||||
<li><p><code>AMR_cleaning_regex</code> <br> A <a href="https://rdrr.io/r/base/regex.html" class="external-link">regular expression</a> (case-insensitive) to use in <code><a href="as.mo.html">as.mo()</a></code> and all <code><a href="mo_property.html">mo_*</a></code> functions, to clean the user input. The default is the outcome of <code><a href="as.mo.html">mo_cleaning_regex()</a></code>, which removes texts between brackets and texts such as "species" and "serovar".</p></li>
|
||||
<li><p><code>AMR_custom_ab</code> <br> A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in <code><a href="add_custom_antimicrobials.html">add_custom_antimicrobials()</a></code>.</p></li>
|
||||
<li><p><code>AMR_custom_mo</code> <br> A file location to an RDS file, to use custom microorganisms with this package. This is explained in <code><a href="add_custom_microorganisms.html">add_custom_microorganisms()</a></code>.</p></li>
|
||||
<li><p><code>AMR_eucastrules</code> <br> A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> to set the default types of rules for <code><a href="eucast_rules.html">eucast_rules()</a></code> function, must be one or more of: <code>"breakpoints"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code>c("breakpoints", "expert")</code>.</p></li>
|
||||
<li><p><code>AMR_eucastrules</code> <br> A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> to set the default types of rules for <code><a href="interpretive_rules.html">eucast_rules()</a></code> function, must be one or more of: <code>"breakpoints"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code>c("breakpoints", "expert")</code>.</p></li>
|
||||
<li><p><code>AMR_guideline</code> <br> A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> to set the default guideline for interpreting MIC values and disk diffusion diameters with <code><a href="as.sir.html">as.sir()</a></code>. Can be only the guideline name (e.g., <code>"CLSI"</code>) or the name with a year (e.g. <code>"CLSI 2019"</code>). The default to the latest implemented EUCAST guideline, currently <code>"EUCAST 2025"</code>. Supported guideline are currently EUCAST (2011-2025) and CLSI (2011-2025).</p></li>
|
||||
<li><p><code>AMR_ignore_pattern</code> <br> A <a href="https://rdrr.io/r/base/regex.html" class="external-link">regular expression</a> to ignore (i.e., make <code>NA</code>) any match given in <code><a href="as.mo.html">as.mo()</a></code> and all <code><a href="mo_property.html">mo_*</a></code> functions.</p></li>
|
||||
<li><p><code>AMR_include_PKPD</code> <br> A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to use in <code><a href="as.sir.html">as.sir()</a></code>, to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is <code>TRUE</code>.</p></li>
|
||||
|
||||
@@ -47,7 +47,7 @@ This is an overview of all the package-specific
|
||||
- `AMR_eucastrules`
|
||||
A [character](https://rdrr.io/r/base/character.html) to set the
|
||||
default types of rules for
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md)
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
function, must be one or more of: `"breakpoints"`, `"expert"`,
|
||||
`"other"`, `"custom"`, `"all"`, and defaults to
|
||||
`c("breakpoints", "expert")`.
|
||||
|
||||
@@ -21,7 +21,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/eucast_rules.html" />
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/interpretive_rules.html" />
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/eucast_rules.html">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/interpretive_rules.html">
|
||||
</head>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -112,16 +112,16 @@
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">df</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> birth_date age age_exact age_at_y2k</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1980-02-27 45 45.88493 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1953-07-26 72 72.47671 46</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1949-09-02 76 76.37260 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1986-08-03 39 39.45479 13</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1932-11-19 93 93.15890 67</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1949-03-30 76 76.80000 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1996-06-23 29 29.56712 3</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1963-09-16 62 62.33425 36</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1952-05-16 73 73.67123 47</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1952-11-14 73 73.17260 47</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1980-02-27 45 45.94795 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1953-07-26 72 72.53973 46</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1949-09-02 76 76.43562 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1986-08-03 39 39.51781 13</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1932-11-19 93 93.22192 67</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1949-03-30 76 76.86301 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1996-06-23 29 29.63014 3</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1963-09-16 62 62.39726 36</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1952-05-16 73 73.73425 47</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1952-11-14 73 73.23562 47</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
||||
@@ -81,14 +81,14 @@ df$age_at_y2k <- age(df$birth_date, "2000-01-01")
|
||||
|
||||
df
|
||||
#> birth_date age age_exact age_at_y2k
|
||||
#> 1 1980-02-27 45 45.88493 19
|
||||
#> 2 1953-07-26 72 72.47671 46
|
||||
#> 3 1949-09-02 76 76.37260 50
|
||||
#> 4 1986-08-03 39 39.45479 13
|
||||
#> 5 1932-11-19 93 93.15890 67
|
||||
#> 6 1949-03-30 76 76.80000 50
|
||||
#> 7 1996-06-23 29 29.56712 3
|
||||
#> 8 1963-09-16 62 62.33425 36
|
||||
#> 9 1952-05-16 73 73.67123 47
|
||||
#> 10 1952-11-14 73 73.17260 47
|
||||
#> 1 1980-02-27 45 45.94795 19
|
||||
#> 2 1953-07-26 72 72.53973 46
|
||||
#> 3 1949-09-02 76 76.43562 50
|
||||
#> 4 1986-08-03 39 39.51781 13
|
||||
#> 5 1932-11-19 93 93.22192 67
|
||||
#> 6 1949-03-30 76 76.86301 50
|
||||
#> 7 1996-06-23 29 29.63014 3
|
||||
#> 8 1963-09-16 62 62.39726 36
|
||||
#> 9 1952-05-16 73 73.73425 47
|
||||
#> 10 1952-11-14 73 73.23562 47
|
||||
```
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -187,7 +187,7 @@ may affect the computations for subsequent operations.</p></dd>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> Loading required package: tidymodels</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> ── <span style="font-weight: bold;">Attaching packages</span> ────────────────────────────────────── tidymodels 1.4.1 ──</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">broom </span> 1.0.11 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">rsample </span> 1.3.1 </span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">broom </span> 1.0.12 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">rsample </span> 1.3.2 </span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">dials </span> 1.4.2 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">tailor </span> 0.1.0 </span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">infer </span> 1.1.0 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">tidyr </span> 1.3.2 </span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">modeldata </span> 1.5.1 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">tune </span> 2.0.1 </span>
|
||||
|
||||
@@ -166,7 +166,7 @@ if (require("tidymodels")) {
|
||||
}
|
||||
#> Loading required package: tidymodels
|
||||
#> ── Attaching packages ────────────────────────────────────── tidymodels 1.4.1 ──
|
||||
#> ✔ broom 1.0.11 ✔ rsample 1.3.1
|
||||
#> ✔ broom 1.0.12 ✔ rsample 1.3.2
|
||||
#> ✔ dials 1.4.2 ✔ tailor 0.1.0
|
||||
#> ✔ infer 1.1.0 ✔ tidyr 1.3.2
|
||||
#> ✔ modeldata 1.5.1 ✔ tune 2.0.1
|
||||
|
||||
@@ -9,7 +9,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -131,7 +131,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
|
||||
|
||||
|
||||
<dt id="arg-syndromic-group">syndromic_group<a class="anchor" aria-label="anchor" href="#arg-syndromic-group"></a></dt>
|
||||
<dd><p>A column name of <code>x</code>, or values calculated to split rows of <code>x</code>, e.g. by using <code><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse()</a></code> or <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code>. See <em>Examples</em>.</p></dd>
|
||||
<dd><p>A column name of <code>x</code>, or values calculated to split rows of <code>x</code>, e.g. by using <code><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse()</a></code> or <code><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" class="external-link">case_when()</a></code>. See <em>Examples</em>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-add-total-n">add_total_n<a class="anchor" aria-label="anchor" href="#arg-add-total-n"></a></dt>
|
||||
|
||||
@@ -154,7 +154,7 @@ knit_print(x, italicise = TRUE,
|
||||
|
||||
A column name of `x`, or values calculated to split rows of `x`, e.g.
|
||||
by using [`ifelse()`](https://rdrr.io/r/base/ifelse.html) or
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case_when.html).
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case-and-replace-when.html).
|
||||
See *Examples*.
|
||||
|
||||
- add_total_n:
|
||||
|
||||
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %&gt;%
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -211,7 +211,7 @@ my_data_with_all_these_columns %&gt;%
|
||||
<p>The <code>amr_class()</code> function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the <a href="antimicrobials.html">antimicrobials</a> data set within the columns <code>group</code>, <code>atc_group1</code> and <code>atc_group2</code>.</p>
|
||||
<p>The <code>administrable_per_os()</code> and <code>administrable_iv()</code> functions also rely on the <a href="antimicrobials.html">antimicrobials</a> data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the <a href="antimicrobials.html">antimicrobials</a> data set.</p>
|
||||
<p>The <code>amr_selector()</code> function can be used to internally filter the <a href="antimicrobials.html">antimicrobials</a> data set on any results, see <em>Examples</em>. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set.</p>
|
||||
<p>The <code>not_intrinsic_resistant()</code> function can be used to only select antimicrobials that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of <em>E. coli</em> and <em>K. pneumoniae</em> and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expected Resistant Phenotypes' v1.2</a> (2023) to determine intrinsic resistance, using the <code><a href="eucast_rules.html">eucast_rules()</a></code> function internally. Because of this determination, this function is quite slow in terms of performance.</p>
|
||||
<p>The <code>not_intrinsic_resistant()</code> function can be used to only select antimicrobials that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of <em>E. coli</em> and <em>K. pneumoniae</em> and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expected Resistant Phenotypes' v1.2</a> (2023) to determine intrinsic resistance, using the <code><a href="interpretive_rules.html">eucast_rules()</a></code> function internally. Because of this determination, this function is quite slow in terms of performance.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="full-list-of-supported-antimicrobial-classes">Full list of supported (antimicrobial) classes<a class="anchor" aria-label="anchor" href="#full-list-of-supported-antimicrobial-classes"></a></h2>
|
||||
@@ -668,7 +668,7 @@ my_data_with_all_these_columns %&gt;%
|
||||
<span class="r-in"><span><span class="co"># base R, but add `with = FALSE` if using a single AB selector.</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://r-datatable.com" class="external-link">"data.table"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">dt</span> <span class="op"><-</span> <span class="fu"><a href="https://rdatatable.gitlab.io/data.table/reference/as.data.table.html" class="external-link">as.data.table</a></span><span class="op">(</span><span class="va">example_isolates</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">dt</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/data.table/man/as.data.table.html" class="external-link">as.data.table</a></span><span class="op">(</span><span class="va">example_isolates</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span> <span class="co"># this does not work, it returns column *names*</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">dt</span><span class="op">[</span>, <span class="fu">carbapenems</span><span class="op">(</span><span class="op">)</span><span class="op">]</span></span></span>
|
||||
|
||||
@@ -233,7 +233,7 @@ this function. It currently applies ['EUCAST Expected Resistant
|
||||
Phenotypes'
|
||||
v1.2](https://www.eucast.org/bacteria/important-additional-information/expert-rules/)
|
||||
(2023) to determine intrinsic resistance, using the
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md)
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
function internally. Because of this determination, this function is
|
||||
quite slow in terms of performance.
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ The antibiotics data set has been renamed to antimicrobials. The old name will b
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -55,13 +55,15 @@
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">as.mic</span><span class="op">(</span><span class="va">x</span>, na.rm <span class="op">=</span> <span class="cn">FALSE</span>, keep_operators <span class="op">=</span> <span class="st">"all"</span><span class="op">)</span></span>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">as.mic</span><span class="op">(</span><span class="va">x</span>, na.rm <span class="op">=</span> <span class="cn">FALSE</span>, keep_operators <span class="op">=</span> <span class="st">"all"</span>,</span>
|
||||
<span> round_to_next_log2 <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">is.mic</span><span class="op">(</span><span class="va">x</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="va">NA_mic_</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">rescale_mic</span><span class="op">(</span><span class="va">x</span>, <span class="va">mic_range</span>, keep_operators <span class="op">=</span> <span class="st">"edges"</span>, as.mic <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
|
||||
<span><span class="fu">rescale_mic</span><span class="op">(</span><span class="va">x</span>, <span class="va">mic_range</span>, keep_operators <span class="op">=</span> <span class="st">"edges"</span>, as.mic <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> round_to_next_log2 <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">mic_p50</span><span class="op">(</span><span class="va">x</span>, na.rm <span class="op">=</span> <span class="cn">FALSE</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
@@ -87,12 +89,16 @@
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> specifying how to handle operators (such as <code>></code> and <code><=</code>) in the input. Accepts one of three values: <code>"all"</code> (or <code>TRUE</code>) to keep all operators, <code>"none"</code> (or <code>FALSE</code>) to remove all operators, or <code>"edges"</code> to keep operators only at both ends of the range.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-round-to-next-log-">round_to_next_log2<a class="anchor" aria-label="anchor" href="#arg-round-to-next-log-"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to round up all values to the next log2 level, that are not either 0.0001, 0.0002, 0.0005, 0.001, 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4096. Values that are already in this list (with or without operators), are left unchanged (including any operators).</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-mic-range">mic_range<a class="anchor" aria-label="anchor" href="#arg-mic-range"></a></dt>
|
||||
<dd><p>A manual range to rescale the MIC values, e.g., <code>mic_range = c(0.001, 32)</code>. Use <code>NA</code> to prevent rescaling on one side, e.g., <code>mic_range = c(NA, 32)</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-as-mic">as.mic<a class="anchor" aria-label="anchor" href="#arg-as-mic"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the <code>mic</code> class should be kept - the default is <code>TRUE</code> for <code>rescale_mic()</code> and <code>FALSE</code> for <code><a href="https://rdatatable.gitlab.io/data.table/reference/fdroplevels.html" class="external-link">droplevels()</a></code>. When setting this to <code>FALSE</code> in <code>rescale_mic()</code>, the output will have factor levels that acknowledge <code>mic_range</code>.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the <code>mic</code> class should be kept - the default is <code>TRUE</code> for <code>rescale_mic()</code> and <code>FALSE</code> for <code><a href="https://rdrr.io/pkg/data.table/man/fdroplevels.html" class="external-link">droplevels()</a></code>. When setting this to <code>FALSE</code> in <code>rescale_mic()</code>, the output will have factor levels that acknowledge <code>mic_range</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
@@ -101,12 +107,12 @@
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with additional class <code>mic</code>, that in mathematical operations acts as a <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> vector. Bear in mind that the outcome of any mathematical operation on MICs will return a <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> value.</p>
|
||||
<p>Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with additional class <code>mic</code>, that in mathematical operations acts as a <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> vector. Bear in mind that the outcome of any mathematical operation on MICs will return a <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> value.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>To interpret MIC values as SIR values, use <code><a href="as.sir.html">as.sir()</a></code> on MIC values. It supports guidelines from EUCAST (2011-2025) and CLSI (2011-2025).</p>
|
||||
<p>This class for MIC values is a quite a special data type: formally it is an ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with valid MIC values as <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:</p>
|
||||
<p>This class for MIC values is a quite a special data type: formally it is an ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with valid MIC values as <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>x <span class="ot"><-</span> <span class="fu">random_mic</span>(<span class="dv">10</span>)</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a>x</span>
|
||||
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="co">#> Class 'mic'</span></span>
|
||||
@@ -135,9 +141,9 @@
|
||||
<span id="cb1-12"><a href="#cb1-12" tabindex="-1"></a><span class="co">#> 9 32 A</span></span>
|
||||
<span id="cb1-13"><a href="#cb1-13" tabindex="-1"></a><span class="co">#> 10 16 A</span></span></code></pre><p></p></div>
|
||||
<p>All so-called <a href="https://rdrr.io/r/base/groupGeneric.html" class="external-link">group generic functions</a> are implemented for the MIC class (such as <code>!</code>, <code>!=</code>, <code><</code>, <code>>=</code>, <code><a href="https://rdrr.io/r/base/Log.html" class="external-link">exp()</a></code>, <code><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2()</a></code>). Some mathematical functions are also implemented (such as <code><a href="https://rdrr.io/r/stats/quantile.html" class="external-link">quantile()</a></code>, <code><a href="https://rdrr.io/r/stats/median.html" class="external-link">median()</a></code>, <code><a href="https://rdrr.io/r/stats/fivenum.html" class="external-link">fivenum()</a></code>). Since <code><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd()</a></code> and <code><a href="https://rdrr.io/r/stats/cor.html" class="external-link">var()</a></code> are non-generic functions, these could not be extended. Use <code><a href="https://rdrr.io/r/stats/mad.html" class="external-link">mad()</a></code> as an alternative, or use e.g. <code>sd(as.numeric(x))</code> where <code>x</code> is your vector of MIC values.</p>
|
||||
<p>Using <code><a href="https://rdrr.io/r/base/double.html" class="external-link">as.double()</a></code> or <code><a href="https://rdrr.io/r/base/numeric.html" class="external-link">as.numeric()</a></code> on MIC values will remove the operators and return a numeric vector. Do <strong>not</strong> use <code><a href="https://rdrr.io/r/base/integer.html" class="external-link">as.integer()</a></code> on MIC values as by the <span style="R">R</span> convention on <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a>s, it will return the index of the factor levels (which is often useless for regular users).</p>
|
||||
<p>Using <code><a href="https://rdrr.io/r/base/double.html" class="external-link">as.double()</a></code> or <code><a href="https://rdrr.io/r/base/numeric.html" class="external-link">as.numeric()</a></code> on MIC values will remove the operators and return a numeric vector. Do <strong>not</strong> use <code><a href="https://rdrr.io/r/base/integer.html" class="external-link">as.integer()</a></code> on MIC values as by the <span style="R">R</span> convention on <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a>s, it will return the index of the factor levels (which is often useless for regular users).</p>
|
||||
<p>The function <code>is.mic()</code> detects if the input contains class <code>mic</code>. If the input is a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> or <a href="https://rdrr.io/r/base/list.html" class="external-link">list</a>, it iterates over all columns/items and returns a <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> vector.</p>
|
||||
<p>Use <code><a href="https://rdatatable.gitlab.io/data.table/reference/fdroplevels.html" class="external-link">droplevels()</a></code> to drop unused levels. At default, it will return a plain factor. Use <code>droplevels(..., as.mic = TRUE)</code> to maintain the <code>mic</code> class.</p>
|
||||
<p>Use <code><a href="https://rdrr.io/pkg/data.table/man/fdroplevels.html" class="external-link">droplevels()</a></code> to drop unused levels. At default, it will return a plain factor. Use <code>droplevels(..., as.mic = TRUE)</code> to maintain the <code>mic</code> class.</p>
|
||||
<p>With <code>rescale_mic()</code>, existing MIC ranges can be limited to a defined range of MIC values. This can be useful to better compare MIC distributions.</p>
|
||||
<p>For <code>ggplot2</code>, use one of the <code><a href="plot.html">scale_*_mic()</a></code> functions to plot MIC values. They allows custom MIC ranges and to plot intermediate log2 levels for missing MIC values.</p>
|
||||
<p><code>NA_mic_</code> is a missing value of the new <code>mic</code> class, analogous to e.g. base <span style="R">R</span>'s <code><a href="https://rdrr.io/r/base/NA.html" class="external-link">NA_character_</a></code>.</p>
|
||||
|
||||
@@ -7,13 +7,15 @@ allowing valid MIC values known to the field of (medical) microbiology.
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
as.mic(x, na.rm = FALSE, keep_operators = "all")
|
||||
as.mic(x, na.rm = FALSE, keep_operators = "all",
|
||||
round_to_next_log2 = FALSE)
|
||||
|
||||
is.mic(x)
|
||||
|
||||
NA_mic_
|
||||
|
||||
rescale_mic(x, mic_range, keep_operators = "edges", as.mic = TRUE)
|
||||
rescale_mic(x, mic_range, keep_operators = "edges", as.mic = TRUE,
|
||||
round_to_next_log2 = FALSE)
|
||||
|
||||
mic_p50(x, na.rm = FALSE, ...)
|
||||
|
||||
@@ -43,6 +45,15 @@ droplevels(x, as.mic = FALSE, ...)
|
||||
`FALSE`) to remove all operators, or `"edges"` to keep operators only
|
||||
at both ends of the range.
|
||||
|
||||
- round_to_next_log2:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to round up all
|
||||
values to the next log2 level, that are not either 0.0001, 0.0002,
|
||||
0.0005, 0.001, 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.125, 0.25,
|
||||
0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4096.
|
||||
Values that are already in this list (with or without operators), are
|
||||
left unchanged (including any operators).
|
||||
|
||||
- mic_range:
|
||||
|
||||
A manual range to rescale the MIC values, e.g.,
|
||||
@@ -54,7 +65,7 @@ droplevels(x, as.mic = FALSE, ...)
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
the `mic` class should be kept - the default is `TRUE` for
|
||||
`rescale_mic()` and `FALSE` for
|
||||
[`droplevels()`](https://rdatatable.gitlab.io/data.table/reference/fdroplevels.html).
|
||||
[`droplevels()`](https://rdrr.io/pkg/data.table/man/fdroplevels.html).
|
||||
When setting this to `FALSE` in `rescale_mic()`, the output will have
|
||||
factor levels that acknowledge `mic_range`.
|
||||
|
||||
@@ -64,9 +75,8 @@ droplevels(x, as.mic = FALSE, ...)
|
||||
|
||||
## Value
|
||||
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with additional class `mic`, that in mathematical operations acts as a
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
additional class `mic`, that in mathematical operations acts as a
|
||||
[numeric](https://rdrr.io/r/base/numeric.html) vector. Bear in mind that
|
||||
the outcome of any mathematical operation on MICs will return a
|
||||
[numeric](https://rdrr.io/r/base/numeric.html) value.
|
||||
@@ -78,12 +88,11 @@ To interpret MIC values as SIR values, use
|
||||
It supports guidelines from EUCAST (2011-2025) and CLSI (2011-2025).
|
||||
|
||||
This class for MIC values is a quite a special data type: formally it is
|
||||
an ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with valid MIC values as
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
levels (to make sure only valid MIC values are retained), but for any
|
||||
mathematical operation it acts as decimal numbers:
|
||||
an ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
valid MIC values as
|
||||
[factor](https://rdrr.io/pkg/data.table/man/fctr.html) levels (to make
|
||||
sure only valid MIC values are retained), but for any mathematical
|
||||
operation it acts as decimal numbers:
|
||||
|
||||
x <- random_mic(10)
|
||||
x
|
||||
@@ -138,9 +147,9 @@ Using [`as.double()`](https://rdrr.io/r/base/double.html) or
|
||||
remove the operators and return a numeric vector. Do **not** use
|
||||
[`as.integer()`](https://rdrr.io/r/base/integer.html) on MIC values as
|
||||
by the R convention on
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)s,
|
||||
it will return the index of the factor levels (which is often useless
|
||||
for regular users).
|
||||
[factor](https://rdrr.io/pkg/data.table/man/fctr.html)s, it will return
|
||||
the index of the factor levels (which is often useless for regular
|
||||
users).
|
||||
|
||||
The function `is.mic()` detects if the input contains class `mic`. If
|
||||
the input is a [data.frame](https://rdrr.io/r/base/data.frame.html) or
|
||||
@@ -149,8 +158,8 @@ columns/items and returns a
|
||||
[logical](https://rdrr.io/r/base/logical.html) vector.
|
||||
|
||||
Use
|
||||
[`droplevels()`](https://rdatatable.gitlab.io/data.table/reference/fdroplevels.html)
|
||||
to drop unused levels. At default, it will return a plain factor. Use
|
||||
[`droplevels()`](https://rdrr.io/pkg/data.table/man/fdroplevels.html) to
|
||||
drop unused levels. At default, it will return a plain factor. Use
|
||||
`droplevels(..., as.mic = TRUE)` to maintain the `mic` class.
|
||||
|
||||
With `rescale_mic()`, existing MIC ranges can be limited to a defined
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 34 KiB |
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -52,7 +52,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Clean up existing SIR values, or interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI. <code>as.sir()</code> transforms the input to a new class <code>sir</code>, which is an ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> containing the levels <code>S</code>, <code>SDD</code>, <code>I</code>, <code>R</code>, <code>NI</code>.</p>
|
||||
<p>Clean up existing SIR values, or interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI. <code>as.sir()</code> transforms the input to a new class <code>sir</code>, which is an ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> containing the levels <code>S</code>, <code>SDD</code>, <code>I</code>, <code>R</code>, <code>NI</code>.</p>
|
||||
<p>Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025, see <em>Details</em>. All breakpoints used for interpretation are available in our <a href="clinical_breakpoints.html">clinical_breakpoints</a> data set.</p>
|
||||
</div>
|
||||
|
||||
@@ -69,12 +69,14 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span><span class="co"># Default S3 method</span></span>
|
||||
<span><span class="fu">as.sir</span><span class="op">(</span><span class="va">x</span>, S <span class="op">=</span> <span class="st">"^(S|U|1)+$"</span>, I <span class="op">=</span> <span class="st">"^(I|2)+$"</span>,</span>
|
||||
<span> R <span class="op">=</span> <span class="st">"^(R|3)+$"</span>, NI <span class="op">=</span> <span class="st">"^(N|NI|V|4)+$"</span>, SDD <span class="op">=</span> <span class="st">"^(SDD|D|H|5)+$"</span>,</span>
|
||||
<span> WT <span class="op">=</span> <span class="st">"^(WT|6)+$"</span>, NWT <span class="op">=</span> <span class="st">"^(NWT|7)+$"</span>, NS <span class="op">=</span> <span class="st">"^(NS|8)+$"</span>,</span>
|
||||
<span> info <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># S3 method for class 'mic'</span></span>
|
||||
<span><span class="fu">as.sir</span><span class="op">(</span><span class="va">x</span>, mo <span class="op">=</span> <span class="cn">NULL</span>, ab <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/deparse.html" class="external-link">deparse</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/substitute.html" class="external-link">substitute</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>, <span class="st">"EUCAST"</span><span class="op">)</span>, uti <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> capped_mic_handling <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_capped_mic_handling"</span>, <span class="st">"standard"</span><span class="op">)</span>,</span>
|
||||
<span> as_wt_nwt <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/identical.html" class="external-link">identical</a></span><span class="op">(</span><span class="va">breakpoint_type</span>, <span class="st">"ECOFF"</span><span class="op">)</span>,</span>
|
||||
<span> add_intrinsic_resistance <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> reference_data <span class="op">=</span> <span class="fu">AMR</span><span class="fu">::</span><span class="va"><a href="clinical_breakpoints.html">clinical_breakpoints</a></span>,</span>
|
||||
<span> substitute_missing_r_breakpoint <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_substitute_missing_r_breakpoint"</span>,</span>
|
||||
@@ -87,6 +89,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span><span class="co"># S3 method for class 'disk'</span></span>
|
||||
<span><span class="fu">as.sir</span><span class="op">(</span><span class="va">x</span>, mo <span class="op">=</span> <span class="cn">NULL</span>, ab <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/deparse.html" class="external-link">deparse</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/substitute.html" class="external-link">substitute</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>, <span class="st">"EUCAST"</span><span class="op">)</span>, uti <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> as_wt_nwt <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/identical.html" class="external-link">identical</a></span><span class="op">(</span><span class="va">breakpoint_type</span>, <span class="st">"ECOFF"</span><span class="op">)</span>,</span>
|
||||
<span> add_intrinsic_resistance <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> reference_data <span class="op">=</span> <span class="fu">AMR</span><span class="fu">::</span><span class="va"><a href="clinical_breakpoints.html">clinical_breakpoints</a></span>,</span>
|
||||
<span> substitute_missing_r_breakpoint <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_substitute_missing_r_breakpoint"</span>,</span>
|
||||
@@ -100,6 +103,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span><span class="fu">as.sir</span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span>, col_mo <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>, <span class="st">"EUCAST"</span><span class="op">)</span>, uti <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> capped_mic_handling <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_capped_mic_handling"</span>, <span class="st">"standard"</span><span class="op">)</span>,</span>
|
||||
<span> as_wt_nwt <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/identical.html" class="external-link">identical</a></span><span class="op">(</span><span class="va">breakpoint_type</span>, <span class="st">"ECOFF"</span><span class="op">)</span>,</span>
|
||||
<span> add_intrinsic_resistance <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> reference_data <span class="op">=</span> <span class="fu">AMR</span><span class="fu">::</span><span class="va"><a href="clinical_breakpoints.html">clinical_breakpoints</a></span>,</span>
|
||||
<span> substitute_missing_r_breakpoint <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_substitute_missing_r_breakpoint"</span>,</span>
|
||||
@@ -137,7 +141,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<dd><p>Maximum fraction of invalid antimicrobial interpretations of <code>x</code>, see <em>Examples</em>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-s-i-r-ni-sdd">S, I, R, NI, SDD<a class="anchor" aria-label="anchor" href="#arg-s-i-r-ni-sdd"></a></dt>
|
||||
<dt id="arg-s-i-r-ni-sdd-wt-nwt-ns">S, I, R, NI, SDD, WT, NWT, NS<a class="anchor" aria-label="anchor" href="#arg-s-i-r-ni-sdd-wt-nwt-ns"></a></dt>
|
||||
<dd><p>A case-independent <a href="https://rdrr.io/r/base/regex.html" class="external-link">regular expression</a> to translate input to this result. This regular expression will be run <em>after</em> all non-letters and whitespaces are removed from the input.</p></dd>
|
||||
|
||||
|
||||
@@ -174,6 +178,10 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
</ul><p>The default <code>"conservative"</code> setting ensures cautious handling of uncertain values while preserving interpretability. This option can also be set with the package option <code><a href="AMR-options.html">AMR_capped_mic_handling</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-as-wt-nwt">as_wt_nwt<a class="anchor" aria-label="anchor" href="#arg-as-wt-nwt"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to return <code>"WT"</code>/<code>"NWT"</code> instead of <code>"S"</code>/<code>"R"</code>. Defaults to <code>TRUE</code> when using ECOFFs, i.e., when <code>breakpoint_type</code> is set to <code>"ECOFF"</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-add-intrinsic-resistance">add_intrinsic_resistance<a class="anchor" aria-label="anchor" href="#arg-add-intrinsic-resistance"></a></dt>
|
||||
<dd><p><em>(only useful when using a EUCAST guideline)</em> a <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in <em>Klebsiella</em> species. Determination is based on the <a href="intrinsic_resistant.html">intrinsic_resistant</a> data set, that itself is based on <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3</a> (2021).</p></dd>
|
||||
|
||||
@@ -232,7 +240,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with new class <code>sir</code></p>
|
||||
<p>Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with new class <code>sir</code></p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
@@ -302,7 +310,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<h3 id="after-interpretation">After Interpretation<a class="anchor" aria-label="anchor" href="#after-interpretation"></a></h3>
|
||||
|
||||
|
||||
<p>After using <code>as.sir()</code>, you can use the <code><a href="eucast_rules.html">eucast_rules()</a></code> defined by EUCAST to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
|
||||
<p>After using <code>as.sir()</code>, you can use the <code><a href="interpretive_rules.html">eucast_rules()</a></code> defined by EUCAST to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
|
||||
<p>To determine which isolates are multi-drug resistant, be sure to run <code><a href="mdro.html">mdro()</a></code> (which applies the MDR/PDR/XDR guideline from 2012 at default) on a data set that contains S/I/R values. Read more about <a href="mdro.html">interpreting multidrug-resistant organisms here</a>.</p>
|
||||
</div>
|
||||
|
||||
@@ -416,10 +424,10 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 4 × 18</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> datetime index method ab_given mo_given host_given input_given</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dttm></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2026-01-16 <span style="color: #949494;">10:04:38</span> 1 MIC amoxicillin Escherich… human 8 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2026-01-16 <span style="color: #949494;">10:04:39</span> 1 MIC cipro Escherich… human 0.256 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 2026-01-16 <span style="color: #949494;">10:04:39</span> 1 DISK tobra Escherich… human 16 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 2026-01-16 <span style="color: #949494;">10:04:39</span> 1 DISK genta Escherich… human 18 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2026-02-08 <span style="color: #949494;">22:25:52</span> 1 MIC amoxicillin Escherich… human 8 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2026-02-08 <span style="color: #949494;">22:25:53</span> 1 MIC cipro Escherich… human 0.256 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 2026-02-08 <span style="color: #949494;">22:25:53</span> 1 DISK tobra Escherich… human 16 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 2026-02-08 <span style="color: #949494;">22:25:54</span> 1 DISK genta Escherich… human 18 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># breakpoint_S_R <chr>, site <chr></span></span>
|
||||
|
||||
@@ -4,8 +4,8 @@ Clean up existing SIR values, or interpret minimum inhibitory
|
||||
concentration (MIC) values and disk diffusion diameters according to
|
||||
EUCAST or CLSI. `as.sir()` transforms the input to a new class `sir`,
|
||||
which is an ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
containing the levels `S`, `SDD`, `I`, `R`, `NI`.
|
||||
[factor](https://rdrr.io/pkg/data.table/man/fctr.html) containing the
|
||||
levels `S`, `SDD`, `I`, `R`, `NI`.
|
||||
|
||||
Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI
|
||||
2011-2025, see *Details*. All breakpoints used for interpretation are
|
||||
@@ -27,12 +27,14 @@ is_sir_eligible(x, threshold = 0.05)
|
||||
# Default S3 method
|
||||
as.sir(x, S = "^(S|U|1)+$", I = "^(I|2)+$",
|
||||
R = "^(R|3)+$", NI = "^(N|NI|V|4)+$", SDD = "^(SDD|D|H|5)+$",
|
||||
WT = "^(WT|6)+$", NWT = "^(NWT|7)+$", NS = "^(NS|8)+$",
|
||||
info = interactive(), ...)
|
||||
|
||||
# S3 method for class 'mic'
|
||||
as.sir(x, mo = NULL, ab = deparse(substitute(x)),
|
||||
guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL,
|
||||
capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"),
|
||||
as_wt_nwt = identical(breakpoint_type, "ECOFF"),
|
||||
add_intrinsic_resistance = FALSE,
|
||||
reference_data = AMR::clinical_breakpoints,
|
||||
substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint",
|
||||
@@ -45,6 +47,7 @@ as.sir(x, mo = NULL, ab = deparse(substitute(x)),
|
||||
# S3 method for class 'disk'
|
||||
as.sir(x, mo = NULL, ab = deparse(substitute(x)),
|
||||
guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL,
|
||||
as_wt_nwt = identical(breakpoint_type, "ECOFF"),
|
||||
add_intrinsic_resistance = FALSE,
|
||||
reference_data = AMR::clinical_breakpoints,
|
||||
substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint",
|
||||
@@ -58,6 +61,7 @@ as.sir(x, mo = NULL, ab = deparse(substitute(x)),
|
||||
as.sir(x, ..., col_mo = NULL,
|
||||
guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL,
|
||||
capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"),
|
||||
as_wt_nwt = identical(breakpoint_type, "ECOFF"),
|
||||
add_intrinsic_resistance = FALSE,
|
||||
reference_data = AMR::clinical_breakpoints,
|
||||
substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint",
|
||||
@@ -127,7 +131,7 @@ disk diffusion diameters:
|
||||
Maximum fraction of invalid antimicrobial interpretations of `x`, see
|
||||
*Examples*.
|
||||
|
||||
- S, I, R, NI, SDD:
|
||||
- S, I, R, NI, SDD, WT, NWT, NS:
|
||||
|
||||
A case-independent [regular
|
||||
expression](https://rdrr.io/r/base/regex.html) to translate input to
|
||||
@@ -218,6 +222,12 @@ disk diffusion diameters:
|
||||
also be set with the package option
|
||||
[`AMR_capped_mic_handling`](https://amr-for-r.org/reference/AMR-options.md).
|
||||
|
||||
- as_wt_nwt:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to return
|
||||
`"WT"`/`"NWT"` instead of `"S"`/`"R"`. Defaults to `TRUE` when using
|
||||
ECOFFs, i.e., when `breakpoint_type` is set to `"ECOFF"`.
|
||||
|
||||
- add_intrinsic_resistance:
|
||||
|
||||
*(only useful when using a EUCAST guideline)* a
|
||||
@@ -350,9 +360,8 @@ disk diffusion diameters:
|
||||
|
||||
## Value
|
||||
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with new class `sir`
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with new
|
||||
class `sir`
|
||||
|
||||
## Details
|
||||
|
||||
@@ -495,7 +504,7 @@ options to set before analysis:
|
||||
### After Interpretation
|
||||
|
||||
After using `as.sir()`, you can use the
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md)
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
defined by EUCAST to (1) apply inferred susceptibility and resistance
|
||||
based on results of other antimicrobials and (2) apply intrinsic
|
||||
resistance based on taxonomic properties of a microorganism.
|
||||
@@ -651,10 +660,10 @@ sir_interpretation_history()
|
||||
#> # A tibble: 4 × 18
|
||||
#> datetime index method ab_given mo_given host_given input_given
|
||||
#> <dttm> <int> <chr> <chr> <chr> <chr> <chr>
|
||||
#> 1 2026-01-16 10:04:38 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-01-16 10:04:39 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-01-16 10:04:39 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-01-16 10:04:39 1 DISK genta Escherich… human 18
|
||||
#> 1 2026-02-08 22:25:52 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-02-08 22:25:53 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-02-08 22:25:53 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-02-08 22:25:54 1 DISK genta Escherich… human 18
|
||||
#> # ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,
|
||||
#> # outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
|
||||
#> # breakpoint_S_R <chr>, site <chr>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -127,7 +127,7 @@
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>The function <code>bug_drug_combinations()</code> returns a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with columns "mo", "ab", "S", "SDD", "I", "R", and "total".</p>
|
||||
<p>The function <code>bug_drug_combinations()</code> returns a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with columns "mo", "ab", "S", "SDD", "I", "R", "WT, "NWT", and "total".</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
@@ -163,30 +163,30 @@
|
||||
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
|
||||
<span class="r-in"><span><span class="va">x</span> <span class="op"><-</span> <span class="fu">bug_drug_combinations</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 6 × 8</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> (unknown species) AMC 15 0 0 0 0 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> (unknown species) AMK 0 0 0 0 0 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> (unknown species) AMP 15 0 0 1 0 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> (unknown species) AMX 15 0 0 1 0 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> (unknown species) AZM 3 0 0 3 0 6</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> (unknown species) CAZ 0 0 0 0 0 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 6 × 11</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI WT NWT NS total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> (unknown species) AMC 15 0 0 0 0 0 0 0 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> (unknown species) AMK 0 0 0 0 0 0 0 0 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> (unknown species) AMP 15 0 0 1 0 0 0 0 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> (unknown species) AMX 15 0 0 1 0 0 0 0 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> (unknown species) AZM 3 0 0 3 0 0 0 0 6</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> (unknown species) CAZ 0 0 0 0 0 0 0 0 0</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">Use 'format()' on this result to get a publishable/printable format.</span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/format.html" class="external-link">format</a></span><span class="op">(</span><span class="va">x</span>, translate_ab <span class="op">=</span> <span class="st">"name (atc)"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 39 × 12</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Group Drug CoNS `E. coli` `E. faecalis` `K. pneumoniae` `P. aeruginosa`</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> <span style="color: #949494;">"</span>Aminogl… Amik… <span style="color: #949494;">"</span>100… <span style="color: #949494;">"</span> 0.0% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">""</span> <span style="color: #949494;">""</span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> <span style="color: #949494;">""</span> Gent… <span style="color: #949494;">"</span> 13… <span style="color: #949494;">"</span> 2.0% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">"</span> 10.3% (6/58)<span style="color: #949494;">"</span> <span style="color: #949494;">"</span> 0.0% (0/30)<span style="color: #949494;">"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> <span style="color: #949494;">""</span> Gent… <span style="color: #949494;">"</span> 16… <span style="color: #949494;">"</span> 2.0% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">"</span> 10.3% (6/58)<span style="color: #949494;">"</span> <span style="color: #949494;">"</span> 10.0% (3/30)<span style="color: #949494;">"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> <span style="color: #949494;">""</span> Kana… <span style="color: #949494;">"</span>100… <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> <span style="color: #949494;">""</span> Tobr… <span style="color: #949494;">"</span> 78… <span style="color: #949494;">"</span> 2.6% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">"</span> 10.3% (6/58)<span style="color: #949494;">"</span> <span style="color: #949494;">"</span> 0.0% (0/30)<span style="color: #949494;">"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> <span style="color: #949494;">"</span>Aminope… Amox… <span style="color: #949494;">"</span> 93… <span style="color: #949494;">"</span> 50.0% … <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (58/58… <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> <span style="color: #949494;">""</span> Amox… <span style="color: #949494;">"</span> 42… <span style="color: #949494;">"</span> 13.1% … <span style="color: #949494;">""</span> <span style="color: #949494;">"</span> 10.3% (6/58)<span style="color: #949494;">"</span> <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> <span style="color: #949494;">""</span> Amox… <span style="color: #949494;">"</span> 42… <span style="color: #949494;">"</span> 28.9% … <span style="color: #949494;">""</span> <span style="color: #949494;">"</span> 15.5% (9/58)<span style="color: #949494;">"</span> <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> <span style="color: #949494;">""</span> Ampi… <span style="color: #949494;">"</span> 93… <span style="color: #949494;">"</span> 50.0% … <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (58/58… <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> <span style="color: #949494;">"</span>Carbape… Imip… <span style="color: #949494;">"</span> 47… <span style="color: #949494;">"</span> 0.0% … <span style="color: #949494;">"</span> 0.0% (0/3… <span style="color: #949494;">"</span> 0.0% (0/51)<span style="color: #949494;">"</span> <span style="color: #949494;">""</span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> <span style="color: #949494;">""</span> Mero… <span style="color: #949494;">"</span> 47… <span style="color: #949494;">"</span> 0.0% … <span style="color: #949494;">""</span> <span style="color: #949494;">"</span> 0.0% (0/53)<span style="color: #949494;">"</span> <span style="color: #949494;">""</span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> <span style="color: #949494;">"</span>Cephalo… Cefa… <span style="color: #949494;">"</span> 47… <span style="color: #949494;">"</span> 2.4% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> <span style="color: #949494;">"</span>Cephalo… Cefa… <span style="color: #949494;">"</span> 47… <span style="color: #949494;">"</span> 3.7% … <span style="color: #949494;">"</span>100.0% (39/… <span style="color: #949494;">""</span> <span style="color: #949494;">"</span>100.0% (30/30…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 29 more rows</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 5 more variables: `P. mirabilis` <chr>, `S. aureus` <chr>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># `S. epidermidis` <chr>, `S. hominis` <chr>, `S. pneumoniae` <chr></span></span>
|
||||
@@ -195,19 +195,19 @@
|
||||
<span class="r-in"><span><span class="fu">bug_drug_combinations</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
|
||||
<span class="r-in"><span> FUN <span class="op">=</span> <span class="va">mo_gramstain</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 80 × 8</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> Gram-negative AMC 463 0 89 174 0 726</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Gram-negative AMK 251 0 0 5 0 256</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> Gram-negative AMP 226 0 0 405 0 631</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> Gram-negative AMX 226 0 0 405 0 631</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> Gram-negative AZM 1 0 2 696 0 699</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> Gram-negative CAZ 607 0 0 27 0 634</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> Gram-negative CHL 1 0 0 30 0 31</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Gram-negative CIP 610 0 11 63 0 684</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Gram-negative CLI 18 0 1 709 0 728</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Gram-negative COL 309 0 0 78 0 387</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 80 × 11</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI WT NWT NS total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> Gram-negative AMC 463 0 89 174 0 0 0 0 726</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Gram-negative AMK 251 0 0 5 0 0 0 0 256</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> Gram-negative AMP 226 0 0 405 0 0 0 0 631</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> Gram-negative AMX 226 0 0 405 0 0 0 0 631</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> Gram-negative AZM 1 0 2 696 0 0 0 0 699</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> Gram-negative CAZ 607 0 0 27 0 0 0 0 634</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> Gram-negative CHL 1 0 0 30 0 0 0 0 31</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Gram-negative CIP 610 0 11 63 0 0 0 0 684</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Gram-negative CLI 18 0 1 709 0 0 0 0 728</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Gram-negative COL 309 0 0 78 0 0 0 0 387</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 70 more rows</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">Use 'format()' on this result to get a publishable/printable format.</span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
@@ -219,19 +219,19 @@
|
||||
<span class="r-in"><span> <span class="op">)</span></span></span>
|
||||
<span class="r-in"><span> <span class="op">}</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 80 × 8</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> E. coli AMC 332 0 74 61 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> E. coli AMK 171 0 0 0 0 171</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> E. coli AMP 196 0 0 196 0 392</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> E. coli AMX 196 0 0 196 0 392</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> E. coli AZM 0 0 0 467 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> E. coli CAZ 449 0 0 11 0 460</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> E. coli CHL 0 0 0 0 0 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> E. coli CIP 398 0 1 57 0 456</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> E. coli CLI 0 0 0 467 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> E. coli COL 240 0 0 0 0 240</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 80 × 11</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo ab S SDD I R NI WT NWT NS total</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> E. coli AMC 332 0 74 61 0 0 0 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> E. coli AMK 171 0 0 0 0 0 0 0 171</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> E. coli AMP 196 0 0 196 0 0 0 0 392</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> E. coli AMX 196 0 0 196 0 0 0 0 392</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> E. coli AZM 0 0 0 467 0 0 0 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> E. coli CAZ 449 0 0 11 0 0 0 0 460</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> E. coli CHL 0 0 0 0 0 0 0 0 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> E. coli CIP 398 0 1 57 0 0 0 0 456</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> E. coli CLI 0 0 0 467 0 0 0 0 467</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> E. coli COL 240 0 0 0 0 0 0 0 240</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 70 more rows</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">Use 'format()' on this result to get a publishable/printable format.</span></span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
|
||||
@@ -102,7 +102,7 @@ format(x, translate_ab = "name (ab, atc)",
|
||||
|
||||
The function `bug_drug_combinations()` returns a
|
||||
[data.frame](https://rdrr.io/r/base/data.frame.html) with columns "mo",
|
||||
"ab", "S", "SDD", "I", "R", and "total".
|
||||
"ab", "S", "SDD", "I", "R", "WT, "NWT", and "total".
|
||||
|
||||
## Details
|
||||
|
||||
@@ -143,30 +143,30 @@ example_isolates
|
||||
# \donttest{
|
||||
x <- bug_drug_combinations(example_isolates)
|
||||
head(x)
|
||||
#> # A tibble: 6 × 8
|
||||
#> mo ab S SDD I R NI total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 (unknown species) AMC 15 0 0 0 0 15
|
||||
#> 2 (unknown species) AMK 0 0 0 0 0 0
|
||||
#> 3 (unknown species) AMP 15 0 0 1 0 16
|
||||
#> 4 (unknown species) AMX 15 0 0 1 0 16
|
||||
#> 5 (unknown species) AZM 3 0 0 3 0 6
|
||||
#> 6 (unknown species) CAZ 0 0 0 0 0 0
|
||||
#> # A tibble: 6 × 11
|
||||
#> mo ab S SDD I R NI WT NWT NS total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 (unknown species) AMC 15 0 0 0 0 0 0 0 15
|
||||
#> 2 (unknown species) AMK 0 0 0 0 0 0 0 0 0
|
||||
#> 3 (unknown species) AMP 15 0 0 1 0 0 0 0 16
|
||||
#> 4 (unknown species) AMX 15 0 0 1 0 0 0 0 16
|
||||
#> 5 (unknown species) AZM 3 0 0 3 0 0 0 0 6
|
||||
#> 6 (unknown species) CAZ 0 0 0 0 0 0 0 0 0
|
||||
#> Use 'format()' on this result to get a publishable/printable format.
|
||||
format(x, translate_ab = "name (atc)")
|
||||
#> # A tibble: 39 × 12
|
||||
#> Group Drug CoNS `E. coli` `E. faecalis` `K. pneumoniae` `P. aeruginosa`
|
||||
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
|
||||
#> 1 "Aminogl… Amik… "100… " 0.0% … "100.0% (39/… "" ""
|
||||
#> 2 "" Gent… " 13… " 2.0% … "100.0% (39/… " 10.3% (6/58)" " 0.0% (0/30)"
|
||||
#> 2 "" Gent… " 16… " 2.0% … "100.0% (39/… " 10.3% (6/58)" " 10.0% (3/30)"
|
||||
#> 3 "" Kana… "100… "" "100.0% (39/… "" "100.0% (30/30…
|
||||
#> 4 "" Tobr… " 78… " 2.6% … "100.0% (39/… " 10.3% (6/58)" " 0.0% (0/30)"
|
||||
#> 5 "Aminope… Amox… " 93… " 50.0% … "" "100.0% (58/58… "100.0% (30/30…
|
||||
#> 6 "" Amox… " 42… " 13.1% … "" " 10.3% (6/58)" "100.0% (30/30…
|
||||
#> 6 "" Amox… " 42… " 28.9% … "" " 15.5% (9/58)" "100.0% (30/30…
|
||||
#> 7 "" Ampi… " 93… " 50.0% … "" "100.0% (58/58… "100.0% (30/30…
|
||||
#> 8 "Carbape… Imip… " 47… " 0.0% … " 0.0% (0/3… " 0.0% (0/51)" ""
|
||||
#> 9 "" Mero… " 47… " 0.0% … "" " 0.0% (0/53)" ""
|
||||
#> 10 "Cephalo… Cefa… " 47… " 2.4% … "100.0% (39/… "" "100.0% (30/30…
|
||||
#> 10 "Cephalo… Cefa… " 47… " 3.7% … "100.0% (39/… "" "100.0% (30/30…
|
||||
#> # ℹ 29 more rows
|
||||
#> # ℹ 5 more variables: `P. mirabilis` <chr>, `S. aureus` <chr>,
|
||||
#> # `S. epidermidis` <chr>, `S. hominis` <chr>, `S. pneumoniae` <chr>
|
||||
@@ -175,19 +175,19 @@ format(x, translate_ab = "name (atc)")
|
||||
bug_drug_combinations(example_isolates,
|
||||
FUN = mo_gramstain
|
||||
)
|
||||
#> # A tibble: 80 × 8
|
||||
#> mo ab S SDD I R NI total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 Gram-negative AMC 463 0 89 174 0 726
|
||||
#> 2 Gram-negative AMK 251 0 0 5 0 256
|
||||
#> 3 Gram-negative AMP 226 0 0 405 0 631
|
||||
#> 4 Gram-negative AMX 226 0 0 405 0 631
|
||||
#> 5 Gram-negative AZM 1 0 2 696 0 699
|
||||
#> 6 Gram-negative CAZ 607 0 0 27 0 634
|
||||
#> 7 Gram-negative CHL 1 0 0 30 0 31
|
||||
#> 8 Gram-negative CIP 610 0 11 63 0 684
|
||||
#> 9 Gram-negative CLI 18 0 1 709 0 728
|
||||
#> 10 Gram-negative COL 309 0 0 78 0 387
|
||||
#> # A tibble: 80 × 11
|
||||
#> mo ab S SDD I R NI WT NWT NS total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 Gram-negative AMC 463 0 89 174 0 0 0 0 726
|
||||
#> 2 Gram-negative AMK 251 0 0 5 0 0 0 0 256
|
||||
#> 3 Gram-negative AMP 226 0 0 405 0 0 0 0 631
|
||||
#> 4 Gram-negative AMX 226 0 0 405 0 0 0 0 631
|
||||
#> 5 Gram-negative AZM 1 0 2 696 0 0 0 0 699
|
||||
#> 6 Gram-negative CAZ 607 0 0 27 0 0 0 0 634
|
||||
#> 7 Gram-negative CHL 1 0 0 30 0 0 0 0 31
|
||||
#> 8 Gram-negative CIP 610 0 11 63 0 0 0 0 684
|
||||
#> 9 Gram-negative CLI 18 0 1 709 0 0 0 0 728
|
||||
#> 10 Gram-negative COL 309 0 0 78 0 0 0 0 387
|
||||
#> # ℹ 70 more rows
|
||||
#> Use 'format()' on this result to get a publishable/printable format.
|
||||
|
||||
@@ -199,19 +199,19 @@ bug_drug_combinations(example_isolates,
|
||||
)
|
||||
}
|
||||
)
|
||||
#> # A tibble: 80 × 8
|
||||
#> mo ab S SDD I R NI total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 E. coli AMC 332 0 74 61 0 467
|
||||
#> 2 E. coli AMK 171 0 0 0 0 171
|
||||
#> 3 E. coli AMP 196 0 0 196 0 392
|
||||
#> 4 E. coli AMX 196 0 0 196 0 392
|
||||
#> 5 E. coli AZM 0 0 0 467 0 467
|
||||
#> 6 E. coli CAZ 449 0 0 11 0 460
|
||||
#> 7 E. coli CHL 0 0 0 0 0 0
|
||||
#> 8 E. coli CIP 398 0 1 57 0 456
|
||||
#> 9 E. coli CLI 0 0 0 467 0 467
|
||||
#> 10 E. coli COL 240 0 0 0 0 240
|
||||
#> # A tibble: 80 × 11
|
||||
#> mo ab S SDD I R NI WT NWT NS total
|
||||
#> <chr> <chr> <int> <int> <int> <int> <int> <int> <int> <int> <int>
|
||||
#> 1 E. coli AMC 332 0 74 61 0 0 0 0 467
|
||||
#> 2 E. coli AMK 171 0 0 0 0 0 0 0 171
|
||||
#> 3 E. coli AMP 196 0 0 196 0 0 0 0 392
|
||||
#> 4 E. coli AMX 196 0 0 196 0 0 0 0 392
|
||||
#> 5 E. coli AZM 0 0 0 467 0 0 0 0 467
|
||||
#> 6 E. coli CAZ 449 0 0 11 0 0 0 0 460
|
||||
#> 7 E. coli CHL 0 0 0 0 0 0 0 0 0
|
||||
#> 8 E. coli CIP 398 0 1 57 0 0 0 0 456
|
||||
#> 9 E. coli CLI 0 0 0 467 0 0 0 0 467
|
||||
#> 10 E. coli COL 240 0 0 0 0 0 0 0 240
|
||||
#> # ℹ 70 more rows
|
||||
#> Use 'format()' on this result to get a publishable/printable format.
|
||||
# }
|
||||
|
||||
@@ -21,7 +21,7 @@ Use as.sir() to transform MICs or disks measurements to SIR values."><meta prope
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
8
reference/clsi_rules.html
Normal file
8
reference/clsi_rules.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/interpretive_rules.html" />
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/interpretive_rules.html">
|
||||
</head>
|
||||
</html>
|
||||
|
||||
@@ -9,7 +9,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Define custom EUCAST rules for your organisation or specific analysis and use the output of this function in <code><a href="eucast_rules.html">eucast_rules()</a></code>.</p>
|
||||
<p>Define custom EUCAST rules for your organisation or specific analysis and use the output of this function in <code><a href="interpretive_rules.html">eucast_rules()</a></code>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@@ -72,11 +72,11 @@
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>Some organisations have their own adoption of EUCAST rules. This function can be used to define custom EUCAST rules to be used in the <code><a href="eucast_rules.html">eucast_rules()</a></code> function.</p><div class="section">
|
||||
<p>Some organisations have their own adoption of EUCAST rules. This function can be used to define custom EUCAST rules to be used in the <code><a href="interpretive_rules.html">eucast_rules()</a></code> function.</p><div class="section">
|
||||
<h3 id="basics">Basics<a class="anchor" aria-label="anchor" href="#basics"></a></h3>
|
||||
|
||||
|
||||
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
|
||||
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/custom_eucast_rules.html">custom_eucast_rules</a></span><span class="op">(</span><span class="va">TZP</span> <span class="op">==</span> <span class="st">"S"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"S"</span>,</span>
|
||||
<span> <span class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
<p>These are two custom EUCAST rules: if TZP (piperacillin/tazobactam) is "S", all aminopenicillins (ampicillin and amoxicillin) must be made "S", and if TZP is "R", aminopenicillins must be made "R". These rules can also be printed to the console, so it is immediately clear how they work:</p>
|
||||
@@ -98,7 +98,7 @@
|
||||
<span><span class="co">#> 1 Escherichia coli R S S</span></span>
|
||||
<span><span class="co">#> 2 Klebsiella pneumoniae R S S</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span><span class="fu"><a href="../reference/interpretive_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span> rules <span class="op">=</span> <span class="st">"custom"</span>,</span>
|
||||
<span> custom_rules <span class="op">=</span> <span class="va">x</span>,</span>
|
||||
<span> info <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
@@ -118,7 +118,7 @@
|
||||
<span> <span class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&</span> <span class="va">genus</span> <span class="op">==</span> <span class="st">"Klebsiella"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"R"</span></span>
|
||||
<span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span><span class="fu"><a href="../reference/interpretive_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span> rules <span class="op">=</span> <span class="st">"custom"</span>,</span>
|
||||
<span> custom_rules <span class="op">=</span> <span class="va">y</span>,</span>
|
||||
<span> info <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
@@ -205,7 +205,7 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #0000BB;">amoxicillin</span> (AMX), <span style="color: #0000BB;">amoxicillin/clavulanic acid</span> (AMC), <span style="color: #0000BB;">ampicillin</span> (AMP)</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># run the custom rule set (verbose = TRUE will return a logbook instead of the data set):</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="interpretive_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
|
||||
<span class="r-in"><span> rules <span class="op">=</span> <span class="st">"custom"</span>,</span></span>
|
||||
<span class="r-in"><span> custom_rules <span class="op">=</span> <span class="va">x</span>,</span></span>
|
||||
<span class="r-in"><span> info <span class="op">=</span> <span class="cn">FALSE</span>,</span></span>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Define custom EUCAST rules for your organisation or specific analysis
|
||||
and use the output of this function in
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md).
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -25,13 +25,13 @@ A [list](https://rdrr.io/r/base/list.html) containing the custom rules
|
||||
|
||||
Some organisations have their own adoption of EUCAST rules. This
|
||||
function can be used to define custom EUCAST rules to be used in the
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md)
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
function.
|
||||
|
||||
### Basics
|
||||
|
||||
If you are familiar with the
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case_when.html)
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case-and-replace-when.html)
|
||||
function of the `dplyr` package, you will recognise the input method to
|
||||
set your own rules. Rules must be set using what R considers to be the
|
||||
'formula notation'. The rule itself is written *before* the tilde (`~`)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
|
||||
<dt id="arg-as-factor">as_factor<a class="anchor" aria-label="anchor" href="#arg-as-factor"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the returned value should be an ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> (<code>TRUE</code>, default), or otherwise a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vector. For combining rules sets (using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>) this value will be inherited from the first set at default.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the returned value should be an ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> (<code>TRUE</code>, default), or otherwise a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vector. For combining rules sets (using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>) this value will be inherited from the first set at default.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-x">x<a class="anchor" aria-label="anchor" href="#arg-x"></a></dt>
|
||||
@@ -87,7 +87,7 @@
|
||||
<h3 id="basics">Basics<a class="anchor" aria-label="anchor" href="#basics"></a></h3>
|
||||
|
||||
|
||||
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
|
||||
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">custom</span> <span class="op"><-</span> <span class="fu"><a href="../reference/custom_mdro_guideline.html">custom_mdro_guideline</a></span><span class="op">(</span><span class="va">CIP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&</span> <span class="va">age</span> <span class="op">></span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type A"</span>,</span>
|
||||
<span> <span class="va">ERY</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&</span> <span class="va">age</span> <span class="op">></span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type B"</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
<p>If a row/an isolate matches the first rule, the value after the first <code>~</code> (in this case <em>'Elderly Type A'</em>) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.</p>
|
||||
|
||||
@@ -24,8 +24,8 @@ c(x, ..., as_factor = NULL)
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
the returned value should be an ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
(`TRUE`, default), or otherwise a
|
||||
[factor](https://rdrr.io/pkg/data.table/man/fctr.html) (`TRUE`,
|
||||
default), or otherwise a
|
||||
[character](https://rdrr.io/r/base/character.html) vector. For
|
||||
combining rules sets (using [`c()`](https://rdrr.io/r/base/c.html))
|
||||
this value will be inherited from the first set at default.
|
||||
@@ -47,7 +47,7 @@ ward, state of contact isolation or other variables in your data.
|
||||
### Basics
|
||||
|
||||
If you are familiar with the
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case_when.html)
|
||||
[`case_when()`](https://dplyr.tidyverse.org/reference/case-and-replace-when.html)
|
||||
function of the `dplyr` package, you will recognise the input method to
|
||||
set your own rules. Rules must be set using what R considers to be the
|
||||
'formula notation'. The rule itself is written *before* the tilde (`~`)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>EUCAST breakpoints used in this package are based on the dosages in this data set. They can be retrieved with <code><a href="eucast_rules.html">eucast_dosage()</a></code>.</p>
|
||||
<p>EUCAST breakpoints used in this package are based on the dosages in this data set. They can be retrieved with <code><a href="interpretive_rules.html">eucast_dosage()</a></code>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@@ -65,7 +65,7 @@
|
||||
<li><p><code>type</code><br> Type of the dosage, either "high_dosage", "standard_dosage", or "uncomplicated_uti"</p></li>
|
||||
<li><p><code>dose</code><br> Dose, such as "2 g" or "25 mg/kg"</p></li>
|
||||
<li><p><code>dose_times</code><br> Number of times a dose must be administered</p></li>
|
||||
<li><p><code>administration</code><br> Route of administration, either "", "im", "iv", or "oral"</p></li>
|
||||
<li><p><code>administration</code><br> Route of administration, either "", "im", "iv", "oral", or NA</p></li>
|
||||
<li><p><code>notes</code><br> Additional dosage notes</p></li>
|
||||
<li><p><code>original_txt</code><br> Original text in the PDF file of EUCAST</p></li>
|
||||
<li><p><code>eucast_version</code><br> Version number of the EUCAST Clinical Breakpoints guideline to which these dosages apply, either 15, 14, 13.1, 12, or 11</p></li>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
EUCAST breakpoints used in this package are based on the dosages in this
|
||||
data set. They can be retrieved with
|
||||
[`eucast_dosage()`](https://amr-for-r.org/reference/eucast_rules.md).
|
||||
[`eucast_dosage()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -35,7 +35,7 @@ observations and 9 variables:
|
||||
Number of times a dose must be administered
|
||||
|
||||
- `administration`
|
||||
Route of administration, either "", "im", "iv", or "oral"
|
||||
Route of administration, either "", "im", "iv", "oral", or NA
|
||||
|
||||
- `notes`
|
||||
Additional dosage notes
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/eucast_rules.html" />
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/interpretive_rules.html" />
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/eucast_rules.html">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/interpretive_rules.html">
|
||||
</head>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,305 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Apply EUCAST Rules — eucast_rules • AMR (for R)</title><!-- favicons --><link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png"><link rel="icon" type="”image/svg+xml”" href="../favicon.svg"><link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png"><link rel="icon" sizes="any" href="../favicon.ico"><link rel="manifest" href="../site.webmanifest"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/Lato-0.4.10/font.css" rel="stylesheet"><link href="../deps/Fira_Code-0.4.10/font.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet"><script src="../extra.js"></script><meta property="og:title" content="Apply EUCAST Rules — eucast_rules"><meta name="description" content="Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, https://www.eucast.org), see Source. Use eucast_dosage() to get a data.frame with advised dosages of a certain bug-drug combination, which is based on the dosage data set.
|
||||
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details."><meta property="og:description" content="Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, https://www.eucast.org), see Source. Use eucast_dosage() to get a data.frame with advised dosages of a certain bug-drug combination, which is based on the dosage data set.
|
||||
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details."><meta property="og:image" content="https://amr-for-r.org/logo.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-lg fixed-top bg-primary" data-bs-theme="dark" aria-label="Site navigation"><div class="container">
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div id="navbar" class="collapse navbar-collapse ms-3">
|
||||
<ul class="navbar-nav me-auto"><li class="nav-item dropdown">
|
||||
<button class="nav-link dropdown-toggle" type="button" id="dropdown-how-to" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span class="fa fa-question-circle"></span> How to</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdown-how-to"><li><a class="dropdown-item" href="../articles/AMR.html"><span class="fa fa-directions"></span> Conduct AMR Analysis</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/antibiogram.html"><span class="fa fa-file-prescription"></span> Generate Antibiogram (Trad./Syndromic/WISCA)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/AMR_with_tidymodels.html"><span class="fa fa-square-root-variable"></span> Use AMR for Predictive Modelling (tidymodels)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/datasets.html"><span class="fa fa-database"></span> Download Data Sets for Own Use</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/AMR-options.html"><span class="fa fa-gear"></span> Set User- Or Team-specific Package Settings</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/PCA.html"><span class="fa fa-compress"></span> Conduct Principal Component Analysis for AMR</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/mdro.html"><span class="fa fa-skull-crossbones"></span> Determine Multi-Drug Resistance (MDR)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/WHONET.html"><span class="fa fa-globe-americas"></span> Work with WHONET Data</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply EUCAST Rules</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/mo_property.html"><span class="fa fa-bug"></span> Get Taxonomy of a Microorganism</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/ab_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antibiotic Drug</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/av_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antiviral Drug</a></li>
|
||||
</ul></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../articles/AMR_for_Python.html"><span class="fa fab fa-python"></span> AMR for Python</a></li>
|
||||
<li class="active nav-item"><a class="nav-link" href="../reference/index.html"><span class="fa fa-book-open"></span> Manual</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../authors.html"><span class="fa fa-users"></span> Authors</a></li>
|
||||
</ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
|
||||
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../news/index.html"><span class="fa fa-newspaper"></span> Changelog</a></li>
|
||||
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/msberends/AMR"><span class="fa fa-github"></span> Source Code</a></li>
|
||||
</ul></div>
|
||||
|
||||
|
||||
</div>
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.svg" class="logo" alt=""><h1>Apply EUCAST Rules</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/eucast_rules.R" class="external-link"><code>R/eucast_rules.R</code></a></small>
|
||||
<div class="d-none name"><code>eucast_rules.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <a href="https://www.eucast.org" class="external-link">https://www.eucast.org</a>), see <em>Source</em>. Use <code>eucast_dosage()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with advised dosages of a certain bug-drug combination, which is based on the <a href="dosage.html">dosage</a> data set.</p>
|
||||
<p>To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see <em>Details</em>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">eucast_rules</span><span class="op">(</span><span class="va">x</span>, col_mo <span class="op">=</span> <span class="cn">NULL</span>, info <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span>,</span>
|
||||
<span> rules <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_eucastrules"</span>, default <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"breakpoints"</span>,</span>
|
||||
<span> <span class="st">"expected_phenotypes"</span><span class="op">)</span><span class="op">)</span>, verbose <span class="op">=</span> <span class="cn">FALSE</span>, version_breakpoints <span class="op">=</span> <span class="fl">15</span>,</span>
|
||||
<span> version_expected_phenotypes <span class="op">=</span> <span class="fl">1.2</span>, version_expertrules <span class="op">=</span> <span class="fl">3.3</span>,</span>
|
||||
<span> ampc_cephalosporin_resistance <span class="op">=</span> <span class="cn">NA</span>, only_sir_columns <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/any.html" class="external-link">any</a></span><span class="op">(</span><span class="fu"><a href="as.sir.html">is.sir</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> custom_rules <span class="op">=</span> <span class="cn">NULL</span>, overwrite <span class="op">=</span> <span class="cn">FALSE</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="va">ab</span>, administration <span class="op">=</span> <span class="st">"iv"</span>, version_breakpoints <span class="op">=</span> <span class="fl">15</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="source">Source<a class="anchor" aria-label="anchor" href="#source"></a></h2>
|
||||
|
||||
<ul><li><p>EUCAST Expert Rules. Version 2.0, 2012.<br>
|
||||
Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility testing.</strong> <em>Clin Microbiol Infect.</em> 2013;19(2):141-60; <a href="https://doi.org/10.1111/j.1469-0691.2011.03703.x" class="external-link">doi:10.1111/j.1469-0691.2011.03703.x</a></p></li>
|
||||
<li><p>EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.3, 2021. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 11.0, 2021. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_11.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 12.0, 2022. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_12.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
</ul></div>
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg-x">x<a class="anchor" aria-label="anchor" href="#arg-x"></a></dt>
|
||||
<dd><p>A data set with antimicrobials columns, such as <code>amox</code>, <code>AMX</code> and <code>AMC</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-col-mo">col_mo<a class="anchor" aria-label="anchor" href="#arg-col-mo"></a></dt>
|
||||
<dd><p>Column name of the names or codes of the microorganisms (see <code><a href="as.mo.html">as.mo()</a></code>) - the default is the first column of class <code><a href="as.mo.html">mo</a></code>. Values will be coerced using <code><a href="as.mo.html">as.mo()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-info">info<a class="anchor" aria-label="anchor" href="#arg-info"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether progress should be printed to the console - the default is only print while in interactive sessions.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-rules">rules<a class="anchor" aria-label="anchor" href="#arg-rules"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vector that specifies which rules should be applied. Must be one or more of <code>"breakpoints"</code>, <code>"expected_phenotypes"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code>c("breakpoints", "expected_phenotypes")</code>. The default value can be set to another value using the package option <code><a href="AMR-options.html">AMR_eucastrules</a></code>: <code>options(AMR_eucastrules = "all")</code>. If using <code>"custom"</code>, be sure to fill in argument <code>custom_rules</code> too. Custom rules can be created with <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-verbose">verbose<a class="anchor" aria-label="anchor" href="#arg-verbose"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> 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. Using Verbose mode takes a lot more time.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-breakpoints">version_breakpoints<a class="anchor" aria-label="anchor" href="#arg-version-breakpoints"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Clinical Breakpoints guideline. Can be "15.0", "14.0", "13.1", "12.0", "11.0", or "10.0".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-expected-phenotypes">version_expected_phenotypes<a class="anchor" aria-label="anchor" href="#arg-version-expected-phenotypes"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Expected Phenotypes. Can be "1.2".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-expertrules">version_expertrules<a class="anchor" aria-label="anchor" href="#arg-version-expertrules"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be "3.3", "3.2", or "3.1".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-ampc-cephalosporin-resistance">ampc_cephalosporin_resistance<a class="anchor" aria-label="anchor" href="#arg-ampc-cephalosporin-resistance"></a></dt>
|
||||
<dd><p>(only applies when <code>rules</code> contains <code>"expert"</code> or <code>"all"</code>) a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is <code>NA</code>. Currently only works when <code>version_expertrules</code> is <code>3.2</code> and higher; these versions of '<em>EUCAST Expert Rules on Enterobacterales</em>' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of <code>NA</code> (the default) for this argument will remove results for these three drugs, while e.g. a value of <code>"R"</code> will make the results for these drugs resistant. Use <code>NULL</code> or <code>FALSE</code> to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using <code>TRUE</code> is equal to using <code>"R"</code>. <br> For <em>EUCAST Expert Rules</em> v3.2, this rule applies to: <em>Citrobacter braakii</em>, <em>Citrobacter freundii</em>, <em>Citrobacter gillenii</em>, <em>Citrobacter murliniae</em>, <em>Citrobacter rodenticum</em>, <em>Citrobacter sedlakii</em>, <em>Citrobacter werkmanii</em>, <em>Citrobacter youngae</em>, <em>Enterobacter</em>, <em>Hafnia alvei</em>, <em>Klebsiella aerogenes</em>, <em>Morganella morganii</em>, <em>Providencia</em>, and <em>Serratia</em>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-only-sir-columns">only_sir_columns<a class="anchor" aria-label="anchor" href="#arg-only-sir-columns"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether only antimicrobial columns must be included that were transformed to class <a href="as.sir.html">sir</a> on beforehand. Defaults to <code>FALSE</code> if no columns of <code>x</code> have a class <a href="as.sir.html">sir</a>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-custom-rules">custom_rules<a class="anchor" aria-label="anchor" href="#arg-custom-rules"></a></dt>
|
||||
<dd><p>Custom rules to apply, created with <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-overwrite">overwrite<a class="anchor" aria-label="anchor" href="#arg-overwrite"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> indicating whether to overwrite existing SIR values (default: <code>FALSE</code>). When <code>FALSE</code>, only non-SIR values are modified (i.e., any value that is not already S, I or R). To ensure compliance with EUCAST guidelines, <strong>this should remain</strong> <code>FALSE</code>, as EUCAST notes often state that an organism "should be tested for susceptibility to individual agents or be reported resistant".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>Column names of antimicrobials. To automatically detect antimicrobial column names, do not provide any named arguments; <code><a href="guess_ab_col.html">guess_ab_col()</a></code> will then be used for detection. To manually specify a column, provide its name (case-insensitive) as an argument, e.g. <code>AMX = "amoxicillin"</code>. To skip a specific antimicrobial, set it to <code>NULL</code>, e.g. <code>TIC = NULL</code> to exclude ticarcillin. If a manually defined column does not exist in the data, it will be skipped with a warning.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-ab">ab<a class="anchor" aria-label="anchor" href="#arg-ab"></a></dt>
|
||||
<dd><p>Any (vector of) text that can be coerced to a valid antimicrobial drug code with <code><a href="as.ab.html">as.ab()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-administration">administration<a class="anchor" aria-label="anchor" href="#arg-administration"></a></dt>
|
||||
<dd><p>Route of administration, either "", "im", "iv", or "oral".</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>The input of <code>x</code>, possibly with edited values of antimicrobials. Or, if <code>verbose = TRUE</code>, a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all original and new values of the affected bug-drug combinations.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p><strong>Note:</strong> This function does not translate MIC values to SIR values. Use <code><a href="as.sir.html">as.sir()</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. <br></p>
|
||||
<p>The file containing all EUCAST rules is located here: <a href="https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv</a>. <strong>Note:</strong> Old taxonomic names are replaced with the current taxonomy where applicable. For example, <em>Ochrobactrum anthropi</em> was renamed to <em>Brucella anthropi</em> in 2020; the original EUCAST rules v3.1 and v3.2 did not yet contain this new taxonomic name. The <code>AMR</code> package contains the full microbial taxonomy updated until June 24th, 2024, see <a href="microorganisms.html">microorganisms</a>.</p><div class="section">
|
||||
<h3 id="custom-rules">Custom Rules<a class="anchor" aria-label="anchor" href="#custom-rules"></a></h3>
|
||||
|
||||
|
||||
<p>Custom rules can be created using <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>, e.g.:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/custom_eucast_rules.html">custom_eucast_rules</a></span><span class="op">(</span><span class="va">AMC</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&</span> <span class="va">genus</span> <span class="op">==</span> <span class="st">"Klebsiella"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"R"</span>,</span>
|
||||
<span> <span class="va">AMC</span> <span class="op">==</span> <span class="st">"I"</span> <span class="op">&</span> <span class="va">genus</span> <span class="op">==</span> <span class="st">"Klebsiella"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"I"</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">example_isolates</span>, rules <span class="op">=</span> <span class="st">"custom"</span>, custom_rules <span class="op">=</span> <span class="va">x</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="-other-rules">'Other' Rules<a class="anchor" aria-label="anchor" href="#-other-rules"></a></h3>
|
||||
|
||||
|
||||
<p>Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules, and the reliability of your data (analysis). These rules are:</p><ol><li><p>A drug <strong>with</strong> enzyme inhibitor will be set to S if the same drug <strong>without</strong> enzyme inhibitor is S</p></li>
|
||||
<li><p>A drug <strong>without</strong> enzyme inhibitor will be set to R if the same drug <strong>with</strong> enzyme inhibitor is R</p></li>
|
||||
</ol><p>Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set.</p>
|
||||
<p>Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include <code>"other"</code> to the <code>rules</code> argument, or use <code>eucast_rules(..., rules = "all")</code>. You can also set the package option <code><a href="AMR-options.html">AMR_eucastrules</a></code>, i.e. run <code>options(AMR_eucastrules = "all")</code>.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="download-our-reference-data">Download Our Reference Data<a class="anchor" aria-label="anchor" href="#download-our-reference-data"></a></h2>
|
||||
|
||||
|
||||
<p>All reference data sets in the AMR package - including information on microorganisms, antimicrobials, and clinical breakpoints - are freely available for download in multiple formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata.</p>
|
||||
<p>For maximum compatibility, we also provide machine-readable, tab-separated plain text files suitable for use in any software, including laboratory information systems.</p>
|
||||
<p>Visit <a href="https://amr-for-r.org/articles/datasets.html">our website for direct download links</a>, or explore the actual files in <a href="https://github.com/msberends/AMR/tree/main/data-raw/datasets" class="external-link">our GitHub repository</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># \donttest{</span></span></span>
|
||||
<span class="r-in"><span><span class="va">a</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> <span class="st">"Staphylococcus aureus"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Enterococcus faecalis"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Escherichia coli"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Klebsiella pneumoniae"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Pseudomonas aeruginosa"</span></span></span>
|
||||
<span class="r-in"><span> <span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> VAN <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Vancomycin</span></span></span>
|
||||
<span class="r-in"><span> AMX <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Amoxicillin</span></span></span>
|
||||
<span class="r-in"><span> COL <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Colistin</span></span></span>
|
||||
<span class="r-in"><span> CAZ <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Ceftazidime</span></span></span>
|
||||
<span class="r-in"><span> CXM <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Cefuroxime</span></span></span>
|
||||
<span class="r-in"><span> PEN <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Benzylpenicillin</span></span></span>
|
||||
<span class="r-in"><span> FOX <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Cefoxitin</span></span></span>
|
||||
<span class="r-in"><span> stringsAsFactors <span class="op">=</span> <span class="cn">FALSE</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">a</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus aureus - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Enterococcus faecalis - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Escherichia coli - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Klebsiella pneumoniae - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Pseudomonas aeruginosa - - - - - S S</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># apply EUCAST rules: some results wil be changed</span></span></span>
|
||||
<span class="r-in"><span><span class="va">b</span> <span class="op"><-</span> <span class="fu">eucast_rules</span><span class="op">(</span><span class="va">a</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`eucast_rules()`</span>: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class 'sir'. Transform them on beforehand, with e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% as.sir(CXM:AMX)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% mutate_if(is_sir_eligible, as.sir)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% mutate(across(where(is_sir_eligible), as.sir))</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">b</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus aureus - S R R S S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Enterococcus faecalis - - R R R S R</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Escherichia coli R - - - - R S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Klebsiella pneumoniae R R - - - R S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Pseudomonas aeruginosa R R - - R R R</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># do not apply EUCAST rules, but rather get a data.frame</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># containing all details about the transformations:</span></span></span>
|
||||
<span class="r-in"><span><span class="va">c</span> <span class="op"><-</span> <span class="fu">eucast_rules</span><span class="op">(</span><span class="va">a</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span>, verbose <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`eucast_rules()`</span>: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class 'sir'. Transform them on beforehand, with e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% as.sir(CXM:AMX)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% mutate_if(is_sir_eligible, as.sir)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - a %>% mutate(across(where(is_sir_eligible), as.sir))</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">c</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> row col mo_fullname old new rule rule_group</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1 AMX Staphylococcus aureus - S Breakpoints</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1 CXM Staphylococcus aureus - S Breakpoints</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1 CAZ Staphylococcus aureus - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1 COL Staphylococcus aureus - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 2 CAZ Enterococcus faecalis - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 2 COL Enterococcus faecalis - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> rule_name</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Staphylococcus</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> rule_source</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 'EUCAST Clinical Breakpoint Tables' v15.0, 2025</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 'EUCAST Clinical Breakpoint Tables' v15.0, 2025</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Dosage guidelines:</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"tobra"</span>, <span class="st">"genta"</span>, <span class="st">"cipro"</span><span class="op">)</span>, <span class="st">"iv"</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Dosages for antimicrobial drugs, as meant for 'EUCAST Clinical Breakpoint</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> Tables' v15.0 (2025). </span><span style="color: #BB0000;">This note will be shown once per session.</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ab name standard_dosage high_dosage eucast_version</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> TOB Tobramycin 6-7 mg/kg x 1 iv <span style="color: #BB0000;">NA</span> 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> GEN Gentamicin 6-7 mg/kg x 1 iv <span style="color: #BB0000;">NA</span> 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> CIP Ciprofloxacin 0.4 g x 2 iv 0.4 g x 3 iv 15</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"tobra"</span>, <span class="st">"genta"</span>, <span class="st">"cipro"</span><span class="op">)</span>, <span class="st">"iv"</span>, version_breakpoints <span class="op">=</span> <span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ab name standard_dosage high_dosage eucast_version</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> TOB Tobramycin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> GEN Gentamicin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> CIP Ciprofloxacin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
||||
<footer><div class="pkgdown-footer-left">
|
||||
<p><code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE" class="external-link">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <a target="_blank" href="https://www.rug.nl" class="external-link">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl" class="external-link">University Medical Center Groningen</a> in The Netherlands.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown-footer-right">
|
||||
<p><a target="_blank" href="https://www.rug.nl" class="external-link"><img src="https://amr-for-r.org/logo_rug.svg" style="max-width: 150px;"></a><a target="_blank" href="https://www.umcg.nl" class="external-link"><img src="https://amr-for-r.org/logo_umcg.svg" style="max-width: 150px;"></a></p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=https://amr-for-r.org/reference/interpretive_rules.html" />
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/interpretive_rules.html">
|
||||
</head>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -154,20 +154,20 @@
|
||||
<span class="r-in"><span><span class="va">df</span> <span class="op"><-</span> <span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></span><span class="op">(</span><span class="fl">2000</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 43 9 7 14 28 40 49 29 19 27 10 44 18 22 42 12 8 36 13 3 46 5 4 35 38</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [26] 16 22 23 16 10 42 13 2 45 18 19 39 32 22 36 40 45 39 40 11 23 25 39 26 23</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [51] 25 12 17 23 30 30 34 16 21 37 40 26 11 7 4 16 43 22 47 37 39 31 25 41 1</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [76] 45 39 23 32 45 20 22 15 14 13 43 9 38 29 6 48 24 21 23 44 19 31 1 3 33</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3</span>
|
||||
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [25] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [37] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [49] TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [73] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [25] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE FALSE</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
|
||||
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
@@ -263,7 +263,7 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 58 14 38 44</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 58 13 37 44</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 26 7 20 23</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 7 4 6 7</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
@@ -297,16 +297,16 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, mo, ward [96]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> patient mo ward flag_episode</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 917895 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 022060 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> C36883 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 5DF436 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 971739 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 488175 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 5DB1C8 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> BC9909 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 5B78D5 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 284FFF <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 473F39 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 917895 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 022060 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> C36883 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 5DF436 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 971739 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 488175 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 5DB1C8 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> BC9909 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 5B78D5 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
|
||||
@@ -178,20 +178,20 @@ x
|
||||
df <- example_isolates[sample(seq_len(2000), size = 100), ]
|
||||
|
||||
get_episode(df$date, episode_days = 60) # indices
|
||||
#> [1] 43 9 7 14 28 40 49 29 19 27 10 44 18 22 42 12 8 36 13 3 46 5 4 35 38
|
||||
#> [26] 16 22 23 16 10 42 13 2 45 18 19 39 32 22 36 40 45 39 40 11 23 25 39 26 23
|
||||
#> [51] 25 12 17 23 30 30 34 16 21 37 40 26 11 7 4 16 43 22 47 37 39 31 25 41 1
|
||||
#> [76] 45 39 23 32 45 20 22 15 14 13 43 9 38 29 6 48 24 21 23 44 19 31 1 3 33
|
||||
#> [1] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34
|
||||
#> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26
|
||||
#> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40
|
||||
#> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3
|
||||
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
|
||||
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
|
||||
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
|
||||
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
|
||||
#> [25] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
|
||||
#> [37] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE
|
||||
#> [49] TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE TRUE
|
||||
#> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE
|
||||
#> [73] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE
|
||||
#> [85] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE
|
||||
#> [97] FALSE FALSE FALSE TRUE
|
||||
#> [25] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
|
||||
#> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
|
||||
#> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE
|
||||
#> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
|
||||
#> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
|
||||
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE
|
||||
#> [97] FALSE FALSE FALSE FALSE
|
||||
|
||||
# filter on results from the third 60-day episode only, using base R
|
||||
df[which(get_episode(df$date, 60) == 3), ]
|
||||
@@ -287,7 +287,7 @@ if (require("dplyr")) {
|
||||
#> # A tibble: 3 × 5
|
||||
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
|
||||
#> <chr> <int> <int> <int> <int>
|
||||
#> 1 Clinical 58 14 38 44
|
||||
#> 1 Clinical 58 13 37 44
|
||||
#> 2 ICU 26 7 20 23
|
||||
#> 3 Outpatient 7 4 6 7
|
||||
|
||||
@@ -321,16 +321,16 @@ if (require("dplyr")) {
|
||||
#> # Groups: patient, mo, ward [96]
|
||||
#> patient mo ward flag_episode
|
||||
#> <chr> <mo> <chr> <lgl>
|
||||
#> 1 917895 B_STPHY_CPTS ICU TRUE
|
||||
#> 2 022060 B_ENTRBC_CLOC ICU TRUE
|
||||
#> 3 C36883 B_ESCHR_COLI Clinical TRUE
|
||||
#> 4 5DF436 B_STPHY_AURS ICU TRUE
|
||||
#> 5 971739 B_STPHY_CONS Clinical TRUE
|
||||
#> 6 488175 B_ESCHR_COLI Clinical TRUE
|
||||
#> 7 5DB1C8 B_STPHY_CPTS Clinical TRUE
|
||||
#> 8 BC9909 B_ENTRBC_CLOC Clinical TRUE
|
||||
#> 9 5B78D5 B_STPHY_AURS Clinical TRUE
|
||||
#> 10 284FFF B_STPHY_EPDR Clinical TRUE
|
||||
#> 1 473F39 B_ESCHR_COLI Clinical TRUE
|
||||
#> 2 917895 B_STPHY_CPTS ICU TRUE
|
||||
#> 3 022060 B_ENTRBC_CLOC ICU TRUE
|
||||
#> 4 C36883 B_ESCHR_COLI Clinical TRUE
|
||||
#> 5 5DF436 B_STPHY_AURS ICU TRUE
|
||||
#> 6 971739 B_STPHY_CONS Clinical TRUE
|
||||
#> 7 488175 B_ESCHR_COLI Clinical TRUE
|
||||
#> 8 5DB1C8 B_STPHY_CPTS Clinical TRUE
|
||||
#> 9 BC9909 B_ENTRBC_CLOC Clinical TRUE
|
||||
#> 10 5B78D5 B_STPHY_AURS Clinical TRUE
|
||||
#> # ℹ 90 more rows
|
||||
# }
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -221,7 +221,7 @@
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> The first warning was:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In argument: `PEN = (function (..., minimum = 30, as_percent = FALSE,</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> only_all_tested = FALSE) ...`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In group 5: `order = "Lactobacillales"` `genus = "Enterococcus"`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In group 5: `order = "Lactobacillales"`, `genus = "Enterococcus"`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> Caused by warning:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #BBBB00;">!</span> Introducing NA: only 14 results available for PEN in group: order =</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> "Lactobacillales", genus = "Enterococcus" (<span style="background-color: #444444;">`minimum`</span> = 30).</span>
|
||||
|
||||
@@ -212,7 +212,7 @@ if (require("dplyr")) {
|
||||
#> The first warning was:
|
||||
#> ℹ In argument: `PEN = (function (..., minimum = 30, as_percent = FALSE,
|
||||
#> only_all_tested = FALSE) ...`.
|
||||
#> ℹ In group 5: `order = "Lactobacillales"` `genus = "Enterococcus"`.
|
||||
#> ℹ In group 5: `order = "Lactobacillales"`, `genus = "Enterococcus"`.
|
||||
#> Caused by warning:
|
||||
#> ! Introducing NA: only 14 results available for PEN in group: order =
|
||||
#> "Lactobacillales", genus = "Enterococcus" (`minimum` = 30).
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -257,6 +257,13 @@
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">age_group</span>, <span class="va">CIP</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu">ggplot_sir</span><span class="op">(</span>x <span class="op">=</span> <span class="st">"age_group"</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>There were 1131 warnings in `mutate()`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> The first warning was:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In argument: `first_isolate = first_isolate()`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> Caused by warning:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #BBBB00;">!</span> in <span style="background-color: #444444;">`as.sir()`</span>: 7 results in column 'first_isolate' truncated (18%) that</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> were invalid antimicrobial interpretations: "."</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> Run `dplyr::last_dplyr_warnings()` to see the 1130 remaining warnings.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>Removed 6 rows containing missing values or values outside the scale range</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> (`geom_col()`).</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>Removed 6 rows containing missing values or values outside the scale range</span>
|
||||
|
||||
@@ -267,6 +267,13 @@ if (require("ggplot2") && require("dplyr")) {
|
||||
select(age_group, CIP) %>%
|
||||
ggplot_sir(x = "age_group")
|
||||
}
|
||||
#> Warning: There were 1131 warnings in `mutate()`.
|
||||
#> The first warning was:
|
||||
#> ℹ In argument: `first_isolate = first_isolate()`.
|
||||
#> Caused by warning:
|
||||
#> ! in `as.sir()`: 7 results in column 'first_isolate' truncated (18%) that
|
||||
#> were invalid antimicrobial interpretations: "."
|
||||
#> ℹ Run `dplyr::last_dplyr_warnings()` to see the 1130 remaining warnings.
|
||||
#> Warning: Removed 6 rows containing missing values or values outside the scale range
|
||||
#> (`geom_col()`).
|
||||
#> Warning: Removed 6 rows containing missing values or values outside the scale range
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -147,7 +147,7 @@
|
||||
</dl></div><div class="section level2">
|
||||
<h2 id="preparing-data-antimicrobial-results">Preparing data: antimicrobial results<a class="anchor" aria-label="anchor" href="#preparing-data-antimicrobial-results"></a></h2>
|
||||
|
||||
<div class="section-desc"><p>With <code><a href="../reference/as.mic.html">as.mic()</a></code> and <code><a href="../reference/as.disk.html">as.disk()</a></code> you can transform your raw input to valid MIC or disk diffusion values. Use <code><a href="../reference/as.sir.html">as.sir()</a></code> for cleaning raw data to let it only contain “R”, “I” and “S”, or to interpret MIC or disk diffusion values as SIR based on the lastest EUCAST and CLSI guidelines. Afterwards, you can extend antibiotic interpretations by applying <a href="https://www.eucast.org/expert_rules_and_intrinsic_resistance/" class="external-link">EUCAST rules</a> with <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>.</p></div>
|
||||
<div class="section-desc"><p>With <code><a href="../reference/as.mic.html">as.mic()</a></code> and <code><a href="../reference/as.disk.html">as.disk()</a></code> you can transform your raw input to valid MIC or disk diffusion values. Use <code><a href="../reference/as.sir.html">as.sir()</a></code> for cleaning raw data to let it only contain “R”, “I” and “S”, or to interpret MIC or disk diffusion values as SIR based on the lastest EUCAST and CLSI guidelines. Afterwards, you can extend antibiotic interpretations by applying <a href="https://www.eucast.org/expert_rules_and_intrinsic_resistance/" class="external-link">EUCAST rules</a> with <code><a href="../reference/interpretive_rules.html">eucast_rules()</a></code>.</p></div>
|
||||
|
||||
<dl></dl></div><div class="section level2">
|
||||
|
||||
@@ -177,10 +177,10 @@
|
||||
|
||||
<dt>
|
||||
|
||||
<code><a href="eucast_rules.html">eucast_rules()</a></code> <code><a href="eucast_rules.html">eucast_dosage()</a></code>
|
||||
<code><a href="interpretive_rules.html">interpretive_rules()</a></code> <code><a href="interpretive_rules.html">eucast_rules()</a></code> <code><a href="interpretive_rules.html">clsi_rules()</a></code> <code><a href="interpretive_rules.html">eucast_dosage()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Apply EUCAST Rules</dd>
|
||||
<dd>Apply Interpretive Rules</dd>
|
||||
|
||||
<dt>
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ guidelines. Afterwards, you can extend antibiotic interpretations by
|
||||
applying [EUCAST
|
||||
rules](https://www.eucast.org/expert_rules_and_intrinsic_resistance/)
|
||||
with
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md).
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
|
||||
- [`as.sir()`](https://amr-for-r.org/reference/as.sir.md)
|
||||
[`NA_sir_`](https://amr-for-r.org/reference/as.sir.md)
|
||||
@@ -146,9 +146,11 @@ with
|
||||
[`NA_disk_`](https://amr-for-r.org/reference/as.disk.md)
|
||||
[`is.disk()`](https://amr-for-r.org/reference/as.disk.md) : Transform
|
||||
Input to Disk Diffusion Diameters
|
||||
- [`eucast_rules()`](https://amr-for-r.org/reference/eucast_rules.md)
|
||||
[`eucast_dosage()`](https://amr-for-r.org/reference/eucast_rules.md) :
|
||||
Apply EUCAST Rules
|
||||
- [`interpretive_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
[`clsi_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
[`eucast_dosage()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
: Apply Interpretive Rules
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/custom_eucast_rules.md)
|
||||
: Define Custom EUCAST Rules
|
||||
|
||||
|
||||
322
reference/interpretive_rules.html
Normal file
322
reference/interpretive_rules.html
Normal file
@@ -0,0 +1,322 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Apply Interpretive Rules — interpretive_rules • AMR (for R)</title><!-- favicons --><link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png"><link rel="icon" type="”image/svg+xml”" href="../favicon.svg"><link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png"><link rel="icon" sizes="any" href="../favicon.ico"><link rel="manifest" href="../site.webmanifest"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/Lato-0.4.10/font.css" rel="stylesheet"><link href="../deps/Fira_Code-0.4.10/font.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet"><script src="../extra.js"></script><meta property="og:title" content="Apply Interpretive Rules — interpretive_rules"><meta name="description" content="WORK IN PROGRESS
|
||||
The interpretive_rules() function is new, to allow CLSI 'rules' too. The old eucast_rules() function will stay as a wrapper, but we need to generalise more parts of the underlying code to allow more than just EUCAST.
|
||||
Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by e.g. the European Committee on Antimicrobial Susceptibility Testing (EUCAST, https://www.eucast.org), see Source. Use eucast_dosage() to get a data.frame with advised dosages of a certain bug-drug combination, which is based on the dosage data set.
|
||||
To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive rules are applied, some AMR-specific rules can be applied at default, see Details."><meta property="og:description" content="WORK IN PROGRESS
|
||||
The interpretive_rules() function is new, to allow CLSI 'rules' too. The old eucast_rules() function will stay as a wrapper, but we need to generalise more parts of the underlying code to allow more than just EUCAST.
|
||||
Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by e.g. the European Committee on Antimicrobial Susceptibility Testing (EUCAST, https://www.eucast.org), see Source. Use eucast_dosage() to get a data.frame with advised dosages of a certain bug-drug combination, which is based on the dosage data set.
|
||||
To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive rules are applied, some AMR-specific rules can be applied at default, see Details."><meta property="og:image" content="https://amr-for-r.org/logo.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-lg fixed-top bg-primary" data-bs-theme="dark" aria-label="Site navigation"><div class="container">
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div id="navbar" class="collapse navbar-collapse ms-3">
|
||||
<ul class="navbar-nav me-auto"><li class="nav-item dropdown">
|
||||
<button class="nav-link dropdown-toggle" type="button" id="dropdown-how-to" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span class="fa fa-question-circle"></span> How to</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdown-how-to"><li><a class="dropdown-item" href="../articles/AMR.html"><span class="fa fa-directions"></span> Conduct AMR Analysis</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/antibiogram.html"><span class="fa fa-file-prescription"></span> Generate Antibiogram (Trad./Syndromic/WISCA)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/AMR_with_tidymodels.html"><span class="fa fa-square-root-variable"></span> Use AMR for Predictive Modelling (tidymodels)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/datasets.html"><span class="fa fa-database"></span> Download Data Sets for Own Use</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/AMR-options.html"><span class="fa fa-gear"></span> Set User- Or Team-specific Package Settings</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/PCA.html"><span class="fa fa-compress"></span> Conduct Principal Component Analysis for AMR</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/mdro.html"><span class="fa fa-skull-crossbones"></span> Determine Multi-Drug Resistance (MDR)</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/WHONET.html"><span class="fa fa-globe-americas"></span> Work with WHONET Data</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply EUCAST Rules</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/mo_property.html"><span class="fa fa-bug"></span> Get Taxonomy of a Microorganism</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/ab_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antibiotic Drug</a></li>
|
||||
<li><a class="dropdown-item" href="../reference/av_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antiviral Drug</a></li>
|
||||
</ul></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../articles/AMR_for_Python.html"><span class="fa fab fa-python"></span> AMR for Python</a></li>
|
||||
<li class="active nav-item"><a class="nav-link" href="../reference/index.html"><span class="fa fa-book-open"></span> Manual</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../authors.html"><span class="fa fa-users"></span> Authors</a></li>
|
||||
</ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
|
||||
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../news/index.html"><span class="fa fa-newspaper"></span> Changelog</a></li>
|
||||
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/msberends/AMR"><span class="fa fa-github"></span> Source Code</a></li>
|
||||
</ul></div>
|
||||
|
||||
|
||||
</div>
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.svg" class="logo" alt=""><h1>Apply Interpretive Rules</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/interpretive_rules.R" class="external-link"><code>R/interpretive_rules.R</code></a></small>
|
||||
<div class="d-none name"><code>interpretive_rules.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p><strong>WORK IN PROGRESS</strong></p>
|
||||
<p><strong>The <code>interpretive_rules()</code> function is new, to allow CLSI 'rules' too. The old <code>eucast_rules()</code> function will stay as a wrapper, but we need to generalise more parts of the underlying code to allow more than just EUCAST.</strong></p>
|
||||
<p>Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by e.g. the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <a href="https://www.eucast.org" class="external-link">https://www.eucast.org</a>), see <em>Source</em>. Use <code>eucast_dosage()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with advised dosages of a certain bug-drug combination, which is based on the <a href="dosage.html">dosage</a> data set.</p>
|
||||
<p>To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive rules are applied, some AMR-specific rules can be applied at default, see <em>Details</em>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">interpretive_rules</span><span class="op">(</span><span class="va">x</span>, col_mo <span class="op">=</span> <span class="cn">NULL</span>, guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>,</span>
|
||||
<span> <span class="st">"EUCAST"</span><span class="op">)</span>, info <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span>,</span>
|
||||
<span> rules <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_interpretive_rules"</span>, default <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"breakpoints"</span>,</span>
|
||||
<span> <span class="st">"expected_phenotypes"</span><span class="op">)</span><span class="op">)</span>, verbose <span class="op">=</span> <span class="cn">FALSE</span>, version_breakpoints <span class="op">=</span> <span class="fl">15</span>,</span>
|
||||
<span> version_expected_phenotypes <span class="op">=</span> <span class="fl">1.2</span>, version_expertrules <span class="op">=</span> <span class="fl">3.3</span>,</span>
|
||||
<span> ampc_cephalosporin_resistance <span class="op">=</span> <span class="cn">NA</span>, only_sir_columns <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/any.html" class="external-link">any</a></span><span class="op">(</span><span class="fu"><a href="as.sir.html">is.sir</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> custom_rules <span class="op">=</span> <span class="cn">NULL</span>, overwrite <span class="op">=</span> <span class="cn">FALSE</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">eucast_rules</span><span class="op">(</span><span class="va">x</span>, rules <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_interpretive_rules"</span>, default <span class="op">=</span></span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"breakpoints"</span>, <span class="st">"expected_phenotypes"</span><span class="op">)</span><span class="op">)</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">clsi_rules</span><span class="op">(</span><span class="va">x</span>, rules <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_interpretive_rules"</span>, default <span class="op">=</span></span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"breakpoints"</span>, <span class="st">"expected_phenotypes"</span><span class="op">)</span><span class="op">)</span>, <span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="va">ab</span>, administration <span class="op">=</span> <span class="st">"iv"</span>, version_breakpoints <span class="op">=</span> <span class="fl">15</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="source">Source<a class="anchor" aria-label="anchor" href="#source"></a></h2>
|
||||
|
||||
<ul><li><p>EUCAST Expert Rules. Version 2.0, 2012.<br>
|
||||
Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility testing.</strong> <em>Clin Microbiol Infect.</em> 2013;19(2):141-60; <a href="https://doi.org/10.1111/j.1469-0691.2011.03703.x" class="external-link">doi:10.1111/j.1469-0691.2011.03703.x</a></p></li>
|
||||
<li><p>EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.3, 2021. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 11.0, 2021. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_11.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
<li><p>EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 12.0, 2022. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_12.0_Breakpoint_Tables.xlsx" class="external-link">(link)</a></p></li>
|
||||
</ul></div>
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg-x">x<a class="anchor" aria-label="anchor" href="#arg-x"></a></dt>
|
||||
<dd><p>A data set with antimicrobials columns, such as <code>amox</code>, <code>AMX</code> and <code>AMC</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-col-mo">col_mo<a class="anchor" aria-label="anchor" href="#arg-col-mo"></a></dt>
|
||||
<dd><p>Column name of the names or codes of the microorganisms (see <code><a href="as.mo.html">as.mo()</a></code>) - the default is the first column of class <code><a href="as.mo.html">mo</a></code>. Values will be coerced using <code><a href="as.mo.html">as.mo()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-guideline">guideline<a class="anchor" aria-label="anchor" href="#arg-guideline"></a></dt>
|
||||
<dd><p>A guideline name, either "EUCAST" (default) or "CLSI". This can be set with the package option <code><a href="AMR-options.html">AMR_guideline</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-info">info<a class="anchor" aria-label="anchor" href="#arg-info"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether progress should be printed to the console - the default is only print while in interactive sessions.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-rules">rules<a class="anchor" aria-label="anchor" href="#arg-rules"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vector that specifies which rules should be applied. Must be one or more of <code>"breakpoints"</code>, <code>"expected_phenotypes"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code>c("breakpoints", "expected_phenotypes")</code>. The default value can be set to another value using the package option <code><a href="AMR-options.html">AMR_interpretive_rules</a></code>: <code>options(AMR_interpretive_rules = "all")</code>. If using <code>"custom"</code>, be sure to fill in argument <code>custom_rules</code> too. Custom rules can be created with <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-verbose">verbose<a class="anchor" aria-label="anchor" href="#arg-verbose"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> 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. Using Verbose mode takes a lot more time.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-breakpoints">version_breakpoints<a class="anchor" aria-label="anchor" href="#arg-version-breakpoints"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Clinical Breakpoints guideline. Can be "15.0", "14.0", "13.1", "12.0", "11.0", or "10.0".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-expected-phenotypes">version_expected_phenotypes<a class="anchor" aria-label="anchor" href="#arg-version-expected-phenotypes"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Expected Phenotypes. Can be "1.2".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-version-expertrules">version_expertrules<a class="anchor" aria-label="anchor" href="#arg-version-expertrules"></a></dt>
|
||||
<dd><p>The version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be "3.3", "3.2", or "3.1".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-ampc-cephalosporin-resistance">ampc_cephalosporin_resistance<a class="anchor" aria-label="anchor" href="#arg-ampc-cephalosporin-resistance"></a></dt>
|
||||
<dd><p>(only applies when <code>rules</code> contains <code>"expert"</code> or <code>"all"</code>) a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is <code>NA</code>. Currently only works when <code>version_expertrules</code> is <code>3.2</code> and higher; these versions of '<em>EUCAST Expert Rules on Enterobacterales</em>' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of <code>NA</code> (the default) for this argument will remove results for these three drugs, while e.g. a value of <code>"R"</code> will make the results for these drugs resistant. Use <code>NULL</code> or <code>FALSE</code> to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using <code>TRUE</code> is equal to using <code>"R"</code>. <br> For <em>EUCAST Expert Rules</em> v3.2, this rule applies to: <em>Citrobacter braakii</em>, <em>Citrobacter freundii</em>, <em>Citrobacter gillenii</em>, <em>Citrobacter murliniae</em>, <em>Citrobacter rodenticum</em>, <em>Citrobacter sedlakii</em>, <em>Citrobacter werkmanii</em>, <em>Citrobacter youngae</em>, <em>Enterobacter</em>, <em>Hafnia alvei</em>, <em>Klebsiella aerogenes</em>, <em>Morganella morganii</em>, <em>Providencia</em>, and <em>Serratia</em>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-only-sir-columns">only_sir_columns<a class="anchor" aria-label="anchor" href="#arg-only-sir-columns"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether only antimicrobial columns must be included that were transformed to class <a href="as.sir.html">sir</a> on beforehand. Defaults to <code>FALSE</code> if no columns of <code>x</code> have a class <a href="as.sir.html">sir</a>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-custom-rules">custom_rules<a class="anchor" aria-label="anchor" href="#arg-custom-rules"></a></dt>
|
||||
<dd><p>Custom rules to apply, created with <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-overwrite">overwrite<a class="anchor" aria-label="anchor" href="#arg-overwrite"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> indicating whether to overwrite existing SIR values (default: <code>FALSE</code>). When <code>FALSE</code>, only non-SIR values are modified (i.e., any value that is not already S, I or R). To ensure compliance with EUCAST guidelines, <strong>this should remain</strong> <code>FALSE</code>, as EUCAST notes often state that an organism "should be tested for susceptibility to individual agents or be reported resistant".</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>Column names of antimicrobials. To automatically detect antimicrobial column names, do not provide any named arguments; <code><a href="guess_ab_col.html">guess_ab_col()</a></code> will then be used for detection. To manually specify a column, provide its name (case-insensitive) as an argument, e.g. <code>AMX = "amoxicillin"</code>. To skip a specific antimicrobial, set it to <code>NULL</code>, e.g. <code>TIC = NULL</code> to exclude ticarcillin. If a manually defined column does not exist in the data, it will be skipped with a warning.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-ab">ab<a class="anchor" aria-label="anchor" href="#arg-ab"></a></dt>
|
||||
<dd><p>Any (vector of) text that can be coerced to a valid antimicrobial drug code with <code><a href="as.ab.html">as.ab()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-administration">administration<a class="anchor" aria-label="anchor" href="#arg-administration"></a></dt>
|
||||
<dd><p>Route of administration, either "", "im", "iv", "oral", or NA.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>The input of <code>x</code>, possibly with edited values of antimicrobials. Or, if <code>verbose = TRUE</code>, a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all original and new values of the affected bug-drug combinations.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p><strong>Note:</strong> This function does not translate MIC values to SIR values. Use <code><a href="as.sir.html">as.sir()</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. <br></p>
|
||||
<p>The file containing all EUCAST rules is located here: <a href="https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv</a>. <strong>Note:</strong> Old taxonomic names are replaced with the current taxonomy where applicable. For example, <em>Ochrobactrum anthropi</em> was renamed to <em>Brucella anthropi</em> in 2020; the original EUCAST rules v3.1 and v3.2 did not yet contain this new taxonomic name. The <code>AMR</code> package contains the full microbial taxonomy updated until June 24th, 2024, see <a href="microorganisms.html">microorganisms</a>.</p><div class="section">
|
||||
<h3 id="custom-rules">Custom Rules<a class="anchor" aria-label="anchor" href="#custom-rules"></a></h3>
|
||||
|
||||
|
||||
<p>Custom rules can be created using <code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>, e.g.:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/custom_eucast_rules.html">custom_eucast_rules</a></span><span class="op">(</span><span class="va">AMC</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&</span> <span class="va">genus</span> <span class="op">==</span> <span class="st">"Klebsiella"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"R"</span>,</span>
|
||||
<span> <span class="va">AMC</span> <span class="op">==</span> <span class="st">"I"</span> <span class="op">&</span> <span class="va">genus</span> <span class="op">==</span> <span class="st">"Klebsiella"</span> <span class="op">~</span> <span class="va">aminopenicillins</span> <span class="op">==</span> <span class="st">"I"</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="../reference/interpretive_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">example_isolates</span>, rules <span class="op">=</span> <span class="st">"custom"</span>, custom_rules <span class="op">=</span> <span class="va">x</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="-other-rules">'Other' Rules<a class="anchor" aria-label="anchor" href="#-other-rules"></a></h3>
|
||||
|
||||
|
||||
<p>Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules, and the reliability of your data (analysis). These rules are:</p><ol><li><p>A drug <strong>with</strong> enzyme inhibitor will be set to S if the same drug <strong>without</strong> enzyme inhibitor is S</p></li>
|
||||
<li><p>A drug <strong>without</strong> enzyme inhibitor will be set to R if the same drug <strong>with</strong> enzyme inhibitor is R</p></li>
|
||||
</ol><p>Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set.</p>
|
||||
<p>Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include <code>"other"</code> to the <code>rules</code> argument, or use <code>eucast_rules(..., rules = "all")</code>. You can also set the package option <code><a href="AMR-options.html">AMR_interpretive_rules</a></code>, i.e. run <code>options(AMR_interpretive_rules = "all")</code>.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="download-our-reference-data">Download Our Reference Data<a class="anchor" aria-label="anchor" href="#download-our-reference-data"></a></h2>
|
||||
|
||||
|
||||
<p>All reference data sets in the AMR package - including information on microorganisms, antimicrobials, and clinical breakpoints - are freely available for download in multiple formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata.</p>
|
||||
<p>For maximum compatibility, we also provide machine-readable, tab-separated plain text files suitable for use in any software, including laboratory information systems.</p>
|
||||
<p>Visit <a href="https://amr-for-r.org/articles/datasets.html">our website for direct download links</a>, or explore the actual files in <a href="https://github.com/msberends/AMR/tree/main/data-raw/datasets" class="external-link">our GitHub repository</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># \donttest{</span></span></span>
|
||||
<span class="r-in"><span><span class="va">a</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> mo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> <span class="st">"Staphylococcus aureus"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Enterococcus faecalis"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Escherichia coli"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Klebsiella pneumoniae"</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="st">"Pseudomonas aeruginosa"</span></span></span>
|
||||
<span class="r-in"><span> <span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> VAN <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Vancomycin</span></span></span>
|
||||
<span class="r-in"><span> AMX <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Amoxicillin</span></span></span>
|
||||
<span class="r-in"><span> COL <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Colistin</span></span></span>
|
||||
<span class="r-in"><span> CAZ <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Ceftazidime</span></span></span>
|
||||
<span class="r-in"><span> CXM <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Cefuroxime</span></span></span>
|
||||
<span class="r-in"><span> PEN <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Benzylpenicillin</span></span></span>
|
||||
<span class="r-in"><span> FOX <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Cefoxitin</span></span></span>
|
||||
<span class="r-in"><span> stringsAsFactors <span class="op">=</span> <span class="cn">FALSE</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">a</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus aureus - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Enterococcus faecalis - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Escherichia coli - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Klebsiella pneumoniae - - - - - S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Pseudomonas aeruginosa - - - - - S S</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># apply EUCAST rules: some results wil be changed</span></span></span>
|
||||
<span class="r-in"><span><span class="va">b</span> <span class="op"><-</span> <span class="fu">eucast_rules</span><span class="op">(</span><span class="va">a</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`eucast_rules()`</span>: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class 'sir'. Transform them on beforehand, with e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% as.sir(CXM:AMX)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% mutate_if(is_sir_eligible, as.sir)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% mutate(across(where(is_sir_eligible), as.sir))</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">b</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> mo VAN AMX COL CAZ CXM PEN FOX</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus aureus - S R R S S S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Enterococcus faecalis - - R R R S R</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Escherichia coli R - - - - R S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Klebsiella pneumoniae R R - - - R S</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Pseudomonas aeruginosa R R - - R R R</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># do not apply EUCAST rules, but rather get a data.frame</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># containing all details about the transformations:</span></span></span>
|
||||
<span class="r-in"><span><span class="va">c</span> <span class="op"><-</span> <span class="fu">eucast_rules</span><span class="op">(</span><span class="va">a</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span>, verbose <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`eucast_rules()`</span>: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class 'sir'. Transform them on beforehand, with e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% as.sir(CXM:AMX)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% mutate_if(is_sir_eligible, as.sir)</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> - x %>% mutate(across(where(is_sir_eligible), as.sir))</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">c</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> row col mo_fullname old new rule rule_group</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1 AMX Staphylococcus aureus - S Breakpoints</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1 CXM Staphylococcus aureus - S Breakpoints</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1 CAZ Staphylococcus aureus - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1 COL Staphylococcus aureus - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 2 CAZ Enterococcus faecalis - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 2 COL Enterococcus faecalis - R Expected phenotypes</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> rule_name</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 Staphylococcus</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 Staphylococcus</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 Table 4: Expected resistant phenotype in gram-positive bacteria</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> rule_source</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 'EUCAST Clinical Breakpoint Tables' v15.0, 2025</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 'EUCAST Clinical Breakpoint Tables' v15.0, 2025</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 'EUCAST Expected Resistant Phenotypes' v1.2, 2023</span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Dosage guidelines:</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"tobra"</span>, <span class="st">"genta"</span>, <span class="st">"cipro"</span><span class="op">)</span>, <span class="st">"iv"</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Dosages for antimicrobial drugs, as meant for 'EUCAST Clinical Breakpoint</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> Tables' v15.0 (2025). </span><span style="color: #BB0000;">This note will be shown once per session.</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ab name standard_dosage high_dosage eucast_version</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> TOB Tobramycin 6-7 mg/kg x 1 iv <span style="color: #BB0000;">NA</span> 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> GEN Gentamicin 6-7 mg/kg x 1 iv <span style="color: #BB0000;">NA</span> 15</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> CIP Ciprofloxacin 0.4 g x 2 iv 0.4 g x 3 iv 15</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">eucast_dosage</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"tobra"</span>, <span class="st">"genta"</span>, <span class="st">"cipro"</span><span class="op">)</span>, <span class="st">"iv"</span>, version_breakpoints <span class="op">=</span> <span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ab name standard_dosage high_dosage eucast_version</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><ab></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> TOB Tobramycin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> GEN Gentamicin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> CIP Ciprofloxacin <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
||||
<footer><div class="pkgdown-footer-left">
|
||||
<p><code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE" class="external-link">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <a target="_blank" href="https://www.rug.nl" class="external-link">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl" class="external-link">University Medical Center Groningen</a> in The Netherlands.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown-footer-right">
|
||||
<p><a target="_blank" href="https://www.rug.nl" class="external-link"><img src="https://amr-for-r.org/logo_rug.svg" style="max-width: 150px;"></a><a target="_blank" href="https://www.umcg.nl" class="external-link"><img src="https://amr-for-r.org/logo_umcg.svg" style="max-width: 150px;"></a></p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
@@ -1,26 +1,41 @@
|
||||
# Apply EUCAST Rules
|
||||
# Apply Interpretive Rules
|
||||
|
||||
**WORK IN PROGRESS**
|
||||
|
||||
**The `interpretive_rules()` function is new, to allow CLSI 'rules' too.
|
||||
The old `eucast_rules()` function will stay as a wrapper, but we need to
|
||||
generalise more parts of the underlying code to allow more than just
|
||||
EUCAST.**
|
||||
|
||||
Apply rules from clinical breakpoints notes and expected resistant
|
||||
phenotypes as defined by the European Committee on Antimicrobial
|
||||
phenotypes as defined by e.g. the European Committee on Antimicrobial
|
||||
Susceptibility Testing (EUCAST, <https://www.eucast.org>), see *Source*.
|
||||
Use `eucast_dosage()` to get a
|
||||
[data.frame](https://rdrr.io/r/base/data.frame.html) with advised
|
||||
dosages of a certain bug-drug combination, which is based on the
|
||||
[dosage](https://amr-for-r.org/reference/dosage.md) data set.
|
||||
|
||||
To improve the interpretation of the antibiogram before EUCAST rules are
|
||||
applied, some non-EUCAST rules can applied at default, see *Details*.
|
||||
To improve the interpretation of the antibiogram before CLSI/EUCAST
|
||||
interpretive rules are applied, some AMR-specific rules can be applied
|
||||
at default, see *Details*.
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
eucast_rules(x, col_mo = NULL, info = interactive(),
|
||||
rules = getOption("AMR_eucastrules", default = c("breakpoints",
|
||||
interpretive_rules(x, col_mo = NULL, guideline = getOption("AMR_guideline",
|
||||
"EUCAST"), info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints",
|
||||
"expected_phenotypes")), verbose = FALSE, version_breakpoints = 15,
|
||||
version_expected_phenotypes = 1.2, version_expertrules = 3.3,
|
||||
ampc_cephalosporin_resistance = NA, only_sir_columns = any(is.sir(x)),
|
||||
custom_rules = NULL, overwrite = FALSE, ...)
|
||||
|
||||
eucast_rules(x, rules = getOption("AMR_interpretive_rules", default =
|
||||
c("breakpoints", "expected_phenotypes")), ...)
|
||||
|
||||
clsi_rules(x, rules = getOption("AMR_interpretive_rules", default =
|
||||
c("breakpoints", "expected_phenotypes")), ...)
|
||||
|
||||
eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
```
|
||||
|
||||
@@ -72,6 +87,12 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
[`mo`](https://amr-for-r.org/reference/as.mo.md). Values will be
|
||||
coerced using [`as.mo()`](https://amr-for-r.org/reference/as.mo.md).
|
||||
|
||||
- guideline:
|
||||
|
||||
A guideline name, either "EUCAST" (default) or "CLSI". This can be set
|
||||
with the package option
|
||||
[`AMR_guideline`](https://amr-for-r.org/reference/AMR-options.md).
|
||||
|
||||
- info:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
@@ -86,9 +107,10 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
`"custom"`, `"all"`, and defaults to
|
||||
`c("breakpoints", "expected_phenotypes")`. The default value can be
|
||||
set to another value using the package option
|
||||
[`AMR_eucastrules`](https://amr-for-r.org/reference/AMR-options.md):
|
||||
`options(AMR_eucastrules = "all")`. If using `"custom"`, be sure to
|
||||
fill in argument `custom_rules` too. Custom rules can be created with
|
||||
[`AMR_interpretive_rules`](https://amr-for-r.org/reference/AMR-options.md):
|
||||
`options(AMR_interpretive_rules = "all")`. If using `"custom"`, be
|
||||
sure to fill in argument `custom_rules` too. Custom rules can be
|
||||
created with
|
||||
[`custom_eucast_rules()`](https://amr-for-r.org/reference/custom_eucast_rules.md).
|
||||
|
||||
- verbose:
|
||||
@@ -179,7 +201,7 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
|
||||
- administration:
|
||||
|
||||
Route of administration, either "", "im", "iv", or "oral".
|
||||
Route of administration, either "", "im", "iv", "oral", or NA.
|
||||
|
||||
## Value
|
||||
|
||||
@@ -237,8 +259,8 @@ Since these rules are not officially approved by EUCAST, they are not
|
||||
applied at default. To use these rules, include `"other"` to the `rules`
|
||||
argument, or use `eucast_rules(..., rules = "all")`. You can also set
|
||||
the package option
|
||||
[`AMR_eucastrules`](https://amr-for-r.org/reference/AMR-options.md),
|
||||
i.e. run `options(AMR_eucastrules = "all")`.
|
||||
[`AMR_interpretive_rules`](https://amr-for-r.org/reference/AMR-options.md),
|
||||
i.e. run `options(AMR_interpretive_rules = "all")`.
|
||||
|
||||
## Download Our Reference Data
|
||||
|
||||
@@ -291,9 +313,9 @@ head(a)
|
||||
b <- eucast_rules(a, overwrite = TRUE)
|
||||
#> Warning: in `eucast_rules()`: not all columns with antimicrobial results are of
|
||||
#> class 'sir'. Transform them on beforehand, with e.g.:
|
||||
#> - a %>% as.sir(CXM:AMX)
|
||||
#> - a %>% mutate_if(is_sir_eligible, as.sir)
|
||||
#> - a %>% mutate(across(where(is_sir_eligible), as.sir))
|
||||
#> - x %>% as.sir(CXM:AMX)
|
||||
#> - x %>% mutate_if(is_sir_eligible, as.sir)
|
||||
#> - x %>% mutate(across(where(is_sir_eligible), as.sir))
|
||||
|
||||
head(b)
|
||||
#> mo VAN AMX COL CAZ CXM PEN FOX
|
||||
@@ -309,9 +331,9 @@ head(b)
|
||||
c <- eucast_rules(a, overwrite = TRUE, verbose = TRUE)
|
||||
#> Warning: in `eucast_rules()`: not all columns with antimicrobial results are of
|
||||
#> class 'sir'. Transform them on beforehand, with e.g.:
|
||||
#> - a %>% as.sir(CXM:AMX)
|
||||
#> - a %>% mutate_if(is_sir_eligible, as.sir)
|
||||
#> - a %>% mutate(across(where(is_sir_eligible), as.sir))
|
||||
#> - x %>% as.sir(CXM:AMX)
|
||||
#> - x %>% mutate_if(is_sir_eligible, as.sir)
|
||||
#> - x %>% mutate(across(where(is_sir_eligible), as.sir))
|
||||
head(c)
|
||||
#> row col mo_fullname old new rule rule_group
|
||||
#> 1 1 AMX Staphylococcus aureus - S Breakpoints
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -95,7 +95,7 @@
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p><strong>Note:</strong> As opposed to the <code>join()</code> functions of <code>dplyr</code>, <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix.</p>
|
||||
<p>If the <code>dplyr</code> package is installed, their join functions will be used. Otherwise, the much slower <code><a href="https://rdatatable.gitlab.io/data.table/reference/merge.html" class="external-link">merge()</a></code> and <code><a href="https://rdrr.io/r/base/interaction.html" class="external-link">interaction()</a></code> functions from base <span style="R">R</span> will be used.</p>
|
||||
<p>If the <code>dplyr</code> package is installed, their join functions will be used. Otherwise, the much slower <code><a href="https://rdrr.io/pkg/data.table/man/merge.html" class="external-link">merge()</a></code> and <code><a href="https://rdrr.io/r/base/interaction.html" class="external-link">interaction()</a></code> functions from base <span style="R">R</span> will be used.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
|
||||
@@ -66,8 +66,8 @@ joined columns will not get a suffix.
|
||||
|
||||
If the `dplyr` package is installed, their join functions will be used.
|
||||
Otherwise, the much slower
|
||||
[`merge()`](https://rdatatable.gitlab.io/data.table/reference/merge.html)
|
||||
and [`interaction()`](https://rdrr.io/r/base/interaction.html) functions
|
||||
[`merge()`](https://rdrr.io/pkg/data.table/man/merge.html) and
|
||||
[`interaction()`](https://rdrr.io/r/base/interaction.html) functions
|
||||
from base R will be used.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -168,10 +168,14 @@
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># those strings can be compared with:</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">antimicrobials_equal</span><span class="op">(</span><span class="va">strainA</span>, <span class="va">strainB</span>, type <span class="op">=</span> <span class="st">"keyantimicrobials"</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`as.sir()`</span>: 4 results truncated (33%) that were invalid antimicrobial</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> interpretations: "."</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE</span>
|
||||
<span class="r-in"><span><span class="co"># TRUE, because I is ignored (as well as missing values)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">antimicrobials_equal</span><span class="op">(</span><span class="va">strainA</span>, <span class="va">strainB</span>, type <span class="op">=</span> <span class="st">"keyantimicrobials"</span>, ignore_I <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`as.sir()`</span>: 4 results truncated (33%) that were invalid antimicrobial</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> interpretations: "."</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] FALSE</span>
|
||||
<span class="r-in"><span><span class="co"># FALSE, because I is not ignored and so the 4th [character] differs</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
@@ -191,6 +195,14 @@
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/sum.html" class="external-link">sum</a></span><span class="op">(</span><span class="va">my_patients</span><span class="op">$</span><span class="va">first_regular</span>, na.rm <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/sum.html" class="external-link">sum</a></span><span class="op">(</span><span class="va">my_patients</span><span class="op">$</span><span class="va">first_weighted</span>, na.rm <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>There were 823 warnings in `mutate()`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> The first warning was:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In argument: `first_weighted = first_isolate(col_keyantimicrobials =</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> "keyab")`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> Caused by warning:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #BBBB00;">!</span> in <span style="background-color: #444444;">`as.sir()`</span>: 1 result in column 'first_weighted' truncated (8%) that were</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> invalid antimicrobial interpretations: "."</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> Run `dplyr::last_dplyr_warnings()` to see the 822 remaining warnings.</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1383</span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
|
||||
@@ -195,10 +195,14 @@ strainB <- "SSSIRSSSRSSS"
|
||||
|
||||
# those strings can be compared with:
|
||||
antimicrobials_equal(strainA, strainB, type = "keyantimicrobials")
|
||||
#> Warning: in `as.sir()`: 4 results truncated (33%) that were invalid antimicrobial
|
||||
#> interpretations: "."
|
||||
#> [1] TRUE
|
||||
# TRUE, because I is ignored (as well as missing values)
|
||||
|
||||
antimicrobials_equal(strainA, strainB, type = "keyantimicrobials", ignore_I = FALSE)
|
||||
#> Warning: in `as.sir()`: 4 results truncated (33%) that were invalid antimicrobial
|
||||
#> interpretations: "."
|
||||
#> [1] FALSE
|
||||
# FALSE, because I is not ignored and so the 4th [character] differs
|
||||
|
||||
@@ -218,6 +222,14 @@ if (require("dplyr")) {
|
||||
sum(my_patients$first_regular, na.rm = TRUE)
|
||||
sum(my_patients$first_weighted, na.rm = TRUE)
|
||||
}
|
||||
#> Warning: There were 823 warnings in `mutate()`.
|
||||
#> The first warning was:
|
||||
#> ℹ In argument: `first_weighted = first_isolate(col_keyantimicrobials =
|
||||
#> "keyab")`.
|
||||
#> Caused by warning:
|
||||
#> ! in `as.sir()`: 1 result in column 'first_weighted' truncated (8%) that were
|
||||
#> invalid antimicrobial interpretations: "."
|
||||
#> ℹ Run `dplyr::last_dplyr_warnings()` to see the 822 remaining warnings.
|
||||
#> [1] 1383
|
||||
# }
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -91,9 +91,9 @@
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 3.069947</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 2.985485</span>
|
||||
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] -0.02599697</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.01413942</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
||||
@@ -45,7 +45,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE)
|
||||
|
||||
``` r
|
||||
kurtosis(rnorm(10000))
|
||||
#> [1] 3.069947
|
||||
#> [1] 2.985485
|
||||
kurtosis(rnorm(10000), excess = TRUE)
|
||||
#> [1] -0.02599697
|
||||
#> [1] 0.01413942
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -143,13 +143,13 @@
|
||||
<ul><li><p>If <code>verbose</code> is set to <code>TRUE</code>:<br>
|
||||
A <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> containing columns <code>row_number</code>, <code>microorganism</code>, <code>MDRO</code>, <code>reason</code>, <code>all_nonsusceptible_columns</code>, <code>guideline</code></p></li>
|
||||
<li><p>CMI 2012 paper - function <code>mdr_cmi2012()</code> or <code>mdro()</code>:<br>
|
||||
Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Multi-drug-resistant (MDR)</code> < <code>Extensively drug-resistant (XDR)</code> < <code>Pandrug-resistant (PDR)</code></p></li>
|
||||
Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Multi-drug-resistant (MDR)</code> < <code>Extensively drug-resistant (XDR)</code> < <code>Pandrug-resistant (PDR)</code></p></li>
|
||||
<li><p>TB guideline - function <code>mdr_tb()</code> or <code>mdro(..., guideline = "TB")</code>:<br>
|
||||
Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Mono-resistant</code> < <code>Poly-resistant</code> < <code>Multi-drug-resistant</code> < <code>Extensively drug-resistant</code></p></li>
|
||||
Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Mono-resistant</code> < <code>Poly-resistant</code> < <code>Multi-drug-resistant</code> < <code>Extensively drug-resistant</code></p></li>
|
||||
<li><p>German guideline - function <code>mrgn()</code> or <code>mdro(..., guideline = "MRGN")</code>:<br>
|
||||
Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>3MRGN</code> < <code>4MRGN</code></p></li>
|
||||
Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>3MRGN</code> < <code>4MRGN</code></p></li>
|
||||
<li><p>Everything else, except for custom guidelines:<br>
|
||||
Ordered <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Positive, unconfirmed</code> < <code>Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. genotypic) tests</p></li>
|
||||
Ordered <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with levels <code>Negative</code> < <code>Positive, unconfirmed</code> < <code>Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. genotypic) tests</p></li>
|
||||
</ul></div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
|
||||
@@ -145,31 +145,26 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = any(is.sir(x)),
|
||||
`all_nonsusceptible_columns`, `guideline`
|
||||
|
||||
- CMI 2012 paper - function `mdr_cmi2012()` or `mdro()`:
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with levels `Negative` \< `Multi-drug-resistant (MDR)` \<
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
levels `Negative` \< `Multi-drug-resistant (MDR)` \<
|
||||
`Extensively drug-resistant (XDR)` \< `Pandrug-resistant (PDR)`
|
||||
|
||||
- TB guideline - function `mdr_tb()` or `mdro(..., guideline = "TB")`:
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with levels `Negative` \< `Mono-resistant` \< `Poly-resistant` \<
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
levels `Negative` \< `Mono-resistant` \< `Poly-resistant` \<
|
||||
`Multi-drug-resistant` \< `Extensively drug-resistant`
|
||||
|
||||
- German guideline - function `mrgn()` or
|
||||
`mdro(..., guideline = "MRGN")`:
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with levels `Negative` \< `3MRGN` \< `4MRGN`
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
levels `Negative` \< `3MRGN` \< `4MRGN`
|
||||
|
||||
- Everything else, except for custom guidelines:
|
||||
Ordered
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with levels `Negative` \< `Positive, unconfirmed` \< `Positive`. The
|
||||
value `"Positive, unconfirmed"` means that, according to the
|
||||
guideline, it is not entirely sure if the isolate is multi-drug
|
||||
resistant and this should be confirmed with additional (e.g.
|
||||
genotypic) tests
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
levels `Negative` \< `Positive, unconfirmed` \< `Positive`. The value
|
||||
`"Positive, unconfirmed"` means that, according to the guideline, it
|
||||
is not entirely sure if the isolate is multi-drug resistant and this
|
||||
should be confirmed with additional (e.g. genotypic) tests
|
||||
|
||||
## Details
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -110,30 +110,31 @@
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_sir</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">sir</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'sir'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] R R I R I I S R S I</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] R I R I I S R S I I</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">sir</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967 -0.7745967</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [8] -0.621059 -0.621059 -0.621059</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">mic</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">mic</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'mic'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.032 0.5 1 >=8 4 0.016 >=8 1 0.004 0.008</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.25 0.5 8 2 0.004 4 1 0.001 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [9] 0.004 <=0.0005</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">mic</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] -0.7311752 0.2104422 0.4478776 1.1601837 0.9227483 -0.9686106</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 1.1601837 0.4478776 -1.4434813 -1.2060459</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
|
||||
<span class="r-in"><span><span class="co"># equal to the Z-score of their log2:</span></span></span>
|
||||
<span class="r-in"><span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span> <span class="op">-</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] -0.7311752 0.2104422 0.4478776 1.1601837 0.9227483 -0.9686106</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 1.1601837 0.4478776 -1.4434813 -1.2060459</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">disk</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_disk</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">disk</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'disk'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 50 49 38 33 31 17 42 43 46 37</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 49 38 33 31 17 42 43 46 37 46</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">disk</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.15131286 1.05032051 -0.06059541 -0.56555720 -0.76754191 -2.18143490</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.34337401 0.44436637 0.74734344 -0.16158777</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.50734427 0.82443445 -0.12683607 0.82443445</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">y</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> id <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>,</span></span>
|
||||
@@ -144,35 +145,35 @@
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">y</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A I 27 >=2 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B S 28 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 33 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D R 32 1 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 25 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F I 19 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G S 23 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H R 27 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I S 29 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A S 28 >=2 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B R 33 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 32 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 25 1 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 19 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F S 23 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G R 27 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 32 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J R 32 0.5 16</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> and "tobr"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.08471751 -0.21572693 0.55391610 0.98093500 -0.26046456 -1.08721162</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] -0.37467261 -0.14625651 -0.15862291 0.62338653</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.25870477 -0.59093836 0.40418392 0.53075837</span>
|
||||
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op"><-</span> <span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span>, <span class="fu"><a href="as.mic.html">is.mic</a></span><span class="op">(</span><span class="va">y</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "gent" and "tobr"</span></span>
|
||||
<span class="r-in"><span><span class="va">y</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></span><span class="op">(</span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr amr_distance</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F I 19 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H R 27 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B S 28 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 33 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I S 29 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 25 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G S 23 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F S 23 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B R 33 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 32 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 32 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 19 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G R 27 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J R 32 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A I 27 >=2 8 0.6138374</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D R 32 1 16 0.8669863</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A S 28 >=2 8 0.6138374</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 25 1 16 0.8669863</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">y</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span></span>
|
||||
@@ -185,16 +186,16 @@
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> and "tobr"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr amr_distance check_id_C</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 C R 33 1 8 0.55391610 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 J R 32 0.5 16 0.62338653 0.06947042</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 D R 32 1 16 0.98093500 0.42701889</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 A I 27 >=2 8 0.08471751 0.46919859</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 H R 27 0.5 8 -0.14625651 0.70017262</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 I S 29 1 8 -0.15862291 0.71253901</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 B S 28 1 8 -0.21572693 0.76964304</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 E I 25 0.5 16 -0.26046456 0.81438066</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 G S 23 0.5 16 -0.37467261 0.92858871</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 F I 19 0.5 8 -1.08721162 1.64112773</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 C R 32 1 8 0.40418392 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 I R 32 1 8 0.40418392 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 B R 33 1 8 0.45859464 0.05441072</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 J R 32 0.5 16 0.53075837 0.12657445</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 G R 27 0.5 16 0.25870477 0.14547915</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 A S 28 >=2 8 0.06974787 0.33443605</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 D I 25 1 16 0.03309016 0.37109376</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8 -0.59093836 0.99512228</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 E I 19 0.5 16 -0.65092262 1.05510655</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 F S 23 0.5 8 -0.91740267 1.32158659</span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span></span>
|
||||
|
||||
@@ -85,30 +85,31 @@ suspicious.
|
||||
sir <- random_sir(10)
|
||||
sir
|
||||
#> Class 'sir'
|
||||
#> [1] R R I R I I S R S I
|
||||
#> [1] R I R I I S R S I I
|
||||
mean_amr_distance(sir)
|
||||
#> [1] 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967 -0.7745967
|
||||
#> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967
|
||||
#> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138
|
||||
#> [8] -0.621059 -0.621059 -0.621059
|
||||
|
||||
mic <- random_mic(10)
|
||||
mic
|
||||
#> Class 'mic'
|
||||
#> [1] 0.032 0.5 1 >=8 4 0.016 >=8 1 0.004 0.008
|
||||
#> [1] 0.25 0.5 8 2 0.004 4 1 0.001
|
||||
#> [9] 0.004 <=0.0005
|
||||
mean_amr_distance(mic)
|
||||
#> [1] -0.7311752 0.2104422 0.4478776 1.1601837 0.9227483 -0.9686106
|
||||
#> [7] 1.1601837 0.4478776 -1.4434813 -1.2060459
|
||||
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
|
||||
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
|
||||
# equal to the Z-score of their log2:
|
||||
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
|
||||
#> [1] -0.7311752 0.2104422 0.4478776 1.1601837 0.9227483 -0.9686106
|
||||
#> [7] 1.1601837 0.4478776 -1.4434813 -1.2060459
|
||||
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
|
||||
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
|
||||
|
||||
disk <- random_disk(10)
|
||||
disk
|
||||
#> Class 'disk'
|
||||
#> [1] 50 49 38 33 31 17 42 43 46 37
|
||||
#> [1] 49 38 33 31 17 42 43 46 37 46
|
||||
mean_amr_distance(disk)
|
||||
#> [1] 1.15131286 1.05032051 -0.06059541 -0.56555720 -0.76754191 -2.18143490
|
||||
#> [7] 0.34337401 0.44436637 0.74734344 -0.16158777
|
||||
#> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755
|
||||
#> [7] 0.50734427 0.82443445 -0.12683607 0.82443445
|
||||
|
||||
y <- data.frame(
|
||||
id = LETTERS[1:10],
|
||||
@@ -119,35 +120,35 @@ y <- data.frame(
|
||||
)
|
||||
y
|
||||
#> id amox cipr gent tobr
|
||||
#> 1 A I 27 >=2 8
|
||||
#> 2 B S 28 1 8
|
||||
#> 3 C R 33 1 8
|
||||
#> 4 D R 32 1 16
|
||||
#> 5 E I 25 0.5 16
|
||||
#> 6 F I 19 0.5 8
|
||||
#> 7 G S 23 0.5 16
|
||||
#> 8 H R 27 0.5 8
|
||||
#> 9 I S 29 1 8
|
||||
#> 1 A S 28 >=2 8
|
||||
#> 2 B R 33 1 8
|
||||
#> 3 C R 32 1 8
|
||||
#> 4 D I 25 1 16
|
||||
#> 5 E I 19 0.5 16
|
||||
#> 6 F S 23 0.5 8
|
||||
#> 7 G R 27 0.5 16
|
||||
#> 8 H S 29 0.5 8
|
||||
#> 9 I R 32 1 8
|
||||
#> 10 J R 32 0.5 16
|
||||
mean_amr_distance(y)
|
||||
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",
|
||||
#> and "tobr"
|
||||
#> [1] 0.08471751 -0.21572693 0.55391610 0.98093500 -0.26046456 -1.08721162
|
||||
#> [7] -0.37467261 -0.14625651 -0.15862291 0.62338653
|
||||
#> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267
|
||||
#> [7] 0.25870477 -0.59093836 0.40418392 0.53075837
|
||||
y$amr_distance <- mean_amr_distance(y, is.mic(y))
|
||||
#> ℹ Calculating mean AMR distance based on columns "gent" and "tobr"
|
||||
y[order(y$amr_distance), ]
|
||||
#> id amox cipr gent tobr amr_distance
|
||||
#> 6 F I 19 0.5 8 -0.8163565
|
||||
#> 8 H R 27 0.5 8 -0.8163565
|
||||
#> 2 B S 28 1 8 -0.1012596
|
||||
#> 3 C R 33 1 8 -0.1012596
|
||||
#> 9 I S 29 1 8 -0.1012596
|
||||
#> 5 E I 25 0.5 16 0.1518893
|
||||
#> 7 G S 23 0.5 16 0.1518893
|
||||
#> 6 F S 23 0.5 8 -0.8163565
|
||||
#> 8 H S 29 0.5 8 -0.8163565
|
||||
#> 2 B R 33 1 8 -0.1012596
|
||||
#> 3 C R 32 1 8 -0.1012596
|
||||
#> 9 I R 32 1 8 -0.1012596
|
||||
#> 5 E I 19 0.5 16 0.1518893
|
||||
#> 7 G R 27 0.5 16 0.1518893
|
||||
#> 10 J R 32 0.5 16 0.1518893
|
||||
#> 1 A I 27 >=2 8 0.6138374
|
||||
#> 4 D R 32 1 16 0.8669863
|
||||
#> 1 A S 28 >=2 8 0.6138374
|
||||
#> 4 D I 25 1 16 0.8669863
|
||||
|
||||
if (require("dplyr")) {
|
||||
y %>%
|
||||
@@ -160,16 +161,16 @@ if (require("dplyr")) {
|
||||
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",
|
||||
#> and "tobr"
|
||||
#> id amox cipr gent tobr amr_distance check_id_C
|
||||
#> 1 C R 33 1 8 0.55391610 0.00000000
|
||||
#> 2 J R 32 0.5 16 0.62338653 0.06947042
|
||||
#> 3 D R 32 1 16 0.98093500 0.42701889
|
||||
#> 4 A I 27 >=2 8 0.08471751 0.46919859
|
||||
#> 5 H R 27 0.5 8 -0.14625651 0.70017262
|
||||
#> 6 I S 29 1 8 -0.15862291 0.71253901
|
||||
#> 7 B S 28 1 8 -0.21572693 0.76964304
|
||||
#> 8 E I 25 0.5 16 -0.26046456 0.81438066
|
||||
#> 9 G S 23 0.5 16 -0.37467261 0.92858871
|
||||
#> 10 F I 19 0.5 8 -1.08721162 1.64112773
|
||||
#> 1 C R 32 1 8 0.40418392 0.00000000
|
||||
#> 2 I R 32 1 8 0.40418392 0.00000000
|
||||
#> 3 B R 33 1 8 0.45859464 0.05441072
|
||||
#> 4 J R 32 0.5 16 0.53075837 0.12657445
|
||||
#> 5 G R 27 0.5 16 0.25870477 0.14547915
|
||||
#> 6 A S 28 >=2 8 0.06974787 0.33443605
|
||||
#> 7 D I 25 1 16 0.03309016 0.37109376
|
||||
#> 8 H S 29 0.5 8 -0.59093836 0.99512228
|
||||
#> 9 E I 19 0.5 16 -0.65092262 1.05510655
|
||||
#> 10 F S 23 0.5 8 -0.91740267 1.32158659
|
||||
if (require("dplyr")) {
|
||||
# support for groups
|
||||
example_isolates %>%
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -69,7 +69,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
|
||||
<li><p><code>kingdom</code>, <code>phylum</code>, <code>class</code>, <code>order</code>, <code>family</code>, <code>genus</code>, <code>species</code>, <code>subspecies</code><br> Taxonomic rank of the microorganism. Note that for fungi, <em>phylum</em> is equal to their taxonomic <em>division</em>. Also, for fungi, <em>subkingdom</em> and <em>subdivision</em> were left out since they do not occur in the bacterial taxonomy.</p></li>
|
||||
<li><p><code>rank</code><br> Text of the taxonomic rank of the microorganism, such as <code>"species"</code> or <code>"genus"</code></p></li>
|
||||
<li><p><code>ref</code><br> Author(s) and year of related scientific publication. This contains only the <em>first surname</em> and year of the <em>latest</em> authors, e.g. "Wallis <em>et al.</em> 2006 <em>emend.</em> Smith and Jones 2018" becomes "Smith <em>et al.</em>, 2018". This field is directly retrieved from the source specified in the column <code>source</code>. Moreover, accents were removed to comply with CRAN that only allows ASCII characters.</p></li>
|
||||
<li><p><code>oxygen_tolerance</code> <br> Oxygen tolerance, either "aerobe", "anaerobe", "anaerobe/microaerophile", "facultative anaerobe", "likely facultative anaerobe", or "microaerophile". These data were retrieved from BacDive (see <em>Source</em>). Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus to guess the oxygen tolerance. Currently 68.3% of all ~39 000 bacteria in the data set contain an oxygen tolerance.</p></li>
|
||||
<li><p><code>oxygen_tolerance</code> <br> Oxygen tolerance, either "aerobe", "anaerobe", "anaerobe/microaerophile", "facultative anaerobe", "likely facultative anaerobe", "microaerophile", or NA. These data were retrieved from BacDive (see <em>Source</em>). Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus to guess the oxygen tolerance. Currently 68.3% of all ~39 000 bacteria in the data set contain an oxygen tolerance.</p></li>
|
||||
<li><p><code>source</code><br> Either "GBIF", "LPSN", "Manually added", "MycoBank", or "manually added" (see <em>Source</em>)</p></li>
|
||||
<li><p><code>lpsn</code><br> Identifier ('Record number') of List of Prokaryotic names with Standing in Nomenclature (LPSN). This will be the first/highest LPSN identifier to keep one identifier per row. For example, <em>Acetobacter ascendens</em> has LPSN Record number 7864 and 11011. Only the first is available in the <code>microorganisms</code> data set. <em><strong>This is a unique identifier</strong></em>, though available for only ~33 000 records.</p></li>
|
||||
<li><p><code>lpsn_parent</code><br> LPSN identifier of the parent taxon</p></li>
|
||||
|
||||
@@ -61,11 +61,11 @@ A [tibble](https://tibble.tidyverse.org/reference/tibble.html) with 78
|
||||
- `oxygen_tolerance`
|
||||
Oxygen tolerance, either "aerobe", "anaerobe",
|
||||
"anaerobe/microaerophile", "facultative anaerobe", "likely facultative
|
||||
anaerobe", or "microaerophile". These data were retrieved from BacDive
|
||||
(see *Source*). Items that contain "likely" are missing from BacDive
|
||||
and were extrapolated from other species within the same genus to
|
||||
guess the oxygen tolerance. Currently 68.3% of all ~39 000 bacteria in
|
||||
the data set contain an oxygen tolerance.
|
||||
anaerobe", "microaerophile", or NA. These data were retrieved from
|
||||
BacDive (see *Source*). Items that contain "likely" are missing from
|
||||
BacDive and were extrapolated from other species within the same genus
|
||||
to guess the oxygen tolerance. Currently 68.3% of all ~39 000 bacteria
|
||||
in the data set contain an oxygen tolerance.
|
||||
|
||||
- `source`
|
||||
Either "GBIF", "LPSN", "Manually added", "MycoBank", or "manually
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -202,7 +202,7 @@
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
<ul><li><p>An <a href="https://rdrr.io/r/base/integer.html" class="external-link">integer</a> in case of <code>mo_year()</code></p></li>
|
||||
<li><p>An <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">ordered factor</a> in case of <code>mo_pathogenicity()</code></p></li>
|
||||
<li><p>An <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">ordered factor</a> in case of <code>mo_pathogenicity()</code></p></li>
|
||||
<li><p>A <a href="https://rdrr.io/r/base/list.html" class="external-link">list</a> in case of <code>mo_taxonomy()</code>, <code>mo_synonyms()</code>, <code>mo_snomed()</code>, and <code>mo_info()</code></p></li>
|
||||
<li><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> in case of <code>mo_is_anaerobic()</code>, <code>mo_is_gram_negative()</code>, <code>mo_is_gram_positive()</code>, <code>mo_is_intrinsic_resistant()</code>, and <code>mo_is_yeast()</code></p></li>
|
||||
<li><p>A named <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> in case of <code>mo_synonyms()</code> and <code>mo_url()</code></p></li>
|
||||
@@ -217,7 +217,7 @@
|
||||
</ul><p>The short name (<code>mo_shortname()</code>) returns the first character of the genus and the full species, such as <code>"E. coli"</code>, for species and subspecies. Exceptions are abbreviations of staphylococci (such as <em>"CoNS"</em>, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as <em>"GBS"</em>, Group B Streptococci). Please bear in mind that e.g. <em>E. coli</em> could mean <em>Escherichia coli</em> (kingdom of Bacteria) as well as <em>Entamoeba coli</em> (kingdom of Protozoa). Returning to the full name will be done using <code><a href="as.mo.html">as.mo()</a></code> internally, giving priority to bacteria and human pathogens, i.e. <code>"E. coli"</code> will be considered <em>Escherichia coli</em>. As a result, <code>mo_fullname(mo_shortname("Entamoeba coli"))</code> returns <code>"Escherichia coli"</code>.</p>
|
||||
<p>Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions <code>mo_kingdom()</code> and <code>mo_domain()</code> return the exact same results.</p>
|
||||
<p>Determination of human pathogenicity (<code>mo_pathogenicity()</code>) is strongly based on Bartlett <em>et al.</em> (2022, <a href="https://doi.org/10.1099/mic.0.001269" class="external-link">doi:10.1099/mic.0.001269</a>
|
||||
). This function returns a <a href="https://rdatatable.gitlab.io/data.table/reference/fctr.html" class="external-link">factor</a> with the levels <em>Pathogenic</em>, <em>Potentially pathogenic</em>, <em>Non-pathogenic</em>, and <em>Unknown</em>.</p>
|
||||
). This function returns a <a href="https://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with the levels <em>Pathogenic</em>, <em>Potentially pathogenic</em>, <em>Non-pathogenic</em>, and <em>Unknown</em>.</p>
|
||||
<p>Determination of the Gram stain (<code>mo_gramstain()</code>) will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, <a href="https://pubmed.ncbi.nlm.nih.gov/11837318/" class="external-link">PMID 11837318</a>), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were later renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, <a href="https://pubmed.ncbi.nlm.nih.gov/34694987/" class="external-link">PMID 34694987</a>). Bacteria in these phyla are considered Gram-positive in this <code>AMR</code> package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. All other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>. Functions <code>mo_is_gram_negative()</code> and <code>mo_is_gram_positive()</code> always return <code>TRUE</code> or <code>FALSE</code> (or <code>NA</code> when the input is <code>NA</code> or the MO code is <code>UNKNOWN</code>), thus always return <code>FALSE</code> for species outside the taxonomic kingdom of Bacteria.</p>
|
||||
<p>Determination of yeasts (<code>mo_is_yeast()</code>) will be based on the taxonomic kingdom and class. <em>Budding yeasts</em> are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. <em>True yeasts</em> quite specifically refers to yeasts in the underlying order Saccharomycetales (such as <em>Saccharomyces cerevisiae</em>). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return <code>TRUE</code>. It returns <code>FALSE</code> otherwise (or <code>NA</code> when the input is <code>NA</code> or the MO code is <code>UNKNOWN</code>).</p>
|
||||
<p>Determination of intrinsic resistance (<code>mo_is_intrinsic_resistant()</code>) will be based on the <a href="intrinsic_resistant.html">intrinsic_resistant</a> data set, which is based on <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expected Resistant Phenotypes' v1.2</a> (2023). The <code>mo_is_intrinsic_resistant()</code> function can be vectorised over both argument <code>x</code> (input for microorganisms) and <code>ab</code> (input for antimicrobials).</p>
|
||||
|
||||
@@ -180,9 +180,8 @@ mo_property(x, property = "fullname", language = get_AMR_locale(),
|
||||
- An [integer](https://rdrr.io/r/base/integer.html) in case of
|
||||
`mo_year()`
|
||||
|
||||
- An [ordered
|
||||
factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
in case of `mo_pathogenicity()`
|
||||
- An [ordered factor](https://rdrr.io/pkg/data.table/man/fctr.html) in
|
||||
case of `mo_pathogenicity()`
|
||||
|
||||
- A [list](https://rdrr.io/r/base/list.html) in case of `mo_taxonomy()`,
|
||||
`mo_synonyms()`, `mo_snomed()`, and `mo_info()`
|
||||
@@ -240,9 +239,8 @@ Determination of human pathogenicity (`mo_pathogenicity()`) is strongly
|
||||
based on Bartlett *et al.* (2022,
|
||||
[doi:10.1099/mic.0.001269](https://doi.org/10.1099/mic.0.001269) ). This
|
||||
function returns a
|
||||
[factor](https://rdatatable.gitlab.io/data.table/reference/fctr.html)
|
||||
with the levels *Pathogenic*, *Potentially pathogenic*,
|
||||
*Non-pathogenic*, and *Unknown*.
|
||||
[factor](https://rdrr.io/pkg/data.table/man/fctr.html) with the levels
|
||||
*Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*.
|
||||
|
||||
Determination of the Gram stain (`mo_gramstain()`) will be based on the
|
||||
taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the
|
||||
|
||||
@@ -9,7 +9,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -149,7 +149,7 @@
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> The first warning was:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In argument: `PEN = (function (..., minimum = 30, as_percent = FALSE,</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> only_all_tested = FALSE) ...`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In group 5: `order = "Lactobacillales"` `genus = "Enterococcus"`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #00BBBB;">ℹ</span> In group 5: `order = "Lactobacillales"`, `genus = "Enterococcus"`.</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> Caused by warning:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #BBBB00;">!</span> Introducing NA: only 14 results available for PEN in group: order =</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> "Lactobacillales", genus = "Enterococcus" (<span style="background-color: #444444;">`minimum`</span> = 30).</span>
|
||||
|
||||
@@ -111,7 +111,7 @@ if (require("dplyr")) {
|
||||
#> The first warning was:
|
||||
#> ℹ In argument: `PEN = (function (..., minimum = 30, as_percent = FALSE,
|
||||
#> only_all_tested = FALSE) ...`.
|
||||
#> ℹ In group 5: `order = "Lactobacillales"` `genus = "Enterococcus"`.
|
||||
#> ℹ In group 5: `order = "Lactobacillales"`, `genus = "Enterococcus"`.
|
||||
#> Caused by warning:
|
||||
#> ! Introducing NA: only 14 results available for PEN in group: order =
|
||||
#> "Lactobacillales", genus = "Enterococcus" (`minimum` = 30).
|
||||
|
||||
@@ -9,7 +9,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -276,7 +276,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
|
||||
<h3 id="the-scale-sir-functions">The <code>scale_*_sir()</code> Functions<a class="anchor" aria-label="anchor" href="#the-scale-sir-functions"></a></h3>
|
||||
|
||||
|
||||
<p>The functions <code>scale_x_sir()</code>, <code>scale_colour_sir()</code>, and <code>scale_fill_sir()</code> functions allow to plot the <a href="as.sir.html">sir</a> class in the right order (S < SDD < I < R < NI).</p>
|
||||
<p>The functions <code>scale_x_sir()</code>, <code>scale_colour_sir()</code>, and <code>scale_fill_sir()</code> functions allow to plot the <a href="as.sir.html">sir</a> class in the right order (S < SDD < I < R < NI < WT < NWT < NS).</p>
|
||||
<p>There is normally no need to add these scale functions to your plot, as they are applied automatically when plotting values of class <a href="as.sir.html">sir</a>.</p>
|
||||
<p>At default, they translate the S/I/R values to an interpretative text ("Susceptible", "Resistant", etc.) in any of the 28 supported languages (use <code>language = NULL</code> to keep S/I/R). Also, except for <code>scale_x_sir()</code>, they set colour-blind friendly colours to the <code>colour</code> and <code>fill</code> aesthetics.</p>
|
||||
</div>
|
||||
|
||||
@@ -295,7 +295,7 @@ log2 levels will always be plotted too.
|
||||
The functions `scale_x_sir()`, `scale_colour_sir()`, and
|
||||
`scale_fill_sir()` functions allow to plot the
|
||||
[sir](https://amr-for-r.org/reference/as.sir.md) class in the right
|
||||
order (S \< SDD \< I \< R \< NI).
|
||||
order (S \< SDD \< I \< R \< NI \< WT \< NWT \< NS).
|
||||
|
||||
There is normally no need to add these scale functions to your plot, as
|
||||
they are applied automatically when plotting values of class
|
||||
|
||||
@@ -9,7 +9,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9018</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9019</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
Reference in New Issue
Block a user