mirror of
https://github.com/msberends/AMR.git
synced 2025-07-18 00:43:19 +02:00
Built site for AMR: 1.8.2.9152@80cfc50
This commit is contained in:
@ -10,7 +10,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="">1.8.2.9151</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9152</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">
|
||||
@ -163,20 +163,20 @@
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>This function will fill in missing taxonomy for you, if specific taxonomic columns are missing, see <em>Examples</em>.</p>
|
||||
<p><strong>Important:</strong> Due to how <span style="R">R</span> works, the <code>add_custom_microorganisms()</code> function has to be run in every <span style="R">R</span> session - added microorganisms are not stored between sessions and are thus lost when <span style="R">R</span> is exited.</p>
|
||||
<p>There are two ways to automate this process:</p>
|
||||
<p>There are two ways to circumvent this and automate the process of adding microorganisms:</p>
|
||||
<p><strong>Method 1:</strong> Using the <a href="AMR-options.html">package option</a> <code><a href="AMR-options.html">AMR_custom_mo</a></code>, which is the preferred method. To use this method:</p><ol><li><p>Create a data set in the structure of the <a href="microorganisms.html">microorganisms</a> data set (containing at the very least column "genus") and save it with <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS()</a></code> to a location of choice, e.g. <code>"~/my_custom_mo.rds"</code>, or any remote location.</p></li>
|
||||
<li><p>Set the file location to the <a href="AMR-options.html">package option</a> <code><a href="AMR-options.html">AMR_custom_mo</a></code>: <code>options(AMR_custom_mo = "~/my_custom_mo.rds")</code>. This can even be a remote file location, such as an https URL. Since options are not saved between <span style="R">R</span> sessions, it is best to save this option to the <code>.Rprofile</code> file so that it will be loaded on start-up of <span style="R">R</span>. To do this, open the <code>.Rprofile</code> file using e.g. <code>utils::file.edit("~/.Rprofile")</code>, add this text and save the file:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="co"># Add custom microorganism codes:</span></span>
|
||||
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span>AMR_custom_mo <span class="op">=</span> <span class="st">"~/my_custom_mo.rds"</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
<p>Upon package load, this file will be loaded and run through the <code>add_custom_microorganisms()</code> function.</p></li>
|
||||
</ol><p><strong>Method 2:</strong> Loading the microorganism directly from your <code>.Rprofile</code> file. An important downside is that this requires the <code>AMR</code> package to be installed or else this method will fail. To use this method:</p><ol><li><p>Edit the <code>.Rprofile</code> file using e.g. <code>utils::file.edit("~/.Rprofile")</code>.</p></li>
|
||||
</ol><p><strong>Method 2:</strong> Loading the microorganism directly from your <code>.Rprofile</code> file. Note that the definitions will be stored in a user-specific <span style="R">R</span> file, which is a suboptimal workflow. To use this method:</p><ol><li><p>Edit the <code>.Rprofile</code> file using e.g. <code>utils::file.edit("~/.Rprofile")</code>.</p></li>
|
||||
<li><p>Add a text like below and save the file:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span> <span class="co"># Add custom antibiotic drug codes:</span></span>
|
||||
<span> <span class="fu">AMR</span><span class="fu">::</span><span class="fu"><a href="../reference/add_custom_microorganisms.html">add_custom_microorganisms</a></span><span class="op">(</span></span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span>genus <span class="op">=</span> <span class="st">"Enterobacter"</span>,</span>
|
||||
<span> species <span class="op">=</span> <span class="st">"asburiae/cloacae"</span><span class="op">)</span></span>
|
||||
<span> <span class="op">)</span></span></code></pre><p></p></div></li>
|
||||
</ol><p>Use <code>clear_custom_microorganisms()</code> to clear the previously added antimicrobials.</p>
|
||||
</ol><p>Use <code>clear_custom_microorganisms()</code> to clear the previously added microorganisms.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
|
||||
|
Reference in New Issue
Block a user