mirror of
https://github.com/msberends/AMR.git
synced 2025-07-18 00:03:24 +02:00
Built site for AMR: 1.8.2.9092@ca79068
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.9091</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9092</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">
|
||||
@ -128,7 +128,7 @@
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.svg" class="logo" alt=""><h1>Add Custom Microorganisms to This Package</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/HEAD/R/add_custom_microorganisms.R" class="external-link"><code>R/add_custom_microorganisms.R</code></a></small>
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/HEAD/R/custom_microorganisms.R" class="external-link"><code>R/custom_microorganisms.R</code></a></small>
|
||||
<div class="d-none name"><code>add_custom_microorganisms.Rd</code></div>
|
||||
</div>
|
||||
|
||||
@ -146,7 +146,7 @@
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
<dl><dt>x</dt>
|
||||
<dd><p>a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> resembling the <a href="microorganisms.html">microorganisms</a> data set, at least containing columns "genus" and "species"</p></dd>
|
||||
<dd><p>a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> resembling the <a href="microorganisms.html">microorganisms</a> data set, at least containing column "genus" (case-insensitive)</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
@ -154,7 +154,7 @@
|
||||
<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><strong>Method 1:</strong> Save the microorganisms to a local or remote file (can even be the internet). 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 columns "genus" and "species") 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>
|
||||
<p><strong>Method 1:</strong> Save the microorganisms to a local or remote file (can even be the internet). 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 <code>AMR_custom_mo</code> <span style="R">R</span> option: <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 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>
|
||||
@ -190,7 +190,8 @@
|
||||
<span class="r-in"><span> species <span class="op">=</span> <span class="st">"asburiae/cloacae"</span></span></span>
|
||||
<span class="r-in"><span> <span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> ℹ Added one record to the internal microorganisms data set.</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> ℹ Added Enterobacter asburiae/cloacae to the internal microorganisms data</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> set.</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># E. asburiae/cloacae is now a new microorganism:</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"Enterobacter asburiae/cloacae"</span><span class="op">)</span></span></span>
|
||||
@ -212,6 +213,10 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Gram-negative"</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_info</a></span><span class="op">(</span><span class="st">"Enterobacter asburiae/cloacae"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> $identifier</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'mo'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] CUSTOM1_ENTRBC_A_C</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> $kingdom</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Bacteria"</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
@ -249,11 +254,31 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] ""</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> $ref</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] NA</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Self-added, 2023"</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> $snomed</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> character(0)</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># the function tries to be forgiving:</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">add_custom_microorganisms</span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><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">"ESCHERICHIA / KLEBSIELLA"</span>,</span></span>
|
||||
<span class="r-in"><span> SPECIES <span class="op">=</span> <span class="st">"SPECIES"</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> ℹ Added Escherichia/Klebsiella to the internal microorganisms data set.</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"ESCHERICHIA / KLEBSIELLA"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Escherichia/Klebsiella"</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_family</a></span><span class="op">(</span><span class="st">"Escherichia/Klebsiella"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Enterobacteriaceae"</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">add_custom_microorganisms</span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><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">"Citrobacter"</span>, species <span class="op">=</span> <span class="st">"freundii complex"</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> ℹ Added Citrobacter freundii Complex to the internal microorganisms data</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> set.</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"C. freundii complex"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Citrobacter freundii Complex"</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="mo_property.html">mo_gramstain</a></span><span class="op">(</span><span class="st">"C. freundii complex"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Gram-negative"</span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user