1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 18:06:12 +01:00

website update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-02-20 10:38:24 +01:00
parent 616c8ab1ae
commit 8dc027309e
21 changed files with 145 additions and 146 deletions

View File

@ -30,7 +30,7 @@
#' \itemize{
#' \item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
#' \item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
#' \item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
#' \item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
#' \item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
#' \item{The responsible author(s) and year of scientific publication}
#' }

View File

@ -218,26 +218,26 @@
<a class="sourceLine" id="cb2-9" title="9"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb2-10" title="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; expr min lq mean median</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("sau") 42.58139 42.645368 43.3006677 42.970095</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("stau") 76.60094 77.168264 83.7686909 77.316642</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("staaur") 42.86607 42.947083 43.5035571 43.497293</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 18.39354 18.432582 22.4304233 18.495928</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 18.46513 18.559903 18.6640991 18.579110</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("STAAUR") 42.71975 42.788612 44.3280682 43.069864</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co">#&gt; as.mo("Staphylococcus aureus") 11.56285 11.591419 15.9457298 11.667161</span></a>
<a class="sourceLine" id="cb2-20" title="20"><span class="co">#&gt; as.mo("B_STPHY_AUR") 0.40487 0.450128 0.5036822 0.481417</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; expr min lq mean median</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("sau") 42.680497 42.766053 43.5046242 43.2246305</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("stau") 76.627901 76.760320 82.2084011 77.2020310</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("staaur") 42.751945 42.828281 46.8816599 43.0017665</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 18.328588 18.370632 22.3298018 18.4252830</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 18.258048 18.385997 18.7710600 18.5449555</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("STAAUR") 42.734554 42.854751 43.6593017 43.6353320</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co">#&gt; as.mo("Staphylococcus aureus") 11.466961 11.572841 16.5287637 11.6172940</span></a>
<a class="sourceLine" id="cb2-20" title="20"><span class="co">#&gt; as.mo("B_STPHY_AUR") 0.284603 0.302692 0.4095492 0.4190475</span></a>
<a class="sourceLine" id="cb2-21" title="21"><span class="co">#&gt; uq max neval</span></a>
<a class="sourceLine" id="cb2-22" title="22"><span class="co">#&gt; 43.448543 45.058105 10</span></a>
<a class="sourceLine" id="cb2-23" title="23"><span class="co">#&gt; 78.335591 127.180349 10</span></a>
<a class="sourceLine" id="cb2-24" title="24"><span class="co">#&gt; 43.817095 44.999509 10</span></a>
<a class="sourceLine" id="cb2-25" title="25"><span class="co">#&gt; 19.007097 56.501460 10</span></a>
<a class="sourceLine" id="cb2-26" title="26"><span class="co">#&gt; 18.651814 19.373275 10</span></a>
<a class="sourceLine" id="cb2-27" title="27"><span class="co">#&gt; 43.741388 54.703256 10</span></a>
<a class="sourceLine" id="cb2-28" title="28"><span class="co">#&gt; 12.323077 50.121808 10</span></a>
<a class="sourceLine" id="cb2-29" title="29"><span class="co">#&gt; 0.519271 0.766578 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (404 millionths of seconds).</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of <em>Mycoplasma leonicaptivi</em> (<code>B_MYCPL_LEO</code>), a bug probably never found before in humans:</p>
<a class="sourceLine" id="cb2-22" title="22"><span class="co">#&gt; 44.091919 45.191431 10</span></a>
<a class="sourceLine" id="cb2-23" title="23"><span class="co">#&gt; 78.670409 123.715942 10</span></a>
<a class="sourceLine" id="cb2-24" title="24"><span class="co">#&gt; 43.089558 81.640969 10</span></a>
<a class="sourceLine" id="cb2-25" title="25"><span class="co">#&gt; 18.546004 57.384741 10</span></a>
<a class="sourceLine" id="cb2-26" title="26"><span class="co">#&gt; 19.235128 19.693775 10</span></a>
<a class="sourceLine" id="cb2-27" title="27"><span class="co">#&gt; 44.189907 45.381609 10</span></a>
<a class="sourceLine" id="cb2-28" title="28"><span class="co">#&gt; 12.175081 59.815567 10</span></a>
<a class="sourceLine" id="cb2-29" title="29"><span class="co">#&gt; 0.482254 0.500343 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (284 millionths of seconds).</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Mycoplasma leonicaptivi</em> (<code>B_MYCPL_LEO</code>), a bug probably never found before in humans:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">M.leonicaptivi &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"myle"</span>),</a>
<a class="sourceLine" id="cb3-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"mycleo"</span>),</a>
<a class="sourceLine" id="cb3-3" title="3"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"M. leonicaptivi"</span>),</a>
@ -248,22 +248,22 @@
<a class="sourceLine" id="cb3-8" title="8"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb3-9" title="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(M.leonicaptivi, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; expr min lq mean</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("myle") 112.28656 112.372601 112.751678</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("mycleo") 382.46812 382.757612 383.432440</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.68674 203.654949 210.461303</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.89759 203.440956 203.816387</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">#&gt; as.mo("MYCLEO") 382.27864 383.090895 401.904482</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">#&gt; as.mo("Mycoplasma leonicaptivi") 102.99676 103.191196 109.196394</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; as.mo("B_MYCPL_LEO") 0.32155 0.564807 4.320068</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">#&gt; median uq max neval</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt; 112.540884 112.76874 113.76321 10</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt; 383.232219 384.05897 385.28587 10</span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt; 204.255445 205.80976 242.53035 10</span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt; 203.613673 203.82802 206.15038 10</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt; 386.478757 421.87837 437.26978 10</span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt; 103.596136 104.65940 142.25748 10</span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt; 0.593652 0.62522 37.96384 10</span></a></code></pre></div>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; expr min lq mean</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("myle") 112.493914 112.698409 113.5834588</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("mycleo") 382.813554 382.992838 389.0918181</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.903596 203.855253 211.7932317</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">#&gt; as.mo("M. leonicaptivi") 203.761037 204.178479 212.5451427</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">#&gt; as.mo("MYCLEO") 382.602355 383.481517 393.2696052</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">#&gt; as.mo("Mycoplasma leonicaptivi") 103.701176 103.991018 109.5707840</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; as.mo("B_MYCPL_LEO") 0.312051 0.564876 0.5870787</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">#&gt; median uq max neval</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt; 113.363438 114.20691 115.907686 10</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt; 384.139806 388.34114 421.458483 10</span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt; 204.186195 205.16631 243.204461 10</span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt; 204.715173 207.97372 244.462163 10</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt; 383.918409 386.97938 434.456156 10</span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt; 104.428888 104.87207 153.125617 10</span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt; 0.567914 0.63779 0.859048 10</span></a></code></pre></div>
<p>That takes 6 times as much time on average! A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">16</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (16)</span></a>
<a class="sourceLine" id="cb4-2" title="2"></a>
@ -273,9 +273,8 @@
<a class="sourceLine" id="cb4-6" title="6"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(S.aureus, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, max_y_axis),</a>
<a class="sourceLine" id="cb4-7" title="7"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Staphylococcus aureus"</span>))))</a></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="720"></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(M.leonicaptivi, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, max_y_axis),</a>
<a class="sourceLine" id="cb5-3" title="3"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Mycoplasma leonicaptivi"</span>))))</a></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(M.leonicaptivi, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, max_y_axis),</a>
<a class="sourceLine" id="cb5-2" title="2"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Mycoplasma leonicaptivi"</span>))))</a></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-2.png" width="720"></p>
<p>To relieve this pitfall and further improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
<div id="repetitive-results" class="section level3">
@ -283,35 +282,27 @@
<a href="#repetitive-results" class="anchor"></a>Repetitive results</h3>
<p>Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_fullname()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb6-2" title="2"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-3" title="3"><span class="co">#&gt; Attaching package: 'dplyr'</span></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="co">#&gt; The following objects are masked from 'package:stats':</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#&gt; filter, lag</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#&gt; The following objects are masked from 'package:base':</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; intersect, setdiff, setequal, union</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co"># take 500,000 random MO codes from the septic_patients data set</span></a>
<a class="sourceLine" id="cb6-11" title="11">x =<span class="st"> </span>septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-12" title="12"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-13" title="13"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)</a>
<a class="sourceLine" id="cb6-14" title="14"> </a>
<a class="sourceLine" id="cb6-15" title="15"><span class="co"># got the right length?</span></a>
<a class="sourceLine" id="cb6-16" title="16"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)</a>
<a class="sourceLine" id="cb6-17" title="17"><span class="co">#&gt; [1] 500000</span></a>
<a class="sourceLine" id="cb6-18" title="18"></a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co"># and how many unique values do we have?</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)</a>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; [1] 95</span></a>
<a class="sourceLine" id="cb6-22" title="22"></a>
<a class="sourceLine" id="cb6-23" title="23"><span class="co"># now let's see:</span></a>
<a class="sourceLine" id="cb6-24" title="24">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),</a>
<a class="sourceLine" id="cb6-25" title="25"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb6-26" title="26"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb6-27" title="27"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-28" title="28"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-29" title="29"><span class="co">#&gt; X 435.7086 442.1682 465.5949 468.8453 477.1915 505.961 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 95 unique values only takes 0.47 seconds (468 ms). You only lose time on your unique input values.</p>
<a class="sourceLine" id="cb6-2" title="2"><span class="co"># take 500,000 random MO codes from the septic_patients data set</span></a>
<a class="sourceLine" id="cb6-3" title="3">x =<span class="st"> </span>septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)</a>
<a class="sourceLine" id="cb6-6" title="6"> </a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co"># got the right length?</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)</a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; [1] 500000</span></a>
<a class="sourceLine" id="cb6-10" title="10"></a>
<a class="sourceLine" id="cb6-11" title="11"><span class="co"># and how many unique values do we have?</span></a>
<a class="sourceLine" id="cb6-12" title="12"><span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)</a>
<a class="sourceLine" id="cb6-13" title="13"><span class="co">#&gt; [1] 95</span></a>
<a class="sourceLine" id="cb6-14" title="14"></a>
<a class="sourceLine" id="cb6-15" title="15"><span class="co"># now let's see:</span></a>
<a class="sourceLine" id="cb6-16" title="16">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),</a>
<a class="sourceLine" id="cb6-17" title="17"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb6-18" title="18"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; X 413.2556 431.8327 448.3355 445.8654 465.2447 480.5499 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 95 unique values only takes 0.45 seconds (445 ms). You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -323,10 +314,10 @@
<a class="sourceLine" id="cb7-4" title="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb7-5" title="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; A 38.887977 38.920313 39.3674024 39.076862 39.258415 42.166327 10</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#&gt; B 19.589084 19.631059 19.8682396 19.781567 19.955611 20.751941 10</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#&gt; C 0.255829 0.382732 0.4199913 0.400156 0.499156 0.564807 10</span></a></code></pre></div>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; A 39.603291 39.713640 39.950479 39.8150500 40.172707 40.664181 10</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#&gt; B 19.570436 19.623515 19.964292 19.9376620 20.228830 20.609744 10</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#&gt; C 0.251429 0.333144 0.389883 0.3866775 0.499087 0.510401 10</span></a></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0004 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
<a class="sourceLine" id="cb8-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
@ -340,20 +331,20 @@
<a class="sourceLine" id="cb8-10" title="10"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb8-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-12" title="12"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; A 0.250242 0.292496 0.3891774 0.4266960 0.456902 0.520388 10</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt; B 0.259461 0.311702 0.3428727 0.3412800 0.374141 0.443912 10</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt; C 0.290960 0.313169 0.4334429 0.4097595 0.520389 0.725373 10</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt; D 0.271823 0.282789 0.3187217 0.3192800 0.352909 0.375398 10</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt; E 0.245353 0.270985 0.3081197 0.2960235 0.330839 0.429036 10</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt; F 0.246122 0.266585 0.2991101 0.3089435 0.332794 0.351582 10</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; G 0.271893 0.272452 0.3085039 0.2850580 0.368204 0.385525 10</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; H 0.252686 0.259251 0.3161791 0.2985025 0.334820 0.422680 10</span></a></code></pre></div>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; A 0.298084 0.370509 0.4040816 0.4065820 0.449569 0.475480 10</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt; B 0.293753 0.306115 0.3352809 0.3212705 0.370160 0.386154 10</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt; C 0.307652 0.353328 0.4106327 0.3943595 0.467239 0.548255 10</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt; D 0.244376 0.262954 0.2987189 0.3027975 0.338102 0.353747 10</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt; E 0.249614 0.255550 0.2985027 0.2772710 0.351931 0.397049 10</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt; F 0.259531 0.282439 0.3248814 0.3193850 0.345575 0.415906 10</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; G 0.249055 0.266516 0.3293723 0.3020295 0.344528 0.616350 10</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; H 0.242141 0.288515 0.3122614 0.3152295 0.339779 0.355773 10</span></a></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
<h3 class="hasAnchor">
<a href="#results-in-other-languages" class="anchor"></a>Results in other languages</h3>
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions take a little while longer:</p>
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions will have a translated result. This almost doest take extra time:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>) <span class="co"># or just mo_fullname("CoNS") on an English system</span></a>
<a class="sourceLine" id="cb9-2" title="2"><span class="co">#&gt; [1] "Coagulase Negative Staphylococcus (CoNS)"</span></a>
<a class="sourceLine" id="cb9-3" title="3"></a>
@ -371,13 +362,13 @@
<a class="sourceLine" id="cb9-15" title="15"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb9-16" title="16"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb9-17" title="17"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb9-18" title="18"><span class="co">#&gt; en 10.67105 11.03136 11.06332 11.07271 11.15310 11.45006 10</span></a>
<a class="sourceLine" id="cb9-19" title="19"><span class="co">#&gt; de 19.13393 19.50080 26.13799 19.61419 20.23400 52.66501 10</span></a>
<a class="sourceLine" id="cb9-20" title="20"><span class="co">#&gt; nl 19.05410 19.53789 22.94707 19.59205 20.12616 52.47399 10</span></a>
<a class="sourceLine" id="cb9-21" title="21"><span class="co">#&gt; es 19.31635 19.55221 26.22342 19.58633 20.01875 52.97636 10</span></a>
<a class="sourceLine" id="cb9-22" title="22"><span class="co">#&gt; it 19.21725 19.47105 19.63980 19.58053 19.68162 20.58914 10</span></a>
<a class="sourceLine" id="cb9-23" title="23"><span class="co">#&gt; fr 19.07854 19.45450 19.67303 19.56153 19.64517 20.45651 10</span></a>
<a class="sourceLine" id="cb9-24" title="24"><span class="co">#&gt; pt 19.00668 19.28388 19.53493 19.57857 19.66423 20.55317 10</span></a></code></pre></div>
<a class="sourceLine" id="cb9-18" title="18"><span class="co">#&gt; en 10.74026 11.10686 11.09997 11.11563 11.20366 11.34076 10</span></a>
<a class="sourceLine" id="cb9-19" title="19"><span class="co">#&gt; de 19.15977 19.59293 19.76980 19.71204 19.78338 20.54633 10</span></a>
<a class="sourceLine" id="cb9-20" title="20"><span class="co">#&gt; nl 19.42929 19.54013 19.75978 19.67233 19.77263 20.58935 10</span></a>
<a class="sourceLine" id="cb9-21" title="21"><span class="co">#&gt; es 19.31042 19.66821 19.65120 19.69552 19.73421 19.75538 10</span></a>
<a class="sourceLine" id="cb9-22" title="22"><span class="co">#&gt; it 19.26362 19.34003 22.93301 19.62998 19.67213 52.79729 10</span></a>
<a class="sourceLine" id="cb9-23" title="23"><span class="co">#&gt; fr 19.33011 19.54739 26.16391 19.64726 19.87145 52.40164 10</span></a>
<a class="sourceLine" id="cb9-24" title="24"><span class="co">#&gt; pt 19.22800 19.50164 26.41786 19.66766 20.96244 53.16479 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -197,11 +197,12 @@
<p><em>(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <a href="./articles/AMR.html">continue reading here to get started</a>.</em></p>
<hr>
<p><code>AMR</code> is a free and open-source <a href="https://www.r-project.org">R package</a> to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any data format, including WHONET/EARS-Net data.</p>
<p>After installing this package, R knows almost all ~20,000 microorganisms and ~500 antibiotics by name and code, and knows all about valid RSI and MIC values.</p>
<p>After installing this package, R knows almost all ~60,000 microorganisms and ~500 antibiotics by name and code, and knows all about valid RSI and MIC values.</p>
<p><strong>Used to SPSS?</strong> Read our <a href="./articles/SPSS.html">tutorial on how to import data from SPSS, SAS or Stata</a> and learn in which ways R outclasses any of these statistical packages.</p>
<p>We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology &amp; Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and is free software; you can freely use and distribute it for both personal and commercial (but <strong>not</strong> patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full license <a href="./LICENSE-text.html">here</a>.</p>
<p>This package can be used for:</p>
<ul>
<li>Reference for microorganisms, since it contains allmost all 60,000 microbial species of the Catalogue of Life</li>
<li>Calculating antimicrobial resistance</li>
<li>Calculating empirical susceptibility of both mono therapy and combination therapy</li>
<li>Predicting future antimicrobial resistance using regression models</li>
@ -252,7 +253,7 @@
<div id="latest-development-version" class="section level4">
<h4 class="hasAnchor">
<a href="#latest-development-version" class="anchor"></a>Latest development version</h4>
<p>The latest and unpublished development version can be installed with (precaution: may be unstable):</p>
<p>The latest and unpublished development version can be installed with (<strong>precaution: may be unstable</strong>):</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"devtools"</span>)</a>
<a class="sourceLine" id="cb2-2" title="2">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_gitlab</a></span>(<span class="st">"msberends/AMR"</span>)</a></code></pre></div>
</div>
@ -265,12 +266,22 @@
<div id="short-introduction" class="section level2">
<h2 class="hasAnchor">
<a href="#short-introduction" class="anchor"></a>Short introduction</h2>
<div id="whonet--ears-net" class="section level4">
<div id="microbial-taxonomic-reference-data" class="section level4">
<h4 class="hasAnchor">
<a href="#whonet--ears-net" class="anchor"></a>WHONET / EARS-Net</h4>
<p><img src="./whonet.png"></p>
<p>We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an <a href="./reference/WHONET.html">example data set <code>WHONET</code></a> with the exact same structure as a WHONET export file. Furthermore, this package also contains a <a href="./reference/antibiotics.html">data set <code>antibiotics</code></a> with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.</p>
<p>Read our tutorial about <a href="./articles/WHONET.html">how to work with WHONET data here</a>.</p>
<a href="#microbial-taxonomic-reference-data" class="anchor"></a>Microbial (taxonomic) reference data</h4>
<p><img src="reference/figures/logo_col.png"></p>
<p>This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>).</p>
<p>Included are:</p>
<ul>
<li>All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</li>
<li>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</li>
<li>All ~15,000 previously accepted names of included species that have been taxonomically renamed</li>
<li>The responsible author(s) and year of scientific publication</li>
</ul>
<p>This data is updated annually - check the included version with <code><a href="reference/catalogue_of_life_version.html">catalogue_of_life_version()</a></code>.</p>
<p><strong>About</strong></p>
<p>The Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>Read more about the data from the Catalogue of Life <a href="./reference/catalogue_of_life.html">in our manual</a>.</p>
</div>
<div id="antimicrobial-reference-data" class="section level4">
<h4 class="hasAnchor">
@ -281,20 +292,12 @@
<p>This package contains <strong>all ~500 antimicrobial drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href="https://www.whocc.no" class="uri">https://www.whocc.no</a>) and the <a href="http://ec.europa.eu/health/documents/community-register/html/atc.htm">Pharmaceuticals Community Register of the European Commission</a>.</p>
<p>Read more about the data from WHOCC <a href="./reference/WHOCC.html">in our manual</a>.</p>
</div>
<div id="microbial-taxonomic-reference-data" class="section level4">
<div id="whonet--ears-net" class="section level4">
<h4 class="hasAnchor">
<a href="#microbial-taxonomic-reference-data" class="anchor"></a>Microbial (taxonomic) reference data</h4>
<p><img src="reference/figures/logo_col.png" height="60px"></p>
<p>This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href="reference/catalogue_of_life_version.html">catalogue_of_life_version()</a></code>.</p>
<p>Included are:</p>
<ul>
<li>All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</li>
<li>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</li>
<li>All ~15,000 previously accepted names of species that have been taxonomically renamed</li>
<li>The responsible author(s) and year of scientific publication</li>
</ul>
<p>The Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>Read more about the data from the Catalogue of Life <a href="./reference/catalogue_of_life.html">in our manual</a>.</p>
<a href="#whonet--ears-net" class="anchor"></a>WHONET / EARS-Net</h4>
<p><img src="./whonet.png"></p>
<p>We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an <a href="./reference/WHONET.html">example data set <code>WHONET</code></a> with the exact same structure as a WHONET export file. Furthermore, this package also contains a <a href="./reference/antibiotics.html">data set <code>antibiotics</code></a> with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.</p>
<p>Read our tutorial about <a href="./articles/WHONET.html">how to work with WHONET data here</a>.</p>
</div>
<div id="overview-of-functions" class="section level4">
<h4 class="hasAnchor">

View File

@ -345,7 +345,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -250,7 +250,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -251,7 +251,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -258,7 +258,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -282,7 +282,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -264,7 +264,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -331,7 +331,7 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -6,7 +6,7 @@
`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any data format, including WHONET/EARS-Net data.
After installing this package, R knows almost all ~20,000 microorganisms and ~500 antibiotics by name and code, and knows all about valid RSI and MIC values.
After installing this package, R knows almost all ~60,000 microorganisms and ~500 antibiotics by name and code, and knows all about valid RSI and MIC values.
**Used to SPSS?** Read our [tutorial on how to import data from SPSS, SAS or Stata](./articles/SPSS.html) and learn in which ways R outclasses any of these statistical packages.
@ -15,6 +15,7 @@ This R package is actively maintained and is free software; you can freely use a
This package can be used for:
* Reference for microorganisms, since it contains allmost all 60,000 microbial species of the Catalogue of Life
* Calculating antimicrobial resistance
* Calculating empirical susceptibility of both mono therapy and combination therapy
* Predicting future antimicrobial resistance using regression models
@ -67,7 +68,7 @@ It will be downloaded and installed automatically. For RStudio, click on the men
#### Latest development version
The latest and unpublished development version can be installed with (precaution: may be unstable):
The latest and unpublished development version can be installed with (**precaution: may be unstable**):
```r
install.packages("devtools")
devtools::install_gitlab("msberends/AMR")
@ -79,13 +80,27 @@ To find out how to conduct AMR analysis, please [continue reading here to get st
## Short introduction
#### WHONET / EARS-Net
#### Microbial (taxonomic) reference data
<img src="./whonet.png">
<img src="man/figures/logo_col.png">
We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an [example data set `WHONET`](./reference/WHONET.html) with the exact same structure as a WHONET export file. Furthermore, this package also contains a [data set `antibiotics`](./reference/antibiotics.html) with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)).
Read our tutorial about [how to work with WHONET data here](./articles/WHONET.html).
Included are:
* All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses
* All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales.
The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera *Aspergillus*, *Candida*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
* All ~15,000 previously accepted names of included species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication
This data is updated annually - check the included version with `catalogue_of_life_version()`.
**About**
The Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
Read more about the data from the Catalogue of Life [in our manual](./reference/catalogue_of_life.html).
#### Antimicrobial reference data
@ -95,22 +110,13 @@ This package contains **all ~500 antimicrobial drugs** and their Anatomical Ther
Read more about the data from WHOCC [in our manual](./reference/WHOCC.html).
#### Microbial (taxonomic) reference data
#### WHONET / EARS-Net
<img src="man/figures/logo_col.png" height="60px">
<img src="./whonet.png">
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)). This data is updated annually - check the included version with `catalogue_of_life_version()`.
We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an [example data set `WHONET`](./reference/WHONET.html) with the exact same structure as a WHONET export file. Furthermore, this package also contains a [data set `antibiotics`](./reference/antibiotics.html) with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.
Included are:
* All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses
* All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera *Aspergillus*, *Candida*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
* All ~15,000 previously accepted names of species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication
The Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
Read more about the data from the Catalogue of Life [in our manual](./reference/catalogue_of_life.html).
Read our tutorial about [how to work with WHONET data here](./articles/WHONET.html).
#### Overview of functions

View File

@ -119,7 +119,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -15,7 +15,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -18,7 +18,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -47,7 +47,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -24,7 +24,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -29,7 +29,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -102,7 +102,7 @@ Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{All ~15,000 previously accepted names of inckuded (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}

View File

@ -27,7 +27,7 @@ One of the most important features of this package is the complete microbial tax
Using the `microbenchmark` package, we can review the calculation performance of this function. Its function `microbenchmark()` runs different input expressions independently of each other and measures their time-to-result.
```{r}
```{r, message = FALSE}
library(microbenchmark)
library(AMR)
```
@ -51,7 +51,7 @@ print(S.aureus, unit = "ms")
In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of `as.mo("B_STPHY_AUR")`, the input is already a valid MO code, so it only almost takes no time at all (`r as.integer(min(S.aureus$time, na.rm = TRUE) / 1000)` millionths of seconds).
To achieve this speed, the `as.mo` function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of *Mycoplasma leonicaptivi* (`B_MYCPL_LEO`), a bug probably never found before in humans:
To achieve this speed, the `as.mo` function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of *Mycoplasma leonicaptivi* (`B_MYCPL_LEO`), a bug probably never found before in humans:
```{r}
M.leonicaptivi <- microbenchmark(as.mo("myle"),
@ -75,7 +75,6 @@ max_y_axis <- max(S.aureus$time, M.leonicaptivi$time, na.rm = TRUE) / 1e6
boxplot(S.aureus, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, max_y_axis),
main = expression(paste("Benchmark of ", italic("Staphylococcus aureus"))))
boxplot(M.leonicaptivi, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, max_y_axis),
main = expression(paste("Benchmark of ", italic("Mycoplasma leonicaptivi"))))
```
@ -86,7 +85,7 @@ To relieve this pitfall and further improve performance, two important calculati
Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by `as.mo()`. We will use `mo_fullname()` for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses `as.mo()` internally.
```{r}
```{r, message = FALSE}
library(dplyr)
# take 500,000 random MO codes from the septic_patients data set
x = septic_patients %>%
@ -138,7 +137,7 @@ Of course, when running `mo_phylum("Firmicutes")` the function has zero knowledg
### Results in other languages
When the system language is non-English and supported by this `AMR` package, some functions take a little while longer:
When the system language is non-English and supported by this `AMR` package, some functions will have a translated result. This almost does't take extra time:
```{r}
mo_fullname("CoNS", language = "en") # or just mo_fullname("CoNS") on an English system