(v0.9.0.9004) website fix
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 0.9.0.9003
|
||||
Version: 0.9.0.9004
|
||||
Date: 2019-12-20
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
|
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 0.9.0.9003
|
||||
# AMR 0.9.0.9004
|
||||
## <small>Last updated: 20-Dec-2019</small>
|
||||
|
||||
### Changes
|
||||
|
10
_pkgdown.yml
@ -167,15 +167,15 @@ reference:
|
||||
- "`AMR-deprecated`"
|
||||
|
||||
authors:
|
||||
Matthijs S. Berends:
|
||||
Matthijs S Berends:
|
||||
href: https://www.rug.nl/staff/m.s.berends/
|
||||
Christian F. Luz:
|
||||
Christian F Luz:
|
||||
href: https://www.rug.nl/staff/c.f.luz/
|
||||
Alex W. Friedrich:
|
||||
Alexander W Friedrich:
|
||||
href: https://www.rug.nl/staff/a.w.friedrich/
|
||||
Bhanu N. M. Sinha:
|
||||
Bhanu N M Sinha:
|
||||
href: https://www.rug.nl/staff/b.sinha/
|
||||
Casper J. Albers:
|
||||
Casper J Albers:
|
||||
href: https://www.rug.nl/staff/c.j.albers/
|
||||
Corinna Glasner:
|
||||
href: https://www.rug.nl/staff/c.glasner/
|
||||
|
@ -44,13 +44,29 @@ countries_plot <- ggplot(world1) +
|
||||
# this makes the border Antarctica turn white (invisible):
|
||||
scale_colour_gradient(low = "white", high = "#81899B")
|
||||
|
||||
countries_plot_mini <- countries_plot
|
||||
countries_plot_mini$data <- countries_plot_mini$data %>% filter(ID != "Antarctica")
|
||||
countries_plot_mini <- countries_plot_mini + scale_colour_gradient(low = "#81899B", high = "#81899B")
|
||||
countries_plot_big <- countries_plot +
|
||||
labs(title = tools::toTitleCase("Countries where the AMR package for R was downloaded from"),
|
||||
subtitle = paste0("Between March 2018 - ", format(Sys.Date(), "%B %Y"))) +
|
||||
theme(plot.title = element_text(size = 16, hjust = 0.5),
|
||||
plot.subtitle = element_text(size = 12, hjust = 0.5)) +
|
||||
geom_text(aes(x = -170,
|
||||
y = -70,
|
||||
label = stringr::str_wrap(paste0("Countries (n = ",
|
||||
length(countries_name), "): ",
|
||||
paste(countries_name, collapse = ", ")),
|
||||
200)),
|
||||
hjust = 0,
|
||||
size = 4)
|
||||
# main website page
|
||||
ggsave("pkgdown/logos/countries.png",
|
||||
width = 6,
|
||||
height = 3,
|
||||
height = 2.5,
|
||||
units = "in",
|
||||
dpi = 100,
|
||||
plot = countries_plot,
|
||||
plot = countries_plot_mini,
|
||||
scale = 1)
|
||||
# when clicked - a high res enlargement
|
||||
ggsave("pkgdown/logos/countries_large.png",
|
||||
@ -58,20 +74,7 @@ ggsave("pkgdown/logos/countries_large.png",
|
||||
height = 6,
|
||||
units = "in",
|
||||
dpi = 300,
|
||||
plot =
|
||||
countries_plot +
|
||||
labs(title = tools::toTitleCase("Countries where the AMR package for R was downloaded from"),
|
||||
subtitle = paste0("Between March 2018 - ", format(Sys.Date(), "%B %Y"))) +
|
||||
theme(plot.title = element_text(size = 16, hjust = 0.5),
|
||||
plot.subtitle = element_text(size = 12, hjust = 0.5)) +
|
||||
geom_text(aes(x = -170,
|
||||
y = -70,
|
||||
label = stringr::str_wrap(paste0("Countries (n = ",
|
||||
length(countries_name), "): ",
|
||||
paste(countries_name, collapse = ", ")),
|
||||
200)),
|
||||
hjust = 0,
|
||||
size = 4),
|
||||
plot = countries_plot_big,
|
||||
scale = 1.5)
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -240,7 +240,7 @@ Content not found. Please use links in the navbar.
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -84,7 +84,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -488,7 +488,7 @@ END OF TERMS AND CONDITIONS
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -41,7 +41,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">0.9.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -187,7 +187,7 @@
|
||||
<h1>How to conduct AMR analysis</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">11 December 2019</h4>
|
||||
<h4 class="date">20 December 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>AMR.Rmd</code></div>
|
||||
@ -196,10 +196,23 @@
|
||||
|
||||
|
||||
|
||||
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 11 December 2019.</p>
|
||||
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 20 December 2019.</p>
|
||||
<div id="introduction" class="section level1">
|
||||
<h1 class="hasAnchor">
|
||||
<a href="#introduction" class="anchor"></a>Introduction</h1>
|
||||
<p>Conducting antimicrobial resistance analysis unfortunately requires in-depth knowledge from different scientific fields, which makes it hard to do right. At least, it requires:</p>
|
||||
<ul>
|
||||
<li>Good questions (always start with these!)</li>
|
||||
<li>A thorough understanding of both (clinical) epidemiology and (clinical) microbiology, to understand the clinical and epidemiological relevance of results and their pharmaceutical implications</li>
|
||||
<li>Experience with data analysis with microbiological tests and their results (MIC/RSI values)</li>
|
||||
<li>Availability of the biological taxonomy of microorganisms</li>
|
||||
<li>Available (inter-)national guidelines and methods to apply them</li>
|
||||
</ul>
|
||||
<p>Of course, we cannot instantly provide you with knowledge and experience. But with this <code>AMR</code> pacakge, we aimed at providing (1) tools to simplify antimicrobial resistance data cleaning/analysis, (2) methods to easily incorporate international guidelines and (3) scientifically reliable reference data. The <code>AMR</code> package enables standardised and reproducible antimicrobial resistance analyses, including the application of evidence-based rules, determination of first isolates, translation of various codes for microorganisms and antimicrobial agents, determination of (multi-drug) resistant microorganisms, and calculation of antimicrobial resistance, prevalence and future trends.</p>
|
||||
</div>
|
||||
<div id="preparation" class="section level1">
|
||||
<h1 class="hasAnchor">
|
||||
<a href="#preparation" class="anchor"></a>Preparation</h1>
|
||||
<p>For this tutorial, we will create fake demonstration data to work with.</p>
|
||||
<p>You can skip to <a href="#cleaning-the-data">Cleaning the data</a> if you already have your own data ready. If you start your analysis, try to make the structure of your data generally look like this:</p>
|
||||
<table class="table">
|
||||
@ -212,21 +225,21 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2019-12-11</td>
|
||||
<td align="center">2019-12-20</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2019-12-11</td>
|
||||
<td align="center">2019-12-20</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2019-12-11</td>
|
||||
<td align="center">2019-12-20</td>
|
||||
<td align="center">efgh</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
@ -321,71 +334,71 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2017-05-19</td>
|
||||
<td align="center">J2</td>
|
||||
<td align="center">2015-01-13</td>
|
||||
<td align="center">Y8</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2016-07-09</td>
|
||||
<td align="center">K4</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2014-05-10</td>
|
||||
<td align="center">R6</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2011-06-29</td>
|
||||
<td align="center">T4</td>
|
||||
<td align="center">2010-04-08</td>
|
||||
<td align="center">O8</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2012-02-11</td>
|
||||
<td align="center">O10</td>
|
||||
<td align="center">2010-05-11</td>
|
||||
<td align="center">W2</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2017-04-09</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">2011-11-23</td>
|
||||
<td align="center">I9</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">Klebsiella pneumoniae</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2011-03-28</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2013-11-16</td>
|
||||
<td align="center">P8</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Now, let’s start the cleaning and the analysis!</p>
|
||||
@ -406,8 +419,8 @@
|
||||
#
|
||||
# Item Count Percent Cum. Count Cum. Percent
|
||||
# --- ----- ------- -------- ----------- -------------
|
||||
# 1 M 10,408 52.04% 10,408 52.04%
|
||||
# 2 F 9,592 47.96% 20,000 100.00%</code></pre>
|
||||
# 1 M 10,341 51.71% 10,341 51.71%
|
||||
# 2 F 9,659 48.30% 20,000 100.00%</code></pre>
|
||||
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.</p>
|
||||
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">data <-<span class="st"> </span>data <span class="op">%>%</span></a>
|
||||
@ -422,8 +435,8 @@
|
||||
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="co"># Other rules by this AMR package</span></a>
|
||||
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,997 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (165 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,942 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (159 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-9" data-line-number="9"><span class="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-10" data-line-number="10"><span class="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
|
||||
@ -448,14 +461,14 @@
|
||||
<a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Pasteurella multocida (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Staphylococcus (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (1,063 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (942 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Viridans group streptococci (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
|
||||
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,242 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,222 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,782 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,709 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
|
||||
@ -463,15 +476,15 @@
|
||||
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># -------------------------------------------------------------------------------</span></a>
|
||||
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,564 out of 20,000 rows, making a total of 8,249 edits</span></a>
|
||||
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,398 out of 20,000 rows, making a total of 7,974 edits</span></a>
|
||||
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># => added 0 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># => changed 8,249 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 102 test results changed from S to I</span></a>
|
||||
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,787 test results changed from S to R</span></a>
|
||||
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,224 test results changed from I to S</span></a>
|
||||
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 363 test results changed from I to R</span></a>
|
||||
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,773 test results changed from R to S</span></a>
|
||||
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># => changed 7,974 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 95 test results changed from S to I</span></a>
|
||||
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,603 test results changed from S to R</span></a>
|
||||
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,165 test results changed from I to S</span></a>
|
||||
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 334 test results changed from I to R</span></a>
|
||||
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,777 test results changed from R to S</span></a>
|
||||
<a class="sourceLine" id="cb14-56" data-line-number="56"><span class="co"># -------------------------------------------------------------------------------</span></a>
|
||||
<a class="sourceLine" id="cb14-57" data-line-number="57"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-58" data-line-number="58"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
|
||||
@ -499,8 +512,8 @@
|
||||
<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
|
||||
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
|
||||
<a class="sourceLine" id="cb16-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
|
||||
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># => Found 5,656 first isolates (28.3% of total)</span></a></code></pre></div>
|
||||
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
|
||||
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># => Found 5,647 first isolates (28.2% of total)</span></a></code></pre></div>
|
||||
<p>So only 28.2% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">data_1st <-<span class="st"> </span>data <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb17-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
|
||||
@ -510,7 +523,7 @@
|
||||
<div id="first-weighted-isolates" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
|
||||
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient D2, sorted on date:</p>
|
||||
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient T5, sorted on date:</p>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th align="center">isolate</th>
|
||||
@ -526,30 +539,30 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-23</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-02-25</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-03-20</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-03-02</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-13</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-04-02</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -559,19 +572,19 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-06-08</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">5</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-06-20</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -581,21 +594,21 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-08-04</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-09-13</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">7</td>
|
||||
<td align="center">2010-08-19</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-10-06</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -603,35 +616,35 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2010-09-02</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-11-19</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2010-09-04</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-12-06</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">10</td>
|
||||
<td align="center">2010-09-18</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-12-07</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -647,7 +660,7 @@
|
||||
<a class="sourceLine" id="cb19-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
|
||||
<a class="sourceLine" id="cb19-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
|
||||
<a class="sourceLine" id="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
|
||||
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># => Found 15,026 first weighted isolates (75.1% of total)</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># => Found 15,050 first weighted isolates (75.3% of total)</span></a></code></pre></div>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th align="center">isolate</th>
|
||||
@ -664,23 +677,23 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-23</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-02-25</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-03-20</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-03-02</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
@ -688,8 +701,8 @@
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-13</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-04-02</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -700,46 +713,46 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-06-08</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">5</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-06-20</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-08-04</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-09-13</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">7</td>
|
||||
<td align="center">2010-08-19</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-10-06</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -748,47 +761,47 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2010-09-02</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-11-19</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2010-09-04</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-12-06</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">10</td>
|
||||
<td align="center">2010-09-18</td>
|
||||
<td align="center">D2</td>
|
||||
<td align="center">2010-12-07</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Instead of 1, now 9 isolates are flagged. In total, 75.1% of all isolates are marked ‘first weighted’ - 46.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
|
||||
<p>Instead of 1, now 7 isolates are flagged. In total, 75.3% of all isolates are marked ‘first weighted’ - 47.0% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
|
||||
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
|
||||
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data_1st <-<span class="st"> </span>data <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
|
||||
<p>So we end up with 15,026 isolates for analysis.</p>
|
||||
<p>So we end up with 15,050 isolates for analysis.</p>
|
||||
<p>We can remove unneeded columns:</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st <-<span class="st"> </span>data_1st <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
|
||||
@ -796,6 +809,7 @@
|
||||
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(data_1st)</a></code></pre></div>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th></th>
|
||||
<th align="center">date</th>
|
||||
<th align="center">patient_id</th>
|
||||
<th align="center">hospital</th>
|
||||
@ -812,57 +826,13 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2017-05-19</td>
|
||||
<td align="center">J2</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2016-07-09</td>
|
||||
<td align="center">K4</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2014-05-10</td>
|
||||
<td align="center">R6</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2011-06-29</td>
|
||||
<td align="center">T4</td>
|
||||
<td>2</td>
|
||||
<td align="center">2010-04-08</td>
|
||||
<td align="center">O8</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
@ -871,14 +841,63 @@
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2012-02-11</td>
|
||||
<td align="center">O10</td>
|
||||
<tr class="even">
|
||||
<td>3</td>
|
||||
<td align="center">2010-05-11</td>
|
||||
<td align="center">W2</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>4</td>
|
||||
<td align="center">2011-11-23</td>
|
||||
<td align="center">I9</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">B_KLBSL_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Klebsiella</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>5</td>
|
||||
<td align="center">2011-03-28</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>6</td>
|
||||
<td align="center">2013-11-16</td>
|
||||
<td align="center">P8</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
@ -887,15 +906,16 @@
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2017-04-09</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td>7</td>
|
||||
<td align="center">2014-12-19</td>
|
||||
<td align="center">Q5</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
@ -920,7 +940,7 @@
|
||||
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
|
||||
<p><strong>Frequency table</strong></p>
|
||||
<p>Class: character<br>
|
||||
Length: 15,026 (of which NA: 0 = 0%)<br>
|
||||
Length: 15,050 (of which NA: 0 = 0%)<br>
|
||||
Unique: 4</p>
|
||||
<p>Shortest: 16<br>
|
||||
Longest: 24</p>
|
||||
@ -937,33 +957,33 @@ Longest: 24</p>
|
||||
<tr class="odd">
|
||||
<td align="left">1</td>
|
||||
<td align="left">Escherichia coli</td>
|
||||
<td align="right">7,425</td>
|
||||
<td align="right">49.41%</td>
|
||||
<td align="right">7,425</td>
|
||||
<td align="right">49.41%</td>
|
||||
<td align="right">7,510</td>
|
||||
<td align="right">49.90%</td>
|
||||
<td align="right">7,510</td>
|
||||
<td align="right">49.90%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">2</td>
|
||||
<td align="left">Staphylococcus aureus</td>
|
||||
<td align="right">3,806</td>
|
||||
<td align="right">25.33%</td>
|
||||
<td align="right">11,231</td>
|
||||
<td align="right">74.74%</td>
|
||||
<td align="right">3,786</td>
|
||||
<td align="right">25.16%</td>
|
||||
<td align="right">11,296</td>
|
||||
<td align="right">75.06%</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="left">3</td>
|
||||
<td align="left">Streptococcus pneumoniae</td>
|
||||
<td align="right">2,311</td>
|
||||
<td align="right">15.38%</td>
|
||||
<td align="right">13,542</td>
|
||||
<td align="right">90.12%</td>
|
||||
<td align="right">2,294</td>
|
||||
<td align="right">15.24%</td>
|
||||
<td align="right">13,590</td>
|
||||
<td align="right">90.30%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">4</td>
|
||||
<td align="left">Klebsiella pneumoniae</td>
|
||||
<td align="right">1,484</td>
|
||||
<td align="right">9.88%</td>
|
||||
<td align="right">15,026</td>
|
||||
<td align="right">1,460</td>
|
||||
<td align="right">9.70%</td>
|
||||
<td align="right">15,050</td>
|
||||
<td align="right">100.00%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -975,7 +995,7 @@ Longest: 24</p>
|
||||
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
|
||||
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
|
||||
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX)</a>
|
||||
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4631971</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4623256</span></a></code></pre></div>
|
||||
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
@ -988,19 +1008,19 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">0.4553786</td>
|
||||
<td align="center">0.4637522</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">0.4653638</td>
|
||||
<td align="center">0.4602655</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">0.4613043</td>
|
||||
<td align="center">0.4760000</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">0.4729412</td>
|
||||
<td align="center">0.4536218</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1018,23 +1038,23 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">0.4553786</td>
|
||||
<td align="center">4583</td>
|
||||
<td align="center">0.4637522</td>
|
||||
<td align="center">4552</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">0.4653638</td>
|
||||
<td align="center">5168</td>
|
||||
<td align="center">0.4602655</td>
|
||||
<td align="center">5197</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">0.4613043</td>
|
||||
<td align="center">2300</td>
|
||||
<td align="center">0.4760000</td>
|
||||
<td align="center">2250</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">0.4729412</td>
|
||||
<td align="center">2975</td>
|
||||
<td align="center">0.4536218</td>
|
||||
<td align="center">3051</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1054,27 +1074,27 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">0.9248485</td>
|
||||
<td align="center">0.8921212</td>
|
||||
<td align="center">0.9936700</td>
|
||||
<td align="center">0.9227696</td>
|
||||
<td align="center">0.8909454</td>
|
||||
<td align="center">0.9920107</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Klebsiella</td>
|
||||
<td align="center">0.9238544</td>
|
||||
<td align="center">0.8928571</td>
|
||||
<td align="center">0.9946092</td>
|
||||
<td align="center">0.9191781</td>
|
||||
<td align="center">0.9061644</td>
|
||||
<td align="center">0.9917808</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Staphylococcus</td>
|
||||
<td align="center">0.9224908</td>
|
||||
<td align="center">0.9177614</td>
|
||||
<td align="center">0.9923805</td>
|
||||
<td align="center">0.9186476</td>
|
||||
<td align="center">0.9199683</td>
|
||||
<td align="center">0.9915478</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">0.5962787</td>
|
||||
<td align="center">0.6129032</td>
|
||||
<td align="center">0.0000000</td>
|
||||
<td align="center">0.5962787</td>
|
||||
<td align="center">0.6129032</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1193,8 +1213,9 @@ Longest: 24</p>
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#tocnav" class="anchor"></a>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li>
|
||||
<a href="#introduction">Introduction</a><ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li>
|
||||
<a href="#preparation">Preparation</a><ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#needed-r-packages">Needed R packages</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -1230,7 +1251,7 @@ Longest: 24</p>
|
||||
|
||||
|
||||
<footer><div class="copyright">
|
||||
<p>Developed by <a href="https://www.rug.nl/staff/m.s.berends/">Matthijs S. Berends</a>, <a href="https://www.rug.nl/staff/c.f.luz/">Christian F. Luz</a>, <a href="https://www.rug.nl/staff/a.w.friedrich/">Alex W. Friedrich</a>, <a href="https://www.rug.nl/staff/b.sinha/">Bhanu N. M. Sinha</a>, <a href="https://www.rug.nl/staff/c.j.albers/">Casper J. Albers</a>, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href="https://www.rug.nl/staff/m.s.berends/">Matthijs S Berends</a>, <a href="https://www.rug.nl/staff/c.f.luz/">Christian F Luz</a>, <a href="https://www.rug.nl/staff/a.w.friedrich/">Alexander W Friedrich</a>, <a href="https://www.rug.nl/staff/b.sinha/">Bhanu N M Sinha</a>, <a href="https://www.rug.nl/staff/c.j.albers/">Casper J Albers</a>, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
@ -41,7 +41,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -198,11 +198,10 @@
|
||||
|
||||
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by the <a href="http://catalogueoflife.org">Catalogue of Life</a>. We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using intelligent rules combined with the taxonomic tree of Catalogue of Life.</p>
|
||||
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function. Its function <code><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark()</a></code> runs different input expressions independently of each other and measures their time-to-result.</p>
|
||||
<p>FALSE</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(microbenchmark)</a>
|
||||
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(AMR)</a></code></pre></div>
|
||||
<p>In the next test, we try to ‘coerce’ different input values into the microbial code of <em>Staphylococcus aureus</em>. Coercion is a computational process of forcing output based on an input. For microorganism names, coercing user input to taxonomically valid microorganism names is crucial to ensure correct interpretation and to enable grouping based on taxonomic properties.</p>
|
||||
<p>The actual result is the same every time: it returns its microorganism code B_STPHY_AURS (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
|
||||
<p>The actual result is the same every time: it returns its microorganism code <code>B_STPHY_AURS</code> (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
|
||||
<p>But the calculation time differs a lot:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1">S.aureus <-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(</a>
|
||||
<a class="sourceLine" id="cb2-2" data-line-number="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"sau"</span>), <span class="co"># WHONET code</span></a>
|
||||
@ -222,21 +221,36 @@
|
||||
<a class="sourceLine" id="cb2-16" data-line-number="16"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb2-17" data-line-number="17"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
|
||||
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb2-19" data-line-number="19"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb2-20" data-line-number="20"><span class="co"># as.mo("sau") 9.2 9.4 9.7 9.6 10.0 11 10</span></a>
|
||||
<a class="sourceLine" id="cb2-21" data-line-number="21"><span class="co"># as.mo("stau") 32.0 34.0 43.0 37.0 58.0 66 10</span></a>
|
||||
<a class="sourceLine" id="cb2-22" data-line-number="22"><span class="co"># as.mo("STAU") 34.0 34.0 40.0 35.0 36.0 65 10</span></a>
|
||||
<a class="sourceLine" id="cb2-23" data-line-number="23"><span class="co"># as.mo("staaur") 9.2 9.3 12.0 9.8 11.0 33 10</span></a>
|
||||
<a class="sourceLine" id="cb2-24" data-line-number="24"><span class="co"># as.mo("STAAUR") 9.1 9.5 12.0 9.6 9.9 35 10</span></a>
|
||||
<a class="sourceLine" id="cb2-25" data-line-number="25"><span class="co"># as.mo("S. aureus") 24.0 25.0 34.0 28.0 48.0 55 10</span></a>
|
||||
<a class="sourceLine" id="cb2-26" data-line-number="26"><span class="co"># as.mo("S aureus") 24.0 24.0 32.0 26.0 32.0 55 10</span></a>
|
||||
<a class="sourceLine" id="cb2-27" data-line-number="27"><span class="co"># as.mo("Staphylococcus aureus") 4.6 4.7 9.7 4.8 5.5 30 10</span></a>
|
||||
<a class="sourceLine" id="cb2-28" data-line-number="28"><span class="co"># as.mo("Staphylococcus aureus (MRSA)") 620.0 630.0 670.0 650.0 680.0 840 10</span></a>
|
||||
<a class="sourceLine" id="cb2-29" data-line-number="29"><span class="co"># as.mo("Sthafilokkockus aaureuz") 320.0 330.0 370.0 350.0 410.0 470 10</span></a>
|
||||
<a class="sourceLine" id="cb2-30" data-line-number="30"><span class="co"># as.mo("MRSA") 9.2 9.8 17.0 10.0 32.0 37 10</span></a>
|
||||
<a class="sourceLine" id="cb2-31" data-line-number="31"><span class="co"># as.mo("VISA") 19.0 19.0 23.0 20.0 23.0 49 10</span></a>
|
||||
<a class="sourceLine" id="cb2-32" data-line-number="32"><span class="co"># as.mo("VRSA") 19.0 20.0 26.0 22.0 25.0 46 10</span></a>
|
||||
<a class="sourceLine" id="cb2-33" data-line-number="33"><span class="co"># as.mo(22242419) 18.0 19.0 23.0 20.0 24.0 43 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb2-19" data-line-number="19"><span class="co"># expr min lq mean median uq max</span></a>
|
||||
<a class="sourceLine" id="cb2-20" data-line-number="20"><span class="co"># as.mo("sau") 9.7 10.0 33.0 11.0 35.0 110.0</span></a>
|
||||
<a class="sourceLine" id="cb2-21" data-line-number="21"><span class="co"># as.mo("stau") 36.0 36.0 45.0 37.0 60.0 65.0</span></a>
|
||||
<a class="sourceLine" id="cb2-22" data-line-number="22"><span class="co"># as.mo("STAU") 33.0 34.0 41.0 37.0 40.0 61.0</span></a>
|
||||
<a class="sourceLine" id="cb2-23" data-line-number="23"><span class="co"># as.mo("staaur") 9.6 9.9 13.0 10.0 11.0 33.0</span></a>
|
||||
<a class="sourceLine" id="cb2-24" data-line-number="24"><span class="co"># as.mo("STAAUR") 9.6 10.0 11.0 11.0 11.0 13.0</span></a>
|
||||
<a class="sourceLine" id="cb2-25" data-line-number="25"><span class="co"># as.mo("S. aureus") 25.0 26.0 32.0 26.0 28.0 59.0</span></a>
|
||||
<a class="sourceLine" id="cb2-26" data-line-number="26"><span class="co"># as.mo("S aureus") 25.0 26.0 33.0 26.0 33.0 55.0</span></a>
|
||||
<a class="sourceLine" id="cb2-27" data-line-number="27"><span class="co"># as.mo("Staphylococcus aureus") 4.7 4.8 5.2 5.2 5.5 6.4</span></a>
|
||||
<a class="sourceLine" id="cb2-28" data-line-number="28"><span class="co"># as.mo("Staphylococcus aureus (MRSA)") 620.0 640.0 690.0 660.0 680.0 840.0</span></a>
|
||||
<a class="sourceLine" id="cb2-29" data-line-number="29"><span class="co"># as.mo("Sthafilokkockus aaureuz") 310.0 340.0 360.0 350.0 370.0 420.0</span></a>
|
||||
<a class="sourceLine" id="cb2-30" data-line-number="30"><span class="co"># as.mo("MRSA") 9.8 10.0 13.0 11.0 12.0 35.0</span></a>
|
||||
<a class="sourceLine" id="cb2-31" data-line-number="31"><span class="co"># as.mo("VISA") 21.0 21.0 29.0 22.0 27.0 60.0</span></a>
|
||||
<a class="sourceLine" id="cb2-32" data-line-number="32"><span class="co"># as.mo("VRSA") 20.0 21.0 31.0 25.0 44.0 47.0</span></a>
|
||||
<a class="sourceLine" id="cb2-33" data-line-number="33"><span class="co"># as.mo(22242419) 19.0 19.0 26.0 20.0 25.0 52.0</span></a>
|
||||
<a class="sourceLine" id="cb2-34" data-line-number="34"><span class="co"># neval</span></a>
|
||||
<a class="sourceLine" id="cb2-35" data-line-number="35"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-36" data-line-number="36"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-37" data-line-number="37"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-38" data-line-number="38"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-39" data-line-number="39"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-40" data-line-number="40"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-41" data-line-number="41"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-42" data-line-number="42"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-43" data-line-number="43"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-44" data-line-number="44"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-45" data-line-number="45"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-46" data-line-number="46"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-47" data-line-number="47"><span class="co"># 10</span></a>
|
||||
<a class="sourceLine" id="cb2-48" data-line-number="48"><span class="co"># 10</span></a></code></pre></div>
|
||||
<p><img src="benchmarks_files/figure-html/unnamed-chunk-5-1.png" width="562.5"></p>
|
||||
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</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>Methanosarcina semesiae</em> (<code>B_MTHNSR_SEMS</code>), a bug probably never found before in humans:</p>
|
||||
@ -249,23 +263,23 @@
|
||||
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(M.semesiae, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
|
||||
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># expr min lq mean median uq</span></a>
|
||||
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("metsem") 1424.000 1452.000 1483.00 1489.000 1518.00</span></a>
|
||||
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("METSEM") 1342.000 1434.000 1477.00 1491.000 1522.00</span></a>
|
||||
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("M. semesiae") 2104.000 2163.000 2180.00 2196.000 2202.00</span></a>
|
||||
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("M. semesiae") 2111.000 2148.000 2168.00 2170.000 2183.00</span></a>
|
||||
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Methanosarcina semesiae") 5.309 5.483 13.19 5.854 28.63</span></a>
|
||||
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("metsem") 1435.000 1473.000 1510.00 1500.000 1520.00</span></a>
|
||||
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("METSEM") 1466.000 1516.000 1542.00 1541.000 1557.00</span></a>
|
||||
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("M. semesiae") 2113.000 2173.000 2207.00 2187.000 2243.00</span></a>
|
||||
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("M. semesiae") 2154.000 2192.000 2238.00 2215.000 2305.00</span></a>
|
||||
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Methanosarcina semesiae") 5.435 5.508 13.05 5.724 28.23</span></a>
|
||||
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># max neval</span></a>
|
||||
<a class="sourceLine" id="cb3-16" data-line-number="16"><span class="co"># 1554.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-17" data-line-number="17"><span class="co"># 1584.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-18" data-line-number="18"><span class="co"># 2214.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-19" data-line-number="19"><span class="co"># 2208.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-20" data-line-number="20"><span class="co"># 32.07 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb3-16" data-line-number="16"><span class="co"># 1651.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-17" data-line-number="17"><span class="co"># 1632.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-18" data-line-number="18"><span class="co"># 2301.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-19" data-line-number="19"><span class="co"># 2332.00 10</span></a>
|
||||
<a class="sourceLine" id="cb3-20" data-line-number="20"><span class="co"># 32.95 10</span></a></code></pre></div>
|
||||
<p>That takes 15.5 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. Full names (like <em>Methanosarcina semesiae</em>) are always very fast and only take some thousands of seconds to coerce - they are the most probable input from most data sets.</p>
|
||||
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Methanosarcina semesiae</em> (which is uncommon):</p>
|
||||
<p><img src="benchmarks_files/figure-html/unnamed-chunk-8-1.png" width="900"></p>
|
||||
<p>In reality, the <code><a href="../reference/as.mo.html">as.mo()</a></code> functions <strong>learns from its own output to speed up determinations for next times</strong>. In below figure, this effect was disabled to show the difference with the boxplot above:</p>
|
||||
<p>The highest outliers are the first times. All next determinations were done in only thousands of seconds, because the <code><a href="../reference/as.mo.html">as.mo()</a></code> function <strong>learns from its own output to speed up determinations for next times</strong>.</p>
|
||||
<p>In below figure, this effect was disabled to show the difference with the boxplot above:</p>
|
||||
<p><img src="benchmarks_files/figure-html/unnamed-chunk-9-1.png" width="900"></p>
|
||||
<p>The highest outliers are the first times. All next determinations were done in only thousands of seconds.</p>
|
||||
<p>Uncommon microorganisms take a lot more time than common microorganisms. 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">
|
||||
<h3 class="hasAnchor">
|
||||
@ -293,12 +307,12 @@
|
||||
<a class="sourceLine" id="cb4-20" data-line-number="20"></a>
|
||||
<a class="sourceLine" id="cb4-21" data-line-number="21"><span class="co"># now let's see:</span></a>
|
||||
<a class="sourceLine" id="cb4-22" data-line-number="22">run_it <-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(x),</a>
|
||||
<a class="sourceLine" id="cb4-23" data-line-number="23"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb4-23" data-line-number="23"> <span class="dt">times =</span> <span class="dv">100</span>)</a>
|
||||
<a class="sourceLine" id="cb4-24" data-line-number="24"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb4-25" data-line-number="25"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb4-26" data-line-number="26"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb4-27" data-line-number="27"><span class="co"># mo_name(x) 620 645 659 660 672 700 10</span></a></code></pre></div>
|
||||
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.66 seconds (660 ms). You only lose time on your unique input values.</p>
|
||||
<a class="sourceLine" id="cb4-27" data-line-number="27"><span class="co"># mo_name(x) 539 576 598 586 610 728 100</span></a></code></pre></div>
|
||||
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.59 seconds (586 ms). You only lose time on your unique input values.</p>
|
||||
</div>
|
||||
<div id="precalculated-results" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@ -310,10 +324,10 @@
|
||||
<a class="sourceLine" id="cb5-4" data-line-number="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># A 6.360 6.400 6.770 6.500 6.720 8.590 10</span></a>
|
||||
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># B 24.800 25.100 32.500 28.400 30.400 54.200 10</span></a>
|
||||
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># C 0.704 0.747 0.777 0.785 0.814 0.817 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># A 6.460 6.61 6.940 6.720 6.940 8.14 10</span></a>
|
||||
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># B 25.400 25.80 30.700 26.300 27.600 61.60 10</span></a>
|
||||
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># C 0.653 0.67 0.784 0.806 0.842 0.90 10</span></a></code></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.0008 seconds - it doesn’t 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="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">run_it <-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">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="cb6-2" data-line-number="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>
|
||||
@ -327,14 +341,14 @@
|
||||
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
|
||||
<a class="sourceLine" id="cb6-11" data-line-number="11"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb6-12" data-line-number="12"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb6-13" data-line-number="13"><span class="co"># A 0.450 0.453 0.471 0.467 0.491 0.497 10</span></a>
|
||||
<a class="sourceLine" id="cb6-14" data-line-number="14"><span class="co"># B 0.492 0.500 0.508 0.507 0.508 0.549 10</span></a>
|
||||
<a class="sourceLine" id="cb6-15" data-line-number="15"><span class="co"># C 0.725 0.770 0.793 0.799 0.819 0.849 10</span></a>
|
||||
<a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"># D 0.492 0.494 0.505 0.501 0.510 0.549 10</span></a>
|
||||
<a class="sourceLine" id="cb6-17" data-line-number="17"><span class="co"># E 0.450 0.460 0.466 0.462 0.466 0.507 10</span></a>
|
||||
<a class="sourceLine" id="cb6-18" data-line-number="18"><span class="co"># F 0.441 0.450 0.459 0.458 0.467 0.491 10</span></a>
|
||||
<a class="sourceLine" id="cb6-19" data-line-number="19"><span class="co"># G 0.444 0.450 0.463 0.464 0.470 0.492 10</span></a>
|
||||
<a class="sourceLine" id="cb6-20" data-line-number="20"><span class="co"># H 0.448 0.458 0.481 0.459 0.463 0.658 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb6-13" data-line-number="13"><span class="co"># A 0.429 0.450 0.458 0.453 0.469 0.493 10</span></a>
|
||||
<a class="sourceLine" id="cb6-14" data-line-number="14"><span class="co"># B 0.484 0.499 0.519 0.506 0.518 0.646 10</span></a>
|
||||
<a class="sourceLine" id="cb6-15" data-line-number="15"><span class="co"># C 0.674 0.721 0.777 0.796 0.816 0.853 10</span></a>
|
||||
<a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"># D 0.485 0.490 0.507 0.499 0.518 0.554 10</span></a>
|
||||
<a class="sourceLine" id="cb6-17" data-line-number="17"><span class="co"># E 0.439 0.453 0.462 0.460 0.476 0.482 10</span></a>
|
||||
<a class="sourceLine" id="cb6-18" data-line-number="18"><span class="co"># F 0.425 0.446 0.454 0.455 0.462 0.477 10</span></a>
|
||||
<a class="sourceLine" id="cb6-19" data-line-number="19"><span class="co"># G 0.447 0.450 0.464 0.457 0.471 0.508 10</span></a>
|
||||
<a class="sourceLine" id="cb6-20" data-line-number="20"><span class="co"># H 0.449 0.457 0.477 0.459 0.464 0.641 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">
|
||||
@ -357,17 +371,17 @@
|
||||
<a class="sourceLine" id="cb7-14" data-line-number="14"> <span class="dt">it =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"it"</span>),</a>
|
||||
<a class="sourceLine" id="cb7-15" data-line-number="15"> <span class="dt">fr =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>),</a>
|
||||
<a class="sourceLine" id="cb7-16" data-line-number="16"> <span class="dt">pt =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>),</a>
|
||||
<a class="sourceLine" id="cb7-17" data-line-number="17"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
|
||||
<a class="sourceLine" id="cb7-17" data-line-number="17"> <span class="dt">times =</span> <span class="dv">100</span>)</a>
|
||||
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
|
||||
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># Unit: milliseconds</span></a>
|
||||
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># en 20.20 20.36 25.81 20.55 26.48 44.15 10</span></a>
|
||||
<a class="sourceLine" id="cb7-22" data-line-number="22"><span class="co"># de 21.79 21.97 29.74 22.27 45.35 49.38 10</span></a>
|
||||
<a class="sourceLine" id="cb7-23" data-line-number="23"><span class="co"># nl 27.24 27.39 28.69 27.85 28.68 35.16 10</span></a>
|
||||
<a class="sourceLine" id="cb7-24" data-line-number="24"><span class="co"># es 21.48 21.51 27.65 21.97 22.85 55.52 10</span></a>
|
||||
<a class="sourceLine" id="cb7-25" data-line-number="25"><span class="co"># it 21.92 21.95 24.77 22.11 22.63 47.75 10</span></a>
|
||||
<a class="sourceLine" id="cb7-26" data-line-number="26"><span class="co"># fr 21.46 21.55 25.53 22.59 23.05 50.67 10</span></a>
|
||||
<a class="sourceLine" id="cb7-27" data-line-number="27"><span class="co"># pt 21.44 21.79 24.62 21.88 23.07 46.35 10</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||
<a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># en 20.68 22.22 25.57 22.81 24.02 58.73 100</span></a>
|
||||
<a class="sourceLine" id="cb7-22" data-line-number="22"><span class="co"># de 21.96 23.63 28.16 24.45 25.50 138.10 100</span></a>
|
||||
<a class="sourceLine" id="cb7-23" data-line-number="23"><span class="co"># nl 27.91 29.85 33.99 31.06 32.41 63.72 100</span></a>
|
||||
<a class="sourceLine" id="cb7-24" data-line-number="24"><span class="co"># es 22.06 23.81 28.02 24.51 25.63 57.01 100</span></a>
|
||||
<a class="sourceLine" id="cb7-25" data-line-number="25"><span class="co"># it 21.62 23.79 29.36 24.79 27.55 67.42 100</span></a>
|
||||
<a class="sourceLine" id="cb7-26" data-line-number="26"><span class="co"># fr 21.77 23.67 27.02 24.12 25.51 65.44 100</span></a>
|
||||
<a class="sourceLine" id="cb7-27" data-line-number="27"><span class="co"># pt 21.68 23.59 26.42 24.03 25.23 54.05 100</span></a></code></pre></div>
|
||||
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -381,7 +395,7 @@
|
||||
|
||||
|
||||
<footer><div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href="https://www.rug.nl/staff/m.s.berends/">Matthijs S Berends</a>, <a href="https://www.rug.nl/staff/c.f.luz/">Christian F Luz</a>, <a href="https://www.rug.nl/staff/a.w.friedrich/">Alexander W Friedrich</a>, <a href="https://www.rug.nl/staff/b.sinha/">Bhanu N M Sinha</a>, <a href="https://www.rug.nl/staff/c.j.albers/">Casper J Albers</a>, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
@ -84,7 +84,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -250,7 +250,7 @@
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -84,7 +84,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -232,23 +232,23 @@
|
||||
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<p><strong>Matthijs S Berends</strong>. Author, maintainer. <a href='https://orcid.org/0000-0001-7620-1800' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
<p><strong><a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a></strong>. Author, maintainer. <a href='https://orcid.org/0000-0001-7620-1800' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Christian F Luz</strong>. Author, contributor. <a href='https://orcid.org/0000-0001-5809-5995' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
<p><strong><a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a></strong>. Author, contributor. <a href='https://orcid.org/0000-0001-5809-5995' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Alexander W Friedrich</strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0003-4881-038X' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
<p><strong><a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a></strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0003-4881-038X' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Bhanu N M Sinha</strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0003-1634-0010' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
<p><strong><a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a></strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0003-1634-0010' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Casper J Albers</strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0002-9213-6743' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
<p><strong><a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a></strong>. Author, thesis advisor. <a href='https://orcid.org/0000-0002-9213-6743' target='orcid.widget'><img src='https://members.orcid.org/sites/default/files/vector_iD_icon.svg' class='orcid' alt='ORCID'></a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
@ -293,7 +293,7 @@
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
@ -95,7 +95,7 @@ $( document ).ready(function() {
|
||||
}
|
||||
$(".template-authors").html(doct_tit($(".template-authors").html()));
|
||||
$(".developers").html(doct_tit($(".developers").html()));
|
||||
$("footer").html(doct_tit($("footer").html()));
|
||||
// $("footer").html(doct_tit($("footer").html()));
|
||||
|
||||
// Edit title of manual
|
||||
$('.template-reference-index h1').text('Manual');
|
||||
|
@ -45,7 +45,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -413,11 +413,16 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
|
||||
<div class="developers">
|
||||
<h2>Developers</h2>
|
||||
<ul class="list-unstyled">
|
||||
<li>Matthijs S Berends <br><small class="roles"> Author, maintainer </small> <a href="https://orcid.org/0000-0001-7620-1800" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>Christian F Luz <br><small class="roles"> Author, contributor </small> <a href="https://orcid.org/0000-0001-5809-5995" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>Alexander W Friedrich <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0003-4881-038X" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>Bhanu N M Sinha <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0003-1634-0010" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>Casper J Albers <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0002-9213-6743" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/m.s.berends/">Matthijs S Berends</a> <br><small class="roles"> Author, maintainer </small> <a href="https://orcid.org/0000-0001-7620-1800" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/c.f.luz/">Christian F Luz</a> <br><small class="roles"> Author, contributor </small> <a href="https://orcid.org/0000-0001-5809-5995" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/a.w.friedrich/">Alexander W Friedrich</a> <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0003-4881-038X" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/b.sinha/">Bhanu N M Sinha</a> <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0003-1634-0010" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/c.j.albers/">Casper J Albers</a> <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0002-9213-6743" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li>
|
||||
<a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a> <br><small class="roles"> Author, thesis advisor </small> <a href="https://orcid.org/0000-0003-1241-1328" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID"></a> </li>
|
||||
<li><a href="authors.html">All authors...</a></li>
|
||||
@ -429,7 +434,7 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
|
||||
|
||||
|
||||
<footer><div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href="https://www.rug.nl/staff/m.s.berends/">Matthijs S Berends</a>, <a href="https://www.rug.nl/staff/c.f.luz/">Christian F Luz</a>, <a href="https://www.rug.nl/staff/a.w.friedrich/">Alexander W Friedrich</a>, <a href="https://www.rug.nl/staff/b.sinha/">Bhanu N M Sinha</a>, <a href="https://www.rug.nl/staff/c.j.albers/">Casper J Albers</a>, <a href="https://www.rug.nl/staff/c.glasner/">Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -84,7 +84,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -231,9 +231,9 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div id="amr-0-9-0-9003" class="section level1">
|
||||
<div id="amr-0-9-0-9004" class="section level1">
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-0-9-0-9003" class="anchor"></a>AMR 0.9.0.9003<small> Unreleased </small>
|
||||
<a href="#amr-0-9-0-9004" class="anchor"></a>AMR 0.9.0.9004<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-20-dec-2019" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@ -1407,7 +1407,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<div id="tocnav">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#amr-0-9-0-9003">0.9.0.9003</a></li>
|
||||
<li><a href="#amr-0-9-0-9004">0.9.0.9004</a></li>
|
||||
<li><a href="#amr-0-9-0">0.9.0</a></li>
|
||||
<li><a href="#amr-0-8-0">0.8.0</a></li>
|
||||
<li><a href="#amr-0-7-1">0.7.1</a></li>
|
||||
@ -1429,7 +1429,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -84,7 +84,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">0.9.0.9003</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9004</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -585,7 +585,7 @@
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by Matthijs S Berends, Christian F Luz, Alexander W Friedrich, Bhanu N M Sinha, Casper J Albers, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
|
@ -95,7 +95,7 @@ $( document ).ready(function() {
|
||||
}
|
||||
$(".template-authors").html(doct_tit($(".template-authors").html()));
|
||||
$(".developers").html(doct_tit($(".developers").html()));
|
||||
$("footer").html(doct_tit($("footer").html()));
|
||||
// $("footer").html(doct_tit($("footer").html()));
|
||||
|
||||
// Edit title of manual
|
||||
$('.template-reference-index h1').text('Manual');
|
||||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
@ -28,6 +28,18 @@ knitr::opts_chunk$set(
|
||||
|
||||
# Introduction
|
||||
|
||||
Conducting antimicrobial resistance analysis unfortunately requires in-depth knowledge from different scientific fields, which makes it hard to do right. At least, it requires:
|
||||
|
||||
* Good questions (always start with these!)
|
||||
* A thorough understanding of both (clinical) epidemiology and (clinical) microbiology, to understand the clinical and epidemiological relevance of results and their pharmaceutical implications
|
||||
* Experience with data analysis with microbiological tests and their results (MIC/RSI values)
|
||||
* Availability of the biological taxonomy of microorganisms
|
||||
* Available (inter-)national guidelines and methods to apply them
|
||||
|
||||
Of course, we cannot instantly provide you with knowledge and experience. But with this `AMR` pacakge, we aimed at providing (1) tools to simplify antimicrobial resistance data cleaning/analysis, (2) methods to easily incorporate international guidelines and (3) scientifically reliable reference data. The `AMR` package enables standardised and reproducible antimicrobial resistance analyses, including the application of evidence-based rules, determination of first isolates, translation of various codes for microorganisms and antimicrobial agents, determination of (multi-drug) resistant microorganisms, and calculation of antimicrobial resistance, prevalence and future trends.
|
||||
|
||||
# Preparation
|
||||
|
||||
For this tutorial, we will create fake demonstration data to work with.
|
||||
|
||||
You can skip to [Cleaning the data](#cleaning-the-data) if you already have your own data ready. If you start your analysis, try to make the structure of your data generally look like this:
|
||||
|
@ -29,8 +29,6 @@ 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 interactive()`
|
||||
|
||||
```{r, message = FALSE, echo = FALSE}
|
||||
library(dplyr)
|
||||
library(ggplot2)
|
||||
@ -67,7 +65,7 @@ library(AMR)
|
||||
|
||||
In the next test, we try to 'coerce' different input values into the microbial code of *Staphylococcus aureus*. Coercion is a computational process of forcing output based on an input. For microorganism names, coercing user input to taxonomically valid microorganism names is crucial to ensure correct interpretation and to enable grouping based on taxonomic properties.
|
||||
|
||||
The actual result is the same every time: it returns its microorganism code `r as.character(as.mo("Staphylococcus aureus"))` (*B* stands for *Bacteria*, the taxonomic kingdom).
|
||||
The actual result is the same every time: it returns its microorganism code ``r as.character(as.mo("Staphylococcus aureus"))`` (*B* stands for *Bacteria*, the taxonomic kingdom).
|
||||
|
||||
But the calculation time differs a lot:
|
||||
|
||||
@ -134,7 +132,9 @@ boxplot(microbenchmark(
|
||||
main = "Benchmarks per prevalence")
|
||||
```
|
||||
|
||||
In reality, the `as.mo()` functions **learns from its own output to speed up determinations for next times**. In below figure, this effect was disabled to show the difference with the boxplot above:
|
||||
The highest outliers are the first times. All next determinations were done in only thousands of seconds, because the `as.mo()` function **learns from its own output to speed up determinations for next times**.
|
||||
|
||||
In below figure, this effect was disabled to show the difference with the boxplot above:
|
||||
|
||||
```{r, echo = FALSE, fig.width=12}
|
||||
clear_mo_history()
|
||||
@ -154,8 +154,6 @@ boxplot(microbenchmark(
|
||||
options(AMR_disable_mo_history = FALSE)
|
||||
```
|
||||
|
||||
The highest outliers are the first times. All next determinations were done in only thousands of seconds.
|
||||
|
||||
Uncommon microorganisms take a lot more time than common microorganisms. To relieve this pitfall and further improve performance, two important calculations take almost no time at all: **repetitive results** and **already precalculated results**.
|
||||
|
||||
### Repetitive results
|
||||
@ -183,7 +181,7 @@ n_distinct(x)
|
||||
|
||||
# now let's see:
|
||||
run_it <- microbenchmark(mo_name(x),
|
||||
times = 10)
|
||||
times = 100)
|
||||
print(run_it, unit = "ms", signif = 3)
|
||||
```
|
||||
|
||||
@ -245,7 +243,7 @@ run_it <- microbenchmark(en = mo_name("CoNS", language = "en"),
|
||||
it = mo_name("CoNS", language = "it"),
|
||||
fr = mo_name("CoNS", language = "fr"),
|
||||
pt = mo_name("CoNS", language = "pt"),
|
||||
times = 10)
|
||||
times = 100)
|
||||
print(run_it, unit = "ms", signif = 4)
|
||||
```
|
||||
|
||||
|