1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-17 19:53:16 +02:00

Built site for AMR@2.1.1.9231: 5f5b77b

This commit is contained in:
github-actions
2025-03-29 17:12:11 +00:00
parent 5b2e2c9477
commit 3545229978
79 changed files with 242 additions and 242 deletions

View File

@ -31,7 +31,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.1.1.9230</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.1.1.9231</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -51,7 +51,7 @@
<li><a class="dropdown-item" href="../articles/PCA.html"><span class="fa fa-compress"></span> Conduct Principal Component Analysis for AMR</a></li>
<li><a class="dropdown-item" href="../articles/MDR.html"><span class="fa fa-skull-crossbones"></span> Determine Multi-Drug Resistance (MDR)</a></li>
<li><a class="dropdown-item" href="../articles/WHONET.html"><span class="fa fa-globe-americas"></span> Work with WHONET Data</a></li>
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply Eucast Rules</a></li>
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply EUCAST Rules</a></li>
<li><a class="dropdown-item" href="../reference/mo_property.html"><span class="fa fa-bug"></span> Get Taxonomy of a Microorganism</a></li>
<li><a class="dropdown-item" href="../reference/ab_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antibiotic Drug</a></li>
<li><a class="dropdown-item" href="../reference/av_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antiviral Drug</a></li>
@ -93,18 +93,18 @@
Assistant</a>, a ChatGPT manually-trained model able to answer any
question about the AMR package.</p>
</blockquote>
<hr>
<div class="section level2">
<h2 id="example-1-using-antimicrobial-selectors">Example 1: Using Antimicrobial Selectors<a class="anchor" aria-label="anchor" href="#example-1-using-antimicrobial-selectors"></a>
</h2>
<p>Antimicrobial resistance (AMR) is a global health crisis, and
understanding resistance patterns is crucial for managing effective
treatments. The <code>AMR</code> R package provides robust tools for
analysing AMR data, including convenient antimicrobial selector
functions like <code><a href="../reference/antimicrobial_selectors.html">aminoglycosides()</a></code> and
<code><a href="../reference/antimicrobial_selectors.html">betalactams()</a></code>. In this post, we will explore how to use the
<code>tidymodels</code> framework to predict resistance patterns in the
<code>example_isolates</code> dataset.</p>
<code><a href="../reference/antimicrobial_selectors.html">betalactams()</a></code>.</p>
<p>In this post, we will explore how to use the <code>tidymodels</code>
framework to predict resistance patterns in the
<code>example_isolates</code> dataset in two examples.</p>
<div class="section level2">
<h2 id="example-1-using-antimicrobial-selectors">Example 1: Using Antimicrobial Selectors<a class="anchor" aria-label="anchor" href="#example-1-using-antimicrobial-selectors"></a>
</h2>
<p>By leveraging the power of <code>tidymodels</code> and the
<code>AMR</code> package, well build a reproducible machine learning
workflow to predict the Gramstain of the microorganism to two important
@ -136,7 +136,7 @@ package.</p>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span> <span class="co"># For AMR data analysis</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://tidymodels.tidymodels.org" class="external-link">tidymodels</a></span><span class="op">)</span> <span class="co"># For machine learning workflows, and data manipulation (dplyr, tidyr, ...)</span></span>
<span><span class="co">#&gt; ── <span style="font-weight: bold;">Attaching packages</span> ────────────────────────────────────── tidymodels 1.3.0 ──</span></span>
<span><span class="co">#&gt; <span style="color: #00BB00;"></span> <span style="color: #0000BB;">broom </span> 1.0.7 <span style="color: #00BB00;"></span> <span style="color: #0000BB;">recipes </span> 1.2.1</span></span>
<span><span class="co">#&gt; <span style="color: #00BB00;"></span> <span style="color: #0000BB;">broom </span> 1.0.8 <span style="color: #00BB00;"></span> <span style="color: #0000BB;">recipes </span> 1.2.1</span></span>
<span><span class="co">#&gt; <span style="color: #00BB00;"></span> <span style="color: #0000BB;">dials </span> 1.4.0 <span style="color: #00BB00;"></span> <span style="color: #0000BB;">rsample </span> 1.2.1</span></span>
<span><span class="co">#&gt; <span style="color: #00BB00;"></span> <span style="color: #0000BB;">dplyr </span> 1.1.4 <span style="color: #00BB00;"></span> <span style="color: #0000BB;">tibble </span> 3.2.1</span></span>
<span><span class="co">#&gt; <span style="color: #00BB00;"></span> <span style="color: #0000BB;">ggplot2 </span> 3.5.1 <span style="color: #00BB00;"></span> <span style="color: #0000BB;">tidyr </span> 1.3.1</span></span>
@ -624,10 +624,10 @@ workflow. - <code><a href="https://rdrr.io/r/stats/predict.html" class="external
<code>metrics()</code>: Evaluates model performance.</p>
</div>
<div class="section level3">
<h3 id="visualizing-predictions">
<strong>Visualizing Predictions</strong><a class="anchor" aria-label="anchor" href="#visualizing-predictions"></a>
<h3 id="visualising-predictions">
<strong>Visualising Predictions</strong><a class="anchor" aria-label="anchor" href="#visualising-predictions"></a>
</h3>
<p>We plot resistance trends over time for Amoxicillin.</p>
<p>We plot resistance trends over time for amoxicillin.</p>
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://ggplot2.tidyverse.org" class="external-link">ggplot2</a></span><span class="op">)</span></span>
<span></span>
@ -641,7 +641,7 @@ workflow. - <code><a href="https://rdrr.io/r/stats/predict.html" class="external
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html" class="external-link">theme_minimal</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p><img src="AMR_with_tidymodels_files/figure-html/unnamed-chunk-14-1.png" width="720"></p>
<p>Additionally, we can visualise resistance trends in
<code>ggplot2</code> and directly adding linear models there:</p>
<code>ggplot2</code> and directly add linear models there:</p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot</a></span><span class="op">(</span><span class="va">data_time</span>, <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes</a></span><span class="op">(</span>x <span class="op">=</span> <span class="va">year</span>, y <span class="op">=</span> <span class="va">res_AMX</span>, color <span class="op">=</span> <span class="va">gramstain</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html" class="external-link">geom_line</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span></span>