mirror of
https://github.com/msberends/AMR.git
synced 2026-05-31 12:21:40 +02:00
Built site for AMR@3.0.1.9057: 0af3f84
This commit is contained in:
2
404.html
2
404.html
@@ -31,7 +31,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="https://amr-for-r.org/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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -73,7 +73,7 @@
|
||||
<span><span class="fu">pkgdown</span><span class="fu">::</span><span class="fu"><a href="https://pkgdown.r-lib.org/reference/build_site.html" class="external-link">build_site</a></span><span class="op">(</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Code coverage report</span></span>
|
||||
<span><span class="fu">covr</span><span class="fu">::</span><span class="fu">package_coverage</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<span><span class="fu">covr</span><span class="fu">::</span><span class="fu"><a href="http://covr.r-lib.org/reference/package_coverage.html" class="external-link">package_coverage</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<p>From the shell:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="co"># CRAN check from parent directory</span></span>
|
||||
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a><span class="ex">R</span> CMD check AMR</span></code></pre></div>
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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,7 +91,7 @@
|
||||
website update since they are based on randomly created values and the
|
||||
page was written in <a href="https://rmarkdown.rstudio.com/" class="external-link">R
|
||||
Markdown</a>. However, the methodology remains unchanged. This page was
|
||||
generated on 30 April 2026.</p>
|
||||
generated on 02 May 2026.</p>
|
||||
<div class="section level2">
|
||||
<h2 id="introduction">Introduction<a class="anchor" aria-label="anchor" href="#introduction"></a>
|
||||
</h2>
|
||||
@@ -147,21 +147,21 @@ make the structure of your data generally look like this:</p>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2026-04-30</td>
|
||||
<td align="center">2026-05-02</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2026-04-30</td>
|
||||
<td align="center">2026-05-02</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2026-04-30</td>
|
||||
<td align="center">2026-05-02</td>
|
||||
<td align="center">efgh</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
**Note:** values on this page will change with every website update
|
||||
since they are based on randomly created values and the page was written
|
||||
in [R Markdown](https://rmarkdown.rstudio.com/). However, the
|
||||
methodology remains unchanged. This page was generated on 30 April 2026.
|
||||
methodology remains unchanged. This page was generated on 02 May 2026.
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -51,9 +51,9 @@ structure of your data generally look like this:
|
||||
|
||||
| date | patient_id | mo | AMX | CIP |
|
||||
|:----------:|:----------:|:----------------:|:---:|:---:|
|
||||
| 2026-04-30 | abcd | Escherichia coli | S | S |
|
||||
| 2026-04-30 | abcd | Escherichia coli | S | R |
|
||||
| 2026-04-30 | efgh | Escherichia coli | R | S |
|
||||
| 2026-05-02 | abcd | Escherichia coli | S | S |
|
||||
| 2026-05-02 | abcd | Escherichia coli | S | R |
|
||||
| 2026-05-02 | efgh | Escherichia coli | R | S |
|
||||
|
||||
### Needed R packages
|
||||
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -200,7 +200,7 @@ function:</p>
|
||||
<span><span class="co">#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"</span></span>
|
||||
<span><span class="co">#> Importance of components:</span></span>
|
||||
<span><span class="co">#> PC1 PC2 PC3 PC4 PC5 PC6 PC7</span></span>
|
||||
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 1.232e-16</span></span>
|
||||
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 9.577e-17</span></span>
|
||||
<span><span class="co">#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00</span></span>
|
||||
<span><span class="co">#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00</span></span></code></pre></div>
|
||||
<pre><code><span><span class="co">#> Groups (n=4, named as 'order'):</span></span>
|
||||
|
||||
@@ -123,7 +123,7 @@ summary(pca_result)
|
||||
#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"
|
||||
#> Importance of components:
|
||||
#> PC1 PC2 PC3 PC4 PC5 PC6 PC7
|
||||
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 1.232e-16
|
||||
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 9.577e-17
|
||||
#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00
|
||||
#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00
|
||||
```
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -30,7 +30,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -80,7 +80,7 @@
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.svg" class="logo" alt=""><h1>Download data sets for download / own use</h1>
|
||||
|
||||
<h4 data-toc-skip class="date">30 April 2026</h4>
|
||||
<h4 data-toc-skip class="date">02 May 2026</h4>
|
||||
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/vignettes/datasets.Rmd" class="external-link"><code>vignettes/datasets.Rmd</code></a></small>
|
||||
<div class="d-none name"><code>datasets.Rmd</code></div>
|
||||
@@ -424,8 +424,8 @@ column names:<br><em>ab</em>, <em>cid</em>, <em>name</em>, <em>group</em>, <em>a
|
||||
<em>iv_ddd</em>, <em>iv_units</em>, and <em>loinc</em>.</p>
|
||||
<p>This data set is in R available as <code>antimicrobials</code>, after
|
||||
you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 4 April 2026 09:51:50 UTC. Find more info
|
||||
about the contents, (scientific) source, and structure of this <a href="https://amr-for-r.org/reference/antimicrobials.html">data set
|
||||
<p>It was last updated on 2 May 2026 12:56:26 UTC. Find more info about
|
||||
the contents, (scientific) source, and structure of this <a href="https://amr-for-r.org/reference/antimicrobials.html">data set
|
||||
here</a>.</p>
|
||||
<p><strong>Direct download links:</strong></p>
|
||||
<ul>
|
||||
|
||||
@@ -100,8 +100,8 @@ names:
|
||||
This data set is in R available as `antimicrobials`, after you load the
|
||||
`AMR` package.
|
||||
|
||||
It was last updated on 4 April 2026 09:51:50 UTC. Find more info about
|
||||
the contents, (scientific) source, and structure of this [data set
|
||||
It was last updated on 2 May 2026 12:56:26 UTC. Find more info about the
|
||||
contents, (scientific) source, and structure of this [data set
|
||||
here](https://amr-for-r.org/reference/antimicrobials.html).
|
||||
|
||||
**Direct download links:**
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -33,7 +33,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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
19
llms.txt
19
llms.txt
@@ -606,7 +606,7 @@ from clinical text records, using
|
||||
[`clear_custom_antimicrobials()`](https://amr-for-r.org/reference/add_custom_antimicrobials.md)
|
||||
: Add Custom Antimicrobials
|
||||
|
||||
## Preparing data: antimicrobial results
|
||||
## Interpreting data: antimicrobial results
|
||||
|
||||
With [`as.mic()`](https://amr-for-r.org/reference/as.mic.md) and
|
||||
[`as.disk()`](https://amr-for-r.org/reference/as.disk.md) you can
|
||||
@@ -615,10 +615,10 @@ transform your raw input to valid MIC or disk diffusion values. Use
|
||||
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 [EUCAST
|
||||
rules](https://www.eucast.org/expert_rules_and_intrinsic_resistance/)
|
||||
applying interpretive rules, for example [from
|
||||
EUCAST](https://www.eucast.org/expert_rules_and_intrinsic_resistance/)
|
||||
with
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
[`interpretive_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)
|
||||
@@ -643,8 +643,8 @@ with
|
||||
[`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
|
||||
- [`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md)
|
||||
: Define Custom Interpretive Rules
|
||||
|
||||
## Analysing data
|
||||
|
||||
@@ -955,8 +955,8 @@ and other utilities. Especially the ‘like’ function can be useful:
|
||||
|
||||
## Other: statistical tests
|
||||
|
||||
Some statistical tests or methods are not part of base R and were added
|
||||
to this package for convenience.
|
||||
Some statistical tests or methods usable for AMR analyses are not part
|
||||
of base R and were added to this package for convenience.
|
||||
|
||||
- [`g.test()`](https://amr-for-r.org/reference/g.test.md) :
|
||||
|
||||
@@ -973,7 +973,8 @@ to this package for convenience.
|
||||
These objects are deprecated, meaning that they will still work but show
|
||||
a warning that they will be removed in a future version.
|
||||
|
||||
- [`ab_class()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
[`ab_class()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
[`ab_selector()`](https://amr-for-r.org/reference/AMR-deprecated.md) :
|
||||
Deprecated Functions, Arguments, or Datasets
|
||||
|
||||
|
||||
112
news/index.html
112
news/index.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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -49,96 +49,50 @@
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="3.0.1.9055" id="amr-3019055">AMR 3.0.1.9055<a class="anchor" aria-label="anchor" href="#amr-3019055"></a></h2>
|
||||
<p>This will become release v3.1.0, intended for launch end of May.</p>
|
||||
<h2 class="pkg-version" data-toc-text="3.0.1.9057" id="amr-3019057">AMR 3.0.1.9057<a class="anchor" aria-label="anchor" href="#amr-3019057"></a></h2>
|
||||
<p>Planned as v3.1.0, May 2026.</p>
|
||||
<div class="section level4">
|
||||
<h4 id="new-3-0-1-9055">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9055"></a></h4>
|
||||
<ul><li>Support for clinical breakpoints of 2026 of both CLSI and EUCAST, by adding all of their over 5,700 new clinical breakpoints to the <code>clinical_breakpoints</code> data set for usage in <code><a href="../reference/as.sir.html">as.sir()</a></code>. EUCAST 2026 is now the new default guideline for all MIC and disk diffusion interpretations.</li>
|
||||
<li>Support for the <a href="https://future.futureverse.org" class="external-link"><code>future</code></a> package and its framework, as the previous implementation of parallel computing was slow
|
||||
<ul><li>
|
||||
<strong>Breaking change</strong>: <code><a href="../reference/as.sir.html">as.sir()</a></code> with <code>parallel = TRUE</code> now requires a non-sequential <code><a href="https://future.futureverse.org/reference/plan.html" class="external-link">future::plan()</a></code> to be active before the call — e.g., <code>future::plan(future::multisession)</code> — and throws an informative error if none is set.</li>
|
||||
<li>New all-core usage setup: when the number of AB columns is smaller than the number of available cores, rows are now split into batches so all cores stay active (row-batch mode). Previously, a 6-column dataset on a 16-core machine would only use 6 cores; now all 16 are used, with each worker processing a smaller row slice (lower per-worker memory pressure and processing time)</li>
|
||||
<h4 id="new-3-0-1-9057">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9057"></a></h4>
|
||||
<ul><li>EUCAST 2026 and CLSI 2026 breakpoints: over 5,700 new breakpoints added to the <code>clinical_breakpoints</code> data set; EUCAST 2026 is now the default for all MIC and disk diffusion interpretations</li>
|
||||
<li>Wildtype/Non-wildtype (WT/NWT) output when using ECOFF-based interpretation, by setting <code>breakpoint_type = "ECOFF"</code> in <code><a href="../reference/as.sir.html">as.sir()</a></code>; WT/NWT results are fully supported in all resistance/susceptibility functions and plots (<a href="https://github.com/msberends/AMR/issues/254" class="external-link">#254</a>)</li>
|
||||
<li>Faster parallel computing via the <code>future</code> package; <strong>breaking change</strong>: a non-sequential plan (e.g. <code>future::plan(future::multisession)</code>) must be active before using <code>parallel = TRUE</code>; <code><a href="../reference/antibiogram.html">antibiogram()</a></code> and <code><a href="../reference/antibiogram.html">wisca()</a></code> now also support <code>parallel = TRUE</code> (<a href="https://github.com/msberends/AMR/issues/281" class="external-link">#281</a>)</li>
|
||||
<li>
|
||||
<code><a href="../reference/antibiogram.html">antibiogram()</a></code> and <code><a href="../reference/antibiogram.html">wisca()</a></code> gained a <code>parallel</code> argument using the same <code>future</code>/<code>future.apply</code> pattern: for WISCA, Monte Carlo simulations are split into <code>(group, chunk)</code> job pairs distributed across workers; for grouped antibiograms, each group is processed by a separate worker (<a href="https://github.com/msberends/AMR/issues/281" class="external-link">#281</a>)</li>
|
||||
</ul></li>
|
||||
<li>Integration with the <em>tidymodels</em> framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via <code>recipes</code>
|
||||
<ul><li>
|
||||
<code><a href="../reference/amr-tidymodels.html">step_mic_log2()</a></code> to transform <code><mic></code> columns with log2, and <code><a href="../reference/amr-tidymodels.html">step_sir_numeric()</a></code> to convert <code><sir></code> columns to numeric</li>
|
||||
<li>New <code>tidyselect</code> helpers:
|
||||
<ul><li>
|
||||
<code><a href="../reference/amr-tidymodels.html">all_sir()</a></code>, <code><a href="../reference/amr-tidymodels.html">all_sir_predictors()</a></code>
|
||||
<em>tidymodels</em> integration for using SIR, MIC and disk data in modelling pipelines: <code><a href="../reference/amr-tidymodels.html">step_mic_log2()</a></code>, <code><a href="../reference/amr-tidymodels.html">step_sir_numeric()</a></code>, and new column selectors <code><a href="../reference/amr-tidymodels.html">all_sir()</a></code>, <code><a href="../reference/amr-tidymodels.html">all_mic()</a></code>, <code><a href="../reference/amr-tidymodels.html">all_disk()</a></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><a href="../reference/amr-tidymodels.html">all_mic()</a></code>, <code><a href="../reference/amr-tidymodels.html">all_mic_predictors()</a></code>
|
||||
<li>New <code>esbl_isolates</code> data set for practising AMR modelling</li>
|
||||
<li>New antimicrobial selectors: <code><a href="../reference/antimicrobial_selectors.html">ionophores()</a></code>, <code><a href="../reference/antimicrobial_selectors.html">peptides()</a></code>, <code><a href="../reference/antimicrobial_selectors.html">phosphonics()</a></code>, <code><a href="../reference/antimicrobial_selectors.html">spiropyrimidinetriones()</a></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><a href="../reference/amr-tidymodels.html">all_disk()</a></code>, <code><a href="../reference/amr-tidymodels.html">all_disk_predictors()</a></code>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
<li>Data set <code>esbl_isolates</code> to practise with AMR modelling</li>
|
||||
<li>AMR selectors <code><a href="../reference/antimicrobial_selectors.html">ionophores()</a></code>, <code><a href="../reference/antimicrobial_selectors.html">peptides()</a></code>, <code><a href="../reference/antimicrobial_selectors.html">phosphonics()</a></code> and <code><a href="../reference/antimicrobial_selectors.html">spiropyrimidinetriones()</a></code>
|
||||
</li>
|
||||
<li>Support for Wildtype (WT) / Non-wildtype (NWT) in <code><a href="../reference/as.sir.html">as.sir()</a></code>, all plotting functions, and all susceptibility/resistance functions.
|
||||
<ul><li>
|
||||
<code><a href="../reference/as.sir.html">as.sir()</a></code> gained an argument <code>as_wt_nwt</code>, which defaults to <code>TRUE</code> only when <code>breakpoint_type = "ECOFF"</code> (<a href="https://github.com/msberends/AMR/issues/254" class="external-link">#254</a>)</li>
|
||||
<li>This transforms the output from S/R to WT/NWT</li>
|
||||
<li>Functions such as <code><a href="../reference/proportion.html">susceptibility()</a></code> count WT as S and NWT as R</li>
|
||||
</ul></li>
|
||||
<li>Function <code><a href="../reference/interpretive_rules.html">interpretive_rules()</a></code>, which allows future implementation of CLSI interpretive rules (<a href="https://github.com/msberends/AMR/issues/235" class="external-link">#235</a>)
|
||||
<ul><li>
|
||||
<code><a href="../reference/interpretive_rules.html">eucast_rules()</a></code> has become a wrapper around that function</li>
|
||||
<li>Gained argument <code>add_if_missing</code> (default: <code>TRUE</code>). When set to <code>FALSE</code>, rules are only applied to cells that already contain an SIR value; <code>NA</code> cells are left untouched. This is useful with <code>overwrite = TRUE</code> to update reported results without imputing values for drugs that were not tested (<a href="https://github.com/msberends/AMR/issues/259" class="external-link">#259</a>)</li>
|
||||
</ul></li>
|
||||
<li>Function <code><a href="../reference/amr_course.html">amr_course()</a></code>, which allows for automated download and unpacking of a GitHub repository for e.g. webinar use</li>
|
||||
<li>Two new <code>NA</code> objects, <code>NA_ab_</code> and <code>NA_mo_</code>, analogous to base R’s <code>NA_character_</code> and <code>NA_integer_</code>, for use in pipelines that require typed missing values</li>
|
||||
<li>New <code><a href="../reference/interpretive_rules.html">interpretive_rules()</a></code>, a unified function for EUCAST and CLSI interpretive rules; <code><a href="../reference/interpretive_rules.html">eucast_rules()</a></code> is now a wrapper around it (<a href="https://github.com/msberends/AMR/issues/235" class="external-link">#235</a>, <a href="https://github.com/msberends/AMR/issues/259" class="external-link">#259</a>)</li>
|
||||
<li>New <code><a href="../reference/amr_course.html">amr_course()</a></code> to download and unpack course or webinar materials from GitHub in one call</li>
|
||||
<li>Typed missing value constants <code>NA_ab_</code> and <code>NA_mo_</code>, for use in pipelines that need missing values of a specific class</li>
|
||||
</ul></div>
|
||||
<div class="section level4">
|
||||
<h4 id="fixes-3-0-1-9055">Fixes<a class="anchor" aria-label="anchor" href="#fixes-3-0-1-9055"></a></h4>
|
||||
<ul><li>Fixed a bug in <code><a href="../reference/as.sir.html">as.sir()</a></code> where values that were purely numeric (e.g., <code>"1"</code>) and matched the broad SIR-matching regex would be incorrectly stripped of all content by the Unicode letter filter</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.mic.html">as.mic()</a></code> where MIC values in scientific notation (e.g., <code>"1e-3"</code>) were incorrectly handled because the letter <code>e</code> was removed along with other Unicode letters; scientific notation <code>e</code> is now preserved</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.ab.html">as.ab()</a></code> where certain AB codes containing “PH” or “TH” (such as <code>ETH</code>, <code>MTH</code>, <code>PHE</code>, <code>PHN</code>, <code>STH</code>, <code>THA</code>, <code>THI1</code>) would incorrectly return <code>NA</code> when combined in a vector with any untranslatable value (<a href="https://github.com/msberends/AMR/issues/245" class="external-link">#245</a>)</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/antibiogram.html">antibiogram()</a></code> for when no antimicrobials are set</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.sir.html">as.sir()</a></code> where for numeric input the arguments <code>S</code>, <code>I</code>, and <code>R</code> would not be considered (<a href="https://github.com/msberends/AMR/issues/244" class="external-link">#244</a>)</li>
|
||||
<li>Fixed a bug in plotting MIC values when <code>keep_operators = "all"</code>
|
||||
</li>
|
||||
<li>Fixed some foreign translations of antimicrobial drugs</li>
|
||||
<li>Fixed a bug for printing column names to the console when using <code>mutate_at(vars(...), as.mic)</code> (<a href="https://github.com/msberends/AMR/issues/249" class="external-link">#249</a>)</li>
|
||||
<li>Fixed a bug to disregard <code>NI</code> for susceptibility proportion functions</li>
|
||||
<li>Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo and CoPS to Stafilococco coagulasi-positivo (<a href="https://github.com/msberends/AMR/issues/256" class="external-link">#256</a>)</li>
|
||||
<li>Fixed SIR and MIC coercion of combined values, e.g. <code>as.sir("<= 0.002; S")</code> or <code>as.mic("S; 0.002")</code> (<a href="https://github.com/msberends/AMR/issues/252" class="external-link">#252</a>)</li>
|
||||
<li>Fixed translation of foreign languages in <code><a href="../reference/proportion.html">sir_df()</a></code> (<a href="https://github.com/msberends/AMR/issues/272" class="external-link">#272</a>)</li>
|
||||
<li>Fixed BRMO classification by including bacterial complexes (<a href="https://github.com/msberends/AMR/issues/275" class="external-link">#275</a>)</li>
|
||||
<li>Fixed <code><a href="../reference/as.sir.html">as.sir()</a></code> for data frames silently deleting columns whose AB class was already <code><sir></code> when called a second time (re-running on already-converted data) (<a href="https://github.com/msberends/AMR/issues/278" class="external-link">#278</a>)</li>
|
||||
<li>Fixed <code><a href="../reference/as.sir.html">as.sir()</a></code> for data frames incorrectly treating metadata columns (e.g. <code>patient</code>, <code>ward</code>) as antibiotic columns when their names coincidentally matched an antibiotic code; column content is now validated against AMR data patterns before inclusion</li>
|
||||
<li>Fixed <code><a href="../reference/as.sir.html">as.sir()</a></code> ignoring <code>info = FALSE</code> for columns with no breakpoints (e.g. cefoxitin against <em>E. coli</em>)</li>
|
||||
<h4 id="fixes-3-0-1-9057">Fixes<a class="anchor" aria-label="anchor" href="#fixes-3-0-1-9057"></a></h4>
|
||||
<ul><li>
|
||||
<code><a href="../reference/as.sir.html">as.sir()</a></code> on data frames: already-converted SIR columns no longer dropped on re-run (<a href="https://github.com/msberends/AMR/issues/278" class="external-link">#278</a>); metadata columns (e.g. <code>patient</code>, <code>ward</code>) no longer misidentified as antibiotic columns; <code>info = FALSE</code> now suppresses all messages, including for columns without breakpoints</li>
|
||||
<li>
|
||||
<code><a href="../reference/as.mic.html">as.mic()</a></code>: values in scientific notation (e.g. <code>1e-3</code>) now handled correctly</li>
|
||||
<li>
|
||||
<code><a href="../reference/as.ab.html">as.ab()</a></code>: codes containing “PH” or “TH” (e.g. <code>ETH</code>, <code>PHE</code>) no longer return <code>NA</code> when mixed with unrecognised input (<a href="https://github.com/msberends/AMR/issues/245" class="external-link">#245</a>)</li>
|
||||
<li>Combined MIC/SIR input values (e.g. <code>"<= 0.002; S"</code> or <code>"S; 0.002"</code>) now parsed correctly (<a href="https://github.com/msberends/AMR/issues/252" class="external-link">#252</a>)</li>
|
||||
<li>BRMO classification now includes bacterial complexes (<a href="https://github.com/msberends/AMR/issues/275" class="external-link">#275</a>)</li>
|
||||
<li>Translation fixes for Italian CoNS/CoPS names (<a href="https://github.com/msberends/AMR/issues/256" class="external-link">#256</a>), Dutch antimicrobials, and <code><a href="../reference/proportion.html">sir_df()</a></code> foreign-language output (<a href="https://github.com/msberends/AMR/issues/272" class="external-link">#272</a>)</li>
|
||||
</ul></div>
|
||||
<div class="section level4">
|
||||
<h4 id="updates-3-0-1-9055">Updates<a class="anchor" aria-label="anchor" href="#updates-3-0-1-9055"></a></h4>
|
||||
<h4 id="updates-3-0-1-9057">Updates<a class="anchor" aria-label="anchor" href="#updates-3-0-1-9057"></a></h4>
|
||||
<ul><li>
|
||||
<code><a href="../reference/as.sir.html">as.sir()</a></code> with <code>reference_data</code>: custom guideline names now correctly classify values as R using EUCAST convention (<code>> breakpoint_R</code> for MIC, <code>< breakpoint_R</code> for disk); custom breakpoints with <code>host = NA</code> now serve as a host-agnostic fallback when no host-specific row matches (<a href="https://github.com/msberends/AMR/issues/239" class="external-link">#239</a>)</li>
|
||||
<li>Extensive <code>cli</code> integration for better message handling and clickable links in messages and warnings (<a href="https://github.com/msberends/AMR/issues/191" class="external-link">#191</a>, <a href="https://github.com/msberends/AMR/issues/265" class="external-link">#265</a>)</li>
|
||||
<code><a href="../reference/AMR-deprecated.html">custom_eucast_rules()</a></code> renamed to <code><a href="../reference/custom_interpretive_rules.html">custom_interpretive_rules()</a></code>; old name deprecated but still works (<a href="https://github.com/msberends/AMR/issues/268" class="external-link">#268</a>)</li>
|
||||
<li>
|
||||
<code><a href="../reference/mdro.html">mdro()</a></code> now infers resistance for a <em>missing</em> base drug column from an <em>available</em> corresponding drug+inhibitor combination showing resistance (e.g., piperacillin is absent but required, while piperacillin/tazobactam available and resistant). Can be set with the new argument <code>infer_from_combinations</code>, which defaults to <code>TRUE</code> (<a href="https://github.com/msberends/AMR/issues/209" class="external-link">#209</a>). Note that this can yield a higher MDRO detection (which is a good thing as it has become more reliable).</li>
|
||||
<code><a href="../reference/mdro.html">mdro()</a></code> can now infer resistance from a drug+inhibitor combination when the base drug column is absent (e.g. piperacillin inferred from piperacillin/tazobactam); controlled via new <code>infer_from_combinations</code> argument (default <code>TRUE</code>) (<a href="https://github.com/msberends/AMR/issues/209" class="external-link">#209</a>)</li>
|
||||
<li>
|
||||
<code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> gained the argument <code>guideline</code>, which defaults to EUCAST, for interpreting the ‘I’ category correctly.</li>
|
||||
<li>Added to the <code>antimicrobials</code> data set: cefepime/taniborbactam (<code>FTA</code>), ceftibuten/avibactam (<code>CTA</code>), clorobiocin (<code>CLB</code>), kasugamycin (<code>KAS</code>), ostreogrycin (<code>OST</code>), taniborbactam (<code>TAN</code>), thiostrepton (<code>THS</code>), xeruborbactam (<code>XER</code>), and zorbamycin (<code>ZOR</code>)</li>
|
||||
<code><a href="../reference/proportion.html">susceptibility()</a></code> / <code><a href="../reference/proportion.html">resistance()</a></code>: new <code>guideline</code> argument (default EUCAST) to ensure the ‘I’ category is interpreted correctly per guideline</li>
|
||||
<li>Capped MIC handling in <code><a href="../reference/as.sir.html">as.sir()</a></code> reworked into four clearly defined options: <code>"none"</code>, <code>"conservative"</code> (new default), <code>"standard"</code>, <code>"lenient"</code> (<a href="https://github.com/msberends/AMR/issues/243" class="external-link">#243</a>)</li>
|
||||
<li>
|
||||
<code><a href="../reference/as.mic.html">as.mic()</a></code> and <code><a href="../reference/as.mic.html">rescale_mic()</a></code> gained the argument <code>round_to_next_log2</code>, which can be set to <code>TRUE</code> to round all values up to the nearest next log2 level (<a href="https://github.com/msberends/AMR/issues/255" class="external-link">#255</a>)</li>
|
||||
<code><a href="../reference/as.mic.html">as.mic()</a></code> / <code><a href="../reference/as.mic.html">rescale_mic()</a></code>: new <code>round_to_next_log2</code> argument to round values up to the nearest log2 dilution level (<a href="https://github.com/msberends/AMR/issues/255" class="external-link">#255</a>)</li>
|
||||
<li>
|
||||
<code>antimicrobials$group</code> is now a <code>list</code> instead of a <code>character</code>, to contain any group the drug is in (<a href="https://github.com/msberends/AMR/issues/246" class="external-link">#246</a>)</li>
|
||||
<li>
|
||||
<code><a href="../reference/ab_property.html">ab_group()</a></code> gained an argument <code>all_groups</code> to return all groups the antimicrobial drug is in (<a href="https://github.com/msberends/AMR/issues/246" class="external-link">#246</a>)</li>
|
||||
<li>Added explaining message to <code><a href="../reference/as.sir.html">as.sir()</a></code> when interpreting numeric values (e.g., 1 for S, 2 for I, 3 for R) (<a href="https://github.com/msberends/AMR/issues/244" class="external-link">#244</a>)</li>
|
||||
<li>Updated handling of capped MIC values (<code><</code>, <code><=</code>, <code>></code>, <code>>=</code>) in <code><a href="../reference/as.sir.html">as.sir()</a></code> in the argument <code>capped_mic_handling</code>: (<a href="https://github.com/msberends/AMR/issues/243" class="external-link">#243</a>)
|
||||
<ul><li>Introduced four clearly defined options: <code>"none"</code>, <code>"conservative"</code> (default), <code>"standard"</code>, and <code>"lenient"</code>
|
||||
</li>
|
||||
<li>Interpretation of capped MIC values now consistently returns <code>"NI"</code> (non-interpretable) when the true MIC could be at either side of a breakpoint, depending on the selected handling mode</li>
|
||||
<li>This results in more reliable behaviour compared to previous versions for capped MIC values</li>
|
||||
<li>Removed the <code>"inverse"</code> option, which has now become redundant</li>
|
||||
</ul></li>
|
||||
<li>
|
||||
<code><a href="../reference/ab_property.html">ab_group()</a></code> now returns values consist with the AMR selectors (<a href="https://github.com/msberends/AMR/issues/246" class="external-link">#246</a>)</li>
|
||||
<code>antimicrobials$group</code> now a <code>list</code>, so drugs belonging to multiple groups are fully represented; use <code>ab_group(all_groups = TRUE)</code> to retrieve all groups for a drug (<a href="https://github.com/msberends/AMR/issues/246" class="external-link">#246</a>)</li>
|
||||
<li>New antimicrobials added: cefepime/taniborbactam (<code>FTA</code>), ceftibuten/avibactam (<code>CTA</code>), clorobiocin (<code>CLB</code>), kasugamycin (<code>KAS</code>), ostreogrycin (<code>OST</code>), taniborbactam (<code>TAN</code>), thiostrepton (<code>THS</code>), xeruborbactam (<code>XER</code>), zorbamycin (<code>ZOR</code>)</li>
|
||||
<li>Improved console messages with clickable links throughout, powered by <code>cli</code> (<a href="https://github.com/msberends/AMR/issues/191" class="external-link">#191</a>, <a href="https://github.com/msberends/AMR/issues/265" class="external-link">#265</a>)</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
@@ -300,7 +254,7 @@
|
||||
<li>Disks of 0 to 5 mm are now allowed, the newly allowed range for disk diffusion (<code><a href="../reference/as.disk.html">as.disk()</a></code>) is now between 0 and 50 mm</li>
|
||||
<li>Updated <code><a href="../reference/italicise_taxonomy.html">italicise_taxonomy()</a></code> to support HTML output</li>
|
||||
<li>
|
||||
<code><a href="../reference/custom_eucast_rules.html">custom_eucast_rules()</a></code> now supports multiple antimicrobials and antimicrobial groups to be affected by a single rule</li>
|
||||
<code><a href="../reference/AMR-deprecated.html">custom_eucast_rules()</a></code> now supports multiple antimicrobials and antimicrobial groups to be affected by a single rule</li>
|
||||
<li>
|
||||
<code><a href="../reference/mo_property.html">mo_info()</a></code> now contains an extra element <code>rank</code> and <code>group_members</code> (with the contents of the new <code><a href="../reference/mo_property.html">mo_group_members()</a></code> function)</li>
|
||||
<li>Updated all ATC codes from WHOCC</li>
|
||||
|
||||
269
news/index.md
269
news/index.md
@@ -1,201 +1,116 @@
|
||||
# Changelog
|
||||
|
||||
## AMR 3.0.1.9055
|
||||
## AMR 3.0.1.9057
|
||||
|
||||
This will become release v3.1.0, intended for launch end of May.
|
||||
Planned as v3.1.0, May 2026.
|
||||
|
||||
#### New
|
||||
|
||||
- Support for clinical breakpoints of 2026 of both CLSI and EUCAST, by
|
||||
adding all of their over 5,700 new clinical breakpoints to the
|
||||
`clinical_breakpoints` data set for usage in
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md). EUCAST 2026
|
||||
is now the new default guideline for all MIC and disk diffusion
|
||||
interpretations.
|
||||
- Support for the [`future`](https://future.futureverse.org) package and
|
||||
its framework, as the previous implementation of parallel computing
|
||||
was slow
|
||||
- **Breaking change**:
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) with
|
||||
`parallel = TRUE` now requires a non-sequential
|
||||
[`future::plan()`](https://future.futureverse.org/reference/plan.html)
|
||||
to be active before the call — e.g.,
|
||||
`future::plan(future::multisession)` — and throws an informative
|
||||
error if none is set.
|
||||
- New all-core usage setup: when the number of AB columns is smaller
|
||||
than the number of available cores, rows are now split into batches
|
||||
so all cores stay active (row-batch mode). Previously, a 6-column
|
||||
dataset on a 16-core machine would only use 6 cores; now all 16 are
|
||||
used, with each worker processing a smaller row slice (lower
|
||||
per-worker memory pressure and processing time)
|
||||
- [`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md)
|
||||
and [`wisca()`](https://amr-for-r.org/reference/antibiogram.md)
|
||||
gained a `parallel` argument using the same `future`/`future.apply`
|
||||
pattern: for WISCA, Monte Carlo simulations are split into
|
||||
`(group, chunk)` job pairs distributed across workers; for grouped
|
||||
antibiograms, each group is processed by a separate worker
|
||||
- EUCAST 2026 and CLSI 2026 breakpoints: over 5,700 new breakpoints
|
||||
added to the `clinical_breakpoints` data set; EUCAST 2026 is now the
|
||||
default for all MIC and disk diffusion interpretations
|
||||
- Wildtype/Non-wildtype (WT/NWT) output when using ECOFF-based
|
||||
interpretation, by setting `breakpoint_type = "ECOFF"` in
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md); WT/NWT
|
||||
results are fully supported in all resistance/susceptibility functions
|
||||
and plots ([\#254](https://github.com/msberends/AMR/issues/254))
|
||||
- Faster parallel computing via the `future` package; **breaking
|
||||
change**: a non-sequential plan
|
||||
(e.g. `future::plan(future::multisession)`) must be active before
|
||||
using `parallel = TRUE`;
|
||||
[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md) and
|
||||
[`wisca()`](https://amr-for-r.org/reference/antibiogram.md) now also
|
||||
support `parallel = TRUE`
|
||||
([\#281](https://github.com/msberends/AMR/issues/281))
|
||||
- Integration with the *tidymodels* framework to allow seamless use of
|
||||
SIR, MIC and disk data in modelling pipelines via `recipes`
|
||||
- [`step_mic_log2()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
to transform `<mic>` columns with log2, and
|
||||
[`step_sir_numeric()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
to convert `<sir>` columns to numeric
|
||||
- New `tidyselect` helpers:
|
||||
- [`all_sir()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`all_sir_predictors()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
- [`all_mic()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`all_mic_predictors()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
- [`all_disk()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`all_disk_predictors()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
- Data set `esbl_isolates` to practise with AMR modelling
|
||||
- AMR selectors
|
||||
- *tidymodels* integration for using SIR, MIC and disk data in modelling
|
||||
pipelines:
|
||||
[`step_mic_log2()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`step_sir_numeric()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
and new column selectors
|
||||
[`all_sir()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`all_mic()`](https://amr-for-r.org/reference/amr-tidymodels.md),
|
||||
[`all_disk()`](https://amr-for-r.org/reference/amr-tidymodels.md)
|
||||
- New `esbl_isolates` data set for practising AMR modelling
|
||||
- New antimicrobial selectors:
|
||||
[`ionophores()`](https://amr-for-r.org/reference/antimicrobial_selectors.md),
|
||||
[`peptides()`](https://amr-for-r.org/reference/antimicrobial_selectors.md),
|
||||
[`phosphonics()`](https://amr-for-r.org/reference/antimicrobial_selectors.md)
|
||||
and
|
||||
[`phosphonics()`](https://amr-for-r.org/reference/antimicrobial_selectors.md),
|
||||
[`spiropyrimidinetriones()`](https://amr-for-r.org/reference/antimicrobial_selectors.md)
|
||||
- Support for Wildtype (WT) / Non-wildtype (NWT) in
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md), all plotting
|
||||
functions, and all susceptibility/resistance functions.
|
||||
- [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) gained an
|
||||
argument `as_wt_nwt`, which defaults to `TRUE` only when
|
||||
`breakpoint_type = "ECOFF"`
|
||||
([\#254](https://github.com/msberends/AMR/issues/254))
|
||||
- This transforms the output from S/R to WT/NWT
|
||||
- Functions such as
|
||||
[`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
|
||||
count WT as S and NWT as R
|
||||
- Function
|
||||
- New
|
||||
[`interpretive_rules()`](https://amr-for-r.org/reference/interpretive_rules.md),
|
||||
which allows future implementation of CLSI interpretive rules
|
||||
([\#235](https://github.com/msberends/AMR/issues/235))
|
||||
- [`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
has become a wrapper around that function
|
||||
- Gained argument `add_if_missing` (default: `TRUE`). When set to
|
||||
`FALSE`, rules are only applied to cells that already contain an SIR
|
||||
value; `NA` cells are left untouched. This is useful with
|
||||
`overwrite = TRUE` to update reported results without imputing
|
||||
values for drugs that were not tested
|
||||
([\#259](https://github.com/msberends/AMR/issues/259))
|
||||
- Function
|
||||
[`amr_course()`](https://amr-for-r.org/reference/amr_course.md), which
|
||||
allows for automated download and unpacking of a GitHub repository for
|
||||
e.g. webinar use
|
||||
- Two new `NA` objects, `NA_ab_` and `NA_mo_`, analogous to base R’s
|
||||
`NA_character_` and `NA_integer_`, for use in pipelines that require
|
||||
typed missing values
|
||||
a unified function for EUCAST and CLSI interpretive rules;
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
is now a wrapper around it
|
||||
([\#235](https://github.com/msberends/AMR/issues/235),
|
||||
[\#259](https://github.com/msberends/AMR/issues/259))
|
||||
- New [`amr_course()`](https://amr-for-r.org/reference/amr_course.md) to
|
||||
download and unpack course or webinar materials from GitHub in one
|
||||
call
|
||||
- Typed missing value constants `NA_ab_` and `NA_mo_`, for use in
|
||||
pipelines that need missing values of a specific class
|
||||
|
||||
#### Fixes
|
||||
|
||||
- Fixed a bug in [`as.sir()`](https://amr-for-r.org/reference/as.sir.md)
|
||||
where values that were purely numeric (e.g., `"1"`) and matched the
|
||||
broad SIR-matching regex would be incorrectly stripped of all content
|
||||
by the Unicode letter filter
|
||||
- Fixed a bug in [`as.mic()`](https://amr-for-r.org/reference/as.mic.md)
|
||||
where MIC values in scientific notation (e.g., `"1e-3"`) were
|
||||
incorrectly handled because the letter `e` was removed along with
|
||||
other Unicode letters; scientific notation `e` is now preserved
|
||||
- Fixed a bug in [`as.ab()`](https://amr-for-r.org/reference/as.ab.md)
|
||||
where certain AB codes containing “PH” or “TH” (such as `ETH`, `MTH`,
|
||||
`PHE`, `PHN`, `STH`, `THA`, `THI1`) would incorrectly return `NA` when
|
||||
combined in a vector with any untranslatable value
|
||||
- [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) on data
|
||||
frames: already-converted SIR columns no longer dropped on re-run
|
||||
([\#278](https://github.com/msberends/AMR/issues/278)); metadata
|
||||
columns (e.g. `patient`, `ward`) no longer misidentified as antibiotic
|
||||
columns; `info = FALSE` now suppresses all messages, including for
|
||||
columns without breakpoints
|
||||
- [`as.mic()`](https://amr-for-r.org/reference/as.mic.md): values in
|
||||
scientific notation (e.g. `1e-3`) now handled correctly
|
||||
- [`as.ab()`](https://amr-for-r.org/reference/as.ab.md): codes
|
||||
containing “PH” or “TH” (e.g. `ETH`, `PHE`) no longer return `NA` when
|
||||
mixed with unrecognised input
|
||||
([\#245](https://github.com/msberends/AMR/issues/245))
|
||||
- Fixed a bug in
|
||||
[`antibiogram()`](https://amr-for-r.org/reference/antibiogram.md) for
|
||||
when no antimicrobials are set
|
||||
- Fixed a bug in [`as.sir()`](https://amr-for-r.org/reference/as.sir.md)
|
||||
where for numeric input the arguments `S`, `I`, and `R` would not be
|
||||
considered ([\#244](https://github.com/msberends/AMR/issues/244))
|
||||
- Fixed a bug in plotting MIC values when `keep_operators = "all"`
|
||||
- Fixed some foreign translations of antimicrobial drugs
|
||||
- Fixed a bug for printing column names to the console when using
|
||||
`mutate_at(vars(...), as.mic)`
|
||||
([\#249](https://github.com/msberends/AMR/issues/249))
|
||||
- Fixed a bug to disregard `NI` for susceptibility proportion functions
|
||||
- Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo
|
||||
and CoPS to Stafilococco coagulasi-positivo
|
||||
([\#256](https://github.com/msberends/AMR/issues/256))
|
||||
- Fixed SIR and MIC coercion of combined values,
|
||||
e.g. `as.sir("<= 0.002; S")` or `as.mic("S; 0.002")`
|
||||
- Combined MIC/SIR input values (e.g. `"<= 0.002; S"` or `"S; 0.002"`)
|
||||
now parsed correctly
|
||||
([\#252](https://github.com/msberends/AMR/issues/252))
|
||||
- Fixed translation of foreign languages in
|
||||
[`sir_df()`](https://amr-for-r.org/reference/proportion.md)
|
||||
([\#272](https://github.com/msberends/AMR/issues/272))
|
||||
- Fixed BRMO classification by including bacterial complexes
|
||||
- BRMO classification now includes bacterial complexes
|
||||
([\#275](https://github.com/msberends/AMR/issues/275))
|
||||
- Fixed [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) for data
|
||||
frames silently deleting columns whose AB class was already `<sir>`
|
||||
when called a second time (re-running on already-converted data)
|
||||
([\#278](https://github.com/msberends/AMR/issues/278))
|
||||
- Fixed [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) for data
|
||||
frames incorrectly treating metadata columns (e.g. `patient`, `ward`)
|
||||
as antibiotic columns when their names coincidentally matched an
|
||||
antibiotic code; column content is now validated against AMR data
|
||||
patterns before inclusion
|
||||
- Fixed [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) ignoring
|
||||
`info = FALSE` for columns with no breakpoints (e.g. cefoxitin against
|
||||
*E. coli*)
|
||||
- Translation fixes for Italian CoNS/CoPS names
|
||||
([\#256](https://github.com/msberends/AMR/issues/256)), Dutch
|
||||
antimicrobials, and
|
||||
[`sir_df()`](https://amr-for-r.org/reference/proportion.md)
|
||||
foreign-language output
|
||||
([\#272](https://github.com/msberends/AMR/issues/272))
|
||||
|
||||
#### Updates
|
||||
|
||||
- [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) with
|
||||
`reference_data`: custom guideline names now correctly classify values
|
||||
as R using EUCAST convention (`> breakpoint_R` for MIC,
|
||||
`< breakpoint_R` for disk); custom breakpoints with `host = NA` now
|
||||
serve as a host-agnostic fallback when no host-specific row matches
|
||||
([\#239](https://github.com/msberends/AMR/issues/239))
|
||||
- Extensive `cli` integration for better message handling and clickable
|
||||
links in messages and warnings
|
||||
([\#191](https://github.com/msberends/AMR/issues/191),
|
||||
[\#265](https://github.com/msberends/AMR/issues/265))
|
||||
- [`mdro()`](https://amr-for-r.org/reference/mdro.md) now infers
|
||||
resistance for a *missing* base drug column from an *available*
|
||||
corresponding drug+inhibitor combination showing resistance (e.g.,
|
||||
piperacillin is absent but required, while piperacillin/tazobactam
|
||||
available and resistant). Can be set with the new argument
|
||||
`infer_from_combinations`, which defaults to `TRUE`
|
||||
([\#209](https://github.com/msberends/AMR/issues/209)). Note that this
|
||||
can yield a higher MDRO detection (which is a good thing as it has
|
||||
become more reliable).
|
||||
- [`susceptibility()`](https://amr-for-r.org/reference/proportion.md)
|
||||
and [`resistance()`](https://amr-for-r.org/reference/proportion.md)
|
||||
gained the argument `guideline`, which defaults to EUCAST, for
|
||||
interpreting the ‘I’ category correctly.
|
||||
- Added to the `antimicrobials` data set: cefepime/taniborbactam
|
||||
(`FTA`), ceftibuten/avibactam (`CTA`), clorobiocin (`CLB`),
|
||||
kasugamycin (`KAS`), ostreogrycin (`OST`), taniborbactam (`TAN`),
|
||||
thiostrepton (`THS`), xeruborbactam (`XER`), and zorbamycin (`ZOR`)
|
||||
- [`as.mic()`](https://amr-for-r.org/reference/as.mic.md) and
|
||||
[`rescale_mic()`](https://amr-for-r.org/reference/as.mic.md) gained
|
||||
the argument `round_to_next_log2`, which can be set to `TRUE` to round
|
||||
all values up to the nearest next log2 level
|
||||
([\#255](https://github.com/msberends/AMR/issues/255))
|
||||
- `antimicrobials$group` is now a `list` instead of a `character`, to
|
||||
contain any group the drug is in
|
||||
([\#246](https://github.com/msberends/AMR/issues/246))
|
||||
- [`ab_group()`](https://amr-for-r.org/reference/ab_property.md) gained
|
||||
an argument `all_groups` to return all groups the antimicrobial drug
|
||||
is in ([\#246](https://github.com/msberends/AMR/issues/246))
|
||||
- Added explaining message to
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) when
|
||||
interpreting numeric values (e.g., 1 for S, 2 for I, 3 for R)
|
||||
([\#244](https://github.com/msberends/AMR/issues/244))
|
||||
- Updated handling of capped MIC values (`<`, `<=`, `>`, `>=`) in
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) in the
|
||||
argument `capped_mic_handling`:
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
renamed to
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md);
|
||||
old name deprecated but still works
|
||||
([\#268](https://github.com/msberends/AMR/issues/268))
|
||||
- [`mdro()`](https://amr-for-r.org/reference/mdro.md) can now infer
|
||||
resistance from a drug+inhibitor combination when the base drug column
|
||||
is absent (e.g. piperacillin inferred from piperacillin/tazobactam);
|
||||
controlled via new `infer_from_combinations` argument (default `TRUE`)
|
||||
([\#209](https://github.com/msberends/AMR/issues/209))
|
||||
- [`susceptibility()`](https://amr-for-r.org/reference/proportion.md) /
|
||||
[`resistance()`](https://amr-for-r.org/reference/proportion.md): new
|
||||
`guideline` argument (default EUCAST) to ensure the ‘I’ category is
|
||||
interpreted correctly per guideline
|
||||
- Capped MIC handling in
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) reworked into
|
||||
four clearly defined options: `"none"`, `"conservative"` (new
|
||||
default), `"standard"`, `"lenient"`
|
||||
([\#243](https://github.com/msberends/AMR/issues/243))
|
||||
- Introduced four clearly defined options: `"none"`, `"conservative"`
|
||||
(default), `"standard"`, and `"lenient"`
|
||||
- Interpretation of capped MIC values now consistently returns `"NI"`
|
||||
(non-interpretable) when the true MIC could be at either side of a
|
||||
breakpoint, depending on the selected handling mode
|
||||
- This results in more reliable behaviour compared to previous
|
||||
versions for capped MIC values
|
||||
- Removed the `"inverse"` option, which has now become redundant
|
||||
- [`ab_group()`](https://amr-for-r.org/reference/ab_property.md) now
|
||||
returns values consist with the AMR selectors
|
||||
- [`as.mic()`](https://amr-for-r.org/reference/as.mic.md) /
|
||||
[`rescale_mic()`](https://amr-for-r.org/reference/as.mic.md): new
|
||||
`round_to_next_log2` argument to round values up to the nearest log2
|
||||
dilution level ([\#255](https://github.com/msberends/AMR/issues/255))
|
||||
- `antimicrobials$group` now a `list`, so drugs belonging to multiple
|
||||
groups are fully represented; use `ab_group(all_groups = TRUE)` to
|
||||
retrieve all groups for a drug
|
||||
([\#246](https://github.com/msberends/AMR/issues/246))
|
||||
- New antimicrobials added: cefepime/taniborbactam (`FTA`),
|
||||
ceftibuten/avibactam (`CTA`), clorobiocin (`CLB`), kasugamycin
|
||||
(`KAS`), ostreogrycin (`OST`), taniborbactam (`TAN`), thiostrepton
|
||||
(`THS`), xeruborbactam (`XER`), zorbamycin (`ZOR`)
|
||||
- Improved console messages with clickable links throughout, powered by
|
||||
`cli` ([\#191](https://github.com/msberends/AMR/issues/191),
|
||||
[\#265](https://github.com/msberends/AMR/issues/265))
|
||||
|
||||
## AMR 3.0.1
|
||||
|
||||
@@ -581,7 +496,7 @@ this change.
|
||||
- Updated
|
||||
[`italicise_taxonomy()`](https://amr-for-r.org/reference/italicise_taxonomy.md)
|
||||
to support HTML output
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/custom_eucast_rules.md)
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
now supports multiple antimicrobials and antimicrobial groups to be
|
||||
affected by a single rule
|
||||
- [`mo_info()`](https://amr-for-r.org/reference/mo_property.md) now
|
||||
|
||||
@@ -10,7 +10,7 @@ articles:
|
||||
PCA: PCA.html
|
||||
WHONET: WHONET.html
|
||||
WISCA: WISCA.html
|
||||
last_built: 2026-04-30T17:47Z
|
||||
last_built: 2026-05-02T13:01Z
|
||||
urls:
|
||||
reference: https://amr-for-r.org/reference
|
||||
article: https://amr-for-r.org/articles
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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,7 +55,9 @@
|
||||
|
||||
<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">ab_class</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">custom_eucast_rules</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">ab_class</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu">ab_selector</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,8 @@ warning with the name of the alternative object it has been replaced by
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
custom_eucast_rules(...)
|
||||
|
||||
ab_class(...)
|
||||
|
||||
ab_selector(...)
|
||||
|
||||
@@ -9,7 +9,7 @@ options(AMR_guideline = "CLSI")'><meta property="og:image" content="https://amr-
|
||||
|
||||
<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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 1999-06-30 26 26.83288 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1968-01-29 58 58.24932 31</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1965-12-05 60 60.40000 34</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1980-03-01 46 46.16438 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1949-11-01 76 76.49315 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1947-02-14 79 79.20548 52</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1940-02-19 86 86.19178 59</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1988-01-10 38 38.30137 11</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1997-08-27 28 28.67397 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1978-01-26 48 48.25753 21</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1999-06-30 26 26.83836 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1968-01-29 58 58.25479 31</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1965-12-05 60 60.40548 34</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1980-03-01 46 46.16986 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1949-11-01 76 76.49863 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1947-02-14 79 79.21096 52</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1940-02-19 86 86.19726 59</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1988-01-10 38 38.30685 11</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1997-08-27 28 28.67945 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1978-01-26 48 48.26301 21</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 1999-06-30 26 26.83288 0
|
||||
#> 2 1968-01-29 58 58.24932 31
|
||||
#> 3 1965-12-05 60 60.40000 34
|
||||
#> 4 1980-03-01 46 46.16438 19
|
||||
#> 5 1949-11-01 76 76.49315 50
|
||||
#> 6 1947-02-14 79 79.20548 52
|
||||
#> 7 1940-02-19 86 86.19178 59
|
||||
#> 8 1988-01-10 38 38.30137 11
|
||||
#> 9 1997-08-27 28 28.67397 2
|
||||
#> 10 1978-01-26 48 48.25753 21
|
||||
#> 1 1999-06-30 26 26.83836 0
|
||||
#> 2 1968-01-29 58 58.25479 31
|
||||
#> 3 1965-12-05 60 60.40548 34
|
||||
#> 4 1980-03-01 46 46.16986 19
|
||||
#> 5 1949-11-01 76 76.49863 50
|
||||
#> 6 1947-02-14 79 79.21096 52
|
||||
#> 7 1940-02-19 86 86.19726 59
|
||||
#> 8 1988-01-10 38 38.30685 11
|
||||
#> 9 1997-08-27 28 28.67945 2
|
||||
#> 10 1978-01-26 48 48.26301 21
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!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>Split Ages into Age Groups — age_groups • 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="Split Ages into Age Groups — age_groups"><meta name="description" content="Split ages into age groups defined by the split argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered factor."><meta property="og:description" content="Split ages into age groups defined by the split argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered factor."><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>
|
||||
<!-- 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>Split Ages into Age Groups — age_groups • 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="Split Ages into Age Groups — age_groups"><meta name="description" content="Split ages into age groups defined by the `split` argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered [factor]."><meta property="og:description" content="Split ages into age groups defined by the `split` argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered [factor]."><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>
|
||||
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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>Split ages into age groups defined by the <code>split</code> argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered <a href="https://rdrr.io/r/base/factor.html" class="external-link">factor</a>.</p>
|
||||
<p>Split ages into age groups defined by the `split` argument. This allows for easier demographic (antimicrobial resistance) analysis. The function returns an ordered [factor].</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@@ -81,7 +81,7 @@
|
||||
</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://rdrr.io/r/base/factor.html" class="external-link">factor</a></p>
|
||||
<p>Ordered [factor]</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Split Ages into Age Groups
|
||||
|
||||
Split ages into age groups defined by the `split` argument. This allows
|
||||
for easier demographic (antimicrobial resistance) analysis. The function
|
||||
returns an ordered [factor](https://rdrr.io/r/base/factor.html).
|
||||
Split ages into age groups defined by the \`split\` argument. This
|
||||
allows for easier demographic (antimicrobial resistance) analysis. The
|
||||
function returns an ordered \[factor\].
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -34,7 +34,7 @@ age_groups(x, split_at = c(0, 12, 25, 55, 75), names = NULL,
|
||||
|
||||
## Value
|
||||
|
||||
Ordered [factor](https://rdrr.io/r/base/factor.html)
|
||||
Ordered \[factor\]
|
||||
|
||||
## 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -74,41 +74,6 @@
|
||||
<span> skip <span class="op">=</span> <span class="cn">FALSE</span>, id <span class="op">=</span> <span class="fu">recipes</span><span class="fu">::</span><span class="fu"><a href="https://recipes.tidymodels.org/reference/rand_id.html" class="external-link">rand_id</a></span><span class="op">(</span><span class="st">"sir_numeric"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg-recipe">recipe<a class="anchor" aria-label="anchor" href="#arg-recipe"></a></dt>
|
||||
<dd><p>A recipe object. The step will be added to the sequence of
|
||||
operations for this recipe.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>One or more selector functions to choose variables for this step.
|
||||
See <code><a href="https://recipes.tidymodels.org/reference/selections.html" class="external-link">selections()</a></code> for more details.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-role">role<a class="anchor" aria-label="anchor" href="#arg-role"></a></dt>
|
||||
<dd><p>Not used by this step since no new variables are created.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-trained">trained<a class="anchor" aria-label="anchor" href="#arg-trained"></a></dt>
|
||||
<dd><p>A logical to indicate if the quantities for preprocessing have
|
||||
been estimated.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-skip">skip<a class="anchor" aria-label="anchor" href="#arg-skip"></a></dt>
|
||||
<dd><p>A logical. Should the step be skipped when the recipe is baked by
|
||||
<code><a href="https://recipes.tidymodels.org/reference/bake.html" class="external-link">bake()</a></code>? While all operations are baked when <code><a href="https://recipes.tidymodels.org/reference/prep.html" class="external-link">prep()</a></code> is run, some
|
||||
operations may not be able to be conducted on new data (e.g. processing the
|
||||
outcome variable(s)). Care should be taken when using <code>skip = TRUE</code> as it
|
||||
may affect the computations for subsequent operations.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-id">id<a class="anchor" aria-label="anchor" href="#arg-id"></a></dt>
|
||||
<dd><p>A character string that is unique to this step to identify it.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>You can read more in our online <a href="https://amr-for-r.org/articles/AMR_with_tidymodels.html">AMR with tidymodels introduction</a>.</p>
|
||||
|
||||
@@ -25,43 +25,6 @@ step_sir_numeric(recipe, ..., role = NA, trained = FALSE, columns = NULL,
|
||||
skip = FALSE, id = recipes::rand_id("sir_numeric"))
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- recipe:
|
||||
|
||||
A recipe object. The step will be added to the sequence of operations
|
||||
for this recipe.
|
||||
|
||||
- ...:
|
||||
|
||||
One or more selector functions to choose variables for this step. See
|
||||
[`selections()`](https://recipes.tidymodels.org/reference/selections.html)
|
||||
for more details.
|
||||
|
||||
- role:
|
||||
|
||||
Not used by this step since no new variables are created.
|
||||
|
||||
- trained:
|
||||
|
||||
A logical to indicate if the quantities for preprocessing have been
|
||||
estimated.
|
||||
|
||||
- skip:
|
||||
|
||||
A logical. Should the step be skipped when the recipe is baked by
|
||||
[`bake()`](https://recipes.tidymodels.org/reference/bake.html)? While
|
||||
all operations are baked when
|
||||
[`prep()`](https://recipes.tidymodels.org/reference/prep.html) is run,
|
||||
some operations may not be able to be conducted on new data (e.g.
|
||||
processing the outcome variable(s)). Care should be taken when using
|
||||
`skip = TRUE` as it may affect the computations for subsequent
|
||||
operations.
|
||||
|
||||
- id:
|
||||
|
||||
A character string that is unique to this step to identify it.
|
||||
|
||||
## Details
|
||||
|
||||
You can read more in our online [AMR with tidymodels
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 @@ 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -132,7 +132,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-and-replace-when.html" class="external-link">case_when()</a></code>. See <em>Examples</em>.</p></dd>
|
||||
<dd><p>A column name of `x`, or values calculated to split rows of `x`, e.g. by using [ifelse()] or [`case_when()`][dplyr::case_when()]. See *Examples*.</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,10 +154,9 @@ knit_print(x, italicise = TRUE,
|
||||
|
||||
- syndromic_group:
|
||||
|
||||
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-and-replace-when.html).
|
||||
See *Examples*.
|
||||
A column name of \`x\`, or values calculated to split rows of \`x\`,
|
||||
e.g. by using \[ifelse()\] or
|
||||
\[\`case_when()\`\]\[dplyr::case_when()\]. 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 @@ 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
|
||||
<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://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>
|
||||
<dd><p>A [logical] to indicate whether the `mic` class should be kept - the default is `TRUE` for [rescale_mic()] and `FALSE` for [droplevels()]. When setting this to `FALSE` in [rescale_mic()], the output will have factor levels that acknowledge `mic_range`.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
@@ -107,45 +107,45 @@
|
||||
</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://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>
|
||||
<p>Ordered [factor] with additional class [`mic`], that in mathematical operations acts as a [numeric] vector. Bear in mind that the outcome of any mathematical operation on MICs will return a [numeric] 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-2026) and CLSI (2011-2026).</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>
|
||||
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="co">#> [1] 16 1 8 8 64 >=128 0.0625 32 32 16</span></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a></span>
|
||||
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a><span class="fu">is.factor</span>(x)</span>
|
||||
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a><span class="co">#> [1] TRUE</span></span>
|
||||
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a></span>
|
||||
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a>x[<span class="dv">1</span>] <span class="sc">*</span> <span class="dv">2</span></span>
|
||||
<span id="cb1-10"><a href="#cb1-10" tabindex="-1"></a><span class="co">#> [1] 32</span></span>
|
||||
<span id="cb1-11"><a href="#cb1-11" tabindex="-1"></a></span>
|
||||
<span id="cb1-12"><a href="#cb1-12" tabindex="-1"></a><span class="fu">median</span>(x)</span>
|
||||
<span id="cb1-13"><a href="#cb1-13" tabindex="-1"></a><span class="co">#> [1] 26</span></span></code></pre><p></p></div>
|
||||
<p>This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> values in data analysis, e.g.:</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>x[x <span class="sc">></span> <span class="dv">4</span>]</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="co">#> Class <mic></span></span>
|
||||
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="co">#> [1] 16 8 8 64 >=128 32 32 16</span></span>
|
||||
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(x, <span class="at">hospital =</span> <span class="st">"A"</span>)</span>
|
||||
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a><span class="fu">subset</span>(df, x <span class="sc">></span> <span class="dv">4</span>) <span class="co"># or with dplyr: df %>% filter(x > 4)</span></span>
|
||||
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a><span class="co">#> x hospital</span></span>
|
||||
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a><span class="co">#> 1 16 A</span></span>
|
||||
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a><span class="co">#> 5 64 A</span></span>
|
||||
<span id="cb1-10"><a href="#cb1-10" tabindex="-1"></a><span class="co">#> 6 >=128 A</span></span>
|
||||
<span id="cb1-11"><a href="#cb1-11" tabindex="-1"></a><span class="co">#> 8 32 A</span></span>
|
||||
<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://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://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>To interpret MIC values as SIR values, use [as.sir()] on MIC values. It supports guidelines from EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline <!-- %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`). --></p>
|
||||
<p>This class for MIC values is a quite a special data type: formally it is an ordered [factor] with valid MIC values as [factor] levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:</p>
|
||||
<p>“`
|
||||
x <- random_mic(10)
|
||||
x
|
||||
#> Class <mic>
|
||||
#> [1] 16 1 8 8 64 >=128 0.0625 32 32 16</p>
|
||||
<p>is.factor(x)
|
||||
#> [1] TRUE</p>
|
||||
<p>x[1] * 2
|
||||
#> [1] 32</p>
|
||||
<p>median(x)
|
||||
#> [1] 26
|
||||
“`</p>
|
||||
<p>This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using [numeric] values in data analysis, e.g.:</p>
|
||||
<p>“`
|
||||
x[x > 4]
|
||||
#> Class <mic>
|
||||
#> [1] 16 8 8 64 >=128 32 32 16</p>
|
||||
<p>df <- data.frame(x, hospital = "A")
|
||||
subset(df, x > 4) # or with dplyr: df <!-- %>% filter(x > 4) -->
|
||||
#> x hospital
|
||||
#> 1 16 A
|
||||
#> 5 64 A
|
||||
#> 6 >=128 A
|
||||
#> 8 32 A
|
||||
#> 9 32 A
|
||||
#> 10 16 A
|
||||
“`</p>
|
||||
<p>All so-called [group generic functions][groupGeneric()] are implemented for the MIC class (such as `!`, `!=`, `<`, `>=`, [exp()], [log2()]). Some mathematical functions are also implemented (such as [quantile()], [median()], [fivenum()]). Since [sd()] and [var()] are non-generic functions, these could not be extended. Use [mad()] as an alternative, or use e.g. `sd(as.numeric(x))` where `x` is your vector of MIC values.</p>
|
||||
<p>Using [as.double()] or [as.numeric()] on MIC values will remove the operators and return a numeric vector. Do **not** use [as.integer()] on MIC values as by the <span style="R">R</span> convention on [factor]s, it will return the index of the factor levels (which is often useless for regular users).</p>
|
||||
<p>The function [is.mic()] detects if the input contains class `mic`. If the input is a [data.frame] or [list], it iterates over all columns/items and returns a [logical] vector.</p>
|
||||
<p>Use [droplevels()] to drop unused levels. At default, it will return a plain factor. Use `droplevels(..., as.mic = TRUE)` to maintain the `mic` class.</p>
|
||||
<p>With [rescale_mic()], 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 `ggplot2`, use one of the [`scale_*_mic()`][scale_x_mic()] 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>
|
||||
<p>Use <code>mic_p50()</code> and <code>mic_p90()</code> to get the 50th and 90th percentile of MIC values. They return 'normal' <a href="https://rdrr.io/r/base/numeric.html" class="external-link">numeric</a> values.</p>
|
||||
</div>
|
||||
|
||||
@@ -62,12 +62,10 @@ droplevels(x, as.mic = FALSE, ...)
|
||||
|
||||
- as.mic:
|
||||
|
||||
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://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`.
|
||||
A \[logical\] to indicate whether the \`mic\` class should be kept -
|
||||
the default is \`TRUE\` for \[rescale_mic()\] and \`FALSE\` for
|
||||
\[droplevels()\]. When setting this to \`FALSE\` in \[rescale_mic()\],
|
||||
the output will have factor levels that acknowledge \`mic_range\`.
|
||||
|
||||
- ...:
|
||||
|
||||
@@ -75,101 +73,71 @@ droplevels(x, as.mic = FALSE, ...)
|
||||
|
||||
## Value
|
||||
|
||||
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
|
||||
Ordered \[factor\] with additional class \[\`mic\`\], that in
|
||||
mathematical operations acts as a \[numeric\] 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.
|
||||
\[numeric\] value.
|
||||
|
||||
## Details
|
||||
|
||||
To interpret MIC values as SIR values, use
|
||||
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) on MIC values.
|
||||
It supports guidelines from EUCAST (2011-2026) and CLSI (2011-2026).
|
||||
To interpret MIC values as SIR values, use \[as.sir()\] on MIC values.
|
||||
It supports guidelines from EUCAST (\`r min(as.integer(gsub("\[^0-9\]",
|
||||
"", subset(clinical_breakpoints, guideline
|
||||
|
||||
This class for MIC values is a quite a special data type: formally it is
|
||||
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
|
||||
an ordered \[factor\] with valid MIC values as \[factor\] 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
|
||||
#> Class <mic>
|
||||
#> [1] 16 1 8 8 64 >=128 0.0625 32 32 16
|
||||
“\` x \<- random_mic(10) x \#\> Class \<mic\> \#\> \[1\] 16 1 8 8 64
|
||||
\>=128 0.0625 32 32 16
|
||||
|
||||
is.factor(x)
|
||||
#> [1] TRUE
|
||||
is.factor(x) \#\> \[1\] TRUE
|
||||
|
||||
x[1] * 2
|
||||
#> [1] 32
|
||||
x\[1\] \* 2 \#\> \[1\] 32
|
||||
|
||||
median(x)
|
||||
#> [1] 26
|
||||
median(x) \#\> \[1\] 26 “\`
|
||||
|
||||
This makes it possible to maintain operators that often come with MIC
|
||||
values, such "\>=" and "\<=", even when filtering using
|
||||
[numeric](https://rdrr.io/r/base/numeric.html) values in data analysis,
|
||||
e.g.:
|
||||
values, such "\>=" and "\<=", even when filtering using \[numeric\]
|
||||
values in data analysis, e.g.:
|
||||
|
||||
x[x > 4]
|
||||
#> Class <mic>
|
||||
#> [1] 16 8 8 64 >=128 32 32 16
|
||||
“\` x\[x \> 4\] \#\> Class \<mic\> \#\> \[1\] 16 8 8 64 \>=128 32 32 16
|
||||
|
||||
df <- data.frame(x, hospital = "A")
|
||||
subset(df, x > 4) # or with dplyr: df %>% filter(x > 4)
|
||||
#> x hospital
|
||||
#> 1 16 A
|
||||
#> 5 64 A
|
||||
#> 6 >=128 A
|
||||
#> 8 32 A
|
||||
#> 9 32 A
|
||||
#> 10 16 A
|
||||
df \<- data.frame(x, hospital = "A") subset(df, x \> 4) \# or with
|
||||
dplyr: df \#\> x hospital \#\> 1 16 A \#\> 5 64 A \#\> 6 \>=128 A \#\> 8
|
||||
32 A \#\> 9 32 A \#\> 10 16 A “\`
|
||||
|
||||
All so-called [group generic
|
||||
functions](https://rdrr.io/r/base/groupGeneric.html) are implemented for
|
||||
the MIC class (such as `!`, `!=`, `<`, `>=`,
|
||||
[`exp()`](https://rdrr.io/r/base/Log.html),
|
||||
[`log2()`](https://rdrr.io/r/base/Log.html)). Some mathematical
|
||||
functions are also implemented (such as
|
||||
[`quantile()`](https://rdrr.io/r/stats/quantile.html),
|
||||
[`median()`](https://rdrr.io/r/stats/median.html),
|
||||
[`fivenum()`](https://rdrr.io/r/stats/fivenum.html)). Since
|
||||
[`sd()`](https://rdrr.io/r/stats/sd.html) and
|
||||
[`var()`](https://rdrr.io/r/stats/cor.html) are non-generic functions,
|
||||
these could not be extended. Use
|
||||
[`mad()`](https://rdrr.io/r/stats/mad.html) as an alternative, or use
|
||||
e.g. `sd(as.numeric(x))` where `x` is your vector of MIC values.
|
||||
All so-called \[group generic functions\]\[groupGeneric()\] are
|
||||
implemented for the MIC class (such as \`!\`, \`!=\`, \`\<\`, \`\>=\`,
|
||||
\[exp()\], \[log2()\]). Some mathematical functions are also implemented
|
||||
(such as \[quantile()\], \[median()\], \[fivenum()\]). Since \[sd()\]
|
||||
and \[var()\] are non-generic functions, these could not be extended.
|
||||
Use \[mad()\] as an alternative, or use e.g. \`sd(as.numeric(x))\` where
|
||||
\`x\` is your vector of MIC values.
|
||||
|
||||
Using [`as.double()`](https://rdrr.io/r/base/double.html) or
|
||||
[`as.numeric()`](https://rdrr.io/r/base/numeric.html) on MIC values will
|
||||
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://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).
|
||||
Using \[as.double()\] or \[as.numeric()\] on MIC values will remove the
|
||||
operators and return a numeric vector. Do \*\*not\*\* use
|
||||
\[as.integer()\] on MIC values as by the R convention on \[factor\]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
|
||||
[list](https://rdrr.io/r/base/list.html), it iterates over all
|
||||
columns/items and returns a
|
||||
[logical](https://rdrr.io/r/base/logical.html) vector.
|
||||
The function \[is.mic()\] detects if the input contains class \`mic\`.
|
||||
If the input is a \[data.frame\] or \[list\], it iterates over all
|
||||
columns/items and returns a \[logical\] vector.
|
||||
|
||||
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.
|
||||
Use \[droplevels()\] 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
|
||||
With \[rescale_mic()\], existing MIC ranges can be limited to a defined
|
||||
range of MIC values. This can be useful to better compare MIC
|
||||
distributions.
|
||||
|
||||
For `ggplot2`, use one of the
|
||||
[`scale_*_mic()`](https://amr-for-r.org/reference/plot.md) functions to
|
||||
plot MIC values. They allows custom MIC ranges and to plot intermediate
|
||||
log2 levels for missing MIC values.
|
||||
For \`ggplot2\`, use one of the
|
||||
\[\`scale\_\*\_mic()\`\]\[scale_x_mic()\] functions to plot MIC values.
|
||||
They allows custom MIC ranges and to plot intermediate log2 levels for
|
||||
missing MIC values.
|
||||
|
||||
`NA_mic_` is a missing value of the new `mic` class, analogous to e.g.
|
||||
base R's [`NA_character_`](https://rdrr.io/r/base/NA.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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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,7 +1,7 @@
|
||||
<!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>Interpret MIC and Disk Diffusion as SIR, or Clean Existing SIR Data — as.sir • 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="Interpret MIC and Disk Diffusion as SIR, or Clean Existing SIR Data — as.sir"><meta name="description" content="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 containing the levels S, SDD, I, R, NI.
|
||||
Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026, see Details. All breakpoints used for interpretation are available in our clinical_breakpoints data set."><meta property="og:description" content="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 containing the levels S, SDD, I, R, NI.
|
||||
Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026, see Details. All breakpoints used for interpretation are available in our clinical_breakpoints data set."><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>
|
||||
<!-- 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>Interpret MIC and Disk Diffusion as SIR, or Clean Existing SIR Data — as.sir • 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="Interpret MIC and Disk Diffusion as SIR, or Clean Existing SIR Data — as.sir"><meta name="description" content='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] containing the levels `S`, `SDD`, `I`, `R`, `NI`.
|
||||
Breakpoints are currently implemented from EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline '><meta property="og:description" content='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] containing the levels `S`, `SDD`, `I`, `R`, `NI`.
|
||||
Breakpoints are currently implemented from EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline '><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>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
|
||||
|
||||
<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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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,8 +52,8 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
|
||||
</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://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-2026 and CLSI 2011-2026, see <em>Details</em>. All breakpoints used for interpretation are available in our <a href="clinical_breakpoints.html">clinical_breakpoints</a> data set.</p>
|
||||
<p>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] containing the levels `S`, `SDD`, `I`, `R`, `NI`.</p>
|
||||
<p>Breakpoints are currently implemented from EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline <!-- %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "EUCAST")$guideline)))` and CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI")$guideline)))`, see *Details*. All breakpoints used for interpretation are available in our [clinical_breakpoints] data set. --></p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@@ -236,7 +236,7 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
|
||||
</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://rdrr.io/pkg/data.table/man/fctr.html" class="external-link">factor</a> with new class <code>sir</code></p>
|
||||
<p>Ordered [factor] with new class `sir`</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
@@ -420,10 +420,10 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
|
||||
<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-04-30 <span style="color: #949494;">17:47:55</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-04-30 <span style="color: #949494;">17:47:55</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-04-30 <span style="color: #949494;">17:47:55</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-04-30 <span style="color: #949494;">17:47:55</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-05-02 <span style="color: #949494;">13:02:42</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-05-02 <span style="color: #949494;">13:02:42</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-05-02 <span style="color: #949494;">13:02:42</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-05-02 <span style="color: #949494;">13:02:43</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>
|
||||
|
||||
@@ -2,16 +2,13 @@
|
||||
|
||||
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://rdrr.io/pkg/data.table/man/fctr.html) containing the
|
||||
levels `S`, `SDD`, `I`, `R`, `NI`.
|
||||
EUCAST or CLSI. \[as.sir()\] transforms the input to a new class
|
||||
\[\`sir\`\], which is an ordered \[factor\] containing the levels \`S\`,
|
||||
\`SDD\`, \`I\`, \`R\`, \`NI\`.
|
||||
|
||||
Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI
|
||||
2011-2026, see *Details*. All breakpoints used for interpretation are
|
||||
available in our
|
||||
[clinical_breakpoints](https://amr-for-r.org/reference/clinical_breakpoints.md)
|
||||
data set.
|
||||
Breakpoints are currently implemented from EUCAST \`r
|
||||
min(as.integer(gsub("\[^0-9\]", "", subset(AMR::clinical_breakpoints,
|
||||
guideline
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -367,8 +364,7 @@ disk diffusion diameters:
|
||||
|
||||
## Value
|
||||
|
||||
Ordered [factor](https://rdrr.io/pkg/data.table/man/fctr.html) with new
|
||||
class `sir`
|
||||
Ordered \[factor\] with new class \`sir\`
|
||||
|
||||
## Details
|
||||
|
||||
@@ -667,10 +663,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-04-30 17:47:55 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-04-30 17:47:55 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-04-30 17:47:55 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-04-30 17:47:55 1 DISK genta Escherich… human 18
|
||||
#> 1 2026-05-02 13:02:42 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-05-02 13:02:42 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-05-02 13:02:42 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-05-02 13:02:43 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 @@ 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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,269 +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>Define Custom EUCAST Rules — custom_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="Define Custom EUCAST Rules — custom_eucast_rules"><meta name="description" content="Define custom EUCAST rules for your organisation or specific analysis and use the output of this function in eucast_rules()."><meta property="og:description" content="Define custom EUCAST rules for your organisation or specific analysis and use the output of this function in eucast_rules()."><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.9055</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>Define Custom EUCAST Rules</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/custom_eucast_rules.R" class="external-link"><code>R/custom_eucast_rules.R</code></a></small>
|
||||
<div class="d-none name"><code>custom_eucast_rules.Rd</code></div>
|
||||
</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="interpretive_rules.html">eucast_rules()</a></code>.</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">custom_eucast_rules</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>Rules in <a href="https://rdrr.io/r/base/tilde.html" class="external-link">formula</a> notation, see below for instructions, and in <em>Examples</em>.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>A <a href="https://rdrr.io/r/base/list.html" class="external-link">list</a> containing the custom rules</p>
|
||||
</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="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-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>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">x</span></span>
|
||||
<span><span class="co">#> A set of custom EUCAST rules:</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 1. If TZP is "S" then set to S :</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP)</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 2. If TZP is "R" then set to R :</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP)</span></span></code></pre><p></p></div>
|
||||
<p>The rules (the part <em>before</em> the tilde, in above example <code>TZP == "S"</code> and <code>TZP == "R"</code>) must be evaluable in your data set: it should be able to run as a filter in your data set without errors. This means for the above example that the column <code>TZP</code> must exist. We will create a sample data set and test the rules set:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">df</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>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 class="st">"Escherichia coli"</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span>,</span>
|
||||
<span> TZP <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"R"</span><span class="op">)</span>,</span>
|
||||
<span> ampi <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"S"</span><span class="op">)</span>,</span>
|
||||
<span> cipro <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"S"</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="va">df</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<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/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>
|
||||
<span> overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<span><span class="co">#> 1 Escherichia coli R R S</span></span>
|
||||
<span><span class="co">#> 2 Klebsiella pneumoniae R R S</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="using-taxonomic-properties-in-rules">Using taxonomic properties in rules<a class="anchor" aria-label="anchor" href="#using-taxonomic-properties-in-rules"></a></h3>
|
||||
|
||||
|
||||
<p>There is one exception in columns used for the rules: all column names of the <a href="microorganisms.html">microorganisms</a> data set can also be used, but do not have to exist in the data set. These column names are: <code>"mo"</code>, <code>"fullname"</code>, <code>"status"</code>, <code>"kingdom"</code>, <code>"phylum"</code>, <code>"class"</code>, <code>"order"</code>, <code>"family"</code>, <code>"genus"</code>, <code>"species"</code>, <code>"subspecies"</code>, <code>"rank"</code>, <code>"ref"</code>, <code>"oxygen_tolerance"</code>, <code>"source"</code>, <code>"lpsn"</code>, <code>"lpsn_parent"</code>, <code>"lpsn_renamed_to"</code>, <code>"mycobank"</code>, <code>"mycobank_parent"</code>, <code>"mycobank_renamed_to"</code>, <code>"gbif"</code>, <code>"gbif_parent"</code>, <code>"gbif_renamed_to"</code>, <code>"prevalence"</code>, and <code>"snomed"</code>. Thus, this next example will work as well, despite the fact that the <code>df</code> data set does not contain a column <code>genus</code>:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">y</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>
|
||||
<span> <span class="va">TZP</span> <span class="op">==</span> <span class="st">"S"</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">"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">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/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>
|
||||
<span> overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<span><span class="co">#> 1 Escherichia coli R S S</span></span>
|
||||
<span><span class="co">#> 2 Klebsiella pneumoniae R R S</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="sharing-rules-among-multiple-users">Sharing rules among multiple users<a class="anchor" aria-label="anchor" href="#sharing-rules-among-multiple-users"></a></h3>
|
||||
|
||||
|
||||
<p>The rules set (the <code>y</code> object in this case) could be exported to a shared file location using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS()</a></code> if you collaborate with multiple users. The custom rules set could then be imported using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">readRDS()</a></code>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="usage-of-multiple-antimicrobials-and-antimicrobial-group-names">Usage of multiple antimicrobials and antimicrobial group names<a class="anchor" aria-label="anchor" href="#usage-of-multiple-antimicrobials-and-antimicrobial-group-names"></a></h3>
|
||||
|
||||
|
||||
<p>You can define antimicrobial groups instead of single antimicrobials for the rule consequence, which is the part <em>after</em> the tilde (~). In the examples above, the antimicrobial group <code>aminopenicillins</code> includes both ampicillin and amoxicillin.</p>
|
||||
<p>Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code> function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R":</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">"R"</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="va">aminopenicillins</span>, <span class="va">ureidopenicillins</span><span class="op">)</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span></span>
|
||||
<span><span class="va">x</span></span>
|
||||
<span><span class="co">#> A set of custom EUCAST rules:</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 1. If TZP is "R" then set to "R":</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP)</span></span></code></pre><p></p></div>
|
||||
<p>These 43 antimicrobial groups are allowed in the rules (case-insensitive) and can be used in any combination:</p><ul><li><p>aminocoumarins<br>(clorobiocin, novobiocin, and penicillin/novobiocin)</p></li>
|
||||
<li><p>aminoglycosides<br>(amikacin, amikacin/fosfomycin, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, kasugamycin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin, and tobramycin-high)</p></li>
|
||||
<li><p>aminopenicillins<br>(amoxicillin, amoxicillin/clavulanic acid, and ampicillin)</p></li>
|
||||
<li><p>antifungals<br>(amorolfine, amphotericin B, amphotericin B-high, anidulafungin, butoconazole, caspofungin, ciclopirox, clotrimazole, econazole, fluconazole, flucytosine, fosfluconazole, griseofulvin, hachimycin, ibrexafungerp, isavuconazole, isoconazole, itraconazole, ketoconazole, manogepix, micafungin, miconazole, nystatin, oteseconazole, pimaricin, posaconazole, rezafungin, ribociclib, sulconazole, terbinafine, terconazole, and voriconazole)</p></li>
|
||||
<li><p>antimycobacterials<br>(4-aminosalicylic acid, calcium aminosalicylate, capreomycin, clofazimine, delamanid, enviomycin, ethambutol, ethambutol/isoniazid, ethionamide, isoniazid, isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, morinamide, p-aminosalicylic acid, pretomanid, protionamide, pyrazinamide, rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, rifapentine, sodium aminosalicylate, streptomycin/isoniazid, terizidone, thioacetazone, thioacetazone/isoniazid, tiocarlide, and viomycin)</p></li>
|
||||
<li><p>betalactamase_inhibitors<br>(amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin/sulbactam, avibactam, aztreonam/avibactam, aztreonam/nacubactam, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefoperazone/sulbactam, cefotaxime/sulbactam, ceftaroline/avibactam, ceftazidime/avibactam, ceftibuten/avibactam, ceftolozane/tazobactam, imipenem/relebactam, meropenem/nacubactam, meropenem/vaborbactam, mezlocillin/sulbactam, nacubactam, penicillin/sulbactam, piperacillin/sulbactam, piperacillin/tazobactam, sulbactam, sultamicillin, taniborbactam, tazobactam, ticarcillin/clavulanic acid, xeruborbactam, and zidebactam)</p></li>
|
||||
<li><p>betalactams<br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, biapenem, carbenicillin, carindacillin, carumonam, cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, ciclacillin, clometocillin, cloxacillin, dicloxacillin, doripenem, epicillin, ertapenem, flucloxacillin, hetacillin, imipenem, imipenem/EDTA, imipenem/relebactam, latamoxef, lenampicillin, loracarbef, mecillinam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, panipenem, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, razupenem, ritipenem, ritipenem acoxil, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, taniborbactam, tebipenem, temocillin, ticarcillin, ticarcillin/clavulanic acid, and tigemonam)</p></li>
|
||||
<li><p>betalactams_with_inhibitor<br>(amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin/sulbactam, aztreonam/avibactam, aztreonam/nacubactam, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefoperazone/sulbactam, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefpodoxime/clavulanic acid, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, ceftibuten/avibactam, ceftolozane/tazobactam, ceftriaxone/beta-lactamase inhibitor, imipenem/relebactam, meropenem/nacubactam, meropenem/vaborbactam, mezlocillin/sulbactam, penicillin/novobiocin, penicillin/sulbactam, piperacillin/sulbactam, piperacillin/tazobactam, and ticarcillin/clavulanic acid)</p></li>
|
||||
<li><p>carbapenems<br>(biapenem, doripenem, ertapenem, imipenem, imipenem/EDTA, imipenem/relebactam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, panipenem, razupenem, ritipenem, ritipenem acoxil, taniborbactam, and tebipenem)</p></li>
|
||||
<li><p>cephalosporins<br>(cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, latamoxef, and loracarbef)</p></li>
|
||||
<li><p>cephalosporins_1st<br>(cefacetrile, cefadroxil, cefalexin, cefaloridine, cefalotin, cefapirin, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, and cephradine)</p></li>
|
||||
<li><p>cephalosporins_2nd<br>(cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening test, cefprozil, cefuroxime, cefuroxime axetil, and loracarbef)</p></li>
|
||||
<li><p>cephalosporins_3rd<br>(cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotiam hexetil, cefovecin, cefpimizole, cefpiramide, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefsulodin, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, and latamoxef)</p></li>
|
||||
<li><p>cephalosporins_4th<br>(cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetecol, cefoselis, cefozopran, cefpirome, and cefquinome)</p></li>
|
||||
<li><p>cephalosporins_5th<br>(ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, and ceftolozane/tazobactam)</p></li>
|
||||
<li><p>cephalosporins_except_caz<br>(cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, latamoxef, and loracarbef)</p></li>
|
||||
<li><p>fluoroquinolones<br>(besifloxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, pazufloxacin, pefloxacin, pefloxacin screening test, pradofloxacin, premafloxacin, prulifloxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin)</p></li>
|
||||
<li><p>fusidanes<br>(fusidic acid)</p></li>
|
||||
<li><p>glycopeptides<br>(avoparcin, bleomycin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>glycopeptides_except_lipo<br>(avoparcin, bleomycin, norvancomycin, ramoplanin, teicoplanin, teicoplanin-macromethod, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>ionophores<br>(lasalocid, monensin sodium, narasin, nystatin, and salinomycin)</p></li>
|
||||
<li><p>isoxazolylpenicillins<br>(cloxacillin, dicloxacillin, flucloxacillin, meticillin, oxacillin, and oxacillin screening test)</p></li>
|
||||
<li><p>lincosamides<br>(clindamycin, clindamycin inducible screening test, lincomycin, and pirlimycin)</p></li>
|
||||
<li><p>lipoglycopeptides<br>(dalbavancin, oritavancin, and telavancin)</p></li>
|
||||
<li><p>macrolides<br>(acetylmidecamycin, acetylspiramycin, azithromycin, clarithromycin, clindamycin inducible screening test, dirithromycin, erythromycin, flurithromycin, gamithromycin, josamycin, kitasamycin, meleumycin, midecamycin, miocamycin, nafithromycin, oleandomycin, pirlimycin, primycin, rokitamycin, roxithromycin, solithromycin, spiramycin, telithromycin, tildipirosin, tilmicosin, troleandomycin, tulathromycin, tylosin, and tylvalosin)</p></li>
|
||||
<li><p>monobactams<br>(aztreonam, aztreonam/avibactam, aztreonam/nacubactam, carumonam, and tigemonam)</p></li>
|
||||
<li><p>nitrofurans<br>(furazidin, furazolidone, nifurtoinol, nitrofurantoin, and nitrofurazone)</p></li>
|
||||
<li><p>oxazolidinones<br>(cadazolid, cycloserine, linezolid, tedizolid, and thiacetazone)</p></li>
|
||||
<li><p>penicillins<br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, carbenicillin, carindacillin, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, temocillin, ticarcillin, and ticarcillin/clavulanic acid)</p></li>
|
||||
<li><p>peptides<br>(avoparcin, bacitracin, bleomycin, dalbavancin, daptomycin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, thiostrepton, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>phenicols<br>(chloramphenicol, florfenicol, and thiamphenicol)</p></li>
|
||||
<li><p>phosphonics<br>(amikacin/fosfomycin and fosfomycin)</p></li>
|
||||
<li><p>pleuromutilins<br>(retapamulin and tiamulin)</p></li>
|
||||
<li><p>polymyxins<br>(colistin, polymyxin B, and polymyxin B/polysorbate 80)</p></li>
|
||||
<li><p>quinolones<br>(besifloxacin, cinoxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nalidixic acid screening test, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, oxolinic acid, ozenoxacin, pazufloxacin, pefloxacin, pefloxacin screening test, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin)</p></li>
|
||||
<li><p>rifamycins<br>(rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, and rifapentine)</p></li>
|
||||
<li><p>spiropyrimidinetriones<br>(zoliflodacin)</p></li>
|
||||
<li><p>streptogramins<br>(ostreogrycin, pristinamycin, quinupristin/dalfopristin, and virginiamycine)</p></li>
|
||||
<li><p>sulfonamides<br>(isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, ormetroprim/sulfamethoxazole, sulfachlorpyridazine, sulfadiazine, sulfadiazine/tetroxoprim, sulfadiazine/trimethoprim, sulfadimethoxine, sulfadimidine, sulfadimidine/trimethoprim, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamerazine/trimethoprim, sulfamethazine, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfametrole/trimethoprim, sulfamoxole, sulfamoxole/trimethoprim, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfasuccinamide, sulfathiazole, sulfathiourea, sulfisoxazole, sulfonamide, and trimethoprim/sulfamethoxazole)</p></li>
|
||||
<li><p>tetracyclines<br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, sarecycline, tetracycline, tetracycline screening test, tetracycline/oleandomycin, and tigecycline)</p></li>
|
||||
<li><p>tetracyclines_except_tgc<br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, sarecycline, tetracycline, tetracycline screening test, and tetracycline/oleandomycin)</p></li>
|
||||
<li><p>trimethoprims<br>(brodimoprim, iclaprim, isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, ormetroprim/sulfamethoxazole, sulfadiazine, sulfadiazine/tetroxoprim, sulfadiazine/trimethoprim, sulfadimethoxine, sulfadimidine, sulfadimidine/trimethoprim, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamerazine/trimethoprim, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfametrole/trimethoprim, sulfamoxole, sulfamoxole/trimethoprim, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfathiazole, sulfathiourea, trimethoprim, and trimethoprim/sulfamethoxazole)</p></li>
|
||||
<li><p>ureidopenicillins<br>(azlocillin, mezlocillin, piperacillin, and piperacillin/tazobactam)</p></li>
|
||||
</ul></div>
|
||||
|
||||
</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="va">x</span> <span class="op"><-</span> <span class="fu">custom_eucast_rules</span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><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="r-in"><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></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">x</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> A set of custom EUCAST rules:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FFD787;"> I </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FFD787;"> I </span>:</span>
|
||||
<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="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>
|
||||
<span class="r-in"><span> overwrite <span class="op">=</span> <span class="cn">TRUE</span>,</span></span>
|
||||
<span class="r-in"><span> verbose <span class="op">=</span> <span class="cn">TRUE</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: 8 × 9</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> row col mo_fullname old new rule rule_group rule_name rule_source</span>
|
||||
<span class="r-out co"><span class="r-pr">#></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;"><ord></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> 33 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 33 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 34 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 34 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> 531 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> 531 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">7</span> <span style="text-decoration: underline;">1</span>485 AMP Klebsiella oxy… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">8</span> <span style="text-decoration: underline;">1</span>485 AMX Klebsiella oxy… R I <span style="color: #949494;">"</span>rep… Custom EU… Custom E… Object 'x'…</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># combine rule sets</span></span></span>
|
||||
<span class="r-in"><span><span class="va">x2</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></span>
|
||||
<span class="r-in"><span> <span class="va">x</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="fu">custom_eucast_rules</span><span class="op">(</span><span class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">~</span> <span class="va">carbapenems</span> <span class="op">==</span> <span class="st">"R"</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="va">x2</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> A set of custom EUCAST rules:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FFD787;"> I </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FFD787;"> I </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">TZP</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #0000BB;">biapenem</span> (BIA), <span style="color: #0000BB;">doripenem</span> (DOR), <span style="color: #0000BB;">ertapenem</span> (ETP), <span style="color: #0000BB;">imipenem</span> (IPM), <span style="color: #0000BB;">imipenem/EDTA</span> (IPE), <span style="color: #0000BB;">imipenem/relebactam</span> (IMR), <span style="color: #0000BB;">meropenem</span> (MEM), <span style="color: #0000BB;">meropenem/nacubactam</span> (MNC), <span style="color: #0000BB;">meropenem/vaborbactam</span> (MEV), <span style="color: #0000BB;">panipenem</span> (PAN), <span style="color: #0000BB;">razupenem</span> (RZM), <span style="color: #0000BB;">ritipenem</span> (RIT), <span style="color: #0000BB;">ritipenem acoxil</span> (RIA), <span style="color: #0000BB;">taniborbactam</span> (TAN), <span style="color: #0000BB;">tebipenem</span> (TBP)</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/AMR-deprecated.html" />
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="canonical" href="https://amr-for-r.org/reference/AMR-deprecated.html">
|
||||
</head>
|
||||
</html>
|
||||
|
||||
|
||||
269
reference/custom_interpretive_rules.html
Normal file
269
reference/custom_interpretive_rules.html
Normal file
@@ -0,0 +1,269 @@
|
||||
<!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>Define Custom Interpretive Rules — custom_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="Define Custom Interpretive Rules — custom_interpretive_rules"><meta name="description" content="Define custom interpretive rules for your organisation or specific analysis and use the output of this function in interpretive_rules()."><meta property="og:description" content="Define custom interpretive rules for your organisation or specific analysis and use the output of this function in interpretive_rules()."><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.9057</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>Define Custom Interpretive Rules</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/custom_interpretive_rules.R" class="external-link"><code>R/custom_interpretive_rules.R</code></a></small>
|
||||
<div class="d-none name"><code>custom_interpretive_rules.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Define custom interpretive rules for your organisation or specific analysis and use the output of this function in <code><a href="interpretive_rules.html">interpretive_rules()</a></code>.</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">custom_interpretive_rules</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>Rules in <a href="https://rdrr.io/r/base/tilde.html" class="external-link">formula</a> notation, see below for instructions, and in <em>Examples</em>.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>A <a href="https://rdrr.io/r/base/list.html" class="external-link">list</a> containing the custom rules</p>
|
||||
</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 interpretive rules. This function can be used to define custom rules to be used in the <code><a href="interpretive_rules.html">interpretive_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-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_interpretive_rules.html">custom_interpretive_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 interpretive 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>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">x</span></span>
|
||||
<span><span class="co">#> A set of custom interpretive rules:</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 1. If TZP is "S" then set to S :</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP)</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 2. If TZP is "R" then set to R :</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP)</span></span></code></pre><p></p></div>
|
||||
<p>The rules (the part <em>before</em> the tilde, in above example <code>TZP == "S"</code> and <code>TZP == "R"</code>) must be evaluable in your data set: it should be able to run as a filter in your data set without errors. This means for the above example that the column <code>TZP</code> must exist. We will create a sample data set and test the rules set:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">df</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>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 class="st">"Escherichia coli"</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span>,</span>
|
||||
<span> TZP <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"R"</span><span class="op">)</span>,</span>
|
||||
<span> ampi <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"S"</span><span class="op">)</span>,</span>
|
||||
<span> cipro <span class="op">=</span> <span class="fu"><a href="../reference/as.sir.html">as.sir</a></span><span class="op">(</span><span class="st">"S"</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="va">df</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<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/interpretive_rules.html">interpretive_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>
|
||||
<span> overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<span><span class="co">#> 1 Escherichia coli R R S</span></span>
|
||||
<span><span class="co">#> 2 Klebsiella pneumoniae R R S</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="using-taxonomic-properties-in-rules">Using taxonomic properties in rules<a class="anchor" aria-label="anchor" href="#using-taxonomic-properties-in-rules"></a></h3>
|
||||
|
||||
|
||||
<p>There is one exception in columns used for the rules: all column names of the <a href="microorganisms.html">microorganisms</a> data set can also be used, but do not have to exist in the data set. These column names are: <code>"mo"</code>, <code>"fullname"</code>, <code>"status"</code>, <code>"kingdom"</code>, <code>"phylum"</code>, <code>"class"</code>, <code>"order"</code>, <code>"family"</code>, <code>"genus"</code>, <code>"species"</code>, <code>"subspecies"</code>, <code>"rank"</code>, <code>"ref"</code>, <code>"oxygen_tolerance"</code>, <code>"source"</code>, <code>"lpsn"</code>, <code>"lpsn_parent"</code>, <code>"lpsn_renamed_to"</code>, <code>"mycobank"</code>, <code>"mycobank_parent"</code>, <code>"mycobank_renamed_to"</code>, <code>"gbif"</code>, <code>"gbif_parent"</code>, <code>"gbif_renamed_to"</code>, <code>"prevalence"</code>, and <code>"snomed"</code>. Thus, this next example will work as well, despite the fact that the <code>df</code> data set does not contain a column <code>genus</code>:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="va">y</span> <span class="op"><-</span> <span class="fu"><a href="../reference/custom_interpretive_rules.html">custom_interpretive_rules</a></span><span class="op">(</span></span>
|
||||
<span> <span class="va">TZP</span> <span class="op">==</span> <span class="st">"S"</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">"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">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/interpretive_rules.html">interpretive_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>
|
||||
<span> overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> mo TZP ampi cipro</span></span>
|
||||
<span><span class="co">#> 1 Escherichia coli R S S</span></span>
|
||||
<span><span class="co">#> 2 Klebsiella pneumoniae R R S</span></span></code></pre><p></p></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="sharing-rules-among-multiple-users">Sharing rules among multiple users<a class="anchor" aria-label="anchor" href="#sharing-rules-among-multiple-users"></a></h3>
|
||||
|
||||
|
||||
<p>The rules set (the <code>y</code> object in this case) could be exported to a shared file location using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS()</a></code> if you collaborate with multiple users. The custom rules set could then be imported using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">readRDS()</a></code>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3 id="usage-of-multiple-antimicrobials-and-antimicrobial-group-names">Usage of multiple antimicrobials and antimicrobial group names<a class="anchor" aria-label="anchor" href="#usage-of-multiple-antimicrobials-and-antimicrobial-group-names"></a></h3>
|
||||
|
||||
|
||||
<p>You can define antimicrobial groups instead of single antimicrobials for the rule consequence, which is the part <em>after</em> the tilde (~). In the examples above, the antimicrobial group <code>aminopenicillins</code> includes both ampicillin and amoxicillin.</p>
|
||||
<p>Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code> function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R":</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_interpretive_rules.html">custom_interpretive_rules</a></span><span class="op">(</span><span class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</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="va">aminopenicillins</span>, <span class="va">ureidopenicillins</span><span class="op">)</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span></span>
|
||||
<span><span class="va">x</span></span>
|
||||
<span><span class="co">#> A set of custom interpretive rules:</span></span>
|
||||
<span><span class="co">#></span></span>
|
||||
<span><span class="co">#> 1. If TZP is "R" then set to "R":</span></span>
|
||||
<span><span class="co">#> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP)</span></span></code></pre><p></p></div>
|
||||
<p>These 43 antimicrobial groups are allowed in the rules (case-insensitive) and can be used in any combination:</p><ul><li><p>aminocoumarins<br>(clorobiocin, novobiocin, and penicillin/novobiocin)</p></li>
|
||||
<li><p>aminoglycosides<br>(amikacin, amikacin/fosfomycin, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, kasugamycin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin, and tobramycin-high)</p></li>
|
||||
<li><p>aminopenicillins<br>(amoxicillin, amoxicillin/clavulanic acid, and ampicillin)</p></li>
|
||||
<li><p>antifungals<br>(amorolfine, amphotericin B, amphotericin B-high, anidulafungin, butoconazole, caspofungin, ciclopirox, clotrimazole, econazole, fluconazole, flucytosine, fosfluconazole, griseofulvin, hachimycin, ibrexafungerp, isavuconazole, isoconazole, itraconazole, ketoconazole, manogepix, micafungin, miconazole, nystatin, oteseconazole, pimaricin, posaconazole, rezafungin, ribociclib, sulconazole, terbinafine, terconazole, and voriconazole)</p></li>
|
||||
<li><p>antimycobacterials<br>(4-aminosalicylic acid, calcium aminosalicylate, capreomycin, clofazimine, delamanid, enviomycin, ethambutol, ethambutol/isoniazid, ethionamide, isoniazid, isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, morinamide, p-aminosalicylic acid, pretomanid, protionamide, pyrazinamide, rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, rifapentine, sodium aminosalicylate, streptomycin/isoniazid, terizidone, thioacetazone, thioacetazone/isoniazid, tiocarlide, and viomycin)</p></li>
|
||||
<li><p>betalactamase_inhibitors<br>(amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin/sulbactam, avibactam, aztreonam/avibactam, aztreonam/nacubactam, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefoperazone/sulbactam, cefotaxime/sulbactam, ceftaroline/avibactam, ceftazidime/avibactam, ceftibuten/avibactam, ceftolozane/tazobactam, imipenem/relebactam, meropenem/nacubactam, meropenem/vaborbactam, mezlocillin/sulbactam, nacubactam, penicillin/sulbactam, piperacillin/sulbactam, piperacillin/tazobactam, sulbactam, sultamicillin, taniborbactam, tazobactam, ticarcillin/clavulanic acid, xeruborbactam, and zidebactam)</p></li>
|
||||
<li><p>betalactams<br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, biapenem, carbenicillin, carindacillin, carumonam, cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, ciclacillin, clometocillin, cloxacillin, dicloxacillin, doripenem, epicillin, ertapenem, flucloxacillin, hetacillin, imipenem, imipenem/EDTA, imipenem/relebactam, latamoxef, lenampicillin, loracarbef, mecillinam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, panipenem, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, razupenem, ritipenem, ritipenem acoxil, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, taniborbactam, tebipenem, temocillin, ticarcillin, ticarcillin/clavulanic acid, and tigemonam)</p></li>
|
||||
<li><p>betalactams_with_inhibitor<br>(amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin/sulbactam, aztreonam/avibactam, aztreonam/nacubactam, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefoperazone/sulbactam, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefpodoxime/clavulanic acid, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, ceftibuten/avibactam, ceftolozane/tazobactam, ceftriaxone/beta-lactamase inhibitor, imipenem/relebactam, meropenem/nacubactam, meropenem/vaborbactam, mezlocillin/sulbactam, penicillin/novobiocin, penicillin/sulbactam, piperacillin/sulbactam, piperacillin/tazobactam, and ticarcillin/clavulanic acid)</p></li>
|
||||
<li><p>carbapenems<br>(biapenem, doripenem, ertapenem, imipenem, imipenem/EDTA, imipenem/relebactam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, panipenem, razupenem, ritipenem, ritipenem acoxil, taniborbactam, and tebipenem)</p></li>
|
||||
<li><p>cephalosporins<br>(cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, latamoxef, and loracarbef)</p></li>
|
||||
<li><p>cephalosporins_1st<br>(cefacetrile, cefadroxil, cefalexin, cefaloridine, cefalotin, cefapirin, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, and cephradine)</p></li>
|
||||
<li><p>cephalosporins_2nd<br>(cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening test, cefprozil, cefuroxime, cefuroxime axetil, and loracarbef)</p></li>
|
||||
<li><p>cephalosporins_3rd<br>(cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotiam hexetil, cefovecin, cefpimizole, cefpiramide, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefsulodin, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, and latamoxef)</p></li>
|
||||
<li><p>cephalosporins_4th<br>(cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetecol, cefoselis, cefozopran, cefpirome, and cefquinome)</p></li>
|
||||
<li><p>cephalosporins_5th<br>(ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, and ceftolozane/tazobactam)</p></li>
|
||||
<li><p>cephalosporins_except_caz<br>(cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/taniborbactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftibuten/avibactam, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, latamoxef, and loracarbef)</p></li>
|
||||
<li><p>fluoroquinolones<br>(besifloxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, pazufloxacin, pefloxacin, pefloxacin screening test, pradofloxacin, premafloxacin, prulifloxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin)</p></li>
|
||||
<li><p>fusidanes<br>(fusidic acid)</p></li>
|
||||
<li><p>glycopeptides<br>(avoparcin, bleomycin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>glycopeptides_except_lipo<br>(avoparcin, bleomycin, norvancomycin, ramoplanin, teicoplanin, teicoplanin-macromethod, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>ionophores<br>(lasalocid, monensin sodium, narasin, nystatin, and salinomycin)</p></li>
|
||||
<li><p>isoxazolylpenicillins<br>(cloxacillin, dicloxacillin, flucloxacillin, meticillin, oxacillin, and oxacillin screening test)</p></li>
|
||||
<li><p>lincosamides<br>(clindamycin, clindamycin inducible screening test, lincomycin, and pirlimycin)</p></li>
|
||||
<li><p>lipoglycopeptides<br>(dalbavancin, oritavancin, and telavancin)</p></li>
|
||||
<li><p>macrolides<br>(acetylmidecamycin, acetylspiramycin, azithromycin, clarithromycin, clindamycin inducible screening test, dirithromycin, erythromycin, flurithromycin, gamithromycin, josamycin, kitasamycin, meleumycin, midecamycin, miocamycin, nafithromycin, oleandomycin, pirlimycin, primycin, rokitamycin, roxithromycin, solithromycin, spiramycin, telithromycin, tildipirosin, tilmicosin, troleandomycin, tulathromycin, tylosin, and tylvalosin)</p></li>
|
||||
<li><p>monobactams<br>(aztreonam, aztreonam/avibactam, aztreonam/nacubactam, carumonam, and tigemonam)</p></li>
|
||||
<li><p>nitrofurans<br>(furazidin, furazolidone, nifurtoinol, nitrofurantoin, and nitrofurazone)</p></li>
|
||||
<li><p>oxazolidinones<br>(cadazolid, cycloserine, linezolid, tedizolid, and thiacetazone)</p></li>
|
||||
<li><p>penicillins<br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, carbenicillin, carindacillin, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, temocillin, ticarcillin, and ticarcillin/clavulanic acid)</p></li>
|
||||
<li><p>peptides<br>(avoparcin, bacitracin, bleomycin, dalbavancin, daptomycin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, thiostrepton, vancomycin, vancomycin-macromethod, and zorbamycin)</p></li>
|
||||
<li><p>phenicols<br>(chloramphenicol, florfenicol, and thiamphenicol)</p></li>
|
||||
<li><p>phosphonics<br>(amikacin/fosfomycin and fosfomycin)</p></li>
|
||||
<li><p>pleuromutilins<br>(retapamulin and tiamulin)</p></li>
|
||||
<li><p>polymyxins<br>(colistin, polymyxin B, and polymyxin B/polysorbate 80)</p></li>
|
||||
<li><p>quinolones<br>(besifloxacin, cinoxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nalidixic acid screening test, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, oxolinic acid, ozenoxacin, pazufloxacin, pefloxacin, pefloxacin screening test, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin)</p></li>
|
||||
<li><p>rifamycins<br>(rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, and rifapentine)</p></li>
|
||||
<li><p>spiropyrimidinetriones<br>(zoliflodacin)</p></li>
|
||||
<li><p>streptogramins<br>(ostreogrycin, pristinamycin, quinupristin/dalfopristin, and virginiamycine)</p></li>
|
||||
<li><p>sulfonamides<br>(isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, ormetroprim/sulfamethoxazole, sulfachlorpyridazine, sulfadiazine, sulfadiazine/tetroxoprim, sulfadiazine/trimethoprim, sulfadimethoxine, sulfadimidine, sulfadimidine/trimethoprim, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamerazine/trimethoprim, sulfamethazine, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfametrole/trimethoprim, sulfamoxole, sulfamoxole/trimethoprim, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfasuccinamide, sulfathiazole, sulfathiourea, sulfisoxazole, sulfonamide, and trimethoprim/sulfamethoxazole)</p></li>
|
||||
<li><p>tetracyclines<br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, sarecycline, tetracycline, tetracycline screening test, tetracycline/oleandomycin, and tigecycline)</p></li>
|
||||
<li><p>tetracyclines_except_tgc<br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, sarecycline, tetracycline, tetracycline screening test, and tetracycline/oleandomycin)</p></li>
|
||||
<li><p>trimethoprims<br>(brodimoprim, iclaprim, isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, ormetroprim/sulfamethoxazole, sulfadiazine, sulfadiazine/tetroxoprim, sulfadiazine/trimethoprim, sulfadimethoxine, sulfadimidine, sulfadimidine/trimethoprim, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamerazine/trimethoprim, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfametrole/trimethoprim, sulfamoxole, sulfamoxole/trimethoprim, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfathiazole, sulfathiourea, trimethoprim, and trimethoprim/sulfamethoxazole)</p></li>
|
||||
<li><p>ureidopenicillins<br>(azlocillin, mezlocillin, piperacillin, and piperacillin/tazobactam)</p></li>
|
||||
</ul></div>
|
||||
|
||||
</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="va">x</span> <span class="op"><-</span> <span class="fu">custom_interpretive_rules</span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><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="r-in"><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></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">x</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> A set of custom interpretive rules:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FFD787;"> I </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FFD787;"> I </span>:</span>
|
||||
<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="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>
|
||||
<span class="r-in"><span> overwrite <span class="op">=</span> <span class="cn">TRUE</span>,</span></span>
|
||||
<span class="r-in"><span> verbose <span class="op">=</span> <span class="cn">TRUE</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: 8 × 9</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> row col mo_fullname old new rule rule_group rule_name rule_source</span>
|
||||
<span class="r-out co"><span class="r-pr">#></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;"><ord></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> 33 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 33 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 34 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 34 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> 531 AMP Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> 531 AMX Klebsiella pne… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">7</span> <span style="text-decoration: underline;">1</span>485 AMP Klebsiella oxy… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">8</span> <span style="text-decoration: underline;">1</span>485 AMX Klebsiella oxy… R I <span style="color: #949494;">"</span>rep… Custom in… Custom i… Object 'x'…</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># combine rule sets</span></span></span>
|
||||
<span class="r-in"><span><span class="va">x2</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></span>
|
||||
<span class="r-in"><span> <span class="va">x</span>,</span></span>
|
||||
<span class="r-in"><span> <span class="fu">custom_interpretive_rules</span><span class="op">(</span><span class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">~</span> <span class="va">carbapenems</span> <span class="op">==</span> <span class="st">"R"</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="va">x2</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> A set of custom interpretive rules:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">AMC</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FFD787;"> I </span><span style="color: #BBBBBB; font-weight: bold;"> and </span><span style="color: #0000BB;">genus</span><span style="color: #BBBBBB;"> is </span><span style="color: #0000BB;">"Klebsiella"</span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FFD787;"> I </span>:</span>
|
||||
<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-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3. <span style="font-weight: bold;">If </span><span style="color: #0000BB;">TZP</span><span style="color: #BBBBBB;"> is </span><span style="color: #080808; background-color: #FF5F5F;"> R </span><span style="font-weight: bold;"> then </span>set to <span style="color: #080808; background-color: #FF5F5F;"> R </span>:</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #0000BB;">biapenem</span> (BIA), <span style="color: #0000BB;">doripenem</span> (DOR), <span style="color: #0000BB;">ertapenem</span> (ETP), <span style="color: #0000BB;">imipenem</span> (IPM), <span style="color: #0000BB;">imipenem/EDTA</span> (IPE), <span style="color: #0000BB;">imipenem/relebactam</span> (IMR), <span style="color: #0000BB;">meropenem</span> (MEM), <span style="color: #0000BB;">meropenem/nacubactam</span> (MNC), <span style="color: #0000BB;">meropenem/vaborbactam</span> (MEV), <span style="color: #0000BB;">panipenem</span> (PAN), <span style="color: #0000BB;">razupenem</span> (RZM), <span style="color: #0000BB;">ritipenem</span> (RIT), <span style="color: #0000BB;">ritipenem acoxil</span> (RIA), <span style="color: #0000BB;">taniborbactam</span> (TAN), <span style="color: #0000BB;">tebipenem</span> (TBP)</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,13 +1,13 @@
|
||||
# Define Custom EUCAST Rules
|
||||
# Define Custom Interpretive Rules
|
||||
|
||||
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/interpretive_rules.md).
|
||||
Define custom interpretive rules for your organisation or specific
|
||||
analysis and use the output of this function in
|
||||
[`interpretive_rules()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
custom_eucast_rules(...)
|
||||
custom_interpretive_rules(...)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
@@ -23,9 +23,9 @@ A [list](https://rdrr.io/r/base/list.html) containing the custom rules
|
||||
|
||||
## Details
|
||||
|
||||
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/interpretive_rules.md)
|
||||
Some organisations have their own adoption of interpretive rules. This
|
||||
function can be used to define custom rules to be used in the
|
||||
[`interpretive_rules()`](https://amr-for-r.org/reference/interpretive_rules.md)
|
||||
function.
|
||||
|
||||
### Basics
|
||||
@@ -37,17 +37,17 @@ 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 (`~`)
|
||||
and the consequence of the rule is written *after* the tilde:
|
||||
|
||||
x <- custom_eucast_rules(TZP == "S" ~ aminopenicillins == "S",
|
||||
x <- custom_interpretive_rules(TZP == "S" ~ aminopenicillins == "S",
|
||||
TZP == "R" ~ aminopenicillins == "R")
|
||||
|
||||
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:
|
||||
These are two custom interpretive 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:
|
||||
|
||||
x
|
||||
#> A set of custom EUCAST rules:
|
||||
#> A set of custom interpretive rules:
|
||||
#>
|
||||
#> 1. If TZP is "S" then set to S :
|
||||
#> amoxicillin (AMX), ampicillin (AMP)
|
||||
@@ -70,7 +70,7 @@ data set and test the rules set:
|
||||
#> 1 Escherichia coli R S S
|
||||
#> 2 Klebsiella pneumoniae R S S
|
||||
|
||||
eucast_rules(df,
|
||||
interpretive_rules(df,
|
||||
rules = "custom",
|
||||
custom_rules = x,
|
||||
info = FALSE,
|
||||
@@ -94,12 +94,12 @@ column names are: `"mo"`, `"fullname"`, `"status"`, `"kingdom"`,
|
||||
example will work as well, despite the fact that the `df` data set does
|
||||
not contain a column `genus`:
|
||||
|
||||
y <- custom_eucast_rules(
|
||||
y <- custom_interpretive_rules(
|
||||
TZP == "S" & genus == "Klebsiella" ~ aminopenicillins == "S",
|
||||
TZP == "R" & genus == "Klebsiella" ~ aminopenicillins == "R"
|
||||
)
|
||||
|
||||
eucast_rules(df,
|
||||
interpretive_rules(df,
|
||||
rules = "custom",
|
||||
custom_rules = y,
|
||||
info = FALSE,
|
||||
@@ -129,9 +129,9 @@ function to combine multiple antimicrobials. For instance, the following
|
||||
example sets all aminopenicillins and ureidopenicillins to "R" if column
|
||||
TZP (piperacillin/tazobactam) is "R":
|
||||
|
||||
x <- custom_eucast_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R")
|
||||
x <- custom_interpretive_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R")
|
||||
x
|
||||
#> A set of custom EUCAST rules:
|
||||
#> A set of custom interpretive rules:
|
||||
#>
|
||||
#> 1. If TZP is "R" then set to "R":
|
||||
#> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP)
|
||||
@@ -499,12 +499,12 @@ These 43 antimicrobial groups are allowed in the rules
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
x <- custom_eucast_rules(
|
||||
x <- custom_interpretive_rules(
|
||||
AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I"
|
||||
)
|
||||
x
|
||||
#> A set of custom EUCAST rules:
|
||||
#> A set of custom interpretive rules:
|
||||
#>
|
||||
#> 1. If AMC is R and genus is "Klebsiella" then set to R :
|
||||
#> amoxicillin (AMX), amoxicillin/clavulanic acid (AMC), ampicillin (AMP)
|
||||
@@ -523,22 +523,22 @@ eucast_rules(example_isolates,
|
||||
#> # A tibble: 8 × 9
|
||||
#> row col mo_fullname old new rule rule_group rule_name rule_source
|
||||
#> <int> <chr> <chr> <ord> <chr> <chr> <chr> <chr> <chr>
|
||||
#> 1 33 AMP Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 2 33 AMX Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 3 34 AMP Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 4 34 AMX Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 5 531 AMP Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 6 531 AMX Klebsiella pne… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 7 1485 AMP Klebsiella oxy… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 8 1485 AMX Klebsiella oxy… R I "rep… Custom EU… Custom E… Object 'x'…
|
||||
#> 1 33 AMP Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 2 33 AMX Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 3 34 AMP Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 4 34 AMX Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 5 531 AMP Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 6 531 AMX Klebsiella pne… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 7 1485 AMP Klebsiella oxy… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
#> 8 1485 AMX Klebsiella oxy… R I "rep… Custom in… Custom i… Object 'x'…
|
||||
|
||||
# combine rule sets
|
||||
x2 <- c(
|
||||
x,
|
||||
custom_eucast_rules(TZP == "R" ~ carbapenems == "R")
|
||||
custom_interpretive_rules(TZP == "R" ~ carbapenems == "R")
|
||||
)
|
||||
x2
|
||||
#> A set of custom EUCAST rules:
|
||||
#> A set of custom interpretive rules:
|
||||
#>
|
||||
#> 1. If AMC is R and genus is "Klebsiella" then set to R :
|
||||
#> amoxicillin (AMX), amoxicillin/clavulanic acid (AMC), ampicillin (AMP)
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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://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>
|
||||
<dd><p>A [logical] to indicate whether the returned value should be an ordered [factor] (`TRUE`, default), or otherwise a [character] vector. For combining rules sets (using [c()]) 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>
|
||||
|
||||
@@ -22,13 +22,10 @@ c(x, ..., as_factor = NULL)
|
||||
|
||||
- as_factor:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
the returned value should be an ordered
|
||||
[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.
|
||||
A \[logical\] to indicate whether the returned value should be an
|
||||
ordered \[factor\] (\`TRUE\`, default), or otherwise a \[character\]
|
||||
vector. For combining rules sets (using \[c()\]) this value will be
|
||||
inherited from the first set at default.
|
||||
|
||||
- x:
|
||||
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 @@
|
||||
|
||||
<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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -124,8 +124,9 @@
|
||||
|
||||
<dt>stdres</dt>
|
||||
<dd><p>standardized residuals,
|
||||
<code>(observed - expected) / sqrt(V)</code>, where <code>V</code> is the residual cell variance (Agresti, 2007,
|
||||
section 2.4.5 for the case where <code>x</code> is a matrix, <code>n * p * (1 - p)</code> otherwise).</p></dd>
|
||||
<code>(observed - expected) / sqrt(V)</code>, where <code>V</code> is the
|
||||
residual cell variance (<a href="#reference+chisq.test.Rd+R+3AAgresti+3A2007" class="citation">Agresti 2007</a>, section 2.4.5)
|
||||
for the case where <code>x</code> is a matrix, <code>n * p * (1 - p)</code> otherwise).</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
|
||||
@@ -93,8 +93,9 @@ A list with class `"htest"` containing the following components:
|
||||
- stdres:
|
||||
|
||||
standardized residuals, `(observed - expected) / sqrt(V)`, where `V`
|
||||
is the residual cell variance (Agresti, 2007, section 2.4.5 for the
|
||||
case where `x` is a matrix, `n * p * (1 - p)` otherwise).
|
||||
is the residual cell variance ([Agresti
|
||||
2007](#reference+chisq.test.Rd+R+3AAgresti+3A2007), section 2.4.5) for
|
||||
the case where `x` is a matrix, `n * p * (1 - p)` otherwise).
|
||||
|
||||
## 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -96,8 +96,9 @@
|
||||
|
||||
|
||||
<dt id="arg-pc-biplot">pc.biplot<a class="anchor" aria-label="anchor" href="#arg-pc-biplot"></a></dt>
|
||||
<dd><p>If true, use what Gabriel (1971) refers to as a "principal component
|
||||
biplot", with <code>lambda = 1</code> and observations scaled up by sqrt(n) and
|
||||
<dd><p>If true, use what <cite></cite><a href="#reference+biplot.princomp.Rd+R+3AGabriel+3A1971" class="citation">Gabriel (1971)</a> refers to as a
|
||||
“principal component biplot”,
|
||||
with <code>lambda = 1</code> and observations scaled up by sqrt(n) and
|
||||
variables scaled down by sqrt(n). Then inner products between
|
||||
variables approximate covariances and distances between observations
|
||||
approximate Mahalanobis distance.</p></dd>
|
||||
|
||||
@@ -68,11 +68,12 @@ the changes made based on the source code were:
|
||||
|
||||
- pc.biplot:
|
||||
|
||||
If true, use what Gabriel (1971) refers to as a "principal component
|
||||
biplot", with `lambda = 1` and observations scaled up by sqrt(n) and
|
||||
variables scaled down by sqrt(n). Then inner products between
|
||||
variables approximate covariances and distances between observations
|
||||
approximate Mahalanobis distance.
|
||||
If true, use what [Gabriel
|
||||
(1971)](#reference+biplot.princomp.Rd+R+3AGabriel+3A1971) refers to as
|
||||
a “principal component biplot”, with `lambda = 1` and observations
|
||||
scaled up by sqrt(n) and variables scaled down by sqrt(n). Then inner
|
||||
products between variables approximate covariances and distances
|
||||
between observations approximate Mahalanobis distance.
|
||||
|
||||
- labels:
|
||||
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -145,9 +145,9 @@
|
||||
</dt>
|
||||
<dd>Add Custom Antimicrobials</dd>
|
||||
</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>
|
||||
<h2 id="interpreting-data-antimicrobial-results">Interpreting data: antimicrobial results<a class="anchor" aria-label="anchor" href="#interpreting-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/interpretive_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 interpretive rules, for example <a href="https://www.eucast.org/expert_rules_and_intrinsic_resistance/" class="external-link">from EUCAST</a> with <code><a href="../reference/interpretive_rules.html">interpretive_rules()</a></code>.</p></div>
|
||||
|
||||
<dl></dl></div><div class="section level2">
|
||||
|
||||
@@ -184,10 +184,10 @@
|
||||
|
||||
<dt>
|
||||
|
||||
<code><a href="custom_eucast_rules.html">custom_eucast_rules()</a></code>
|
||||
<code><a href="custom_interpretive_rules.html">custom_interpretive_rules()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Define Custom EUCAST Rules</dd>
|
||||
<dd>Define Custom Interpretive Rules</dd>
|
||||
</dl></div><div class="section level2">
|
||||
<h2 id="analysing-data">Analysing data<a class="anchor" aria-label="anchor" href="#analysing-data"></a></h2>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
</dl></div><div class="section level2">
|
||||
<h2 id="other-statistical-tests">Other: statistical tests<a class="anchor" aria-label="anchor" href="#other-statistical-tests"></a></h2>
|
||||
|
||||
<div class="section-desc"><p>Some statistical tests or methods are not part of base R and were added to this package for convenience.</p></div>
|
||||
<div class="section-desc"><p>Some statistical tests or methods usable for AMR analyses are not part of base R and were added to this package for convenience.</p></div>
|
||||
|
||||
<dl></dl></div><div class="section level2">
|
||||
|
||||
@@ -599,7 +599,7 @@
|
||||
|
||||
<dl><dt>
|
||||
|
||||
<code><a href="AMR-deprecated.html">ab_class()</a></code> <code><a href="AMR-deprecated.html">ab_selector()</a></code>
|
||||
<code><a href="AMR-deprecated.html">custom_eucast_rules()</a></code> <code><a href="AMR-deprecated.html">ab_class()</a></code> <code><a href="AMR-deprecated.html">ab_selector()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Deprecated Functions, Arguments, or Datasets</dd>
|
||||
|
||||
@@ -116,7 +116,7 @@ from clinical text records, using
|
||||
[`clear_custom_antimicrobials()`](https://amr-for-r.org/reference/add_custom_antimicrobials.md)
|
||||
: Add Custom Antimicrobials
|
||||
|
||||
## Preparing data: antimicrobial results
|
||||
## Interpreting data: antimicrobial results
|
||||
|
||||
With [`as.mic()`](https://amr-for-r.org/reference/as.mic.md) and
|
||||
[`as.disk()`](https://amr-for-r.org/reference/as.disk.md) you can
|
||||
@@ -125,10 +125,10 @@ transform your raw input to valid MIC or disk diffusion values. Use
|
||||
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 [EUCAST
|
||||
rules](https://www.eucast.org/expert_rules_and_intrinsic_resistance/)
|
||||
applying interpretive rules, for example [from
|
||||
EUCAST](https://www.eucast.org/expert_rules_and_intrinsic_resistance/)
|
||||
with
|
||||
[`eucast_rules()`](https://amr-for-r.org/reference/interpretive_rules.md).
|
||||
[`interpretive_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)
|
||||
@@ -153,8 +153,8 @@ with
|
||||
[`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
|
||||
- [`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md)
|
||||
: Define Custom Interpretive Rules
|
||||
|
||||
## Analysing data
|
||||
|
||||
@@ -465,8 +465,8 @@ and other utilities. Especially the ‘like’ function can be useful:
|
||||
|
||||
## Other: statistical tests
|
||||
|
||||
Some statistical tests or methods are not part of base R and were added
|
||||
to this package for convenience.
|
||||
Some statistical tests or methods usable for AMR analyses are not part
|
||||
of base R and were added to this package for convenience.
|
||||
|
||||
- [`g.test()`](https://amr-for-r.org/reference/g.test.md) :
|
||||
|
||||
@@ -483,6 +483,7 @@ to this package for convenience.
|
||||
These objects are deprecated, meaning that they will still work but show
|
||||
a warning that they will be removed in a future version.
|
||||
|
||||
- [`ab_class()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
- [`custom_eucast_rules()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
[`ab_class()`](https://amr-for-r.org/reference/AMR-deprecated.md)
|
||||
[`ab_selector()`](https://amr-for-r.org/reference/AMR-deprecated.md) :
|
||||
Deprecated Functions, Arguments, or Datasets
|
||||
|
||||
@@ -9,7 +9,7 @@ To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive
|
||||
|
||||
<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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -107,7 +107,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
|
||||
|
||||
<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>
|
||||
<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_interpretive_rules.html">custom_interpretive_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-guideline">guideline<a class="anchor" aria-label="anchor" href="#arg-guideline"></a></dt>
|
||||
@@ -139,7 +139,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
|
||||
|
||||
<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>
|
||||
<dd><p>Custom rules to apply, created with <code><a href="custom_interpretive_rules.html">custom_interpretive_rules()</a></code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-overwrite">overwrite<a class="anchor" aria-label="anchor" href="#arg-overwrite"></a></dt>
|
||||
@@ -169,15 +169,15 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
<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 or disk 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">
|
||||
<p>The file containing all interpretive rules is located here: <a href="https://github.com/msberends/AMR/blob/main/data-raw/interpretive_rules.tsv" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/interpretive_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>
|
||||
<p>Custom rules can be created using <code><a href="custom_interpretive_rules.html">custom_interpretive_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_interpretive_rules.html">custom_interpretive_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>
|
||||
<span><span class="fu"><a href="../reference/interpretive_rules.html">interpretive_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">
|
||||
@@ -187,7 +187,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
<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>
|
||||
<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>interpretive_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>
|
||||
@@ -232,8 +232,8 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
<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 `eucast_rules()`: not all columns with antimicrobial results are of class</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #0000BB;"><sir></span>. Transform them on beforehand, e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in `interpretive_rules()`: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class <span style="color: #0000BB;"><sir></span>. Transform them on beforehand, e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> • x <span style="color: #D7AF00;">|></span> <span style="font-weight: bold;">as.sir</span><span style="color: #D7AF00;">(</span>CXM<span style="color: #D7AF00;">:</span>AMX<span style="color: #D7AF00;">)</span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> </span>
|
||||
@@ -253,8 +253,8 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
<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 `eucast_rules()`: not all columns with antimicrobial results are of class</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="color: #0000BB;"><sir></span>. Transform them on beforehand, e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in `interpretive_rules()`: not all columns with antimicrobial results are of</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> class <span style="color: #0000BB;"><sir></span>. Transform them on beforehand, e.g.:</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> • x <span style="color: #D7AF00;">|></span> <span style="font-weight: bold;">as.sir</span><span style="color: #D7AF00;">(</span>CXM<span style="color: #D7AF00;">:</span>AMX<span style="color: #D7AF00;">)</span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> </span>
|
||||
|
||||
@@ -100,7 +100,7 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
`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).
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md).
|
||||
|
||||
- guideline:
|
||||
|
||||
@@ -166,7 +166,7 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
- custom_rules:
|
||||
|
||||
Custom rules to apply, created with
|
||||
[`custom_eucast_rules()`](https://amr-for-r.org/reference/custom_eucast_rules.md).
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md).
|
||||
|
||||
- overwrite:
|
||||
|
||||
@@ -226,8 +226,8 @@ where there is a dependency on ampicillin. These drugs are
|
||||
interchangeable when it comes to expression of antimicrobial
|
||||
resistance.
|
||||
|
||||
The file containing all EUCAST rules is located here:
|
||||
<https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv>.
|
||||
The file containing all interpretive rules is located here:
|
||||
<https://github.com/msberends/AMR/blob/main/data-raw/interpretive_rules.tsv>.
|
||||
**Note:** Old taxonomic names are replaced with the current taxonomy
|
||||
where applicable. For example, *Ochrobactrum anthropi* was renamed to
|
||||
*Brucella anthropi* in 2020; the original EUCAST rules v3.1 and v3.2 did
|
||||
@@ -238,13 +238,13 @@ full microbial taxonomy updated until June 24th, 2024, see
|
||||
### Custom Rules
|
||||
|
||||
Custom rules can be created using
|
||||
[`custom_eucast_rules()`](https://amr-for-r.org/reference/custom_eucast_rules.md),
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/reference/custom_interpretive_rules.md),
|
||||
e.g.:
|
||||
|
||||
x <- custom_eucast_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
x <- custom_interpretive_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I")
|
||||
|
||||
eucast_rules(example_isolates, rules = "custom", custom_rules = x)
|
||||
interpretive_rules(example_isolates, rules = "custom", custom_rules = x)
|
||||
|
||||
### 'Other' Rules
|
||||
|
||||
@@ -264,8 +264,8 @@ these rules to work, both drugs must be available in the data set.
|
||||
|
||||
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
|
||||
argument, or use `interpretive_rules(..., rules = "all")`. You can also
|
||||
set the package option
|
||||
[`AMR_interpretive_rules`](https://amr-for-r.org/reference/AMR-options.md),
|
||||
i.e. run `options(AMR_interpretive_rules = "all")`.
|
||||
|
||||
@@ -318,8 +318,8 @@ head(a)
|
||||
|
||||
# apply EUCAST rules: some results wil be changed
|
||||
b <- eucast_rules(a, overwrite = TRUE)
|
||||
#> Warning: in `eucast_rules()`: not all columns with antimicrobial results are of class
|
||||
#> <sir>. Transform them on beforehand, e.g.:
|
||||
#> Warning: in `interpretive_rules()`: not all columns with antimicrobial results are of
|
||||
#> class <sir>. Transform them on beforehand, e.g.:
|
||||
#>
|
||||
#> • x |> as.sir(CXM:AMX)
|
||||
#>
|
||||
@@ -339,8 +339,8 @@ head(b)
|
||||
# do not apply EUCAST rules, but rather get a data.frame
|
||||
# containing all details about the transformations:
|
||||
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, e.g.:
|
||||
#> Warning: in `interpretive_rules()`: not all columns with antimicrobial results are of
|
||||
#> class <sir>. Transform them on beforehand, e.g.:
|
||||
#>
|
||||
#> • x |> as.sir(CXM:AMX)
|
||||
#>
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -94,8 +94,8 @@
|
||||
</div>
|
||||
<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://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>
|
||||
<p>**Note:** As opposed to the `join()` functions of `dplyr`, [character] vectors are supported and at default existing columns will get a suffix `"2"` and the newly joined columns will not get a suffix.</p>
|
||||
<p>If the `dplyr` package is installed, their join functions will be used. Otherwise, the much slower [merge()] and [interaction()] functions from base <span style="R">R</span> will be used.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
|
||||
@@ -59,16 +59,13 @@ a [data.frame](https://rdrr.io/r/base/data.frame.html)
|
||||
|
||||
## Details
|
||||
|
||||
**Note:** As opposed to the `join()` functions of `dplyr`,
|
||||
[character](https://rdrr.io/r/base/character.html) vectors are supported
|
||||
and at default existing columns will get a suffix `"2"` and the newly
|
||||
joined columns will not get a suffix.
|
||||
\*\*Note:\*\* As opposed to the \`join()\` functions of \`dplyr\`,
|
||||
\[character\] vectors are supported and at default existing columns will
|
||||
get a suffix \`"2"\` and the newly 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://rdrr.io/pkg/data.table/man/merge.html) and
|
||||
[`interaction()`](https://rdrr.io/r/base/interaction.html) functions
|
||||
from base R will be used.
|
||||
If the \`dplyr\` package is installed, their join functions will be
|
||||
used. Otherwise, the much slower \[merge()\] and \[interaction()\]
|
||||
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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -144,18 +144,17 @@
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
<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://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://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://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://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>
|
||||
<p>- If `verbose` is set to `TRUE`:<br>
|
||||
A [data.frame] containing columns `row_number`, `microorganism`, `MDRO`, `reason`, `all_nonsusceptible_columns`, `guideline`
|
||||
- CMI 2012 paper - function [mdr_cmi2012()] or [mdro()]:<br>
|
||||
Ordered [factor] with levels `Negative` < `Multi-drug-resistant (MDR)` < `Extensively drug-resistant (XDR)` < `Pandrug-resistant (PDR)`
|
||||
- TB guideline - function [mdr_tb()] or [`mdro(..., guideline = "TB")`][mdro()]:<br>
|
||||
Ordered [factor] with levels `Negative` < `Mono-resistant` < `Poly-resistant` < `Multi-drug-resistant` < `Extensively drug-resistant`
|
||||
- German guideline - function [mrgn()] or [`mdro(..., guideline = "MRGN")`][mdro()]:<br>
|
||||
Ordered [factor] with levels `Negative` < `3MRGN` < `4MRGN`
|
||||
- Everything else, except for custom guidelines:<br>
|
||||
Ordered [factor] 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</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>These functions are context-aware. This means that the <code>x</code> argument can be left blank if used inside a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> call, see <em>Examples</em>.</p>
|
||||
|
||||
@@ -152,32 +152,25 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = any(is.sir(x)),
|
||||
|
||||
## Value
|
||||
|
||||
- If `verbose` is set to `TRUE`:
|
||||
A [data.frame](https://rdrr.io/r/base/data.frame.html) containing
|
||||
columns `row_number`, `microorganism`, `MDRO`, `reason`,
|
||||
`all_nonsusceptible_columns`, `guideline`
|
||||
|
||||
- CMI 2012 paper - function `mdr_cmi2012()` or `mdro()`:
|
||||
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://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://rdrr.io/pkg/data.table/man/fctr.html) with
|
||||
levels `Negative` \< `3MRGN` \< `4MRGN`
|
||||
|
||||
- Everything else, except for custom guidelines:
|
||||
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
|
||||
\- If \`verbose\` is set to \`TRUE\`:
|
||||
A \[data.frame\] containing columns \`row_number\`, \`microorganism\`,
|
||||
\`MDRO\`, \`reason\`, \`all_nonsusceptible_columns\`, \`guideline\` -
|
||||
CMI 2012 paper - function \[mdr_cmi2012()\] or \[mdro()\]:
|
||||
Ordered \[factor\] with levels \`Negative\` \< \`Multi-drug-resistant
|
||||
(MDR)\` \< \`Extensively drug-resistant (XDR)\` \< \`Pandrug-resistant
|
||||
(PDR)\` - TB guideline - function \[mdr_tb()\] or \[\`mdro(...,
|
||||
guideline = "TB")\`\]\[mdro()\]:
|
||||
Ordered \[factor\] with levels \`Negative\` \< \`Mono-resistant\` \<
|
||||
\`Poly-resistant\` \< \`Multi-drug-resistant\` \< \`Extensively
|
||||
drug-resistant\` - German guideline - function \[mrgn()\] or
|
||||
\[\`mdro(..., guideline = "MRGN")\`\]\[mdro()\]:
|
||||
Ordered \[factor\] with levels \`Negative\` \< \`3MRGN\` \< \`4MRGN\` -
|
||||
Everything else, except for custom guidelines:
|
||||
Ordered \[factor\] 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -201,32 +201,32 @@
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<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://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>
|
||||
<li><p>A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> in all other cases</p></li>
|
||||
</ul></div>
|
||||
<p>- An [integer] in case of [mo_year()]
|
||||
- An [ordered factor][factor] in case of [mo_pathogenicity()]
|
||||
- A [list] in case of [mo_taxonomy()], [mo_synonyms()], [mo_snomed()], and [mo_info()]
|
||||
- A [logical] in case of [mo_is_anaerobic()], [mo_is_gram_negative()], [mo_is_gram_positive()], [mo_is_intrinsic_resistant()], and [mo_is_yeast()]
|
||||
- A named [character] in case of [mo_synonyms()] and [mo_url()]
|
||||
- A [character] in all other cases</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>All functions will, at default, <strong>not</strong> keep old taxonomic properties, as synonyms are automatically replaced with the current taxonomy. Take for example <em>Enterobacter aerogenes</em>, which was initially named in 1960 but renamed to <em>Klebsiella aerogenes</em> in 2017:</p><ul><li><p><code>mo_genus("Enterobacter aerogenes")</code> will return <code>"Klebsiella"</code> (with a note about the renaming)</p></li>
|
||||
<li><p><code>mo_genus("Enterobacter aerogenes", keep_synonyms = TRUE)</code> will return <code>"Enterobacter"</code> (with a once-per-session warning that the name is outdated)</p></li>
|
||||
<li><p><code>mo_ref("Enterobacter aerogenes")</code> will return <code>"Tindall et al., 2017"</code> (with a note about the renaming)</p></li>
|
||||
<li><p><code>mo_ref("Enterobacter aerogenes", keep_synonyms = TRUE)</code> will return <code>"Hormaeche et al., 1960"</code> (with a once-per-session warning that the name is outdated)</p></li>
|
||||
</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://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>
|
||||
<p>Determination of bacterial oxygen tolerance (<code>mo_oxygen_tolerance()</code>) will be based on BacDive, see <em>Source</em>. The function <code>mo_is_anaerobic()</code> only returns <code>TRUE</code> if the oxygen tolerance is <code>"anaerobe"</code>, indicting an obligate anaerobic species or genus. It always returns <code>FALSE</code> for species outside the taxonomic kingdom of Bacteria.</p>
|
||||
<p>The function <code>mo_url()</code> will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. <a href="https://www.mycobank.org" class="external-link">This MycoBank URL</a> will be used for fungi wherever available , <a href="https://www.mycobank.org" class="external-link">this LPSN URL</a> for bacteria wherever available, and <a href="https://www.gbif.org" class="external-link">this GBIF link</a> otherwise.</p>
|
||||
<p>SNOMED codes (<code>mo_snomed()</code>) was last updated on July 16th, 2024. See <em>Source</em> and the <a href="microorganisms.html">microorganisms</a> data set for more info.</p>
|
||||
<p>Old taxonomic names (so-called 'synonyms') can be retrieved with <code>mo_synonyms()</code> (which will have the scientific reference as <a href="https://rdrr.io/r/base/names.html" class="external-link">name</a>), the current taxonomic name can be retrieved with <code>mo_current()</code>. Both functions return full names.</p>
|
||||
<p>All output <a href="translate.html">will be translated</a> where possible.</p>
|
||||
<p>All functions will, at default, **not** keep old taxonomic properties, as synonyms are automatically replaced with the current taxonomy. Take for example *Enterobacter aerogenes*, which was initially named in 1960 but renamed to *Klebsiella aerogenes* in 2017:
|
||||
- `mo_genus("Enterobacter aerogenes")` will return `"Klebsiella"` (with a note about the renaming)
|
||||
- `mo_genus("Enterobacter aerogenes", keep_synonyms = TRUE)` will return `"Enterobacter"` (with a once-per-session warning that the name is outdated)
|
||||
- `mo_ref("Enterobacter aerogenes")` will return `"Tindall et al., 2017"` (with a note about the renaming)
|
||||
- `mo_ref("Enterobacter aerogenes", keep_synonyms = TRUE)` will return `"Hormaeche et al., 1960"` (with a once-per-session warning that the name is outdated)</p>
|
||||
<p>The short name ([mo_shortname()]) returns the first character of the genus and the full species, such as `"E. coli"`, for species and subspecies. Exceptions are abbreviations of staphylococci (such as *"CoNS"*, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as *"GBS"*, Group B Streptococci). Please bear in mind that e.g. *E. coli* could mean *Escherichia coli* (kingdom of Bacteria) as well as *Entamoeba coli* (kingdom of Protozoa). Returning to the full name will be done using [as.mo()] internally, giving priority to bacteria and human pathogens, i.e. `"E. coli"` will be considered *Escherichia coli*. As a result, `mo_fullname(mo_shortname("Entamoeba coli"))` returns `"Escherichia coli"`.</p>
|
||||
<p>Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions [mo_kingdom()] and [mo_domain()] return the exact same results.</p>
|
||||
<p>Determination of human pathogenicity ([mo_pathogenicity()]) is strongly based on Bartlett *et al.* (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 [factor] with the levels *Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*.</p>
|
||||
<p>Determination of the Gram stain ([mo_gramstain()]) will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were later renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, [PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in these phyla are considered Gram-positive in this `AMR` 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 `NA`. Functions [mo_is_gram_negative()] and [mo_is_gram_positive()] always return `TRUE` or `FALSE` (or `NA` when the input is `NA` or the MO code is `UNKNOWN`), thus always return `FALSE` for species outside the taxonomic kingdom of Bacteria.</p>
|
||||
<p>Determination of yeasts ([mo_is_yeast()]) will be based on the taxonomic kingdom and class. *Budding yeasts* 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. *True yeasts* quite specifically refers to yeasts in the underlying order Saccharomycetales (such as *Saccharomyces cerevisiae*). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`).</p>
|
||||
<p>Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES[1]))`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antimicrobials).</p>
|
||||
<p>Determination of bacterial oxygen tolerance ([mo_oxygen_tolerance()]) will be based on BacDive, see *Source*. The function [mo_is_anaerobic()] only returns `TRUE` if the oxygen tolerance is `"anaerobe"`, indicting an obligate anaerobic species or genus. It always returns `FALSE` for species outside the taxonomic kingdom of Bacteria.</p>
|
||||
<p>The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. [This MycoBank URL](`r TAXONOMY_VERSION$MycoBank$url`) will be used for fungi wherever available , [this LPSN URL](`r TAXONOMY_VERSION$MycoBank$url`) for bacteria wherever available, and [this GBIF link](`r TAXONOMY_VERSION$GBIF$url`) otherwise.</p>
|
||||
<p>SNOMED codes ([mo_snomed()]) was last updated on `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info.</p>
|
||||
<p>Old taxonomic names (so-called 'synonyms') can be retrieved with [mo_synonyms()] (which will have the scientific reference as [name][base::names()]), the current taxonomic name can be retrieved with [mo_current()]. Both functions return full names.</p>
|
||||
<p>All output [will be translated][translate] where possible.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="matching-score-for-microorganisms">Matching Score for Microorganisms<a class="anchor" aria-label="anchor" href="#matching-score-for-microorganisms"></a></h2>
|
||||
|
||||
@@ -184,135 +184,116 @@ mo_property(x, property = "fullname", language = get_AMR_locale(),
|
||||
|
||||
## Value
|
||||
|
||||
- An [integer](https://rdrr.io/r/base/integer.html) in case of
|
||||
`mo_year()`
|
||||
|
||||
- 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()`
|
||||
|
||||
- A [logical](https://rdrr.io/r/base/logical.html) in case of
|
||||
`mo_is_anaerobic()`, `mo_is_gram_negative()`, `mo_is_gram_positive()`,
|
||||
`mo_is_intrinsic_resistant()`, and `mo_is_yeast()`
|
||||
|
||||
- A named [character](https://rdrr.io/r/base/character.html) in case of
|
||||
`mo_synonyms()` and `mo_url()`
|
||||
|
||||
- A [character](https://rdrr.io/r/base/character.html) in all other
|
||||
cases
|
||||
\- An \[integer\] in case of \[mo_year()\] - An \[ordered
|
||||
factor\]\[factor\] in case of \[mo_pathogenicity()\] - A \[list\] in
|
||||
case of \[mo_taxonomy()\], \[mo_synonyms()\], \[mo_snomed()\], and
|
||||
\[mo_info()\] - A \[logical\] in case of \[mo_is_anaerobic()\],
|
||||
\[mo_is_gram_negative()\], \[mo_is_gram_positive()\],
|
||||
\[mo_is_intrinsic_resistant()\], and \[mo_is_yeast()\] - A named
|
||||
\[character\] in case of \[mo_synonyms()\] and \[mo_url()\] - A
|
||||
\[character\] in all other cases
|
||||
|
||||
## Details
|
||||
|
||||
All functions will, at default, **not** keep old taxonomic properties,
|
||||
as synonyms are automatically replaced with the current taxonomy. Take
|
||||
for example *Enterobacter aerogenes*, which was initially named in 1960
|
||||
but renamed to *Klebsiella aerogenes* in 2017:
|
||||
All functions will, at default, \*\*not\*\* keep old taxonomic
|
||||
properties, as synonyms are automatically replaced with the current
|
||||
taxonomy. Take for example \*Enterobacter aerogenes\*, which was
|
||||
initially named in 1960 but renamed to \*Klebsiella aerogenes\* in
|
||||
2017: - \`mo_genus("Enterobacter aerogenes")\` will return
|
||||
\`"Klebsiella"\` (with a note about the renaming) -
|
||||
\`mo_genus("Enterobacter aerogenes", keep_synonyms = TRUE)\` will return
|
||||
\`"Enterobacter"\` (with a once-per-session warning that the name is
|
||||
outdated) - \`mo_ref("Enterobacter aerogenes")\` will return \`"Tindall
|
||||
et al., 2017"\` (with a note about the renaming) -
|
||||
\`mo_ref("Enterobacter aerogenes", keep_synonyms = TRUE)\` will return
|
||||
\`"Hormaeche et al., 1960"\` (with a once-per-session warning that the
|
||||
name is outdated)
|
||||
|
||||
- `mo_genus("Enterobacter aerogenes")` will return `"Klebsiella"` (with
|
||||
a note about the renaming)
|
||||
|
||||
- `mo_genus("Enterobacter aerogenes", keep_synonyms = TRUE)` will return
|
||||
`"Enterobacter"` (with a once-per-session warning that the name is
|
||||
outdated)
|
||||
|
||||
- `mo_ref("Enterobacter aerogenes")` will return
|
||||
`"Tindall et al., 2017"` (with a note about the renaming)
|
||||
|
||||
- `mo_ref("Enterobacter aerogenes", keep_synonyms = TRUE)` will return
|
||||
`"Hormaeche et al., 1960"` (with a once-per-session warning that the
|
||||
name is outdated)
|
||||
|
||||
The short name (`mo_shortname()`) returns the first character of the
|
||||
genus and the full species, such as `"E. coli"`, for species and
|
||||
The short name (\[mo_shortname()\]) returns the first character of the
|
||||
genus and the full species, such as \`"E. coli"\`, for species and
|
||||
subspecies. Exceptions are abbreviations of staphylococci (such as
|
||||
*"CoNS"*, Coagulase-Negative Staphylococci) and beta-haemolytic
|
||||
streptococci (such as *"GBS"*, Group B Streptococci). Please bear in
|
||||
mind that e.g. *E. coli* could mean *Escherichia coli* (kingdom of
|
||||
Bacteria) as well as *Entamoeba coli* (kingdom of Protozoa). Returning
|
||||
to the full name will be done using
|
||||
[`as.mo()`](https://amr-for-r.org/reference/as.mo.md) internally, giving
|
||||
priority to bacteria and human pathogens, i.e. `"E. coli"` will be
|
||||
considered *Escherichia coli*. As a result,
|
||||
`mo_fullname(mo_shortname("Entamoeba coli"))` returns
|
||||
`"Escherichia coli"`.
|
||||
\*"CoNS"\*, Coagulase-Negative Staphylococci) and beta-haemolytic
|
||||
streptococci (such as \*"GBS"\*, Group B Streptococci). Please bear in
|
||||
mind that e.g. \*E. coli\* could mean \*Escherichia coli\* (kingdom of
|
||||
Bacteria) as well as \*Entamoeba coli\* (kingdom of Protozoa). Returning
|
||||
to the full name will be done using \[as.mo()\] internally, giving
|
||||
priority to bacteria and human pathogens, i.e. \`"E. coli"\` will be
|
||||
considered \*Escherichia coli\*. As a result,
|
||||
\`mo_fullname(mo_shortname("Entamoeba coli"))\` returns \`"Escherichia
|
||||
coli"\`.
|
||||
|
||||
Since the top-level of the taxonomy is sometimes referred to as
|
||||
'kingdom' and sometimes as 'domain', the functions `mo_kingdom()` and
|
||||
`mo_domain()` return the exact same results.
|
||||
'kingdom' and sometimes as 'domain', the functions \[mo_kingdom()\] and
|
||||
\[mo_domain()\] return the exact same results.
|
||||
|
||||
Determination of human pathogenicity (`mo_pathogenicity()`) is strongly
|
||||
based on Bartlett *et al.* (2022,
|
||||
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://rdrr.io/pkg/data.table/man/fctr.html) with the levels
|
||||
*Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*.
|
||||
function returns a \[factor\] 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
|
||||
so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID
|
||||
11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only
|
||||
Determination of the Gram stain (\[mo_gramstain()\]) will be based on
|
||||
the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the
|
||||
so-called subkingdoms Negibacteria and Posibacteria (2002, \[PMID
|
||||
11837318\](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only
|
||||
considered these phyla as Posibacteria: Actinobacteria, Chloroflexi,
|
||||
Firmicutes, and Tenericutes. These phyla were later renamed to
|
||||
Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021,
|
||||
[PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in
|
||||
these phyla are considered Gram-positive in this `AMR` 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 `NA`.
|
||||
Functions `mo_is_gram_negative()` and `mo_is_gram_positive()` always
|
||||
return `TRUE` or `FALSE` (or `NA` when the input is `NA` or the MO code
|
||||
is `UNKNOWN`), thus always return `FALSE` for species outside the
|
||||
taxonomic kingdom of Bacteria.
|
||||
\[PMID 34694987\](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria
|
||||
in these phyla are considered Gram-positive in this \`AMR\` 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 \`NA\`. Functions \[mo_is_gram_negative()\] and
|
||||
\[mo_is_gram_positive()\] always return \`TRUE\` or \`FALSE\` (or \`NA\`
|
||||
when the input is \`NA\` or the MO code is \`UNKNOWN\`), thus always
|
||||
return \`FALSE\` for species outside the taxonomic kingdom of Bacteria.
|
||||
|
||||
Determination of yeasts (`mo_is_yeast()`) will be based on the taxonomic
|
||||
kingdom and class. *Budding yeasts* 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. *True yeasts* quite specifically refers to yeasts in
|
||||
the underlying order Saccharomycetales (such as *Saccharomyces
|
||||
cerevisiae*). Thus, for all microorganisms that are member of the
|
||||
taxonomic class Saccharomycetes or Pichiomycetes, the function will
|
||||
return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is
|
||||
`NA` or the MO code is `UNKNOWN`).
|
||||
Determination of yeasts (\[mo_is_yeast()\]) will be based on the
|
||||
taxonomic kingdom and class. \*Budding yeasts\* 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. \*True yeasts\* quite
|
||||
specifically refers to yeasts in the underlying order Saccharomycetales
|
||||
(such as \*Saccharomyces cerevisiae\*). Thus, for all microorganisms
|
||||
that are member of the taxonomic class Saccharomycetes or Pichiomycetes,
|
||||
the function will return \`TRUE\`. It returns \`FALSE\` otherwise (or
|
||||
\`NA\` when the input is \`NA\` or the MO code is \`UNKNOWN\`).
|
||||
|
||||
Determination of intrinsic resistance (`mo_is_intrinsic_resistant()`)
|
||||
will be based on the
|
||||
[intrinsic_resistant](https://amr-for-r.org/reference/intrinsic_resistant.md)
|
||||
data set, which is based on ['EUCAST Expected Resistant Phenotypes'
|
||||
v1.2](https://www.eucast.org/bacteria/important-additional-information/expert-rules/)
|
||||
(2023). The `mo_is_intrinsic_resistant()` function can be vectorised
|
||||
over both argument `x` (input for microorganisms) and `ab` (input for
|
||||
Determination of intrinsic resistance (\[mo_is_intrinsic_resistant()\])
|
||||
will be based on the \[intrinsic_resistant\] data set, which is based on
|
||||
\`r
|
||||
format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES\[1\]))\`.
|
||||
The \[mo_is_intrinsic_resistant()\] function can be vectorised over both
|
||||
argument \`x\` (input for microorganisms) and \`ab\` (input for
|
||||
antimicrobials).
|
||||
|
||||
Determination of bacterial oxygen tolerance (`mo_oxygen_tolerance()`)
|
||||
will be based on BacDive, see *Source*. The function `mo_is_anaerobic()`
|
||||
only returns `TRUE` if the oxygen tolerance is `"anaerobe"`, indicting
|
||||
an obligate anaerobic species or genus. It always returns `FALSE` for
|
||||
species outside the taxonomic kingdom of Bacteria.
|
||||
Determination of bacterial oxygen tolerance (\[mo_oxygen_tolerance()\])
|
||||
will be based on BacDive, see \*Source\*. The function
|
||||
\[mo_is_anaerobic()\] only returns \`TRUE\` if the oxygen tolerance is
|
||||
\`"anaerobe"\`, indicting an obligate anaerobic species or genus. It
|
||||
always returns \`FALSE\` for species outside the taxonomic kingdom of
|
||||
Bacteria.
|
||||
|
||||
The function `mo_url()` will return the direct URL to the online
|
||||
The function \[mo_url()\] will return the direct URL to the online
|
||||
database entry, which also shows the scientific reference of the
|
||||
concerned species. [This MycoBank URL](https://www.mycobank.org) will be
|
||||
used for fungi wherever available , [this LPSN
|
||||
URL](https://www.mycobank.org) for bacteria wherever available, and
|
||||
[this GBIF link](https://www.gbif.org) otherwise.
|
||||
concerned species. \[This MycoBank URL\](\`r
|
||||
TAXONOMY_VERSION\$MycoBank\$url\`) will be used for fungi wherever
|
||||
available , \[this LPSN URL\](\`r TAXONOMY_VERSION\$MycoBank\$url\`) for
|
||||
bacteria wherever available, and \[this GBIF link\](\`r
|
||||
TAXONOMY_VERSION\$GBIF\$url\`) otherwise.
|
||||
|
||||
SNOMED codes (`mo_snomed()`) was last updated on July 16th, 2024. See
|
||||
*Source* and the
|
||||
[microorganisms](https://amr-for-r.org/reference/microorganisms.md) data
|
||||
set for more info.
|
||||
SNOMED codes (\[mo_snomed()\]) was last updated on \`r
|
||||
documentation_date(TAXONOMY_VERSION\$SNOMED\$accessed_date)\`. See
|
||||
\*Source\* and the \[microorganisms\] data set for more info.
|
||||
|
||||
Old taxonomic names (so-called 'synonyms') can be retrieved with
|
||||
`mo_synonyms()` (which will have the scientific reference as
|
||||
[name](https://rdrr.io/r/base/names.html)), the current taxonomic name
|
||||
can be retrieved with `mo_current()`. Both functions return full names.
|
||||
\[mo_synonyms()\] (which will have the scientific reference as
|
||||
\[name\]\[base::names()\]), the current taxonomic name can be retrieved
|
||||
with \[mo_current()\]. Both functions return full names.
|
||||
|
||||
All output [will be
|
||||
translated](https://amr-for-r.org/reference/translate.md) where
|
||||
possible.
|
||||
All output \[will be translated\]\[translate\] where possible.
|
||||
|
||||
## Matching Score for Microorganisms
|
||||
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
@@ -98,7 +98,7 @@
|
||||
standard deviations are less than or equal to <code>tol</code> times the
|
||||
standard deviation of the first component.) With the default null
|
||||
setting, no components are omitted (unless <code>rank.</code> is specified
|
||||
less than <code>min(dim(x))</code>.). Other settings for tol could be
|
||||
less than <code>min(dim(x))</code>.). Other settings for <code>tol</code> could be
|
||||
<code>tol = 0</code> or <code>tol = sqrt(.Machine$double.eps)</code>, which
|
||||
would omit essentially constant components.</p></dd>
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ pca(x, ..., retx = TRUE, center = TRUE, scale. = TRUE, tol = NULL,
|
||||
than or equal to `tol` times the standard deviation of the first
|
||||
component.) With the default null setting, no components are omitted
|
||||
(unless `rank.` is specified less than `min(dim(x))`.). Other settings
|
||||
for tol could be `tol = 0` or `tol = sqrt(.Machine$double.eps)`, which
|
||||
would omit essentially constant components.
|
||||
for `tol` could be `tol = 0` or `tol = sqrt(.Machine$double.eps)`,
|
||||
which would omit essentially constant components.
|
||||
|
||||
- rank.:
|
||||
|
||||
|
||||
@@ -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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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 @@ 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.9055</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9057</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">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user