<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">RMarkdown</a>. However, the methodology remains unchanged. This page was generated on 15 March 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">RMarkdown</a>. However, the methodology remains unchanged. This page was generated on 26 March 2019.</p>
<p>So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researcher perspective: there are slightly more men. Nothing we didn’t already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><ahref="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<aclass="sourceLine"id="cb14-22"title="22"><spanclass="co">#> Table 1: Intrinsic resistance in Enterobacteriaceae (1315 changes)</span></a>
<aclass="sourceLine"id="cb14-22"title="22"><spanclass="co">#> Table 1: Intrinsic resistance in Enterobacteriaceae (1262 changes)</span></a>
<aclass="sourceLine"id="cb14-23"title="23"><spanclass="co">#> Table 2: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<aclass="sourceLine"id="cb14-24"title="24"><spanclass="co">#> Table 3: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<aclass="sourceLine"id="cb14-25"title="25"><spanclass="co">#> Table 4: Intrinsic resistance in Gram-positive bacteria (2799 changes)</span></a>
<aclass="sourceLine"id="cb14-25"title="25"><spanclass="co">#> Table 4: Intrinsic resistance in Gram-positive bacteria (2756 changes)</span></a>
<aclass="sourceLine"id="cb14-26"title="26"><spanclass="co">#> Table 8: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<aclass="sourceLine"id="cb14-27"title="27"><spanclass="co">#> Table 9: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<aclass="sourceLine"id="cb14-28"title="28"><spanclass="co">#> Table 10: Interpretive rules for B-lactam agents and other Gram-negative bacteria (no changes)</span></a>
@ -462,9 +462,9 @@
<aclass="sourceLine"id="cb14-38"title="38"><spanclass="co">#> Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<aclass="sourceLine"id="cb14-39"title="39"><spanclass="co">#> Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<aclass="sourceLine"id="cb14-41"title="41"><spanclass="co">#> => EUCAST rules affected 7,488 out of 20,000 rows</span></a>
<aclass="sourceLine"id="cb14-41"title="41"><spanclass="co">#> => EUCAST rules affected 7,403 out of 20,000 rows</span></a>
<aclass="sourceLine"id="cb14-42"title="42"><spanclass="co">#> -> added 0 test results</span></a>
<aclass="sourceLine"id="cb14-43"title="43"><spanclass="co">#> -> changed 4,114 test results (0 to S; 0 to I; 4,114 to R)</span></a></code></pre></div>
<aclass="sourceLine"id="cb14-43"title="43"><spanclass="co">#> -> changed 4,018 test results (0 to S; 0 to I; 4,018 to R)</span></a></code></pre></div>
<aclass="sourceLine"id="cb16-3"title="3"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb16-4"title="4"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `date` as input for `col_date`.</span></a>
<aclass="sourceLine"id="cb16-5"title="5"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb16-6"title="6"><spanclass="co">#> => Found 5,688 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<aclass="sourceLine"id="cb16-6"title="6"><spanclass="co">#> => Found 5,648 first isolates (28.2% of total)</span></a></code></pre></div>
<p>So only 28.2% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<p>For future use, the above two syntaxes can be shortened with the <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -516,10 +516,10 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-04-01</td>
<tdalign="center">K1</td>
<tdalign="center">2010-01-29</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -527,101 +527,101 @@
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-04-30</td>
<tdalign="center">K1</td>
<tdalign="center">2010-05-18</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-10-12</td>
<tdalign="center">K1</td>
<tdalign="center">2010-06-01</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-12-05</td>
<tdalign="center">K1</td>
<tdalign="center">2010-07-21</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2011-01-19</td>
<tdalign="center">K1</td>
<tdalign="center">2010-08-20</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-04-07</td>
<tdalign="center">K1</td>
<tdalign="center">2010-12-14</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-06-16</td>
<tdalign="center">K1</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-07-16</td>
<tdalign="center">K1</td>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-03-02</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-03-14</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-08-25</td>
<tdalign="center">K1</td>
<tdalign="center">2011-05-28</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-09-11</td>
<tdalign="center">K1</td>
<tdalign="center">2011-08-09</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
</tbody>
@ -637,7 +637,7 @@
<aclass="sourceLine"id="cb19-7"title="7"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb19-8"title="8"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<aclass="sourceLine"id="cb19-9"title="9"><spanclass="co">#> [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<aclass="sourceLine"id="cb19-10"title="10"><spanclass="co">#> => Found 15,948 first weighted isolates (79.7% of total)</span></a></code></pre></div>
<aclass="sourceLine"id="cb19-10"title="10"><spanclass="co">#> => Found 15,891 first weighted isolates (79.5% of total)</span></a></code></pre></div>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -654,10 +654,10 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-04-01</td>
<tdalign="center">K1</td>
<tdalign="center">2010-01-29</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -666,95 +666,95 @@
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-04-30</td>
<tdalign="center">K1</td>
<tdalign="center">2010-05-18</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-10-12</td>
<tdalign="center">K1</td>
<tdalign="center">2010-06-01</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-12-05</td>
<tdalign="center">K1</td>
<tdalign="center">2010-07-21</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2011-01-19</td>
<tdalign="center">K1</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-04-07</td>
<tdalign="center">K1</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-06-16</td>
<tdalign="center">K1</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-07-16</td>
<tdalign="center">K1</td>
<tdalign="center">2010-08-20</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2010-12-14</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-03-02</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-03-14</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2011-08-25</td>
<tdalign="center">K1</td>
<tdalign="center">2011-05-28</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
@ -762,23 +762,23 @@
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2011-09-11</td>
<tdalign="center">K1</td>
<tdalign="center">2011-08-09</td>
<tdalign="center">P7</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 7 isolates are flagged. In total, 79.7% of all isolates are marked ‘first weighted’ - 51.3% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 2, now 8 isolates are flagged. In total, 79.5% of all isolates are marked ‘first weighted’ - 51.2% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
<p>The functions <code><ahref="../reference/portion.html">portion_R()</a></code>, <code>portion_RI()</code>, <code><ahref="../reference/portion.html">portion_I()</a></code>, <code>portion_IS()</code> and <code><ahref="../reference/portion.html">portion_S()</a></code> can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:</p>
<p>The functions <code><ahref="../reference/portion.html">portion_S()</a></code>, <code><ahref="../reference/portion.html">portion_SI()</a></code>, <code><ahref="../reference/portion.html">portion_I()</a></code>, <code><ahref="../reference/portion.html">portion_IR()</a></code> and <code><ahref="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:</p>
<p>Or can be used in conjuction with <code><ahref="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><ahref="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<p>To show results in plots, most R users would nowadays use the <code>ggplot2</code> package. This package lets you create plots in layers. You can read more about it <ahref="https://ggplot2.tidyverse.org/">on their website</a>. A quick example would look like these syntaxes:</p>
<p>The <code>AMR</code> package contains functions to extend this <code>ggplot2</code> package, for example <code><ahref="../reference/ggplot_rsi.html">geom_rsi()</a></code>. It automatically transforms data with <code><ahref="../reference/count.html">count_df()</a></code> or <code><ahref="../reference/portion.html">portion_df()</a></code> and show results in stacked bars. Its simplest and shortest example:</p>
<p>Omit the <code>translate_ab = FALSE</code> to have the antibiotic codes (amox, amcl, cipr, gent) translated to official WHO names (amoxicillin, amoxicillin and betalactamase inhibitor, ciprofloxacin, gentamicin).</p>
<p>If we group on e.g.the <code>genus</code> column and add some additional functions from our package, we can create this:</p>
<divclass="sourceCode"id="cb32"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb32-1"title="1"><spanclass="co"># group the data on `genus`</span></a>
<aclass="sourceLine"id="cb32-16"title="16"><spanclass="st"></span><spanclass="kw"><ahref="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<spanclass="dt">title =</span><spanclass="st">"Resistance per genus and antibiotic"</span>, </a>
<aclass="sourceLine"id="cb32-16"title="16"><spanclass="st"></span><spanclass="kw"><ahref="https://www.rdocumentation.org/packages/ggplot2/topics/labs">labs</a></span>(<spanclass="dt">title =</span><spanclass="st">"Resistance per genus and antibiotic"</span>, </a>
<aclass="sourceLine"id="cb32-17"title="17"><spanclass="dt">subtitle =</span><spanclass="st">"(this is fake data)"</span>) <spanclass="op">+</span></a>
<aclass="sourceLine"id="cb32-18"title="18"><spanclass="st"></span><spanclass="co"># and print genus in italic to follow our convention</span></a>
<aclass="sourceLine"id="cb32-19"title="19"><spanclass="st"></span><spanclass="co"># (is now y axis because we turned the plot)</span></a>
<p>To simplify this, we also created the <code><ahref="../reference/ggplot_rsi.html">ggplot_rsi()</a></code> function, which combines almost all above functions:</p>
<td><p>a logical to indicate whether <em>Staphylococci</em> should be categorised into Coagulase Negative <em>Staphylococci</em> ("CoNS") and Coagulase Positive <em>Staphylococci</em> ("CoPS") instead of their own species, according to Karsten Becker <em>et al.</em> [1]. Note that this does not include species that were newly named after this publication.</p>
<td><p>a logical to indicate whether <em>Staphylococci</em> should be categorised into coagulase-negative <em>Staphylococci</em> ("CoNS") and coagulase-positive <em>Staphylococci</em> ("CoPS") instead of their own species, according to Karsten Becker <em>et al.</em> [1,2]. Note that this does not include species that were newly named after these publications, like <em>S. caeli</em>.</p>
<p>This excludes <em>Staphylococcus aureus</em> at default, use <code>Becker = "all"</code> to also categorise <em>S. aureus</em> as "CoPS".</p></td>
</tr>
<tr>
<th>Lancefield</th>
<td><p>a logical to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [2]. These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p>
<td><p>a logical to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [3]. These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p>
<p>This excludes <em>Enterococci</em> at default (who are in group D), use <code>Lancefield = "all"</code> to also categorise all <em>Enterococci</em> as group D.</p></td>
@ -303,14 +303,15 @@ A microbial ID from this package (class: <code>mo</code>) typically looks like t
| | | ----> subspecies, a 3-4 letter acronym
| | ----> species, a 3-4 letter acronym
| ----> genus, a 5-7 letter acronym, mostly without vowels
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), C (Chromista),
F (Fungi), P (Protozoa) or PL (Plantae)
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
C (Chromista), F (Fungi), P (Protozoa) or
PL (Plantae)
</pre>
<p>Values that cannot be coered will be considered 'unknown' and have an MO code <code>UNKNOWN</code>.</p>
<p>Values that cannot be coered will be considered 'unknown' and will get the MO code <code>UNKNOWN</code>.</p>
<p>Use the <code><ahref='mo_property.html'>mo_property</a>_*</code> functions to get properties based on the returned code, see Examples.</p>
<p>The algorithm uses data from the Catalogue of Life (see below) and from one other source (see <code><ahref='microorganisms.html'>?microorganisms</a></code>).</p>
<p><strong>Self-learning algoritm</strong><br/>
The <code>as.mo()</code> function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use <code>clean_mo_history()</code> to reset the algorithms. Only experience from your current <code>AMR</code> package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. Usually, any guess after the first try runs 90-95% faster than the first try. The algorithm saves its previous findings to <code>~/.Rhistory_mo</code>.</p>
The <code>as.mo()</code> function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use <code>clean_mo_history()</code> to reset the algorithms. Only experience from your current <code>AMR</code> package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. Usually, any guess after the first try runs 80-95% faster than the first try. The algorithm saves its previous findings to <code>~/.Rhistory_mo</code>.</p>
<p><strong>Intelligent rules</strong><br/>
This function uses intelligent rules to help getting fast and logical results. It tries to find matches in this order:</p><ul>
<li><p>Valid MO codes and full names: it first searches in already valid MO code and known genus/species combinations</p></li>
@ -324,7 +325,7 @@ This function uses intelligent rules to help getting fast and logical results. I
<li><p>Something like <code>"stau"</code> or <code>"S aur"</code> will return the ID of <em>Staphylococcus aureus</em> and not <em>Staphylococcus auricularis</em></p></li>
</ul><p>This means that looking up human pathogenic microorganisms takes less time than looking up human non-pathogenic microorganisms.</p>
<p><strong>Uncertain results</strong><br/>
The algorithm can additionally use three different levels of uncertainty to guess valid results. The default is <code>allow_uncertain = TRUE</code>, which is uqual to uncertainty level 2. Using <code>allow_uncertain = FALSE</code> will skip all of these additional rules:</p><ul>
The algorithm can additionally use three different levels of uncertainty to guess valid results. The default is <code>allow_uncertain = TRUE</code>, which is equal to uncertainty level 2. Using <code>allow_uncertain = FALSE</code> will skip all of these additional rules:</p><ul>
<li><p>(uncertainty level 1): It tries to look for only matching genera</p></li>
<li><p>(uncertainty level 1): It tries to look for previously accepted (but now invalid) taxonomic names</p></li>
<li><p>(uncertainty level 2): It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules</p></li>
@ -354,8 +355,9 @@ The intelligent rules takes into account microbial prevalence of pathogens in hu
<p>[2] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <ahref='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[3] Catalogue of Life: Annual Checklist (public online taxonomic database), <ahref='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><ahref='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
<p>[2] Becker K <em>et al.</em><strong>Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong>. 2019. Clin Microbiol Infect. 2019 Mar 11. <ahref='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <ahref='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <ahref='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><ahref='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
<h2class="hasAnchor"id="catalogue-of-life"><aclass="anchor"href="#catalogue-of-life"></a>Catalogue of Life</h2>
<spanclass='kw'>n1</span><spanclass='kw'>=</span><spanclass='fu'>count_all</span>(<spanclass='no'>cipr</span>), <spanclass='co'># the actual total; sum of all three</span>
<spanclass='kw'>n2</span><spanclass='kw'>=</span><spanclass='fu'>n_rsi</span>(<spanclass='no'>cipr</span>), <spanclass='co'># same - analogous to n_distinct</span>
<spanclass='kw'>total</span><spanclass='kw'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <spanclass='co'># NOT the amount of tested isolates!</span>
<spanclass='kw'>total</span><spanclass='kw'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <spanclass='co'># NOT the number of tested isolates!</span>
<spanclass='co'># Count co-resistance between amoxicillin/clav acid and gentamicin,</span>
<spanclass='co'># so we can see that combination therapy does a lot more than mono therapy.</span>
<metaproperty="og:title"content="Filter on antibiotic class — filter_ab_class"/>
<metaproperty="og:title"content="Filter isolates on result in antibiotic class — filter_ab_class"/>
<metaproperty="og:description"content="Filter on specific antibiotic variables based on their class (ATC groups)."/>
<metaproperty="og:description"content="Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside."/>
<p>Filter on specific antibiotic variables based on their class (ATC groups).</p>
<p>Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside.</p>
</div>
@ -274,7 +274,7 @@
</tr>
<tr>
<th>ab_class</th>
<td><p>an antimicrobial class, like <code>"carbapenems"</code></p></td>
<td><p>an antimicrobial class, like <code>"carbapenems"</code>. More specifically, this should be a text that can be found in a 4th level ATC group (chemical subgroup) or a 5th level ATC group (chemical substance), please see <ahref='https://www.whocc.no/atc/structure_and_principles/'>this explanation on the WHOCC website</a>.</p></td>
</tr>
<tr>
<th>result</th>
@ -317,8 +317,14 @@
<spanclass='co'># filter on isolates that show resistance to</span>
<spanclass='co'># any aminoglycoside and any fluoroquinolone</span>
<p>[2] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <ahref='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[3] Catalogue of Life: Annual Checklist (public online taxonomic database), <ahref='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><ahref='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
<p>[2] Becker K <em>et al.</em><strong>Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong>. 2019. Clin Microbiol Infect. 2019 Mar 11. <ahref='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p>
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 571–95. <ahref='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <ahref='www.catalogueoflife.org'>www.catalogueoflife.org</a> (check included annual version with <code><ahref='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
<metaproperty="og:title"content="Calculate resistance of isolates — portion"/>
<metaproperty="og:description"content="These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in dplyrs summarise and support grouped variables, see Examples.
<metaproperty="og:description"content="These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in dplyrs summarise and support grouped variables, see Examples.
portion_R and portion_IR can be used to calculate resistance, portion_S and portion_SI can be used to calculate susceptibility."/>
@ -238,7 +238,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
<divclass="ref-description">
<p>These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in <code>dplyr</code>s <code><ahref='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></code> and support grouped variables, see <em>Examples</em>.</p>
<p>These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in <code>dplyr</code>s <code><ahref='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></code> and support grouped variables, see <em>Examples</em>.</p>
<p><code>portion_R</code> and <code>portion_IR</code> can be used to calculate resistance, <code>portion_S</code> and <code>portion_SI</code> can be used to calculate susceptibility.<br/></p>
</div>
@ -270,7 +270,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
</tr>
<tr>
<th>minimum</th>
<td><p>the minimal amount of available isolates. Any number lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
</tr>
<tr>
<th>as_percent</th>
@ -311,14 +311,14 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
<p>The old <code><ahref='rsi.html'>rsi</a></code> function is still available for backwards compatibility but is deprecated.
<br/><br/>
To calculate the probability (<em>p</em>) of susceptibility of one antibiotic, we use this formula:
To calculate the probability (<em>p</em>) of susceptibility of more antibiotics (i.e. combination therapy), we need to check whether one of them has a susceptible result (as numerator) and count all cases where all antibiotics were tested (as denominator). <br/>
<spanclass='kw'>n</span><spanclass='kw'>=</span><spanclass='fu'><ahref='count.html'>n_rsi</a></span>(<spanclass='no'>cipr</span>), <spanclass='co'># works like n_distinct in dplyr</span>
<spanclass='kw'>total</span><spanclass='kw'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>())<spanclass='co'># NOT the amount of tested isolates!</span>
<spanclass='kw'>n1</span><spanclass='kw'>=</span><spanclass='fu'><ahref='count.html'>count_all</a></span>(<spanclass='no'>cipr</span>), <spanclass='co'># the actual total; sum of all three</span>
<spanclass='kw'>n2</span><spanclass='kw'>=</span><spanclass='fu'><ahref='count.html'>n_rsi</a></span>(<spanclass='no'>cipr</span>),<spanclass='co'># same - analogous to n_distinct</span>
<spanclass='kw'>total</span><spanclass='kw'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <spanclass='co'># NOT the number of tested isolates!</span>
<spanclass='co'># Calculate co-resistance between amoxicillin/clav acid and gentamicin,</span>
<spanclass='co'># so we can see that combination therapy does a lot more than mono therapy:</span>
<td><p>the minimal amount of available isolates. Any number lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
</tr>
<tr>
<th>as_percent</th>
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.