(v1.8.1.9011) update prevalence of some genera

This commit is contained in:
dr. M.S. (Matthijs) Berends 2022-06-03 12:43:25 +02:00
parent 70a07bad39
commit 1b84564d36
35 changed files with 278 additions and 429 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 1.8.1.9010
Date: 2022-05-16
Version: 1.8.1.9011
Date: 2022-06-03
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by
@ -90,5 +90,5 @@ BugReports: https://github.com/msberends/AMR/issues
License: GPL-2 | file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
Roxygen: list(markdown = TRUE)

View File

@ -1,5 +1,5 @@
# `AMR` 1.8.1.9010
## <small>Last updated: 16 May 2022</small>
# `AMR` 1.8.1.9011
## <small>Last updated: 3 June 2022</small>
### New
* EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations.
@ -11,7 +11,7 @@
* Small fix for using `ab_from_text()`
* Fixes for reading in text files using `set_mo_source()`, which now also allows the source file to contain valid taxonomic names instead of only valid microorganism ID of this package
* Using any `random_*()` function (such as `random_mic()`) is now possible by directly calling the package without loading it first: `AMR::random_mic(10)`
* Changed value in column `prevalence` of the `microorganisms` data set from 3 to 2 for these genera: *Acholeplasma*, *Alistipes*, *Alloprevotella*, *Bergeyella*, *Borrelia*, *Brachyspira*, *Butyricimonas*, *Cetobacterium*, *Chlamydia*, *Chlamydophila*, *Deinococcus*, *Dysgonomonas*, *Elizabethkingia*, *Empedobacter*, *Haloarcula*, *Halobacterium*, *Halococcus*, *Myroides*, *Odoribacter*, *Ornithobacterium*, *Parabacteroides*, *Pedobacter*, *Phocaeicola*, *Porphyromonas*, *Riemerella*, *Sphingobacterium*, *Streptobacillus*, *Tenacibaculum*, *Terrimonas*, *Victivallis*, *Wautersiella*, *Weeksella*
# `AMR` 1.8.1

Binary file not shown.

View File

@ -168,31 +168,40 @@ rm(ref_taxonomy)
rm(data_col.bak)
rm(data_dsmz.bak)
mo_found_in_NL <- c("Absidia", "Acremonium", "Actinotignum", "Aedes", "Alternaria", "Anaerosalibacter", "Ancylostoma",
"Angiostrongylus", "Anisakis", "Anopheles", "Apophysomyces", "Arachnia", "Ascaris", "Aspergillus",
"Aureobacterium", "Aureobasidium", "Bacteroides", "Balantidum", "Basidiobolus", "Beauveria",
"Bilophilia", "Blastocystis", "Branhamella", "Brochontrix", "Brugia", "Calymmatobacterium", "Candida", "Capillaria",
"Capnocytophaga", "Catabacter", "Cdc", "Chaetomium", "Chilomastix", "Chryseobacterium",
"Chryseomonas", "Chrysonilia", "Cladophialophora", "Cladosporium", "Clonorchis", "Conidiobolus",
"Contracaecum", "Cordylobia", "Cryptococcus", "Curvularia", "Demodex", "Dermatobia", "Dicrocoelium",
"Dioctophyma", "Diphyllobothrium", "Dipylidium", "Dirofilaria", "Dracunculus", "Echinococcus",
"Echinostoma", "Elisabethkingia", "Enterobius", "Enteromonas", "Euascomycetes", "Exophiala",
"Exserohilum", "Fasciola", "Fasciolopsis", "Flavobacterium", "Fonsecaea", "Fusarium", "Fusobacterium",
"Giardia", "Gnathostoma", "Hendersonula", "Heterophyes", "Hymenolepis", "Hypomyces",
"Hysterothylacium", "Kloeckera", "Koserella", "Larva", "Lecythophora", "Leishmania", "Lelliottia",
"Leptomyxida", "Leptosphaeria", "Leptotrichia", "Loa", "Lucilia", "Lumbricus", "Malassezia",
"Malbranchea", "Mansonella", "Mesocestoides", "Metagonimus", "Metarrhizium", "Molonomonas",
"Mortierella", "Mucor", "Multiceps", "Mycocentrospora", "Mycoplasma", "Nanophetus", "Nattrassia",
"Necator", "Nectria", "Novospingobium", "Ochroconis", "Oesophagostomum", "Oidiodendron", "Onchocerca",
"Opisthorchis", "Opistorchis", "Paragonimus", "Paramyxovirus", "Pediculus", "Phlebotomus",
"Phocanema", "Phoma", "Phthirus", "Piedraia", "Pithomyces", "Pityrosporum", "Prevotella",
mo_found_in_NL <- c("Absidia", "Acholeplasma", "Acremonium", "Actinotignum", "Aedes", "Alistipes",
"Alloprevotella", "Alternaria", "Anaerosalibacter", "Ancylostoma", "Angiostrongylus",
"Anisakis", "Anopheles", "Apophysomyces", "Arachnia", "Ascaris", "Aspergillus",
"Aureobacterium", "Aureobasidium", "Bacteroides", "Balantidum", "Basidiobolus",
"Beauveria", "Bergeyella", "Bilophilia", "Blastocystis", "Borrelia", "Brachyspira",
"Branhamella", "Brochontrix", "Brugia", "Butyricimonas", "Calymmatobacterium",
"Candida", "Capillaria", "Capnocytophaga", "Catabacter", "Cdc", "Cetobacterium",
"Chaetomium", "Chilomastix", "Chlamydia", "Chlamydophila", "Chryseobacterium",
"Chryseomonas", "Chrysonilia", "Cladophialophora", "Cladosporium", "Clonorchis",
"Conidiobolus", "Contracaecum", "Cordylobia", "Cryptococcus", "Curvularia", "Deinococcus",
"Demodex", "Dermatobia", "Dicrocoelium", "Dioctophyma", "Diphyllobothrium", "Dipylidium",
"Dirofilaria", "Dracunculus", "Dysgonomonas", "Echinococcus", "Echinostoma",
"Elisabethkingia", "Elizabethkingia", "Empedobacter", "Enterobius", "Enteromonas",
"Euascomycetes", "Exophiala", "Exserohilum", "Fasciola", "Fasciolopsis", "Flavobacterium",
"Fonsecaea", "Fusarium", "Fusobacterium", "Giardia", "Gnathostoma", "Haloarcula",
"Halobacterium", "Halococcus", "Hendersonula", "Heterophyes", "Hymenolepis", "Hypomyces",
"Hysterothylacium", "Kloeckera", "Koserella", "Larva", "Lecythophora", "Leishmania",
"Lelliottia", "Leptomyxida", "Leptosphaeria", "Leptotrichia", "Loa", "Lucilia", "Lumbricus",
"Malassezia", "Malbranchea", "Mansonella", "Mesocestoides", "Metagonimus", "Metarrhizium",
"Molonomonas", "Mortierella", "Mucor", "Multiceps", "Mycocentrospora", "Mycoplasma",
"Myroides", "Nanophetus", "Nattrassia", "Necator", "Nectria", "Novospingobium", "Ochroconis",
"Odoribacter", "Oesophagostomum", "Oidiodendron", "Onchocerca", "Opisthorchis",
"Opistorchis", "Ornithobacterium", "Parabacteroides", "Paragonimus", "Paramyxovirus",
"Pediculus", "Pedobacter", "Phlebotomus", "Phocaeicola", "Phocanema", "Phoma",
"Phthirus", "Piedraia", "Pithomyces", "Pityrosporum", "Porphyromonas", "Prevotella",
"Pseudallescheria", "Pseudoterranova", "Pulex", "Retortamonas", "Rhizomucor", "Rhizopus",
"Rhodotorula", "Salinococcus", "Sanguibacteroides", "Sarcophagidae", "Sarcoptes", "Schistosoma",
"Scolecobasidium", "Scopulariopsis", "Scytalidium", "Spirometra", "Sporobolomyces", "Stachybotrys",
"Stenotrophomononas", "Stomatococcus", "Strongyloides", "Syncephalastraceae", "Syngamus", "Taenia",
"Ternidens", "Torulopsis", "Toxocara", "Toxoplasma", "Treponema", "Trichinella", "Trichobilharzia", "Trichoderma",
"Trichomonas", "Trichophyton", "Trichosporon", "Trichostrongylus", "Trichuris", "Tritirachium",
"Trombicula", "Trypanosoma", "Tunga", "Ureaplasma", "Wuchereria")
"Rhodotorula", "Riemerella", "Salinococcus", "Sanguibacteroides", "Sarcophagidae", "Sarcoptes",
"Schistosoma", "Scolecobasidium", "Scopulariopsis", "Scytalidium", "Sphingobacterium",
"Spirometra", "Sporobolomyces", "Stachybotrys", "Stenotrophomononas", "Stomatococcus",
"Streptobacillus", "Strongyloides", "Syncephalastraceae", "Syngamus", "Taenia",
"Tenacibaculum", "Ternidens", "Terrimonas", "Torulopsis", "Toxocara", "Toxoplasma",
"Treponema", "Trichinella", "Trichobilharzia", "Trichoderma", "Trichomonas", "Trichophyton",
"Trichosporon", "Trichostrongylus", "Trichuris", "Tritirachium", "Trombicula", "Trypanosoma",
"Tunga", "Ureaplasma", "Victivallis", "Wautersiella", "Weeksella", "Wuchereria")
MOs <- data_total %>%
filter(

View File

@ -43,7 +43,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>

View File

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

View File

@ -44,7 +44,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -190,7 +190,7 @@
<div class="page-header toc-ignore">
<h1 data-toc-skip>Data sets for download / own use</h1>
<h4 data-toc-skip class="date">16 May 2022</h4>
<h4 data-toc-skip class="date">03 June 2022</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/HEAD/vignettes/datasets.Rmd" class="external-link"><code>vignettes/datasets.Rmd</code></a></small>
<div class="hidden name"><code>datasets.Rmd</code></div>
@ -883,7 +883,7 @@ Dipivoxil, …</td>
<div class="section level2">
<h2 id="interpretation-from-mic-values-disk-diameters-to-rsi">Interpretation from MIC values / disk diameters to R/SI<a class="anchor" aria-label="anchor" href="#interpretation-from-mic-values-disk-diameters-to-rsi"></a>
</h2>
<p>A data set with 20,318 rows and 11 columns, containing the following
<p>A data set with 20,369 rows and 11 columns, containing the following
column names:<br><em>guideline</em>, <em>method</em>, <em>site</em>, <em>mo</em>,
<em>rank_index</em>, <em>ab</em>, <em>ref_tbl</em>, <em>disk_dose</em>,
<em>breakpoint_S</em>, <em>breakpoint_R</em> and <em>uti</em>.</p>
@ -915,8 +915,8 @@ file</a> (3.8 MB)</li>
<h3 id="source-4">Source<a class="anchor" aria-label="anchor" href="#source-4"></a>
</h3>
<p>This data set contains interpretation rules for MIC values and disk
diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
(2011-2021).</p>
diffusion diameters. Included guidelines are CLSI (2011-2022) and EUCAST
(2011-2022).</p>
</div>
<div class="section level3">
<h3 id="example-content-4">Example content<a class="anchor" aria-label="anchor" href="#example-content-4"></a>
@ -954,7 +954,7 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">EUCAST 2021</td>
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_ASPRG_MGTS</td>
@ -965,11 +965,11 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
<td align="center">Aspergillus</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">4</td>
<td align="center">1</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">EUCAST 2021</td>
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_ASPRG_NIGR</td>
@ -980,11 +980,11 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
<td align="center">Aspergillus</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">4</td>
<td align="center">1</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">EUCAST 2021</td>
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_CANDD</td>
@ -995,11 +995,11 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
<td align="center">Candida</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
<td align="center">1</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">EUCAST 2021</td>
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_CANDD_ALBC</td>
@ -1010,11 +1010,26 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
<td align="center">Candida</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
<td align="center">1</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">EUCAST 2021</td>
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_CANDD_DBLN</td>
<td align="center">Candida dubliniensis</td>
<td align="center">2</td>
<td align="center">AMB</td>
<td align="center">Amphotericin B</td>
<td align="center">Candida</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">EUCAST 2022</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_CANDD_KRUS</td>
@ -1025,22 +1040,7 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
<td align="center">Candida</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">EUCAST 2021</td>
<td align="center">MIC</td>
<td align="center"></td>
<td align="center">F_CANDD_PRPS</td>
<td align="center">Candida parapsilosis</td>
<td align="center">2</td>
<td align="center">AMB</td>
<td align="center">Amphotericin B</td>
<td align="center">Candida</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
<td align="center">FALSE</td>
</tr>
</tbody>

View File

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

View File

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

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -157,16 +157,16 @@
</div>
<div class="section level2">
<h2 class="page-header" data-toc-text="1.8.1.9010" id="amr-1819010">
<code>AMR</code> 1.8.1.9010<a class="anchor" aria-label="anchor" href="#amr-1819010"></a></h2>
<h2 class="page-header" data-toc-text="1.8.1.9011" id="amr-1819011">
<code>AMR</code> 1.8.1.9011<a class="anchor" aria-label="anchor" href="#amr-1819011"></a></h2>
<div class="section level3">
<h3 id="last-updated-may-1-8-1-9010"><small>Last updated: 16 May 2022</small><a class="anchor" aria-label="anchor" href="#last-updated-may-1-8-1-9010"></a></h3>
<h3 id="last-updated-june-1-8-1-9011"><small>Last updated: 3 June 2022</small><a class="anchor" aria-label="anchor" href="#last-updated-june-1-8-1-9011"></a></h3>
<div class="section level4">
<h4 id="new-1-8-1-9010">New<a class="anchor" aria-label="anchor" href="#new-1-8-1-9010"></a></h4>
<h4 id="new-1-8-1-9011">New<a class="anchor" aria-label="anchor" href="#new-1-8-1-9011"></a></h4>
<ul><li>EUCAST 2022 and CLSI 2022 guidelines have been added for <code><a href="../reference/as.rsi.html">as.rsi()</a></code>. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations.</li>
</ul></div>
<div class="section level4">
<h4 id="changed-1-8-1-9010">Changed<a class="anchor" aria-label="anchor" href="#changed-1-8-1-9010"></a></h4>
<h4 id="changed-1-8-1-9011">Changed<a class="anchor" aria-label="anchor" href="#changed-1-8-1-9011"></a></h4>
<ul><li>Fix for <code><a href="../reference/as.rsi.html">as.rsi()</a></code> on certain EUCAST breakpoints for MIC values</li>
<li>Removed <code><a href="https://rdrr.io/r/base/integer.html" class="external-link">as.integer()</a></code> for MIC values, since MIC are not integer values and running <code><a href="https://rdrr.io/r/base/table.html" class="external-link">table()</a></code> on MIC values consequently failed for not being able to retrieve the level position (as thats how normally <code><a href="https://rdrr.io/r/base/integer.html" class="external-link">as.integer()</a></code> on <code>factor</code>s work)</li>
<li>
@ -176,6 +176,8 @@
<li>Fixes for reading in text files using <code><a href="../reference/mo_source.html">set_mo_source()</a></code>, which now also allows the source file to contain valid taxonomic names instead of only valid microorganism ID of this package</li>
<li>Using any <code>random_*()</code> function (such as <code><a href="../reference/random.html">random_mic()</a></code>) is now possible by directly calling the package without loading it first: <code>AMR::random_mic(10)</code>
</li>
<li>Changed value in column <code>prevalence</code> of the <code>microorganisms</code> data set from 3 to 2 for these genera: <em>Acholeplasma</em>, <em>Alistipes</em>, <em>Alloprevotella</em>, <em>Bergeyella</em>, <em>Borrelia</em>, <em>Brachyspira</em>, <em>Butyricimonas</em>, <em>Cetobacterium</em>, <em>Chlamydia</em>, <em>Chlamydophila</em>, <em>Deinococcus</em>, <em>Dysgonomonas</em>, <em>Elizabethkingia</em>, <em>Empedobacter</em>, <em>Haloarcula</em>, <em>Halobacterium</em>, <em>Halococcus</em>, <em>Myroides</em>, <em>Odoribacter</em>, <em>Ornithobacterium</em>, <em>Parabacteroides</em>, <em>Pedobacter</em>, <em>Phocaeicola</em>, <em>Porphyromonas</em>, <em>Riemerella</em>, <em>Sphingobacterium</em>, <em>Streptobacillus</em>, <em>Tenacibaculum</em>, <em>Terrimonas</em>, <em>Victivallis</em>, <em>Wautersiella</em>, <em>Weeksella</em>
</li>
</ul></div>
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -217,20 +217,8 @@
<h3 id="general-info">General Info<a class="anchor" aria-label="anchor" href="#general-info"></a></h3>
<p>A microorganism (MO) code from this package (class: <code>mo</code>) is human readable and typically looks like these examples:</p><div class="sourceCode"><pre><code> Code Full name
--------------- --------------------------------------
B_KLBSL Klebsiella
B_KLBSL_PNMN Klebsiella pneumoniae
B_KLBSL_PNMN_RHNS Klebsiella pneumoniae rhinoscleromatis
| | | |
| | | |
| | | \---&gt; subspecies, a 4-5 letter acronym
| | \----&gt; species, a 4-5 letter acronym
| \----&gt; genus, a 5-7 letter acronym
\----&gt; taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
C (Chromista), F (Fungi), P (Protozoa)
</code></pre></div>
<p>A microorganism (MO) code from this package (class: <code>mo</code>) is human readable and typically looks like these examples:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Values that cannot be coerced will be considered 'unknown' and will get the MO code <code>UNKNOWN</code>.</p>
<p>Use the <code><a href="mo_property.html">mo_*</a></code> functions to get properties based on the returned code, see <em>Examples</em>.</p>
<p>The algorithm uses data from the Catalogue of Life (see below) and from one other source (see <a href="microorganisms.html">microorganisms</a>).</p>
@ -269,12 +257,12 @@
<h2>Source</h2>
<ol><li><p>Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870-926; doi: <a href="https://doi.org/10.1128/CMR.00109-13" class="external-link">10.1128/CMR.00109-13</a></p></li>
<li><p>Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect; doi: <a href="https://doi.org/10.1016/j.cmi.2019.02.028" class="external-link">10.1016/j.cmi.2019.02.028</a></p></li>
<li><p>Becker K <em>et al.</em> <strong>Emergence of coagulase-negative staphylococci</strong> 2020. Expert Rev Anti Infect Ther. 18(4):349-366; doi: <a href="https://doi.org/10.1080/14787210.2020.1730813" class="external-link">10.1080/14787210.2020.1730813</a></p></li>
<li><p>Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571-95; doi: <a href="https://doi.org/10.1084/jem.57.4.571" class="external-link">10.1084/jem.57.4.571</a></p></li>
<ol><li><p>Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870-926; <a href="https://doi.org/10.1128/CMR.00109-13" class="external-link">doi:10.1128/CMR.00109-13</a></p></li>
<li><p>Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect; <a href="https://doi.org/10.1016/j.cmi.2019.02.028" class="external-link">doi:10.1016/j.cmi.2019.02.028</a></p></li>
<li><p>Becker K <em>et al.</em> <strong>Emergence of coagulase-negative staphylococci</strong> 2020. Expert Rev Anti Infect Ther. 18(4):349-366; <a href="https://doi.org/10.1080/14787210.2020.1730813" class="external-link">doi:10.1080/14787210.2020.1730813</a></p></li>
<li><p>Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571-95; <a href="https://doi.org/10.1084/jem.57.4.571" class="external-link">doi:10.1084/jem.57.4.571</a></p></li>
<li><p>Catalogue of Life: 2019 Annual Checklist, <a href="http://www.catalogueoflife.org" class="external-link">http://www.catalogueoflife.org</a></p></li>
<li><p>List of Prokaryotic names with Standing in Nomenclature (5 October 2021), doi: <a href="https://doi.org/10.1099/ijsem.0.004332" class="external-link">10.1099/ijsem.0.004332</a></p></li>
<li><p>List of Prokaryotic names with Standing in Nomenclature (5 October 2021), <a href="https://doi.org/10.1099/ijsem.0.004332" class="external-link">doi:10.1099/ijsem.0.004332</a></p></li>
<li><p>US Edition of SNOMED CT from 1 September 2020, retrieved from the Public Health Information Network Vocabulary Access and Distribution System (PHIN VADS), OID 2.16.840.1.114222.4.11.1009, version 12; url: <a href="https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.1009" class="external-link">https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.1009</a></p></li>
</ol></div>
<div id="stable-lifecycle">

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -249,12 +249,12 @@
<p>The <code>as.rsi()</code> function works in four ways:</p><ol><li><p>For <strong>cleaning raw / untransformed data</strong>. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as <code>"&lt;0.25; S"</code> will be coerced to <code>"S"</code>. Combined interpretations for multiple test methods (as seen in laboratory records) such as <code>"S; S"</code> will be coerced to <code>"S"</code>, but a value like <code>"S; I"</code> will return <code>NA</code> with a warning that the input is unclear.</p></li>
<li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><a href="as.mic.html">as.mic()</a></code>, that also gives your columns the new data class <code><a href="as.mic.html">mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><div class="sourceCode"><pre><code><span class="va">your_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html" class="external-link">mutate_if</a></span><span class="op">(</span><span class="va">is.mic</span>, <span class="va">as.rsi</span><span class="op">)</span> <span class="co"># until dplyr 1.0.0</span>
<span class="va">your_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/across.html" class="external-link">across</a></span><span class="op">(</span><span class="fu">where</span><span class="op">(</span><span class="va">is.mic</span><span class="op">)</span>, <span class="va">as.rsi</span><span class="op">)</span><span class="op">)</span> <span class="co"># since dplyr 1.0.0</span></code></pre></div></li>
<li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><a href="as.mic.html">as.mic()</a></code>, that also gives your columns the new data class <code><a href="as.mic.html">mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div></li>
<li><p>Operators like "&lt;=" will be stripped before interpretation. When using <code>conserve_capped_values = TRUE</code>, an MIC value of e.g. "&gt;2" will always return "R", even if the breakpoint according to the chosen guideline is "&gt;=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (<code>conserve_capped_values = FALSE</code>) considers "&gt;2" to be lower than "&gt;=4" and might in this case return "S" or "I".</p></li>
</ul></li>
<li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><a href="as.disk.html">as.disk()</a></code>, that also gives your columns the new data class <code><a href="as.disk.html">disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><div class="sourceCode"><pre><code><span class="va">your_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html" class="external-link">mutate_if</a></span><span class="op">(</span><span class="va">is.disk</span>, <span class="va">as.rsi</span><span class="op">)</span> <span class="co"># until dplyr 1.0.0</span>
<span class="va">your_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/across.html" class="external-link">across</a></span><span class="op">(</span><span class="fu">where</span><span class="op">(</span><span class="va">is.disk</span><span class="op">)</span>, <span class="va">as.rsi</span><span class="op">)</span><span class="op">)</span> <span class="co"># since dplyr 1.0.0</span></code></pre></div></li>
<li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><a href="as.disk.html">as.disk()</a></code>, that also gives your columns the new data class <code><a href="as.disk.html">disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div></li>
</ul></li>
<li><p>For <strong>interpreting a complete data set</strong>, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running <code>as.rsi(your_data)</code>.</p></li>
</ol></div>

View File

@ -18,7 +18,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -243,30 +243,12 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<h2>Combination Therapy</h2>
<p>When using more than one variable for <code>...</code> (= combination therapy), use <code>only_all_tested</code> to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how <code><a href="proportion.html">susceptibility()</a></code> works to calculate the %SI:</p><div class="sourceCode"><pre><code>--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE
----------------------- -----------------------
Drug A Drug B include as include as include as include as
numerator denominator numerator denominator
-------- -------- ---------- ----------- ---------- -----------
S or I S or I X X X X
R S or I X X X X
&lt;NA&gt; S or I X X - -
S or I R X X X X
R R - X - X
&lt;NA&gt; R - - - -
S or I &lt;NA&gt; X X - -
R &lt;NA&gt; - - - -
&lt;NA&gt; &lt;NA&gt; - - - -
--------------------------------------------------------------------
</code></pre></div>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/count.html">count_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">=</span> <span class="fu"><a href="../reference/count.html">count_all</a></span><span class="op">(</span><span class="op">)</span>
<span class="fu"><a href="../reference/proportion.html">proportion_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">=</span> <span class="fl">1</span></code></pre></div>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/count.html">count_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&gt;=</span> <span class="fu"><a href="../reference/count.html">count_all</a></span><span class="op">(</span><span class="op">)</span>
<span class="fu"><a href="../reference/proportion.html">proportion_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&gt;=</span> <span class="fl">1</span></code></pre></div>
<p>When using more than one variable for <code>...</code> (= combination therapy), use <code>only_all_tested</code> to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how <code><a href="proportion.html">susceptibility()</a></code> works to calculate the %SI:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Using <code>only_all_tested</code> has no impact when only using one antibiotic as input.</p>
</div>
<div id="read-more-on-our-website-">

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -186,81 +186,29 @@
<h3 id="basics">Basics<a class="anchor" aria-label="anchor" href="#basics"></a></h3>
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p><div class="sourceCode"><pre><code><span class="va">x</span> <span class="op">&lt;-</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 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></code></pre></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><div class="sourceCode"><pre><code><span class="va">x</span>
<span class="co">#&gt; A set of custom EUCAST rules:</span>
<span class="co">#&gt; </span>
<span class="co">#&gt; 1. If TZP is S then set to S:</span>
<span class="co">#&gt; amoxicillin (AMX), ampicillin (AMP)</span>
<span class="co">#&gt; </span>
<span class="co">#&gt; 2. If TZP is R then set to R:</span>
<span class="co">#&gt; amoxicillin (AMX), ampicillin (AMP)</span></code></pre></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><div class="sourceCode"><pre><code><span class="va">df</span> <span class="op">&lt;-</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">"E. coli"</span>, <span class="st">"K. pneumoniae"</span><span class="op">)</span>,
TZP <span class="op">=</span> <span class="st">"R"</span>,
amox <span class="op">=</span> <span class="st">""</span>,
AMP <span class="op">=</span> <span class="st">""</span><span class="op">)</span>
<span class="va">df</span>
<span class="co">#&gt; mo TZP amox AMP</span>
<span class="co">#&gt; 1 E. coli R </span>
<span class="co">#&gt; 2 K. pneumoniae R </span>
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</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 class="co">#&gt; mo TZP amox AMP</span>
<span class="co">#&gt; 1 E. coli R R R </span>
<span class="co">#&gt; 2 K. pneumoniae R R R </span></code></pre></div>
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule itself is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
<p></p><div class="sourceCode"><pre><code></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"><pre><code></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"><pre><code></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 variables 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>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>species_id</code>, <code>source</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><div class="sourceCode"><pre><code><span class="va">y</span> <span class="op">&lt;-</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">&amp;</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 class="va">TZP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</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 class="op">)</span>
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">df</span>, rules <span class="op">=</span> <span class="st">"custom"</span>, custom_rules <span class="op">=</span> <span class="va">y</span><span class="op">)</span>
<span class="co">#&gt; mo TZP amox AMP</span>
<span class="co">#&gt; 1 E. coli R </span>
<span class="co">#&gt; 2 K. pneumoniae R R R</span></code></pre></div>
<p>There is one exception in variables 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>r vector_and(colnames(microorganisms), quote = "``", sort = FALSE)</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"><pre><code></code></pre><p></p></div>
</div>
<div class="section">
<h3 id="usage-of-antibiotic-group-names">Usage of antibiotic group names<a class="anchor" aria-label="anchor" href="#usage-of-antibiotic-group-names"></a></h3>
<p>It is possible to define antibiotic groups instead of single antibiotics for the rule consequence, the part <em>after</em> the tilde. In above examples, the antibiotic group <code>aminopenicillins</code> is used to include ampicillin and amoxicillin. The following groups are allowed (case-insensitive). Within parentheses are the agents that will be matched when running the rule.</p><ul><li><p><code>aminoglycosides</code><br>(amikacin, amikacin/fosfomycin, amphotericin B-high, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin and tobramycin-high)</p></li>
<li><p><code>aminopenicillins</code><br>(amoxicillin and ampicillin)</p></li>
<li><p><code>antifungals</code><br>(5-fluorocytosine, amphotericin B, anidulafungin, butoconazole, caspofungin, ciclopirox, clotrimazole, econazole, fluconazole, fosfluconazole, griseofulvin, hachimycin, ibrexafungerp, isavuconazole, isoconazole, itraconazole, ketoconazole, manogepix, micafungin, miconazole, nystatin, pimaricin, posaconazole, rezafungin, ribociclib, sulconazole, terbinafine, terconazole and voriconazole)</p></li>
<li><p><code>antimycobacterials</code><br>(4-aminosalicylic acid, calcium aminosalicylate, capreomycin, clofazimine, delamanid, enviomycin, ethambutol, ethambutol/isoniazid, ethionamide, isoniazid, morinamide, p-aminosalicylic acid, pretomanid, prothionamide, pyrazinamide, rifabutin, rifampicin, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, rifapentine, simvastatin/fenofibrate, sodium aminosalicylate, streptomycin/isoniazid, terizidone, thioacetazone/isoniazid, tiocarlide and viomycin)</p></li>
<li><p><code>betalactams</code><br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, avibactam, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, biapenem, carbenicillin, carindacillin, cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/nacubactam, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, 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, methicillin, mezlocillin, mezlocillin/sulbactam, nacubactam, nafcillin, oxacillin, panipenem, penamecillin, penicillin/novobiocin, penicillin/sulbactam, phenethicillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, razupenem, ritipenem, ritipenem acoxil, sarmoxicillin, sulbactam, sulbenicillin, sultamicillin, talampicillin, tazobactam, tebipenem, temocillin, ticarcillin and ticarcillin/clavulanic acid)</p></li>
<li><p><code>carbapenems</code><br>(biapenem, doripenem, ertapenem, imipenem, imipenem/EDTA, imipenem/relebactam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, panipenem, razupenem, ritipenem, ritipenem acoxil and tebipenem)</p></li>
<li><p><code>cephalosporins</code><br>(cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, cephradine, latamoxef and loracarbef)</p></li>
<li><p><code>cephalosporins_1st</code><br>(cefacetrile, cefadroxil, cefaloridine, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, cephalexin, cephalothin, cephapirin and cephradine)</p></li>
<li><p><code>cephalosporins_2nd</code><br>(cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening, cefprozil, cefuroxime, cefuroxime axetil and loracarbef)</p></li>
<li><p><code>cephalosporins_3rd</code><br>(cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone and latamoxef)</p></li>
<li><p><code>cephalosporins_4th</code><br>(cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetecol, cefoselis, cefozopran, cefpirome and cefquinome)</p></li>
<li><p><code>cephalosporins_5th</code><br>(ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor and ceftolozane/tazobactam)</p></li>
<li><p><code>cephalosporins_except_caz</code><br>(cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, cephradine, latamoxef and loracarbef)</p></li>
<li><p><code>fluoroquinolones</code><br>(besifloxacin, ciprofloxacin, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nifuroquine, norfloxacin, ofloxacin, orbifloxacin, pazufloxacin, pefloxacin, pradofloxacin, premafloxacin, prulifloxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin and trovafloxacin)</p></li>
<li><p><code>glycopeptides</code><br>(avoparcin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin and vancomycin-macromethod)</p></li>
<li><p><code>glycopeptides_except_lipo</code><br>(avoparcin, norvancomycin, ramoplanin, teicoplanin, teicoplanin-macromethod, vancomycin and vancomycin-macromethod)</p></li>
<li><p><code>lincosamides</code><br>(acetylmidecamycin, acetylspiramycin, clindamycin, gamithromycin, kitasamycin, lincomycin, meleumycin, nafithromycin, pirlimycin, primycin, solithromycin, tildipirosin, tilmicosin, tulathromycin, tylosin and tylvalosin)</p></li>
<li><p><code>lipoglycopeptides</code><br>(dalbavancin, oritavancin and telavancin)</p></li>
<li><p><code>macrolides</code><br>(acetylmidecamycin, acetylspiramycin, azithromycin, clarithromycin, 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><code>oxazolidinones</code><br>(cadazolid, cycloserine, linezolid, tedizolid and thiacetazone)</p></li>
<li><p><code>penicillins</code><br>(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, avibactam, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, carbenicillin, carindacillin, cefepime/nacubactam, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam, metampicillin, methicillin, mezlocillin, mezlocillin/sulbactam, nacubactam, nafcillin, oxacillin, penamecillin, penicillin/novobiocin, penicillin/sulbactam, phenethicillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbactam, sulbenicillin, sultamicillin, talampicillin, tazobactam, temocillin, ticarcillin and ticarcillin/clavulanic acid)</p></li>
<li><p><code>polymyxins</code><br>(colistin, polymyxin B and polymyxin B/polysorbate 80)</p></li>
<li><p><code>quinolones</code><br>(besifloxacin, cinoxacin, ciprofloxacin, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nifuroquine, nitroxoline, norfloxacin, ofloxacin, orbifloxacin, oxolinic acid, pazufloxacin, pefloxacin, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin and trovafloxacin)</p></li>
<li><p><code>streptogramins</code><br>(pristinamycin and quinupristin/dalfopristin)</p></li>
<li><p><code>tetracyclines</code><br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, tetracycline and tigecycline)</p></li>
<li><p><code>tetracyclines_except_tgc</code><br>(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline and tetracycline)</p></li>
<li><p><code>trimethoprims</code><br>(brodimoprim, 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><code>ureidopenicillins</code><br>(azlocillin, mezlocillin, piperacillin and piperacillin/tazobactam)</p></li>
</ul></div>
<p>It is possible to define antibiotic groups instead of single antibiotics for the rule consequence, the part <em>after</em> the tilde. In above examples, the antibiotic group <code>aminopenicillins</code> is used to include ampicillin and amoxicillin. The following groups are allowed (case-insensitive). Within parentheses are the agents that will be matched when running the rule.</p>
<p><code>r paste0(" * ", sapply(DEFINED_AB_GROUPS, function(x) paste0("``", tolower(gsub("^AB_", "", x)), "``\\cr(", vector_and(ab_name(eval(parse(text = x), envir = asNamespace("AMR")), language = NULL, tolower = TRUE), quotes = FALSE), ")"), USE.NAMES = FALSE), "\n", collapse = "")</code></p>
</div>
</div>
<div id="stable-lifecycle">

View File

@ -18,7 +18,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -185,7 +185,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<h2>Source</h2>
<ul><li><p>EUCAST Expert Rules. Version 2.0, 2012.<br>
Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility testing.</strong> <em>Clin Microbiol Infect.</em> 2013;19(2):141-60; doi: <a href="https://doi.org/10.1111/j.1469-0691.2011.03703.x" class="external-link">10.1111/j.1469-0691.2011.03703.x</a></p></li>
Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility testing.</strong> <em>Clin Microbiol Infect.</em> 2013;19(2):141-60; <a href="https://doi.org/10.1111/j.1469-0691.2011.03703.x" class="external-link">doi:10.1111/j.1469-0691.2011.03703.x</a></p></li>
<li><p>EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" class="external-link">(link)</a></p></li>
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" class="external-link">(link)</a></p></li>
<li><p>EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.3, 2021. <a href="https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf" class="external-link">(link)</a></p></li>
@ -233,11 +233,8 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
<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><div class="sourceCode"><pre><code><span class="va">x</span> <span class="op">&lt;-</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">&amp;</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 class="va">AMC</span> <span class="op">==</span> <span class="st">"I"</span> <span class="op">&amp;</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 class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">example_isolates</span>, rules <span class="op">=</span> <span class="st">"custom"</span>, custom_rules <span class="op">=</span> <span class="va">x</span><span class="op">)</span></code></pre></div>
<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"><pre><code></code></pre><p></p></div>
</div>
<div class="section">

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -249,8 +249,8 @@
<p>Unlike the exact test of goodness-of-fit (<code><a href="https://rdrr.io/r/stats/fisher.test.html" class="external-link">fisher.test()</a></code>), the <em>G</em>-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the <em>G</em>-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.</p>
<p>The <em>G</em>-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a <em>G</em>-statistic is:</p>
<p>\(G = 2 * sum(x * log(x / E))\)</p>
<p>where <code>E</code> are the expected values. Since this is chi-square distributed, the p value can be calculated in <span style="R">R</span> with:</p><div class="sourceCode"><pre><code><span class="va">p</span> <span class="op">&lt;-</span> <span class="fu">stats</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/stats/Chisquare.html" class="external-link">pchisq</a></span><span class="op">(</span><span class="va">G</span>, <span class="va">df</span>, lower.tail <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div>
<p>where <code>E</code> are the expected values. Since this is chi-square distributed, the p value can be calculated in <span style="R">R</span> with:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>where <code>df</code> are the degrees of freedom.</p>
<p>If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use <em>G</em>-tests for each category, of course.</p>
</div>

View File

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

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -258,31 +258,15 @@ Ordered <a href="https://rdrr.io/r/base/factor.html" class="external-link">facto
<p>Custom guidelines can be set with the <code>custom_mdro_guideline()</code> function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.</p>
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p><div class="sourceCode"><pre><code><span class="va">custom</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">custom_mdro_guideline</a></span><span class="op">(</span><span class="va">CIP</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type A"</span>,
<span class="va">ERY</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">60</span> <span class="op">~</span> <span class="st">"Elderly Type B"</span><span class="op">)</span></code></pre></div>
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule 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"><pre><code></code></pre><p></p></div>
<p>If a row/an isolate matches the first rule, the value after the first <code>~</code> (in this case <em>'Elderly Type A'</em>) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.</p>
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p><div class="sourceCode"><pre><code><span class="va">custom</span>
<span class="co">#&gt; A set of custom MDRO rules:</span>
<span class="co">#&gt; 1. CIP is "R" and age is higher than 60 -&gt; Elderly Type A</span>
<span class="co">#&gt; 2. ERY is "R" and age is higher than 60 -&gt; Elderly Type B</span>
<span class="co">#&gt; 3. Otherwise -&gt; Negative</span>
<span class="co">#&gt; </span>
<span class="co">#&gt; Unmatched rows will return NA.</span></code></pre></div>
<p>The outcome of the function can be used for the <code>guideline</code> argument in the <code>mdro()</code> function:</p><div class="sourceCode"><pre><code><span class="va">x</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">example_isolates</span>,
guideline <span class="op">=</span> <span class="va">custom</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/table.html" class="external-link">table</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co">#&gt; Negative Elderly Type A Elderly Type B</span>
<span class="co">#&gt; 1070 198 732</span></code></pre></div>
<p>Rules can also be combined with other custom rules by using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>:</p><div class="sourceCode"><pre><code><span class="va">x</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">example_isolates</span>,
guideline <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">custom</span>,
<span class="fu"><a href="../reference/mdro.html">custom_mdro_guideline</a></span><span class="op">(</span><span class="va">ERY</span> <span class="op">==</span> <span class="st">"R"</span> <span class="op">&amp;</span> <span class="va">age</span> <span class="op">&gt;</span> <span class="fl">50</span> <span class="op">~</span> <span class="st">"Elderly Type C"</span><span class="op">)</span><span class="op">)</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/table.html" class="external-link">table</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co">#&gt; Negative Elderly Type A Elderly Type B Elderly Type C </span>
<span class="co">#&gt; 961 198 732 109</span></code></pre></div>
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>The outcome of the function can be used for the <code>guideline</code> argument in the <code>mdro()</code> function:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Rules can also be combined with other custom rules by using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>The rules set (the <code>custom</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 id="stable-lifecycle">

View File

@ -18,7 +18,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -192,56 +192,19 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<p>Imagine this data on a sheet of an Excel file. The first column contains the organisation specific codes, the second column contains valid taxonomic names:</p><div class="sourceCode"><pre><code> | A | B |
--|--------------------|-----------------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | Escherichia coli |
3 | lab_mo_kpneumoniae | Klebsiella pneumoniae |
4 | | |
</code></pre></div>
<p>We save it as <code>"home/me/ourcodes.xlsx"</code>. Now we have to set it as a source:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/mo_source.html">set_mo_source</a></span><span class="op">(</span><span class="st">"home/me/ourcodes.xlsx"</span><span class="op">)</span>
<span class="co">#&gt; NOTE: Created mo_source file '/Users/me/mo_source.rds' (0.3 kB) from</span>
<span class="co">#&gt; '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns </span>
<span class="co">#&gt; "Organisation XYZ" and "mo"</span></code></pre></div>
<p>Imagine this data on a sheet of an Excel file. The first column contains the organisation specific codes, the second column contains valid taxonomic names:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>We save it as <code>"home/me/ourcodes.xlsx"</code>. Now we have to set it as a source:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>It has now created a file <code>"~/mo_source.rds"</code> with the contents of our Excel file. Only the first column with foreign values and the 'mo' column will be kept when creating the RDS file.</p>
<p>And now we can use it in our functions:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"lab_mo_ecoli"</span><span class="op">)</span>
<span class="co">#&gt; Class &lt;mo&gt;</span>
<span class="co">#&gt; [1] B_ESCHR_COLI</span>
<span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"lab_mo_kpneumoniae"</span><span class="op">)</span>
<span class="co">#&gt; [1] "Klebsiella"</span>
<span class="co"># other input values still work too</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Escherichia coli"</span>, <span class="st">"E. coli"</span>, <span class="st">"lab_mo_ecoli"</span><span class="op">)</span><span class="op">)</span>
<span class="co">#&gt; NOTE: Translation to one microorganism was guessed with uncertainty.</span>
<span class="co">#&gt; Use mo_uncertainties() to review it.</span>
<span class="co">#&gt; Class &lt;mo&gt;</span>
<span class="co">#&gt; [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI</span></code></pre></div>
<p>If we edit the Excel file by, let's say, adding row 4 like this:</p><div class="sourceCode"><pre><code> | A | B |
--|--------------------|-----------------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | Escherichia coli |
3 | lab_mo_kpneumoniae | Klebsiella pneumoniae |
4 | lab_Staph_aureus | Staphylococcus aureus |
5 | | |
</code></pre></div>
<p>...any new usage of an MO function in this package will update your data file:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"lab_mo_ecoli"</span><span class="op">)</span>
<span class="co">#&gt; NOTE: Updated mo_source file '/Users/me/mo_source.rds' (0.3 kB) from </span>
<span class="co">#&gt; '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns</span>
<span class="co">#&gt; "Organisation XYZ" and "mo"</span>
<span class="co">#&gt; Class &lt;mo&gt;</span>
<span class="co">#&gt; [1] B_ESCHR_COLI</span>
<span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"lab_Staph_aureus"</span><span class="op">)</span>
<span class="co">#&gt; [1] "Staphylococcus"</span></code></pre></div>
<p>To delete the reference data file, just use <code>""</code>, <code>NULL</code> or <code>FALSE</code> as input for <code>set_mo_source()</code>:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/mo_source.html">set_mo_source</a></span><span class="op">(</span><span class="cn">NULL</span><span class="op">)</span>
<span class="co">#&gt; Removed mo_source file '/Users/me/mo_source.rds'</span></code></pre></div>
<p>And now we can use it in our functions:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>If we edit the Excel file by, let's say, adding row 4 like this:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>...any new usage of an MO function in this package will update your data file:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>To delete the reference data file, just use <code>""</code>, <code>NULL</code> or <code>FALSE</code> as input for <code>set_mo_source()</code>:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>If the original file (in the previous case an Excel file) is moved or deleted, the <code>mo_source.rds</code> file will be removed upon the next use of <code><a href="as.mo.html">as.mo()</a></code> or any <code><a href="mo_property.html">mo_*</a></code> function.</p>
</div>
<div id="stable-lifecycle">

View File

@ -18,7 +18,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -239,30 +239,12 @@ resistance() should be used to calculate resistance, susceptibility() should be
<h2>Combination Therapy</h2>
<p>When using more than one variable for <code>...</code> (= combination therapy), use <code>only_all_tested</code> to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how <code>susceptibility()</code> works to calculate the %SI:</p><div class="sourceCode"><pre><code>--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE
----------------------- -----------------------
Drug A Drug B include as include as include as include as
numerator denominator numerator denominator
-------- -------- ---------- ----------- ---------- -----------
S or I S or I X X X X
R S or I X X X X
&lt;NA&gt; S or I X X - -
S or I R X X X X
R R - X - X
&lt;NA&gt; R - - - -
S or I &lt;NA&gt; X X - -
R &lt;NA&gt; - - - -
&lt;NA&gt; &lt;NA&gt; - - - -
--------------------------------------------------------------------
</code></pre></div>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/count.html">count_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">=</span> <span class="fu"><a href="../reference/count.html">count_all</a></span><span class="op">(</span><span class="op">)</span>
<span class="fu"><a href="../reference/proportion.html">proportion_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">=</span> <span class="fl">1</span></code></pre></div>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><div class="sourceCode"><pre><code><span class="fu"><a href="../reference/count.html">count_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/count.html">count_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&gt;=</span> <span class="fu"><a href="../reference/count.html">count_all</a></span><span class="op">(</span><span class="op">)</span>
<span class="fu"><a href="../reference/proportion.html">proportion_S</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_I</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="../reference/proportion.html">proportion_R</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&gt;=</span> <span class="fl">1</span></code></pre></div>
<p>When using more than one variable for <code>...</code> (= combination therapy), use <code>only_all_tested</code> to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how <code>susceptibility()</code> works to calculate the %SI:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>Using <code>only_all_tested</code> has no impact when only using one antibiotic as input.</p>
</div>
<div id="stable-lifecycle">

View File

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

View File

@ -17,7 +17,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1.9011</span>
</span>
</div>
@ -181,21 +181,9 @@
</ul></div>
<div id="details">
<h2>Details</h2>
<p>Overview of the data set:</p><div class="sourceCode r"><pre><code><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">rsi_translation</span><span class="op">)</span></code></pre><p></p></div><div class="sourceCode"><pre><code><span class="co">## guideline method site mo rank_index ab ref_tbl disk_dose</span>
<span class="co">## 1 EUCAST 2022 MIC &lt;NA&gt; F_ASPRG_MGTS 2 AMB Aspergillus &lt;NA&gt;</span>
<span class="co">## 2 EUCAST 2022 MIC &lt;NA&gt; F_ASPRG_NIGR 2 AMB Aspergillus &lt;NA&gt;</span>
<span class="co">## 3 EUCAST 2022 MIC &lt;NA&gt; F_CANDD 3 AMB Candida &lt;NA&gt;</span>
<span class="co">## 4 EUCAST 2022 MIC &lt;NA&gt; F_CANDD_ALBC 2 AMB Candida &lt;NA&gt;</span>
<span class="co">## 5 EUCAST 2022 MIC &lt;NA&gt; F_CANDD_DBLN 2 AMB Candida &lt;NA&gt;</span>
<span class="co">## 6 EUCAST 2022 MIC &lt;NA&gt; F_CANDD_KRUS 2 AMB Candida &lt;NA&gt;</span>
<span class="co">## breakpoint_S breakpoint_R uti</span>
<span class="co">## 1 1 1 FALSE</span>
<span class="co">## 2 1 1 FALSE</span>
<span class="co">## 3 1 1 FALSE</span>
<span class="co">## 4 1 1 FALSE</span>
<span class="co">## 5 1 1 FALSE</span>
<span class="co">## 6 1 1 FALSE</span></code></pre></div>
<p>Overview of the data set:</p>
<p></p><div class="sourceCode r"><pre><code><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">rsi_translation</span><span class="op">)</span></code></pre><p></p></div>
<p></p><div class="sourceCode"><pre><code></code></pre><p></p></div>
<p>The repository of this <code>AMR</code> package contains a file comprising this exact data set: <a href="https://github.com/msberends/AMR/blob/main/data-raw/rsi_translation.txt" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/rsi_translation.txt</a>. This file <strong>allows for machine reading EUCAST and CLSI guidelines</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically and the <code>mo</code> and <code>ab</code> columns have been transformed to contain the full official names instead of codes.</p>
</div>
<div id="reference-data-publicly-available">

View File

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

View File

@ -35,7 +35,9 @@ This transforms vectors to a new class \code{\link{mic}}, which treats the input
\details{
To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MIC values. It supports guidelines from EUCAST (2011-2022) and CLSI (2011-2022).
This class for MIC values is a quite a special data type: formally it is an ordered \link{factor} with valid MIC values as \link{factor} levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:\preformatted{x <- random_mic(10)
This class for MIC values is a quite a special data type: formally it is an ordered \link{factor} with valid MIC values as \link{factor} levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- random_mic(10)
x
#> Class <mic>
#> [1] 16 1 8 8 64 >=128 0.0625 32 32 16
@ -48,9 +50,11 @@ x[1] * 2
median(x)
#> [1] 26
}
}\if{html}{\out{</div>}}
This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using \link{numeric} values in data analysis, e.g.:\preformatted{x[x > 4]
This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using \link{numeric} values in data analysis, e.g.:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x[x > 4]
#> Class <mic>
#> [1] 16 8 8 64 >=128 32 32 16
@ -63,7 +67,7 @@ subset(df, x > 4) # or with dplyr: df \%>\% filter(x > 4)
#> 8 32 A
#> 9 32 A
#> 10 16 A
}
}\if{html}{\out{</div>}}
The following \link[=groupGeneric]{generic functions} are implemented for the MIC class: \code{!}, \code{!=}, \code{\%\%}, \code{\%/\%}, \code{&}, \code{*}, \code{+}, \code{-}, \code{/}, \code{<}, \code{<=}, \code{==}, \code{>}, \code{>=}, \code{^}, \code{|}, \code{\link[=abs]{abs()}}, \code{\link[=acos]{acos()}}, \code{\link[=acosh]{acosh()}}, \code{\link[=all]{all()}}, \code{\link[=any]{any()}}, \code{\link[=asin]{asin()}}, \code{\link[=asinh]{asinh()}}, \code{\link[=atan]{atan()}}, \code{\link[=atanh]{atanh()}}, \code{\link[=ceiling]{ceiling()}}, \code{\link[=cos]{cos()}}, \code{\link[=cosh]{cosh()}}, \code{\link[=cospi]{cospi()}}, \code{\link[=cummax]{cummax()}}, \code{\link[=cummin]{cummin()}}, \code{\link[=cumprod]{cumprod()}}, \code{\link[=cumsum]{cumsum()}}, \code{\link[=digamma]{digamma()}}, \code{\link[=exp]{exp()}}, \code{\link[=expm1]{expm1()}}, \code{\link[=floor]{floor()}}, \code{\link[=gamma]{gamma()}}, \code{\link[=lgamma]{lgamma()}}, \code{\link[=log]{log()}}, \code{\link[=log1p]{log1p()}}, \code{\link[=log2]{log2()}}, \code{\link[=log10]{log10()}}, \code{\link[=max]{max()}}, \code{\link[=mean]{mean()}}, \code{\link[=min]{min()}}, \code{\link[=prod]{prod()}}, \code{\link[=range]{range()}}, \code{\link[=round]{round()}}, \code{\link[=sign]{sign()}}, \code{\link[=signif]{signif()}}, \code{\link[=sin]{sin()}}, \code{\link[=sinh]{sinh()}}, \code{\link[=sinpi]{sinpi()}}, \code{\link[=sqrt]{sqrt()}}, \code{\link[=sum]{sum()}}, \code{\link[=tan]{tan()}}, \code{\link[=tanh]{tanh()}}, \code{\link[=tanpi]{tanpi()}}, \code{\link[=trigamma]{trigamma()}} and \code{\link[=trunc]{trunc()}}. Some functions of the \code{stats} package are also implemented: \code{\link[=median]{median()}}, \code{\link[=quantile]{quantile()}}, \code{\link[=mad]{mad()}}, \code{\link[=IQR]{IQR()}}, \code{\link[=fivenum]{fivenum()}}. Also, \code{\link[=boxplot.stats]{boxplot.stats()}} is supported. Since \code{\link[=sd]{sd()}} and \code{\link[=var]{var()}} are non-generic functions, these could not be extended. Use \code{\link[=mad]{mad()}} as an alternative, or use e.g. \code{sd(as.numeric(x))} where \code{x} is your vector of MIC values.

View File

@ -61,7 +61,9 @@ Use this function to determine a valid microorganism code (\code{\link{mo}}). De
\details{
\subsection{General Info}{
A microorganism (MO) code from this package (class: \code{\link{mo}}) is human readable and typically looks like these examples:\preformatted{ Code Full name
A microorganism (MO) code from this package (class: \code{\link{mo}}) is human readable and typically looks like these examples:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ Code Full name
--------------- --------------------------------------
B_KLBSL Klebsiella
B_KLBSL_PNMN Klebsiella pneumoniae
@ -73,7 +75,7 @@ A microorganism (MO) code from this package (class: \code{\link{mo}}) is human r
| \\----> genus, a 5-7 letter acronym
\\----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
C (Chromista), F (Fungi), P (Protozoa)
}
}\if{html}{\out{</div>}}
Values that cannot be coerced will be considered 'unknown' and will get the MO code \code{UNKNOWN}.

View File

@ -94,16 +94,20 @@ The \code{\link[=as.rsi]{as.rsi()}} function works in four ways:
\item For \strong{cleaning raw / untransformed data}. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as \code{"<0.25; S"} will be coerced to \code{"S"}. Combined interpretations for multiple test methods (as seen in laboratory records) such as \code{"S; S"} will be coerced to \code{"S"}, but a value like \code{"S; I"} will return \code{NA} with a warning that the input is unclear.
\item For \strong{interpreting minimum inhibitory concentration (MIC) values} according to EUCAST or CLSI. You must clean your MIC values first using \code{\link[=as.mic]{as.mic()}}, that also gives your columns the new data class \code{\link{mic}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument.
\itemize{
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:
\if{html}{\out{<div class="sourceCode">}}\preformatted{your_data \%>\% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0
your_data \%>\% mutate(across(where(is.mic), as.rsi)) # since dplyr 1.0.0
}
}\if{html}{\out{</div>}}
\item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".
}
\item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument.
\itemize{
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:
\if{html}{\out{<div class="sourceCode">}}\preformatted{your_data \%>\% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0
your_data \%>\% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0
}
}\if{html}{\out{</div>}}
}
\item For \strong{interpreting a complete data set}, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running \code{as.rsi(your_data)}.
}

View File

@ -97,7 +97,9 @@ This AMR package honours this (new) insight. Use \code{\link[=susceptibility]{su
\section{Combination Therapy}{
When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{--------------------------------------------------------------------
When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:
\if{html}{\out{<div class="sourceCode">}}\preformatted{--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE
----------------------- -----------------------
Drug A Drug B include as include as include as include as
@ -113,15 +115,19 @@ When using more than one variable for \code{...} (= combination therapy), use \c
R <NA> - - - -
<NA> <NA> - - - -
--------------------------------------------------------------------
}
}\if{html}{\out{</div>}}
Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:\preformatted{ count_S() + count_I() + count_R() = count_all()
Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ count_S() + count_I() + count_R() = count_all()
proportion_S() + proportion_I() + proportion_R() = 1
}
}\if{html}{\out{</div>}}
and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:\preformatted{ count_S() + count_I() + count_R() >= count_all()
and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ count_S() + count_I() + count_R() >= count_all()
proportion_S() + proportion_I() + proportion_R() >= 1
}
}\if{html}{\out{</div>}}
Using \code{only_all_tested} has no impact when only using one antibiotic as input.
}

View File

@ -22,11 +22,15 @@ Some organisations have their own adoption of EUCAST rules. This function can be
\subsection{Basics}{
If you are familiar with the \code{\link[dplyr:case_when]{case_when()}} function of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation'. The rule itself is written \emph{before} the tilde (\code{~}) and the consequence of the rule is written \emph{after} the tilde:\preformatted{x <- custom_eucast_rules(TZP == "S" ~ aminopenicillins == "S",
TZP == "R" ~ aminopenicillins == "R")
}
If you are familiar with the \code{\link[dplyr:case_when]{case_when()}} function of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation'. The rule itself is written \emph{before} the tilde (\code{~}) and the consequence of the rule is written \emph{after} the tilde:
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:\preformatted{x
\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- custom_eucast_rules(TZP == "S" ~ aminopenicillins == "S",
TZP == "R" ~ aminopenicillins == "R")
}\if{html}{\out{</div>}}
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:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x
#> A set of custom EUCAST rules:
#>
#> 1. If TZP is S then set to S:
@ -34,9 +38,11 @@ These are two custom EUCAST rules: if TZP (piperacillin/tazobactam) is "S", all
#>
#> 2. If TZP is R then set to R:
#> amoxicillin (AMX), ampicillin (AMP)
}
}\if{html}{\out{</div>}}
The rules (the part \emph{before} the tilde, in above example \code{TZP == "S"} and \code{TZP == "R"}) 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} must exist. We will create a sample data set and test the rules set:\preformatted{df <- data.frame(mo = c("E. coli", "K. pneumoniae"),
The rules (the part \emph{before} the tilde, in above example \code{TZP == "S"} and \code{TZP == "R"}) 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} must exist. We will create a sample data set and test the rules set:
\if{html}{\out{<div class="sourceCode">}}\preformatted{df <- data.frame(mo = c("E. coli", "K. pneumoniae"),
TZP = "R",
amox = "",
AMP = "")
@ -49,54 +55,28 @@ eucast_rules(df, rules = "custom", custom_rules = x)
#> mo TZP amox AMP
#> 1 E. coli R R R
#> 2 K. pneumoniae R R R
}
}\if{html}{\out{</div>}}
}
\subsection{Using taxonomic properties in rules}{
There is one exception in variables used for the rules: all column names of the \link{microorganisms} data set can also be used, but do not have to exist in the data set. These column names are: \code{mo}, \code{fullname}, \code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, \code{genus}, \code{species}, \code{subspecies}, \code{rank}, \code{ref}, \code{species_id}, \code{source}, \code{prevalence} and \code{snomed}. Thus, this next example will work as well, despite the fact that the \code{df} data set does not contain a column \code{genus}:\preformatted{y <- custom_eucast_rules(TZP == "S" & genus == "Klebsiella" ~ aminopenicillins == "S",
There is one exception in variables used for the rules: all column names of the \link{microorganisms} data set can also be used, but do not have to exist in the data set. These column names are: \verb{r vector_and(colnames(microorganisms), quote = "``", sort = FALSE)}. Thus, this next example will work as well, despite the fact that the \code{df} data set does not contain a column \code{genus}:
\if{html}{\out{<div class="sourceCode">}}\preformatted{y <- custom_eucast_rules(TZP == "S" & genus == "Klebsiella" ~ aminopenicillins == "S",
TZP == "R" & genus == "Klebsiella" ~ aminopenicillins == "R")
eucast_rules(df, rules = "custom", custom_rules = y)
#> mo TZP amox AMP
#> 1 E. coli R
#> 2 K. pneumoniae R R R
}
}\if{html}{\out{</div>}}
}
\subsection{Usage of antibiotic group names}{
It is possible to define antibiotic groups instead of single antibiotics for the rule consequence, the part \emph{after} the tilde. In above examples, the antibiotic group \code{aminopenicillins} is used to include ampicillin and amoxicillin. The following groups are allowed (case-insensitive). Within parentheses are the agents that will be matched when running the rule.
\itemize{
\item \code{aminoglycosides}\cr(amikacin, amikacin/fosfomycin, amphotericin B-high, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin and tobramycin-high)
\item \code{aminopenicillins}\cr(amoxicillin and ampicillin)
\item \code{antifungals}\cr(5-fluorocytosine, amphotericin B, anidulafungin, butoconazole, caspofungin, ciclopirox, clotrimazole, econazole, fluconazole, fosfluconazole, griseofulvin, hachimycin, ibrexafungerp, isavuconazole, isoconazole, itraconazole, ketoconazole, manogepix, micafungin, miconazole, nystatin, pimaricin, posaconazole, rezafungin, ribociclib, sulconazole, terbinafine, terconazole and voriconazole)
\item \code{antimycobacterials}\cr(4-aminosalicylic acid, calcium aminosalicylate, capreomycin, clofazimine, delamanid, enviomycin, ethambutol, ethambutol/isoniazid, ethionamide, isoniazid, morinamide, p-aminosalicylic acid, pretomanid, prothionamide, pyrazinamide, rifabutin, rifampicin, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, rifapentine, simvastatin/fenofibrate, sodium aminosalicylate, streptomycin/isoniazid, terizidone, thioacetazone/isoniazid, tiocarlide and viomycin)
\item \code{betalactams}\cr(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, avibactam, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, biapenem, carbenicillin, carindacillin, cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/nacubactam, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, 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, methicillin, mezlocillin, mezlocillin/sulbactam, nacubactam, nafcillin, oxacillin, panipenem, penamecillin, penicillin/novobiocin, penicillin/sulbactam, phenethicillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, razupenem, ritipenem, ritipenem acoxil, sarmoxicillin, sulbactam, sulbenicillin, sultamicillin, talampicillin, tazobactam, tebipenem, temocillin, ticarcillin and ticarcillin/clavulanic acid)
\item \code{carbapenems}\cr(biapenem, doripenem, ertapenem, imipenem, imipenem/EDTA, imipenem/relebactam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, panipenem, razupenem, ritipenem, ritipenem acoxil and tebipenem)
\item \code{cephalosporins}\cr(cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, cephradine, latamoxef and loracarbef)
\item \code{cephalosporins_1st}\cr(cefacetrile, cefadroxil, cefaloridine, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, cephalexin, cephalothin, cephapirin and cephradine)
\item \code{cephalosporins_2nd}\cr(cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening, cefprozil, cefuroxime, cefuroxime axetil and loracarbef)
\item \code{cephalosporins_3rd}\cr(cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone and latamoxef)
\item \code{cephalosporins_4th}\cr(cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetecol, cefoselis, cefozopran, cefpirome and cefquinome)
\item \code{cephalosporins_5th}\cr(ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor and ceftolozane/tazobactam)
\item \code{cephalosporins_except_caz}\cr(cefacetrile, cefaclor, cefadroxil, cefaloridine, cefamandole, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/clavulanic acid, cefepime/tazobactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening, 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, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/enzyme inhibitor, ceftolozane/tazobactam, ceftriaxone, cefuroxime, cefuroxime axetil, cephalexin, cephalothin, cephapirin, cephradine, latamoxef and loracarbef)
\item \code{fluoroquinolones}\cr(besifloxacin, ciprofloxacin, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nifuroquine, norfloxacin, ofloxacin, orbifloxacin, pazufloxacin, pefloxacin, pradofloxacin, premafloxacin, prulifloxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin and trovafloxacin)
\item \code{glycopeptides}\cr(avoparcin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin and vancomycin-macromethod)
\item \code{glycopeptides_except_lipo}\cr(avoparcin, norvancomycin, ramoplanin, teicoplanin, teicoplanin-macromethod, vancomycin and vancomycin-macromethod)
\item \code{lincosamides}\cr(acetylmidecamycin, acetylspiramycin, clindamycin, gamithromycin, kitasamycin, lincomycin, meleumycin, nafithromycin, pirlimycin, primycin, solithromycin, tildipirosin, tilmicosin, tulathromycin, tylosin and tylvalosin)
\item \code{lipoglycopeptides}\cr(dalbavancin, oritavancin and telavancin)
\item \code{macrolides}\cr(acetylmidecamycin, acetylspiramycin, azithromycin, clarithromycin, 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)
\item \code{oxazolidinones}\cr(cadazolid, cycloserine, linezolid, tedizolid and thiacetazone)
\item \code{penicillins}\cr(amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, avibactam, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, carbenicillin, carindacillin, cefepime/nacubactam, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam, metampicillin, methicillin, mezlocillin, mezlocillin/sulbactam, nacubactam, nafcillin, oxacillin, penamecillin, penicillin/novobiocin, penicillin/sulbactam, phenethicillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbactam, sulbenicillin, sultamicillin, talampicillin, tazobactam, temocillin, ticarcillin and ticarcillin/clavulanic acid)
\item \code{polymyxins}\cr(colistin, polymyxin B and polymyxin B/polysorbate 80)
\item \code{quinolones}\cr(besifloxacin, cinoxacin, ciprofloxacin, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, levofloxacin, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nifuroquine, nitroxoline, norfloxacin, ofloxacin, orbifloxacin, oxolinic acid, pazufloxacin, pefloxacin, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin and trovafloxacin)
\item \code{streptogramins}\cr(pristinamycin and quinupristin/dalfopristin)
\item \code{tetracyclines}\cr(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, tetracycline and tigecycline)
\item \code{tetracyclines_except_tgc}\cr(cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline and tetracycline)
\item \code{trimethoprims}\cr(brodimoprim, 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)
\item \code{ureidopenicillins}\cr(azlocillin, mezlocillin, piperacillin and piperacillin/tazobactam)
}
\verb{r paste0(" * ", sapply(DEFINED_AB_GROUPS, function(x) paste0("``", tolower(gsub("^AB_", "", x)), "``\\\\cr(", vector_and(ab_name(eval(parse(text = x), envir = asNamespace("AMR")), language = NULL, tolower = TRUE), quotes = FALSE), ")"), USE.NAMES = FALSE), "\\n", collapse = "")}
}
}

View File

@ -76,11 +76,13 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
The file containing all EUCAST rules is located here: \url{https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv}. \strong{Note:} Old taxonomic names are replaced with the current taxonomy where applicable. For example, \emph{Ochrobactrum anthropi} was renamed to \emph{Brucella anthropi} in 2020; the original EUCAST rules v3.1 and v3.2 did not yet contain this new taxonomic name. The file used as input for this \code{AMR} package contains the taxonomy updated until \link[=catalogue_of_life]{5 October 2021}.
\subsection{Custom Rules}{
Custom rules can be created using \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}, e.g.:\preformatted{x <- custom_eucast_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
Custom rules can be created using \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}, e.g.:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- custom_eucast_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I")
eucast_rules(example_isolates, rules = "custom", custom_rules = x)
}
}\if{html}{\out{</div>}}
}
\subsection{'Other' Rules}{

View File

@ -89,8 +89,10 @@ The \emph{G}-test uses the log of the ratio of two likelihoods as the test stati
\eqn{G = 2 * sum(x * log(x / E))}
where \code{E} are the expected values. Since this is chi-square distributed, the p value can be calculated in \R with:\preformatted{p <- stats::pchisq(G, df, lower.tail = FALSE)
}
where \code{E} are the expected values. Since this is chi-square distributed, the p value can be calculated in \R with:
\if{html}{\out{<div class="sourceCode">}}\preformatted{p <- stats::pchisq(G, df, lower.tail = FALSE)
}\if{html}{\out{</div>}}
where \code{df} are the degrees of freedom.

View File

@ -122,35 +122,43 @@ Please suggest your own (country-specific) guidelines by letting us know: \url{h
Custom guidelines can be set with the \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}} function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.
If you are familiar with the \code{\link[dplyr:case_when]{case_when()}} function of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation'. The rule is written \emph{before} the tilde (\code{~}) and the consequence of the rule is written \emph{after} the tilde:\preformatted{custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
If you are familiar with the \code{\link[dplyr:case_when]{case_when()}} function of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation'. The rule is written \emph{before} the tilde (\code{~}) and the consequence of the rule is written \emph{after} the tilde:
\if{html}{\out{<div class="sourceCode">}}\preformatted{custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
ERY == "R" & age > 60 ~ "Elderly Type B")
}
}\if{html}{\out{</div>}}
If a row/an isolate matches the first rule, the value after the first \code{~} (in this case \emph{'Elderly Type A'}) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.
You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.\preformatted{custom
You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.
\if{html}{\out{<div class="sourceCode">}}\preformatted{custom
#> A set of custom MDRO rules:
#> 1. CIP is "R" and age is higher than 60 -> Elderly Type A
#> 2. ERY is "R" and age is higher than 60 -> Elderly Type B
#> 3. Otherwise -> Negative
#>
#> Unmatched rows will return NA.
}
}\if{html}{\out{</div>}}
The outcome of the function can be used for the \code{guideline} argument in the \code{\link[=mdro]{mdro()}} function:\preformatted{x <- mdro(example_isolates,
The outcome of the function can be used for the \code{guideline} argument in the \code{\link[=mdro]{mdro()}} function:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- mdro(example_isolates,
guideline = custom)
table(x)
#> Negative Elderly Type A Elderly Type B
#> 1070 198 732
}
}\if{html}{\out{</div>}}
Rules can also be combined with other custom rules by using \code{\link[=c]{c()}}:\preformatted{x <- mdro(example_isolates,
Rules can also be combined with other custom rules by using \code{\link[=c]{c()}}:
\if{html}{\out{<div class="sourceCode">}}\preformatted{x <- mdro(example_isolates,
guideline = c(custom,
custom_mdro_guideline(ERY == "R" & age > 50 ~ "Elderly Type C")))
table(x)
#> Negative Elderly Type A Elderly Type B Elderly Type C
#> 961 198 732 109
}
}\if{html}{\out{</div>}}
The rules set (the \code{custom} object in this case) could be exported to a shared file location using \code{\link[=saveRDS]{saveRDS()}} if you collaborate with multiple users. The custom rules set could then be imported using \code{\link[=readRDS]{readRDS()}}.
}

View File

@ -37,23 +37,29 @@ Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The
\section{How to Setup}{
Imagine this data on a sheet of an Excel file. The first column contains the organisation specific codes, the second column contains valid taxonomic names:\preformatted{ | A | B |
Imagine this data on a sheet of an Excel file. The first column contains the organisation specific codes, the second column contains valid taxonomic names:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ | A | B |
--|--------------------|-----------------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | Escherichia coli |
3 | lab_mo_kpneumoniae | Klebsiella pneumoniae |
4 | | |
}
}\if{html}{\out{</div>}}
We save it as \code{"home/me/ourcodes.xlsx"}. Now we have to set it as a source:\preformatted{set_mo_source("home/me/ourcodes.xlsx")
We save it as \code{"home/me/ourcodes.xlsx"}. Now we have to set it as a source:
\if{html}{\out{<div class="sourceCode">}}\preformatted{set_mo_source("home/me/ourcodes.xlsx")
#> NOTE: Created mo_source file '/Users/me/mo_source.rds' (0.3 kB) from
#> '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns
#> "Organisation XYZ" and "mo"
}
}\if{html}{\out{</div>}}
It has now created a file \code{"~/mo_source.rds"} with the contents of our Excel file. Only the first column with foreign values and the 'mo' column will be kept when creating the RDS file.
And now we can use it in our functions:\preformatted{as.mo("lab_mo_ecoli")
And now we can use it in our functions:
\if{html}{\out{<div class="sourceCode">}}\preformatted{as.mo("lab_mo_ecoli")
#> Class <mo>
#> [1] B_ESCHR_COLI
@ -66,18 +72,22 @@ as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
#> Use mo_uncertainties() to review it.
#> Class <mo>
#> [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
}
}\if{html}{\out{</div>}}
If we edit the Excel file by, let's say, adding row 4 like this:\preformatted{ | A | B |
If we edit the Excel file by, let's say, adding row 4 like this:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ | A | B |
--|--------------------|-----------------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | Escherichia coli |
3 | lab_mo_kpneumoniae | Klebsiella pneumoniae |
4 | lab_Staph_aureus | Staphylococcus aureus |
5 | | |
}
}\if{html}{\out{</div>}}
...any new usage of an MO function in this package will update your data file:\preformatted{as.mo("lab_mo_ecoli")
...any new usage of an MO function in this package will update your data file:
\if{html}{\out{<div class="sourceCode">}}\preformatted{as.mo("lab_mo_ecoli")
#> NOTE: Updated mo_source file '/Users/me/mo_source.rds' (0.3 kB) from
#> '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns
#> "Organisation XYZ" and "mo"
@ -86,11 +96,13 @@ If we edit the Excel file by, let's say, adding row 4 like this:\preformatted{
mo_genus("lab_Staph_aureus")
#> [1] "Staphylococcus"
}
}\if{html}{\out{</div>}}
To delete the reference data file, just use \code{""}, \code{NULL} or \code{FALSE} as input for \code{\link[=set_mo_source]{set_mo_source()}}:\preformatted{set_mo_source(NULL)
To delete the reference data file, just use \code{""}, \code{NULL} or \code{FALSE} as input for \code{\link[=set_mo_source]{set_mo_source()}}:
\if{html}{\out{<div class="sourceCode">}}\preformatted{set_mo_source(NULL)
#> Removed mo_source file '/Users/me/mo_source.rds'
}
}\if{html}{\out{</div>}}
If the original file (in the previous case an Excel file) is moved or deleted, the \code{mo_source.rds} file will be removed upon the next use of \code{\link[=as.mo]{as.mo()}} or any \code{\link[=mo_property]{mo_*}} function.
}

View File

@ -89,7 +89,9 @@ The function \code{\link[=proportion_df]{proportion_df()}} takes any variable fr
}
\section{Combination Therapy}{
When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{--------------------------------------------------------------------
When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:
\if{html}{\out{<div class="sourceCode">}}\preformatted{--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE
----------------------- -----------------------
Drug A Drug B include as include as include as include as
@ -105,15 +107,19 @@ When using more than one variable for \code{...} (= combination therapy), use \c
R <NA> - - - -
<NA> <NA> - - - -
--------------------------------------------------------------------
}
}\if{html}{\out{</div>}}
Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:\preformatted{ count_S() + count_I() + count_R() = count_all()
Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ count_S() + count_I() + count_R() = count_all()
proportion_S() + proportion_I() + proportion_R() = 1
}
}\if{html}{\out{</div>}}
and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:\preformatted{ count_S() + count_I() + count_R() >= count_all()
and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:
\if{html}{\out{<div class="sourceCode">}}\preformatted{ count_S() + count_I() + count_R() >= count_all()
proportion_S() + proportion_I() + proportion_R() >= 1
}
}\if{html}{\out{</div>}}
Using \code{only_all_tested} has no impact when only using one antibiotic as input.
}

View File

@ -27,8 +27,12 @@ rsi_translation
Data set containing reference data to interpret MIC and disk diffusion to R/SI values, according to international guidelines. Currently implemented guidelines are EUCAST (2011-2022) and CLSI (2011-2022). Use \code{\link[=as.rsi]{as.rsi()}} to transform MICs or disks measurements to R/SI values.
}
\details{
Overview of the data set:\if{html}{\out{<div class="sourceCode r">}}\preformatted{head(rsi_translation)
}\if{html}{\out{</div>}}\preformatted{## guideline method site mo rank_index ab ref_tbl disk_dose
Overview of the data set:
\if{html}{\out{<div class="sourceCode r">}}\preformatted{head(rsi_translation)
}\if{html}{\out{</div>}}
\if{html}{\out{<div class="sourceCode">}}\preformatted{## guideline method site mo rank_index ab ref_tbl disk_dose
## 1 EUCAST 2022 MIC <NA> F_ASPRG_MGTS 2 AMB Aspergillus <NA>
## 2 EUCAST 2022 MIC <NA> F_ASPRG_NIGR 2 AMB Aspergillus <NA>
## 3 EUCAST 2022 MIC <NA> F_CANDD 3 AMB Candida <NA>
@ -42,7 +46,7 @@ Overview of the data set:\if{html}{\out{<div class="sourceCode r">}}\preformatte
## 4 1 1 FALSE
## 5 1 1 FALSE
## 6 1 1 FALSE
}
}\if{html}{\out{</div>}}
The repository of this \code{AMR} package contains a file comprising this exact data set: \url{https://github.com/msberends/AMR/blob/main/data-raw/rsi_translation.txt}. This file \strong{allows for machine reading EUCAST and CLSI guidelines}, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically and the \code{mo} and \code{ab} columns have been transformed to contain the full official names instead of codes.
}