mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:42:22 +02:00
(v1.7.1.9026) updated DDDs
This commit is contained in:
@ -92,7 +92,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9025</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9026</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -240,17 +240,17 @@
|
||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div id="amr-1719025" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.7.1.9025">
|
||||
<a href="#amr-1719025" class="anchor" aria-hidden="true"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9025</h1>
|
||||
<div id="last-updated-18-august-2021" class="section level2">
|
||||
<div id="amr-1719026" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.7.1.9026">
|
||||
<a href="#amr-1719026" class="anchor" aria-hidden="true"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9026</h1>
|
||||
<div id="last-updated-19-august-2021" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#last-updated-18-august-2021" class="anchor" aria-hidden="true"></a><small>Last updated: 18 August 2021</small>
|
||||
<a href="#last-updated-19-august-2021" class="anchor" aria-hidden="true"></a><small>Last updated: 19 August 2021</small>
|
||||
</h2>
|
||||
<div id="breaking-changes" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#breaking-changes" class="anchor" aria-hidden="true"></a>Breaking changes</h3>
|
||||
<ul><li>Removed <code>p_symbol()</code> and all <code>filter_*()</code> functions (except for <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>), which were all deprecated in a previous package version</li>
|
||||
<ul><li>Removed <code><a href="https://msberends.github.io/AMR/reference/AMR-deprecated.html">p_symbol()</a></code> and all <code>filter_*()</code> functions (except for <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>), which were all deprecated in a previous package version</li>
|
||||
<li>Removed the <code>key_antibiotics()</code> and <code>key_antibiotics_equal()</code> functions, which were deprecated and superseded by <code><a href="../reference/key_antimicrobials.html">key_antimicrobials()</a></code> and <code><a href="../reference/key_antimicrobials.html">antimicrobials_equal()</a></code>
|
||||
</li>
|
||||
<li>Removed all previously implemented <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot2::ggplot()</a></code> generics for classes <code><mic></code>, <code><disk></code>, <code><rsi></code> and <code><resistance_predict></code> as they did not follow the <code>ggplot2</code> logic. They were replaced with <code><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">ggplot2::autoplot()</a></code> generics.</li>
|
||||
@ -269,6 +269,7 @@
|
||||
<code>antibiotics$atc</code> is now a <code>list</code> instead of a <code>character</code>, and this <code>atc</code> column was moved to the 5th position of the <code>antibiotics</code> data set</li>
|
||||
<li>
|
||||
<code><a href="../reference/ab_property.html">ab_atc()</a></code> does not always return a character vector with length 1, and returns a <code>list</code> if the input is larger than length 1</li>
|
||||
<li>Some DDDs (daily defined doses) were added or updated according to newly included ATC codes</li>
|
||||
</ul></li>
|
||||
<li>Antibiotic selectors
|
||||
<ul><li><p>They now also work in R-3.0 and R-3.1, supporting every version of R since 2013</p></li>
|
||||
@ -280,6 +281,13 @@
|
||||
<span class="va">example_isolates</span><span class="op">[</span>, <span class="fu"><a href="../reference/antibiotic_class_selectors.html">penicillins</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&</span> <span class="fu"><a href="../reference/antibiotic_class_selectors.html">administrable_per_os</a></span><span class="op">(</span><span class="op">)</span><span class="op">]</span> <span class="co"># base R</span>
|
||||
<span class="va">example_isolates</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="fu"><a href="../reference/antibiotic_class_selectors.html">penicillins</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&</span> <span class="fu"><a href="../reference/antibiotic_class_selectors.html">administrable_per_os</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span> <span class="co"># dplyr</span></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Added the selector <code><a href="../reference/antibiotic_class_selectors.html">ab_selector()</a></code>, which accepts a filter to be used internally on the <code>antibiotics</code> data set, yielding great flexibility on drug properties, such as selecting antibiotic columns with an oral DDD of at least 1 gram:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">example_isolates</span><span class="op">[</span>, <span class="fu"><a href="../reference/antibiotic_class_selectors.html">ab_selector</a></span><span class="op">(</span><span class="va">oral_ddd</span> <span class="op">></span> <span class="fl">1</span> <span class="op">&</span> <span class="va">oral_units</span> <span class="op">==</span> <span class="st">"g"</span><span class="op">)</span><span class="op">]</span> <span class="co"># base R</span>
|
||||
<span class="va">example_isolates</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="fu"><a href="../reference/antibiotic_class_selectors.html">ab_selector</a></span><span class="op">(</span><span class="va">oral_ddd</span> <span class="op">></span> <span class="fl">1</span> <span class="op">&</span> <span class="va">oral_units</span> <span class="op">==</span> <span class="st">"g"</span><span class="op">)</span><span class="op">)</span> <span class="co"># dplyr</span></code></pre></div>
|
||||
</li>
|
||||
<li><p>Fix for using selectors multiple times in one call (e.g., using them in <code><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">dplyr::filter()</a></code> and immediately after in <code><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">dplyr::select()</a></code>)</p></li>
|
||||
<li><p>Added argument <code>only_treatable</code>, which defaults to <code>TRUE</code> and will exclude drugs that are only for laboratory tests and not for treating patients (such as imipenem/EDTA and gentamicin-high)</p></li>
|
||||
</ul></li>
|
||||
@ -313,7 +321,7 @@
|
||||
<a href="#breaking-change" class="anchor" aria-hidden="true"></a>Breaking change</h3>
|
||||
<ul><li>
|
||||
<p>All antibiotic class selectors (such as <code><a href="../reference/antibiotic_class_selectors.html">carbapenems()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">aminoglycosides()</a></code>) can now be used for filtering as well, making all their accompanying <code>filter_*()</code> functions redundant (such as <code>filter_carbapenems()</code>, <code>filter_aminoglycosides()</code>). These functions are now deprecated and will be removed in a next release. Examples of how the selectors can be used for filtering:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># select columns with results for carbapenems</span>
|
||||
<span class="va">example_isolates</span><span class="op">[</span>, <span class="fu"><a href="../reference/antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">]</span> <span class="co"># base R</span>
|
||||
@ -370,7 +378,7 @@
|
||||
<ul><li><p>Now checks if <code>pattern</code> is a <em>valid</em> regular expression</p></li>
|
||||
<li>
|
||||
<p>Added <code><a href="../reference/like.html">%unlike%</a></code> and <code><a href="../reference/like.html">%unlike_case%</a></code> (as negations of the existing <code><a href="../reference/like.html">%like%</a></code> and <code><a href="../reference/like.html">%like_case%</a></code>). This greatly improves readability:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/grep.html">grepl</a></span><span class="op">(</span><span class="st">"EUCAST"</span>, <span class="va">guideline</span><span class="op">)</span><span class="op">)</span> <span class="va">...</span>
|
||||
<span class="co"># same:</span>
|
||||
@ -426,7 +434,7 @@
|
||||
</ul></li>
|
||||
<li>
|
||||
<p>Functions <code><a href="../reference/antibiotic_class_selectors.html">oxazolidinones()</a></code> (an antibiotic selector function) and <code>filter_oxazolidinones()</code> (an antibiotic filter function) to select/filter on e.g. linezolid and tedizolid</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
<span class="va">x</span> <span class="op"><-</span> <span class="va">example_isolates</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="va">date</span>, <span class="va">hospital_id</span>, <span class="fu"><a href="../reference/antibiotic_class_selectors.html">oxazolidinones</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>
|
||||
@ -439,7 +447,7 @@
|
||||
<li><p><code>ggplot()</code> generics for classes <code><mic></code> and <code><disk></code></p></li>
|
||||
<li>
|
||||
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_kingdom</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Aspergillus"</span>, <span class="st">"Candida"</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="co">#> [1] "Fungi" "Fungi"</span>
|
||||
@ -451,7 +459,7 @@
|
||||
<span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html">which</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_is_yeast</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>, <span class="op">]</span> <span class="co"># base R</span>
|
||||
<span class="va">example_isolates</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_is_yeast</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span> <span class="co"># dplyr</span></code></pre></div>
|
||||
<p>The <code><a href="../reference/mo_property.html">mo_type()</a></code> function has also been updated to reflect this change:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_type</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Aspergillus"</span>, <span class="st">"Candida"</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="co"># [1] "Fungi" "Yeasts"</span>
|
||||
@ -461,7 +469,7 @@
|
||||
<li><p>Added Pretomanid (PMD, J04AK08) to the <code>antibiotics</code> data set</p></li>
|
||||
<li>
|
||||
<p>MIC values (see <code><a href="../reference/as.mic.html">as.mic()</a></code>) can now be used in any mathematical processing, such as usage inside functions <code><a href="https://rdrr.io/r/base/Extremes.html" class="external-link">min()</a></code>, <code><a href="https://rdrr.io/r/base/Extremes.html" class="external-link">max()</a></code>, <code><a href="https://rdrr.io/r/base/range.html" class="external-link">range()</a></code>, and with binary operators (<code><a href="https://rdrr.io/r/base/Arithmetic.html" class="external-link">+</a></code>, <code><a href="https://rdrr.io/r/base/Arithmetic.html" class="external-link">-</a></code>, etc.). This allows for easy distribution analysis and fast filtering on MIC values:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span>
|
||||
<span class="va">x</span>
|
||||
@ -534,7 +542,7 @@
|
||||
<a href="#new-3" class="anchor" aria-hidden="true"></a>New</h3>
|
||||
<ul><li>
|
||||
<p>Functions <code><a href="../reference/get_episode.html">get_episode()</a></code> and <code><a href="../reference/get_episode.html">is_new_episode()</a></code> to determine (patient) episodes which are not necessarily based on microorganisms. The <code><a href="../reference/get_episode.html">get_episode()</a></code> function returns the index number of the episode per group, while the <code><a href="../reference/get_episode.html">is_new_episode()</a></code> function returns values <code>TRUE</code>/<code>FALSE</code> to indicate whether an item in a vector is the start of a new episode. They also support <code>dplyr</code>s grouping (i.e. using <code><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by()</a></code>):</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
<span class="va">example_isolates</span> <span class="op">%>%</span>
|
||||
@ -580,7 +588,7 @@
|
||||
<li>
|
||||
<code><a href="../reference/mdro.html">mdr_cmi2012()</a></code>,</li>
|
||||
<li><code><a href="../reference/mdro.html">eucast_exceptional_phenotypes()</a></code></li>
|
||||
</ul><div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
|
||||
</ul><div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># to select first isolates that are Gram-negative </span>
|
||||
<span class="co"># and view results of cephalosporins and aminoglycosides:</span>
|
||||
@ -592,7 +600,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<p>For antibiotic selection functions (such as <code><a href="../reference/antibiotic_class_selectors.html">cephalosporins()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">aminoglycosides()</a></code>) to select columns based on a certain antibiotic group, the dependency on the <code>tidyselect</code> package was removed, meaning that they can now also be used without the need to have this package installed and now also work in base R function calls (they rely on R 3.2 or later):</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># above example in base R:</span>
|
||||
<span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html">which</a></span><span class="op">(</span><span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span><span class="op">(</span><span class="op">)</span> <span class="op">&</span> <span class="fu"><a href="../reference/mo_property.html">mo_is_gram_negative</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>,
|
||||
@ -600,7 +608,7 @@
|
||||
</li>
|
||||
<li><p>For all function arguments in the code, it is now defined what the exact type of user input should be (inspired by the <a href="https://github.com/moodymudskipper/typed" class="external-link"><code>typed</code></a> package). If the user input for a certain function does not meet the requirements for a specific argument (such as the class or length), an informative error will be thrown. This makes the package more robust and the use of it more reproducible and reliable. In total, more than 420 arguments were defined.</p></li>
|
||||
<li><p>Fix for <code><a href="../reference/mo_source.html">set_mo_source()</a></code>, that previously would not remember the file location of the original file</p></li>
|
||||
<li><p>Deprecated function <code>p_symbol()</code> that not really fits the scope of this package. It will be removed in a future version. See <a href="https://github.com/msberends/AMR/blob/v1.4.0/R/p_symbol.R" class="external-link">here</a> for the source code to preserve it.</p></li>
|
||||
<li><p>Deprecated function <code><a href="https://msberends.github.io/AMR/reference/AMR-deprecated.html">p_symbol()</a></code> that not really fits the scope of this package. It will be removed in a future version. See <a href="https://github.com/msberends/AMR/blob/v1.4.0/R/p_symbol.R" class="external-link">here</a> for the source code to preserve it.</p></li>
|
||||
<li><p>Updated coagulase-negative staphylococci determination with Becker <em>et al.</em> 2020 (PMID 32056452), meaning that the species <em>S. argensis</em>, <em>S. caeli</em>, <em>S. debuckii</em>, <em>S. edaphicus</em> and <em>S. pseudoxylosus</em> are now all considered CoNS</p></li>
|
||||
<li><p>Fix for using argument <code>reference_df</code> in <code><a href="../reference/as.mo.html">as.mo()</a></code> and <code>mo_*()</code> functions that contain old microbial codes (from previous package versions)</p></li>
|
||||
<li><p>Fixed a bug where <code><a href="../reference/as.mo.html">mo_uncertainties()</a></code> would not return the results based on the MO matching score</p></li>
|
||||
@ -638,7 +646,7 @@
|
||||
<li>
|
||||
<p>Data set <code>intrinsic_resistant</code>. This data set contains all bug-drug combinations where the ‘bug’ is intrinsic resistant to the ‘drug’ according to the latest EUCAST insights. It contains just two columns: <code>microorganism</code> and <code>antibiotic</code>.</p>
|
||||
<p>Curious about which enterococci are actually intrinsic resistant to vancomycin?</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/msberends/AMR">AMR</a></span><span class="op">)</span>
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
@ -658,7 +666,7 @@
|
||||
<p>Improvements for <code><a href="../reference/as.rsi.html">as.rsi()</a></code>:</p>
|
||||
<ul><li>
|
||||
<p>Support for using <code>dplyr</code>’s <code><a href="https://dplyr.tidyverse.org/reference/across.html" class="external-link">across()</a></code> to interpret MIC values or disk zone diameters, which also automatically determines the column with microorganism names or codes.</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># until dplyr 1.0.0</span>
|
||||
<span class="va">your_data</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_if</a></span><span class="op">(</span><span class="va">is.mic</span>, <span class="va">as.rsi</span><span class="op">)</span>
|
||||
@ -675,7 +683,7 @@
|
||||
</ul></li>
|
||||
<li>
|
||||
<p>Added intelligent data cleaning to <code><a href="../reference/as.disk.html">as.disk()</a></code>, so numbers can also be extracted from text and decimal numbers will always be rounded up:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/as.disk.html">as.disk</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"disk zone: 23.4 mm"</span>, <span class="fl">23.4</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="co">#> Class <disk></span>
|
||||
@ -727,7 +735,7 @@
|
||||
<ul><li><p>Function <code><a href="../reference/ab_from_text.html">ab_from_text()</a></code> to retrieve antimicrobial drug names, doses and forms of administration from clinical texts in e.g. health care records, which also corrects for misspelling since it uses <code><a href="../reference/as.ab.html">as.ab()</a></code> internally</p></li>
|
||||
<li>
|
||||
<p><a href="https://tidyselect.r-lib.org/reference/language.html" class="external-link">Tidyverse selection helpers</a> for antibiotic classes, that help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. They can be used in any function that allows selection helpers, like <code><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">dplyr::select()</a></code> and <code><a href="https://tidyr.tidyverse.org/reference/pivot_longer.html" class="external-link">tidyr::pivot_longer()</a></code>:</p>
|
||||
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
|
||||
@ -833,7 +841,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<div id="other-5" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other-5" class="anchor" aria-hidden="true"></a>Other</h3>
|
||||
<ul><li>Removed previously deprecated function <code>p.symbol()</code> - it was replaced with <code>p_symbol()</code>
|
||||
<ul><li>Removed previously deprecated function <code>p.symbol()</code> - it was replaced with <code><a href="https://msberends.github.io/AMR/reference/AMR-deprecated.html">p_symbol()</a></code>
|
||||
</li>
|
||||
<li>Removed function <code>read.4d()</code>, that was only useful for reading data from an old test database.</li>
|
||||
</ul></div>
|
||||
@ -880,7 +888,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul><li><p>Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline</p></li>
|
||||
<li>
|
||||
<p>Interpretation from MIC values (and disk zones) to R/SI can now be used with <code><a href="https://dplyr.tidyverse.org/reference/mutate_all.html" class="external-link">mutate_at()</a></code> of the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">yourdata</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_at</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/vars.html">vars</a></span><span class="op">(</span><span class="va">antibiotic1</span><span class="op">:</span><span class="va">antibiotic25</span><span class="op">)</span>, <span class="va">as.rsi</span>, mo <span class="op">=</span> <span class="st">"E. coli"</span><span class="op">)</span>
|
||||
@ -905,7 +913,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Support for LOINC and SNOMED codes
|
||||
<ul><li>
|
||||
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><a href="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use a LOINC code for input in any <code>ab_*</code> function:</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/ab_property.html">ab_loinc</a></span><span class="op">(</span><span class="st">"ampicillin"</span><span class="op">)</span>
|
||||
<span class="co">#> [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"</span>
|
||||
@ -916,7 +924,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for SNOMED CT codes in the <code>microorganisms</code> data set. Use <code><a href="../reference/mo_property.html">mo_snomed()</a></code> to retrieve SNOMED codes, or use a SNOMED code for input in any <code>mo_*</code> function:</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_snomed</a></span><span class="op">(</span><span class="st">"S. aureus"</span><span class="op">)</span>
|
||||
<span class="co">#> [1] 115329001 3092008 113961008</span>
|
||||
@ -968,11 +976,11 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul><li>Adopted Adeolu <em>et al.</em> (2016), <a href="https:/pubmed.ncbi.nlm.nih.gov/27620848/">PMID 27620848</a> for the <code>microorganisms</code> data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like <em>Morganellaceae</em> and <em>Yersiniaceae</em>). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with <code><a href="../reference/mdro.html">mdro()</a></code> will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family.
|
||||
<ul><li>
|
||||
<p>If you were dependent on the old Enterobacteriaceae family e.g. by using in your code:</p>
|
||||
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_family</a></span><span class="op">(</span><span class="va">somebugs</span><span class="op">)</span> <span class="op">==</span> <span class="st">"Enterobacteriaceae"</span><span class="op">)</span> <span class="va">...</span></code></pre></div>
|
||||
<p>then please adjust this to:</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_order</a></span><span class="op">(</span><span class="va">somebugs</span><span class="op">)</span> <span class="op">==</span> <span class="st">"Enterobacterales"</span><span class="op">)</span> <span class="va">...</span></code></pre></div>
|
||||
</li>
|
||||
@ -983,7 +991,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<a href="#new-8" class="anchor" aria-hidden="true"></a>New</h3>
|
||||
<ul><li>
|
||||
<p>Functions <code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> as aliases of <code><a href="../reference/proportion.html">proportion_SI()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
|
||||
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
<span class="va">example_isolates</span> <span class="op">%>%</span>
|
||||
@ -1007,7 +1015,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>More intelligent way of coping with some consonants like “l” and “r”</p></li>
|
||||
<li>
|
||||
<p>Added a score (a certainty percentage) to <code><a href="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <a href="https://en.wikipedia.org/wiki/Levenshtein_distance" class="external-link">Levenshtein distance</a>:</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Stafylococcus aureus"</span>,
|
||||
<span class="st">"staphylokok aureuz"</span><span class="op">)</span><span class="op">)</span>
|
||||
@ -1058,14 +1066,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<a href="#breaking-2" class="anchor" aria-hidden="true"></a>Breaking</h3>
|
||||
<ul><li>
|
||||
<p>Determination of first isolates now <strong>excludes</strong> all ‘unknown’ microorganisms at default, i.e. microbial code <code>"UNKNOWN"</code>. They can be included with the new argument <code>include_unknown</code>:</p>
|
||||
<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span><span class="op">(</span><span class="va">...</span>, include_unknown <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div>
|
||||
<p>For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of ‘unknown’ microorganisms that were included or excluded.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
|
||||
<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># how it works in base R:</span>
|
||||
<span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html">factor</a></span><span class="op">(</span><span class="st">"A"</span><span class="op">)</span>
|
||||
@ -1088,7 +1096,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<a href="#new-9" class="anchor" aria-hidden="true"></a>New</h3>
|
||||
<ul><li>
|
||||
<p>Function <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><a href="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
|
||||
<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span><span class="op">(</span><span class="va">example_isolates</span><span class="op">)</span>
|
||||
<span class="co">#> NOTE: Using column `mo` as input for `col_mo`.</span>
|
||||
@ -1111,13 +1119,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="co">#> 4 Gram-negative AMX 227 0 405 632</span>
|
||||
<span class="co">#> NOTE: Use 'format()' on this result to get a publicable/printable format.</span></code></pre></div>
|
||||
<p>You can format this to a printable format, ready for reporting or exporting to e.g. Excel with the base R <code><a href="https://rdrr.io/r/base/format.html" class="external-link">format()</a></code> function:</p>
|
||||
<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="https://rdrr.io/r/base/format.html">format</a></span><span class="op">(</span><span class="va">x</span>, combine_IR <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new argument <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
|
||||
<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb27"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># --------------------------------------------------------------------</span>
|
||||
<span class="co"># only_all_tested = FALSE only_all_tested = TRUE</span>
|
||||
@ -1139,7 +1147,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code> <code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
|
||||
<div class="sourceCode" id="cb27"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb28"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># (run this on your own console, as this page does not support colour printing)</span>
|
||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||
@ -1187,7 +1195,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Improved <code>filter_ab_class()</code> to be more reliable and to support 5th generation cephalosporins</li>
|
||||
<li>Function <code><a href="../reference/availability.html">availability()</a></code> now uses <code>portion_R()</code> instead of <code>portion_IR()</code>, to comply with EUCAST insights</li>
|
||||
<li>Functions <code><a href="../reference/age.html">age()</a></code> and <code><a href="../reference/age_groups.html">age_groups()</a></code> now have a <code>na.rm</code> argument to remove empty values</li>
|
||||
<li>Renamed function <code>p.symbol()</code> to <code>p_symbol()</code> (the former is now deprecated and will be removed in a future version)</li>
|
||||
<li>Renamed function <code>p.symbol()</code> to <code><a href="https://msberends.github.io/AMR/reference/AMR-deprecated.html">p_symbol()</a></code> (the former is now deprecated and will be removed in a future version)</li>
|
||||
<li>Using negative values for <code>x</code> in <code><a href="../reference/age_groups.html">age_groups()</a></code> will now introduce <code>NA</code>s and not return an error anymore</li>
|
||||
<li>Fix for determining the system’s language</li>
|
||||
<li>Fix for <code>key_antibiotics()</code> on foreign systems</li>
|
||||
@ -1211,7 +1219,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<a href="#new-10" class="anchor" aria-hidden="true"></a>New</h4>
|
||||
<ul><li>
|
||||
<p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code>portion_df()</code> to immediately show resistance percentages and number of available isolates:</p>
|
||||
<div class="sourceCode" id="cb28"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb29"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="va">AMX</span>, <span class="va">CIP</span><span class="op">)</span> <span class="op">%>%</span>
|
||||
@ -1236,7 +1244,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>STEC (Shiga-toxin producing <em>E. coli</em>)</li>
|
||||
<li>UPEC (Uropathogenic <em>E. coli</em>)</li>
|
||||
</ul><p>All these lead to the microbial ID of <em>E. coli</em>:</p>
|
||||
<div class="sourceCode" id="cb29"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb30"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"UPEC"</span><span class="op">)</span>
|
||||
<span class="co"># B_ESCHR_COL</span>
|
||||
@ -1325,7 +1333,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>when all values are unique it now shows a message instead of a warning</p></li>
|
||||
<li>
|
||||
<p>support for boxplots:</p>
|
||||
<div class="sourceCode" id="cb30"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb31"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%>%</span>
|
||||
@ -1405,7 +1413,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</ul></li>
|
||||
<li>
|
||||
<p>New filters for antimicrobial classes. Use these functions to filter isolates on results in one of more antibiotics from a specific class:</p>
|
||||
<div class="sourceCode" id="cb31"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb32"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu">filter_aminoglycosides</span><span class="op">(</span><span class="op">)</span>
|
||||
<span class="fu">filter_carbapenems</span><span class="op">(</span><span class="op">)</span>
|
||||
@ -1419,7 +1427,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="fu">filter_macrolides</span><span class="op">(</span><span class="op">)</span>
|
||||
<span class="fu">filter_tetracyclines</span><span class="op">(</span><span class="op">)</span></code></pre></div>
|
||||
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
|
||||
<div class="sourceCode" id="cb32"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb33"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span> <span class="fu">filter_glycopeptides</span><span class="op">(</span>result <span class="op">=</span> <span class="st">"R"</span><span class="op">)</span>
|
||||
<span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span>
|
||||
@ -1428,7 +1436,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
|
||||
<div class="sourceCode" id="cb33"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb34"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">ab_property</span> <span class="op">-></span> <span class="fu">atc_property</span><span class="op">(</span><span class="op">)</span>
|
||||
<span class="va">ab_name</span> <span class="op">-></span> <span class="fu">atc_name</span><span class="op">(</span><span class="op">)</span>
|
||||
@ -1449,7 +1457,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>New function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic AMR data analysis per age group.</p></li>
|
||||
<li>
|
||||
<p>New function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="../reference/plot.html">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
|
||||
<div class="sourceCode" id="cb34"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb35"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">x</span> <span class="op"><-</span> <span class="fu"><a href="../reference/resistance_predict.html">resistance_predict</a></span><span class="op">(</span><span class="va">septic_patients</span>, col_ab <span class="op">=</span> <span class="st">"amox"</span><span class="op">)</span>
|
||||
<span class="fu"><a href="../reference/plot.html">plot</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
|
||||
@ -1457,13 +1465,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code>filter_first_weighted_isolate()</code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
|
||||
<div class="sourceCode" id="cb35"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb36"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span><span class="op">(</span><span class="va">...</span><span class="op">)</span>
|
||||
<span class="co"># or</span>
|
||||
<span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span><span class="op">(</span><span class="va">septic_patients</span>, <span class="va">...</span><span class="op">)</span></code></pre></div>
|
||||
<p>is equal to:</p>
|
||||
<div class="sourceCode" id="cb36"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb37"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span><span class="op">(</span>only_firsts <span class="op">=</span> <span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span><span class="op">(</span><span class="va">septic_patients</span>, <span class="va">...</span><span class="op">)</span><span class="op">)</span> <span class="op">%>%</span>
|
||||
@ -1491,7 +1499,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:
|
||||
<ul><li>
|
||||
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
|
||||
<div class="sourceCode" id="cb37"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb38"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># mo_fullname() uses as.mo() internally</span>
|
||||
|
||||
@ -1503,7 +1511,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><a href="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
|
||||
<div class="sourceCode" id="cb38"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb39"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># equal:</span>
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="va">...</span>, allow_uncertain <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
|
||||
@ -1518,7 +1526,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</p></li>
|
||||
<li>
|
||||
<p>Incoercible results will now be considered ‘unknown’, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb39"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb40"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"qwerty"</span>, language <span class="op">=</span> <span class="st">"es"</span><span class="op">)</span>
|
||||
<span class="co"># Warning: </span>
|
||||
@ -1562,7 +1570,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Frequency tables (<code>freq()</code> function):
|
||||
<ul><li>
|
||||
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
|
||||
<div class="sourceCode" id="cb40"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb41"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span>
|
||||
<span class="co"># OLD WAY</span>
|
||||
@ -1636,7 +1644,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Fewer than 3 characters as input for <code>as.mo</code> will return NA</p></li>
|
||||
<li>
|
||||
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
|
||||
<div class="sourceCode" id="cb41"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"E. species"</span><span class="op">)</span> <span class="co"># B_ESCHR</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span><span class="op">(</span><span class="st">"E. spp."</span><span class="op">)</span> <span class="co"># "Escherichia species"</span>
|
||||
@ -1652,7 +1660,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<p>Frequency tables - <code>freq()</code>:</p>
|
||||
<ul><li>
|
||||
<p>Support for grouping variables, test with:</p>
|
||||
<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%>%</span>
|
||||
@ -1660,7 +1668,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for (un)selecting columns:</p>
|
||||
<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb44"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%>%</span>
|
||||
@ -1730,7 +1738,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Author and year: <code>mo_ref</code>
|
||||
</li>
|
||||
</ul><p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb44"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb45"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span><span class="op">(</span><span class="st">"E. coli"</span><span class="op">)</span>
|
||||
<span class="co"># [1] "Gram negative"</span>
|
||||
@ -1741,7 +1749,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span><span class="op">(</span><span class="st">"S. group A"</span>, language <span class="op">=</span> <span class="st">"pt"</span><span class="op">)</span> <span class="co"># Portuguese</span>
|
||||
<span class="co"># [1] "Streptococcus grupo A"</span></code></pre></div>
|
||||
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name:</p>
|
||||
<div class="sourceCode" id="cb45"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb46"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span><span class="op">(</span><span class="st">"Esc blattae"</span><span class="op">)</span>
|
||||
<span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span>
|
||||
@ -1754,7 +1762,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Function <code>is.rsi.eligible</code> to check for columns that have valid antimicrobial results, but do not have the <code>rsi</code> class yet. Transform the columns of your raw data with: <code>data %>% mutate_if(is.rsi.eligible, as.rsi)</code></p></li>
|
||||
<li>
|
||||
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
|
||||
<div class="sourceCode" id="cb46"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb47"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"E. coli"</span><span class="op">)</span>
|
||||
<span class="co"># [1] B_ESCHR_COL</span>
|
||||
@ -1763,7 +1771,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"S group A"</span><span class="op">)</span>
|
||||
<span class="co"># [1] B_STRPTC_GRA</span></code></pre></div>
|
||||
<p>And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:</p>
|
||||
<div class="sourceCode" id="cb47"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb48"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">thousands_of_E_colis</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="st">"E. coli"</span>, <span class="fl">25000</span><span class="op">)</span>
|
||||
<span class="fu">microbenchmark</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span><span class="op">(</span><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="va">thousands_of_E_colis</span><span class="op">)</span>, unit <span class="op">=</span> <span class="st">"s"</span><span class="op">)</span>
|
||||
@ -1793,7 +1801,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul><li><p>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</p></li>
|
||||
<li>
|
||||
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
|
||||
<div class="sourceCode" id="cb48"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb49"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="fu">ab_official</span><span class="op">(</span><span class="st">"Bactroban"</span><span class="op">)</span>
|
||||
<span class="co"># [1] "Mupirocin"</span>
|
||||
@ -1810,7 +1818,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Added arguments <code>minimum</code> and <code>as_percent</code> to <code>portion_df</code></p></li>
|
||||
<li>
|
||||
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
|
||||
<div class="sourceCode" id="cb49"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb50"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="va">amox</span>, <span class="va">cipr</span><span class="op">)</span> <span class="op">%>%</span> <span class="fu"><a href="../reference/count.html">count_IR</a></span><span class="op">(</span><span class="op">)</span>
|
||||
<span class="co"># which is the same as:</span>
|
||||
@ -1830,12 +1838,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Added longest en shortest character length in the frequency table (<code>freq</code>) header of class <code>character</code></p></li>
|
||||
<li>
|
||||
<p>Support for types (classes) list and matrix for <code>freq</code></p>
|
||||
<div class="sourceCode" id="cb50"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb51"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">my_matrix</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">septic_patients</span>, <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">age</span>, <span class="va">gender</span><span class="op">)</span>, ncol <span class="op">=</span> <span class="fl">2</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></code></pre></div>
|
||||
<p>For lists, subsetting is possible:</p>
|
||||
<div class="sourceCode" id="cb51"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb52"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">my_list</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span>age <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">age</span>, gender <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">gender</span><span class="op">)</span>
|
||||
<span class="va">my_list</span> <span class="op">%>%</span> <span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span>
|
||||
|
Reference in New Issue
Block a user