1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-25 15:05:40 +02:00

(v1.3.0.9016) mo_uncertainties() overhaul

This commit is contained in:
2020-09-12 08:49:01 +02:00
parent 68e9cb78e9
commit 3ff871afeb
71 changed files with 820 additions and 169 deletions

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9016</span>
</span>
</div>
@ -226,22 +226,82 @@
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"VISA"</span>), <span class="co"># Vancomycin Intermediate S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"VRSA"</span>), <span class="co"># Vancomycin Resistant S. aureus</span>
times = <span class="fl">10</span>)
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Results of three values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="kw">S.aureus</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">2</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max</span>
<span class="co"># as.mo("sau") 12.0 12.0 24.0 15.0 40.0 43.0</span>
<span class="co"># as.mo("stau") 170.0 170.0 190.0 180.0 210.0 250.0</span>
<span class="co"># as.mo("STAU") 160.0 180.0 200.0 190.0 220.0 230.0</span>
<span class="co"># as.mo("staaur") 9.4 11.0 21.0 13.0 40.0 48.0</span>
<span class="co"># as.mo("STAAUR") 9.0 13.0 34.0 14.0 43.0 140.0</span>
<span class="co"># as.mo("S. aureus") 16.0 18.0 20.0 19.0 21.0 25.0</span>
<span class="co"># as.mo("S aureus") 15.0 16.0 20.0 18.0 21.0 39.0</span>
<span class="co"># as.mo("Staphylococcus aureus") 1.1 1.1 1.4 1.6 1.6 1.7</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 870.0 920.0 950.0 940.0 980.0 1000.0</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 390.0 410.0 440.0 440.0 460.0 490.0</span>
<span class="co"># as.mo("MRSA") 11.0 12.0 30.0 13.0 40.0 130.0</span>
<span class="co"># as.mo("VISA") 16.0 18.0 30.0 20.0 46.0 69.0</span>
<span class="co"># as.mo("VRSA") 14.0 19.0 33.0 33.0 47.0 51.0</span>
<span class="co"># expr min lq mean median uq max</span>
<span class="co"># as.mo("sau") 9.9 13.0 24.0 17.0 39.0 45</span>
<span class="co"># as.mo("stau") 200.0 210.0 240.0 240.0 260.0 290</span>
<span class="co"># as.mo("STAU") 190.0 220.0 230.0 220.0 260.0 270</span>
<span class="co"># as.mo("staaur") 9.4 13.0 26.0 15.0 44.0 47</span>
<span class="co"># as.mo("STAAUR") 9.3 11.0 18.0 14.0 15.0 45</span>
<span class="co"># as.mo("S. aureus") 21.0 25.0 30.0 26.0 26.0 50</span>
<span class="co"># as.mo("S aureus") 25.0 47.0 48.0 51.0 56.0 64</span>
<span class="co"># as.mo("Staphylococcus aureus") 1.5 1.9 2.3 2.4 2.5 3</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 860.0 900.0 930.0 920.0 950.0 1100</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 410.0 420.0 430.0 430.0 450.0 460</span>
<span class="co"># as.mo("MRSA") 12.0 13.0 16.0 14.0 15.0 41</span>
<span class="co"># as.mo("VISA") 15.0 21.0 38.0 22.0 47.0 130</span>
<span class="co"># as.mo("VRSA") 18.0 20.0 25.0 22.0 22.0 47</span>
<span class="co"># neval</span>
<span class="co"># 10</span>
<span class="co"># 10</span>
@ -286,9 +346,9 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># mo_name(x) 90.3 101 120 102 141 202 10</span>
<span class="co"># mo_name(x) 96.1 123 140 133 144 251 10</span>
</pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.102 seconds. You only lose time on your unique input values.</p>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.133 seconds. You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -299,14 +359,24 @@
B = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"S. aureus"</span>),
C = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"Staphylococcus aureus"</span>),
times = <span class="fl">10</span>)
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 7.08 7.29 8.00 8.25 8.49 9.22 10</span>
<span class="co"># B 12.30 13.50 14.20 14.50 14.70 14.80 10</span>
<span class="co"># C 2.14 2.26 7.35 2.38 2.51 52.30 10</span>
<span class="co"># A 7.83 7.96 8.19 8.22 8.33 8.84 10</span>
<span class="co"># B 18.10 19.50 27.80 20.20 20.70 65.90 10</span>
<span class="co"># C 1.77 2.11 2.34 2.27 2.33 3.22 10</span>
</pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0024 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>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0023 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="cb5"><pre class="downlit">
<span class="kw">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(A = <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),
B = <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),
@ -320,14 +390,14 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 1.29 1.38 1.64 1.47 1.84 2.28 10</span>
<span class="co"># B 1.27 1.62 1.76 1.69 1.82 2.71 10</span>
<span class="co"># C 1.28 1.32 1.56 1.48 1.77 2.09 10</span>
<span class="co"># D 1.29 1.46 1.68 1.66 1.77 2.24 10</span>
<span class="co"># E 1.26 1.39 5.34 1.64 1.77 39.00 10</span>
<span class="co"># F 1.26 1.33 1.58 1.44 1.80 2.14 10</span>
<span class="co"># G 1.32 1.51 1.65 1.68 1.75 2.05 10</span>
<span class="co"># H 1.31 1.43 1.71 1.68 1.86 2.49 10</span>
<span class="co"># A 1.56 1.62 5.61 1.93 2.26 38.90 10</span>
<span class="co"># B 1.50 1.72 1.88 1.90 2.01 2.34 10</span>
<span class="co"># C 1.52 1.76 1.88 1.89 1.96 2.27 10</span>
<span class="co"># D 1.47 1.62 1.85 1.86 1.89 2.80 10</span>
<span class="co"># E 1.51 1.84 1.98 1.88 2.07 2.56 10</span>
<span class="co"># F 1.44 1.50 1.68 1.57 1.89 2.19 10</span>
<span class="co"># G 1.47 1.48 1.65 1.59 1.84 2.00 10</span>
<span class="co"># H 1.55 1.60 1.75 1.69 1.81 2.34 10</span>
</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> anyway, 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>
@ -356,13 +426,13 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">4</span>)
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># en 13.29 13.54 17.53 13.70 14.93 58.25 100</span>
<span class="co"># de 14.25 14.46 19.09 14.69 16.23 58.96 100</span>
<span class="co"># nl 17.89 18.46 24.37 19.05 21.14 70.25 100</span>
<span class="co"># es 14.05 14.41 18.08 14.72 16.11 57.07 100</span>
<span class="co"># it 14.07 14.38 19.18 14.63 16.40 58.14 100</span>
<span class="co"># fr 13.98 14.42 17.30 14.57 15.31 56.81 100</span>
<span class="co"># pt 13.95 14.38 17.78 14.60 16.32 57.53 100</span>
<span class="co"># en 13.84 14.04 20.10 14.54 16.47 59.20 100</span>
<span class="co"># de 14.79 15.10 20.00 15.76 17.64 63.37 100</span>
<span class="co"># nl 18.52 19.35 24.11 21.44 22.93 62.12 100</span>
<span class="co"># es 14.72 15.02 20.10 16.06 17.90 60.60 100</span>
<span class="co"># it 14.61 14.93 18.06 15.45 17.33 52.47 100</span>
<span class="co"># fr 14.73 15.02 21.06 15.62 18.09 69.54 100</span>
<span class="co"># pt 14.74 14.99 21.19 16.17 17.88 64.71 100</span>
</pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9016</span>
</span>
</div>
@ -210,7 +210,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
<a href="#microorganisms-currently-accepted-names" class="anchor"></a>Microorganisms (currently accepted names)</h2>
<p>A data set with 67,151 rows and 16 columns, containing the following column names:<br><em>mo, fullname, kingdom, phylum, class, order, family, genus, species, subspecies, rank, ref, species_id, source, prevalence, snomed</em>.</p>
<p>This data set is in R available as <code>microorganisms</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 1 September 2020 11:07:11 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
<p>It was last updated on 3 September 2020 20:59:45 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.rds" target="_blank"><img src="download_rds.png" width="50px" title="2.7 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="6.1 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.txt" target="_blank"><img src="download_txt.png" width="50px" title="13.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sas" target="_blank"><img src="download_sas.png" width="50px" title="26.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sav" target="_blank"><img src="download_sav.png" width="50px" title="28.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.dta" target="_blank"><img src="download_dta.png" width="50px" title="25.2 MB"></a></p>
<div id="source" class="section level3">
<h3 class="hasAnchor">

View File

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