Browse Source

(v1.4.0.9000) more extensive unit tests

new-mo-algorithm
parent
commit
833a1be36d
  1. 34
      .github/workflows/check.yaml
  2. 4
      DESCRIPTION
  3. 7
      NEWS.md
  4. 4
      docs/404.html
  5. 4
      docs/LICENSE-text.html
  6. 790
      docs/articles/AMR.html
  7. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  8. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  9. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  10. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  11. 12
      docs/articles/AMR_files/header-attrs-2.4/header-attrs.js
  12. 46
      docs/articles/EUCAST.html
  13. 12
      docs/articles/EUCAST_files/header-attrs-2.4/header-attrs.js
  14. 130
      docs/articles/MDR.html
  15. 12
      docs/articles/MDR_files/header-attrs-2.4/header-attrs.js
  16. 262
      docs/articles/benchmarks.html
  17. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png
  18. 12
      docs/articles/benchmarks_files/header-attrs-2.4/header-attrs.js
  19. 6
      docs/articles/datasets.html
  20. 12
      docs/articles/datasets_files/header-attrs-2.4/header-attrs.js
  21. 4
      docs/articles/index.html
  22. 4
      docs/authors.html
  23. 12
      docs/index.html
  24. 432
      docs/news/index.html
  25. 18
      docs/pkgdown.yml
  26. 4
      docs/reference/AMR.html
  27. 10
      docs/reference/WHOCC.html
  28. 6
      docs/reference/WHONET.html
  29. 76
      docs/reference/ab_from_text.html
  30. 84
      docs/reference/ab_property.html
  31. 14
      docs/reference/age.html
  32. 38
      docs/reference/age_groups.html
  33. 64
      docs/reference/antibiotic_class_selectors.html
  34. 14
      docs/reference/antibiotics.html
  35. 40
      docs/reference/as.ab.html
  36. 32
      docs/reference/as.disk.html
  37. 36
      docs/reference/as.mic.html
  38. 90
      docs/reference/as.mo.html
  39. 188
      docs/reference/as.rsi.html
  40. 28
      docs/reference/atc_online.html
  41. 22
      docs/reference/availability.html
  42. 48
      docs/reference/bug_drug_combinations.html
  43. 20
      docs/reference/catalogue_of_life.html
  44. 6
      docs/reference/catalogue_of_life_version.html
  45. 120
      docs/reference/count.html
  46. 56
      docs/reference/eucast_rules.html
  47. 6
      docs/reference/example_isolates.html
  48. 6
      docs/reference/example_isolates_unclean.html
  49. 132
      docs/reference/first_isolate.html
  50. 22
      docs/reference/g.test.html
  51. 230
      docs/reference/ggplot_rsi.html
  52. 32
      docs/reference/guess_ab_col.html
  53. 4
      docs/reference/index.html
  54. 16
      docs/reference/intrinsic_resistant.html
  55. 48
      docs/reference/join.html
  56. 98
      docs/reference/key_antibiotics.html
  57. 12
      docs/reference/kurtosis.html
  58. 32
      docs/reference/like.html
  59. 54
      docs/reference/mdro.html
  60. 6
      docs/reference/microorganisms.codes.html
  61. 8
      docs/reference/microorganisms.html
  62. 6
      docs/reference/microorganisms.old.html
  63. 14
      docs/reference/mo_matching_score.html
  64. 160
      docs/reference/mo_property.html
  65. 22
      docs/reference/mo_source.html
  66. 6
      docs/reference/p_symbol.html
  67. 76
      docs/reference/plot.html
  68. 164
      docs/reference/proportion.html
  69. 162
      docs/reference/resistance_predict.html
  70. 6
      docs/reference/rsi_translation.html
  71. 12
      docs/reference/skewness.html
  72. 20
      docs/reference/translate.html
  73. 4
      docs/survey.html
  74. 4
      vignettes/benchmarks.Rmd

34
.github/workflows/check.yaml

@ -48,24 +48,22 @@ jobs: @@ -48,24 +48,22 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: windows-latest, r: 'oldrel'}
# - {os: macOS-latest, r: 'oldrel'}
# - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: macOS-latest, r: 'oldrel'}
- {os: windows-latest, r: 'devel'}
# - {os: macOS-latest, r: 'devel'}
# - {os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: windows-latest, r: '3.6'}
# - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel'}
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
@ -80,7 +78,6 @@ jobs: @@ -80,7 +78,6 @@ jobs:
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
@ -88,8 +85,8 @@ jobs: @@ -88,8 +85,8 @@ jobs:
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-
- name: Install system dependencies
if: runner.os == 'Linux'
@ -100,6 +97,11 @@ jobs: @@ -100,6 +97,11 @@ jobs:
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install macOS dependencies
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
run: |
brew install mariadb-connector-c
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
@ -126,7 +128,7 @@ jobs: @@ -126,7 +128,7 @@ jobs:
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

4
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 1.4.0
Date: 2020-10-08
Version: 1.4.0.9000
Date: 2020-10-15
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

7
NEWS.md

@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
# AMR 1.4.0
# AMR 1.4.0.9000
## <small>Last updated: 15 October 2020</small>
### Other
* More extensive unit tests
# AMR 1.4.0
Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt about this package to. We are those reviewers very grateful for going through our code so thoroughly!

4
docs/404.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -255,7 +255,7 @@ Content not found. Please use links in the navbar. @@ -255,7 +255,7 @@ Content not found. Please use links in the navbar.
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

4
docs/LICENSE-text.html

@ -81,7 +81,7 @@ @@ -81,7 +81,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.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -503,7 +503,7 @@ END OF TERMS AND CONDITIONS @@ -503,7 +503,7 @@ END OF TERMS AND CONDITIONS
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

790
docs/articles/AMR.html

File diff suppressed because it is too large Load Diff

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 26 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 68 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 45 KiB

12
docs/articles/AMR_files/header-attrs-2.4/header-attrs.js

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});

46
docs/articles/EUCAST.html

@ -39,7 +39,7 @@ @@ -39,7 +39,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.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
</header><script src="EUCAST_files/header-attrs-2.3/header-attrs.js"></script><script src="EUCAST_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
</header><script src="EUCAST_files/header-attrs-2.4/header-attrs.js"></script><script src="EUCAST_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>How to apply EUCAST rules</h1>
@ -216,38 +216,35 @@ @@ -216,38 +216,35 @@
<p>These rules can be used to discard impossible bug-drug combinations in your data. For example, <em>Klebsiella</em> produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, practically every strain of <em>Klebsiella</em> is resistant to ampicillin.</p>
<p>Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, <em>Klebsiella</em>). EUCAST expert rules solve this, that can be applied using <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:</p>
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="kw">oops</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(mo = <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Klebsiella"</span>,
<span class="st">"Escherichia"</span>),
ampicillin = <span class="st">"S"</span>)
<span class="kw">oops</span>
<span class="va">oops</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <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">"Klebsiella"</span>,
<span class="st">"Escherichia"</span><span class="op">)</span>,
ampicillin <span class="op">=</span> <span class="st">"S"</span><span class="op">)</span>
<span class="va">oops</span>
<span class="co"># mo ampicillin</span>
<span class="co"># 1 Klebsiella S</span>
<span class="co"># 2 Escherichia S</span>
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="kw">oops</span>, info = <span class="fl">FALSE</span>)
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">oops</span>, info <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>
<span class="co"># mo ampicillin</span>
<span class="co"># 1 Klebsiella R</span>
<span class="co"># 2 Escherichia S</span>
</pre></div>
<span class="co"># 2 Escherichia S</span></pre></div>
<p>EUCAST rules can not only be used for correction, they can also be used for filling in known resistance and susceptibility based on results of other antimicrobials drugs. This process is called <em>interpretive reading</em> and is part of the <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> function as well:</p>
<div class="sourceCode" id="cb2"><pre class="downlit">
<span class="kw">data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(mo = <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Staphylococcus aureus"</span>,
<span class="va">data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>mo <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">"Staphylococcus aureus"</span>,
<span class="st">"Enterococcus faecalis"</span>,
<span class="st">"Escherichia coli"</span>,
<span class="st">"Klebsiella pneumoniae"</span>,
<span class="st">"Pseudomonas aeruginosa"</span>),
VAN = <span class="st">"-"</span>, <span class="co"># Vancomycin</span>
AMX = <span class="st">"-"</span>, <span class="co"># Amoxicillin</span>
COL = <span class="st">"-"</span>, <span class="co"># Colistin</span>
CAZ = <span class="st">"-"</span>, <span class="co"># Ceftazidime</span>
CXM = <span class="st">"-"</span>, <span class="co"># Cefuroxime</span>
PEN = <span class="st">"S"</span>, <span class="co"># Benzylenicillin</span>
FOX = <span class="st">"S"</span>, <span class="co"># Cefoxitin</span>
stringsAsFactors = <span class="fl">FALSE</span>)
</pre></div>
<span class="st">"Pseudomonas aeruginosa"</span><span class="op">)</span>,
VAN <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Vancomycin</span>
AMX <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Amoxicillin</span>
COL <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Colistin</span>
CAZ <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Ceftazidime</span>
CXM <span class="op">=</span> <span class="st">"-"</span>, <span class="co"># Cefuroxime</span>
PEN <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Benzylenicillin</span>
FOX <span class="op">=</span> <span class="st">"S"</span>, <span class="co"># Cefoxitin</span>
stringsAsFactors <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div>
<div class="sourceCode" id="cb3"><pre class="downlit">
<span class="kw">data</span>
</pre></div>
<span class="va">data</span></pre></div>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>
@ -313,8 +310,7 @@ @@ -313,8 +310,7 @@
</tbody>
</table>
<div class="sourceCode" id="cb4"><pre class="downlit">
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span>(<span class="kw">data</span>)
</pre></div>
<span class="fu"><a href="../reference/eucast_rules.html">eucast_rules</a></span><span class="op">(</span><span class="va">data</span><span class="op">)</span></pre></div>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>
@ -397,7 +393,7 @@ @@ -397,7 +393,7 @@
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

12
docs/articles/EUCAST_files/header-attrs-2.4/header-attrs.js

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});

130
docs/articles/MDR.html

@ -39,7 +39,7 @@ @@ -39,7 +39,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.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
</header><script src="MDR_files/header-attrs-2.3/header-attrs.js"></script><script src="MDR_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
</header><script src="MDR_files/header-attrs-2.4/header-attrs.js"></script><script src="MDR_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>How to determine multi-drug resistance (MDR)</h1>
@ -240,16 +240,14 @@ @@ -240,16 +240,14 @@
<p>The <code><a href="../reference/mdro.html">mdro()</a></code> function always returns an ordered <code>factor</code>. For example, the output of the default guideline by Magiorakos <em>et al.</em> returns a <code>factor</code> with levels ‘Negative’, ‘MDR’, ‘XDR’ or ‘PDR’ in that order.</p>
<p>The next example uses the <code>example_isolates</code> data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis. If we test the MDR/XDR/PDR guideline on this data set, we get:</p>
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="kw"><a href="https://dplyr.tidyverse.org">dplyr</a></span>) <span class="co"># to support pipes: %&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="kw"><a href="https://github.com/msberends/cleaner">cleaner</a></span>) <span class="co"># to create frequency tables</span>
</pre></div>
<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="co"># to support pipes: %&gt;%</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://github.com/msberends/cleaner">cleaner</a></span><span class="op">)</span> <span class="co"># to create frequency tables</span></pre></div>
<div class="sourceCode" id="cb2"><pre class="downlit">
<span class="kw">example_isolates</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="../reference/mdro.html">mdro</a></span>() <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>() <span class="co"># show frequency table of the result</span>
<span class="va">example_isolates</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="op">)</span> <span class="co"># show frequency table of the result</span>
<span class="co"># Warning in mdro(.): NA introduced for isolates where the available percentage of</span>
<span class="co"># antimicrobial classes was below 50% (set with `pct_required_classes`)</span>
</pre></div>
<span class="co"># antimicrobial classes was below 50% (set with `pct_required_classes`)</span></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: factor &gt; ordered (numeric)<br>
Length: 2,000<br>
@ -288,62 +286,56 @@ Unique: 2</p> @@ -288,62 +286,56 @@ Unique: 2</p>
<div class="sourceCode" id="cb3"><pre class="downlit">
<span class="co"># a helper function to get a random vector with values S, I and R</span>
<span class="co"># with the probabilities 50% - 10% - 40%</span>
<span class="kw">sample_rsi</span> <span class="op">&lt;-</span> <span class="fu">function</span>() {
<span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"S"</span>, <span class="st">"I"</span>, <span class="st">"R"</span>),
size = <span class="fl">5000</span>,
prob = <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="fl">0.5</span>, <span class="fl">0.1</span>, <span class="fl">0.4</span>),
replace = <span class="fl">TRUE</span>)
}
<span class="va">sample_rsi</span> <span class="op">&lt;-</span> <span class="kw">function</span><span class="op">(</span><span class="op">)</span> <span class="op">{</span>
<span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</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">"S"</span>, <span class="st">"I"</span>, <span class="st">"R"</span><span class="op">)</span>,
size <span class="op">=</span> <span class="fl">5000</span>,
prob <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="fl">0.5</span>, <span class="fl">0.1</span>, <span class="fl">0.4</span><span class="op">)</span>,
replace <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
<span class="op">}</span>
<span class="kw">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(rifampicin = <span class="fu">sample_rsi</span>(),
isoniazid = <span class="fu">sample_rsi</span>(),
gatifloxacin = <span class="fu">sample_rsi</span>(),
ethambutol = <span class="fu">sample_rsi</span>(),
pyrazinamide = <span class="fu">sample_rsi</span>(),
moxifloxacin = <span class="fu">sample_rsi</span>(),
kanamycin = <span class="fu">sample_rsi</span>())
</pre></div>
<span class="va">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>rifampicin <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
isoniazid <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
gatifloxacin <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
ethambutol <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
pyrazinamide <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
moxifloxacin <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
kanamycin <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span><span class="op">)</span></pre></div>
<p>Because all column names are automatically verified for valid drug names or codes, this would have worked exactly the same:</p>
<div class="sourceCode" id="cb4"><pre class="downlit">
<span class="kw">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(RIF = <span class="fu">sample_rsi</span>(),
INH = <span class="fu">sample_rsi</span>(),
GAT = <span class="fu">sample_rsi</span>(),
ETH = <span class="fu">sample_rsi</span>(),
PZA = <span class="fu">sample_rsi</span>(),
MFX = <span class="fu">sample_rsi</span>(),
KAN = <span class="fu">sample_rsi</span>())
</pre></div>
<span class="va">my_TB_data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>RIF <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
INH <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
GAT <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
ETH <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
PZA <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
MFX <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span>,
KAN <span class="op">=</span> <span class="fu">sample_rsi</span><span class="op">(</span><span class="op">)</span><span class="op">)</span></pre></div>
<p>The data set now looks like this:</p>
<div class="sourceCode" id="cb5"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(<span class="kw">my_TB_data</span>)
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span>
<span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span>
<span class="co"># 1 R S S R S I</span>
<span class="co"># 2 I S S S I R</span>
<span class="co"># 3 R R R R R R</span>
<span class="co"># 4 R I S R S S</span>
<span class="co"># 5 S S I S S R</span>
<span class="co"># 1 R S S R R S</span>
<span class="co"># 2 I R S R S I</span>
<span class="co"># 3 R R S S S S</span>
<span class="co"># 4 R R S I S S</span>
<span class="co"># 5 S I R S R S</span>
<span class="co"># 6 S S S R S S</span>
<span class="co"># kanamycin</span>
<span class="co"># 1 R</span>
<span class="co"># 1 S</span>
<span class="co"># 2 S</span>
<span class="co"># 3 R</span>
<span class="co"># 4 R</span>
<span class="co"># 3 S</span>
<span class="co"># 4 S</span>
<span class="co"># 5 S</span>
<span class="co"># 6 R</span>
</pre></div>
<span class="co"># 6 R</span></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb6"><pre class="downlit">
<span class="fu"><a href="../reference/mdro.html">mdro</a></span>(<span class="kw">my_TB_data</span>, guideline = <span class="st">"TB"</span>)
</pre></div>
<span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">my_TB_data</span>, guideline <span class="op">=</span> <span class="st">"TB"</span><span class="op">)</span></pre></div>
<p>or its shortcut <code><a href="../reference/mdro.html">mdr_tb()</a></code>:</p>
<div class="sourceCode" id="cb7"><pre class="downlit">
<span class="kw">my_TB_data</span><span class="op">$</span><span class="kw">mdr</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdr_tb</a></span>(<span class="kw">my_TB_data</span>)
<span class="co"># NOTE: No column found as input for `col_mo`, assuming all records contain Mycobacterium tuberculosis.</span>
</pre></div>
<span class="va">my_TB_data</span><span class="op">$</span><span class="va">mdr</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mdro.html">mdr_tb</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span>
<span class="co"># NOTE: No column found as input for `col_mo`, assuming all records contain Mycobacterium tuberculosis.</span></pre></div>
<p>Create a frequency table of the results:</p>
<div class="sourceCode" id="cb8"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="kw">my_TB_data</span><span class="op">$</span><span class="kw">mdr</span>)
</pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">$</span><span class="va">mdr</span><span class="op">)</span></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: factor &gt; ordered (numeric)<br>
Length: 5,000<br>
@ -363,40 +355,40 @@ Unique: 5</p> @@ -363,40 +355,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3225</td>
<td align="right">64.50%</td>
<td align="right">3225</td>
<td align="right">64.50%</td>
<td align="right">3262</td>
<td align="right">65.24%</td>
<td align="right">3262</td>
<td align="right">65.24%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">698</td>
<td align="right">13.96%</td>
<td align="right">3923</td>
<td align="right">78.46%</td>
<td align="right">664</td>
<td align="right">13.28%</td>
<td align="right">3926</td>
<td align="right">78.52%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">581</td>
<td align="right">11.62%</td>
<td align="right">4504</td>
<td align="right">90.08%</td>
<td align="right">609</td>
<td align="right">12.18%</td>
<td align="right">4535</td>
<td align="right">90.70%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">298</td>
<td align="right">5.96%</td>
<td align="right">4802</td>
<td align="right">96.04%</td>
<td align="right">283</td>
<td align="right">5.66%</td>
<td align="right">4818</td>
<td align="right">96.36%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">198</td>
<td align="right">3.96%</td>
<td align="right">182</td>
<td align="right">3.64%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>
@ -418,7 +410,7 @@ Unique: 5</p> @@ -418,7 +410,7 @@ Unique: 5</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

12
docs/articles/MDR_files/header-attrs-2.4/header-attrs.js

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});

262
docs/articles/benchmarks.html

@ -39,7 +39,7 @@ @@ -39,7 +39,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.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
</header><script src="benchmarks_files/header-attrs-2.3/header-attrs.js"></script><script src="benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
</header><script src="benchmarks_files/header-attrs-2.4/header-attrs.js"></script><script src="benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>Benchmarks</h1>
@ -203,106 +203,44 @@ @@ -203,106 +203,44 @@
<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>microbenchmark()</code> runs different input expressions independently of each other and measures their time-to-result.</p>
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="kw">microbenchmark</span> <span class="op">&lt;-</span> <span class="kw">microbenchmark</span>::<span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>
<span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="kw"><a href="https://msberends.github.io/AMR">AMR</a></span>)
<span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="kw"><a href="https://dplyr.tidyverse.org">dplyr</a></span>)
</pre></div>
<span class="va">microbenchmark</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="fu">::</span><span class="va"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></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://msberends.github.io/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></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 <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="downlit">
<span class="kw">S.aureus</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"sau"</span>), <span class="co"># WHONET code</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"stau"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAU"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"staaur"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAAUR"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S aureus"</span>),
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus"</span>), <span class="co"># official taxonomic name</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus (MRSA)"</span>), <span class="co"># additional text</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Sthafilokkockus aaureuz"</span>), <span class="co"># incorrect spelling</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>), <span class="co"># Methicillin Resistant S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"VISA"</span>), <span class="co"># Vancomycin Intermediate S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"VRSA"</span>), <span class="co"># Vancomycin Resistant S. aureus</span>
times = <span class="fl">10</span>)
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span>(<span class="kw">S.aureus</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">2</span>)
<span class="va">S.aureus</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"sau"</span><span class="op">)</span>, <span class="co"># WHONET code</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"stau"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"STAU"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"staaur"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"STAAUR"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"S. aureus"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"S aureus"</span><span class="op">)</span>,
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span><span class="op">)</span>, <span class="co"># official taxonomic name</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus (MRSA)"</span><span class="op">)</span>, <span class="co"># additional text</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"Sthafilokkockus aaureuz"</span><span class="op">)</span>, <span class="co"># incorrect spelling</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"MRSA"</span><span class="op">)</span>, <span class="co"># Methicillin Resistant S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"VISA"</span><span class="op">)</span>, <span class="co"># Vancomycin Intermediate S. aureus</span>
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span><span class="op">(</span><span class="st">"VRSA"</span><span class="op">)</span>, <span class="co"># Vancomycin Resistant S. aureus</span>
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span><span class="op">(</span><span class="va">S.aureus</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">2</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># as.mo("sau") 11.0 12.0 25.0 13.0 14.0 130 10</span>
<span class="co"># as.mo("stau") 210.0 230.0 240.0 250.0 250.0 260 10</span>
<span class="co"># as.mo("STAU") 210.0 210.0 240.0 240.0 260.0 270 10</span>
<span class="co"># as.mo("staaur") 12.0 14.0 22.0 14.0 41.0 43 10</span>
<span class="co"># as.mo("STAAUR") 12.0 12.0 19.0 13.0 14.0 47 10</span>
<span class="co"># as.mo("S. aureus") 26.0 28.0 38.0 30.0 58.0 62 10</span>
<span class="co"># as.mo("S aureus") 28.0 29.0 45.0 52.0 56.0 60 10</span>
<span class="co"># as.mo("Staphylococcus aureus") 2.1 2.2 7.9 2.4 2.6 32 10</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 840.0 880.0 890.0 890.0 890.0 930 10</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 340.0 370.0 390.0 390.0 410.0 490 10</span>
<span class="co"># as.mo("MRSA") 11.0 12.0 16.0 13.0 14.0 44 10</span>
<span class="co"># as.mo("VISA") 19.0 20.0 32.0 22.0 50.0 51 10</span>
<span class="co"># as.mo("VRSA") 18.0 22.0 24.0 22.0 23.0 46 10</span>
</pre></div>
<span class="co"># as.mo("sau") 12.0 13.0 25.0 15.0 40.0 43 10</span>
<span class="co"># as.mo("stau") 210.0 220.0 230.0 230.0 250.0 260 10</span>
<span class="co"># as.mo("STAU") 210.0 210.0 230.0 250.0 250.0 260 10</span>
<span class="co"># as.mo("staaur") 12.0 13.0 24.0 14.0 41.0 42 10</span>
<span class="co"># as.mo("STAAUR") 13.0 13.0 22.0 14.0 39.0 42 10</span>
<span class="co"># as.mo("S. aureus") 27.0 30.0 42.0 41.0 54.0 61 10</span>
<span class="co"># as.mo("S aureus") 24.0 29.0 45.0 43.0 60.0 66 10</span>
<span class="co"># as.mo("Staphylococcus aureus") 2.1 2.5 4.9 2.5 2.9 26 10</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 820.0 860.0 880.0 880.0 900.0 970 10</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 330.0 340.0 370.0 370.0 390.0 420 10</span>
<span class="co"># as.mo("MRSA") 11.0 13.0 22.0 14.0 41.0 44 10</span>
<span class="co"># as.mo("VISA") 21.0 22.0 48.0 47.0 51.0 140 10</span>
<span class="co"># as.mo("VRSA") 19.0 20.0 23.0 21.0 22.0 47 10</span></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-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. It is clear that accepted taxonomic names are extremely fast, but some variations can take up to 500-1000 times as much time.</p>
<p>To improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
@ -312,79 +250,66 @@ @@ -312,79 +250,66 @@
<p>Repetitive results are unique values that are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_name()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<div class="sourceCode" id="cb3"><pre class="downlit">
<span class="co"># take all MO codes from the example_isolates data set</span>
<span class="kw">x</span> <span class="op">&lt;-</span> <span class="kw">example_isolates</span><span class="op">$</span><span class="kw">mo</span> <span class="op">%&gt;%</span>
<span class="va">x</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span><span class="op">$</span><span class="va">mo</span> <span class="op">%&gt;%</span>
<span class="co"># and copy them a thousand times</span>
<span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span>(<span class="fl">1000</span>) <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="co"># then scramble them</span>
<span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span>()
<span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span><span class="op">(</span><span class="op">)</span>
<span class="co"># as the example_isolates has 2,000 rows, we should have 2 million items</span>
<span class="fu"><a href="https://rdrr.io/r/base/length.html">length</a></span>(<span class="kw">x</span>)
<span class="fu"><a href="https://rdrr.io/r/base/length.html">length</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># [1] 2000000</span>
<span class="co"># and how many unique values do we have?</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(<span class="kw">x</span>)
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># [1] 90</span>
<span class="co"># now let's see:</span>
<span class="kw">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="kw">x</span>),
times = <span class="fl">10</span>)
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>,
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># mo_name(x) 131 161 200 168 187 341 10</span>
</pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.168 seconds. You only lose time on your unique input values.</p>
<span class="co"># mo_name(x) 150 154 195 179 197 301 10</span></pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.179 seconds. You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
<a href="#precalculated-results" class="anchor"></a>Precalculated results</h3>
<p>What about precalculated results? If the input is an already precalculated result of a helper function like <code><a href="../reference/mo_property.html">mo_name()</a></code>, it almost doesn’t take any time at all (see ‘C’ below):</p>
<div class="sourceCode" id="cb4"><pre class="downlit">
<span class="kw">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(A = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"STAAUR"</span>),
B = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"S. aureus"</span>),
C = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"Staphylococcus aureus"</span>),
times = <span class="fl">10</span>)
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="co"># Result of one value was guessed with uncertainty. Use mo_uncertainties() to review it.</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"STAAUR"</span><span class="op">)</span>,
B <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"S. aureus"</span><span class="op">)</span>,
C <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span><span class="op">)</span>,
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 6.85 7.05 7.57 7.51 8.05 8.52 10</span>
<span class="co"># B 21.50 21.70 27.40 23.80 25.00 64.70 10</span>
<span class="co"># C 1.75 1.86 1.99 1.93 2.08 2.27 10</span>
</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.0019 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>
<span class="co"># A 7.11 7.23 7.79 7.74 8.46 8.54 10</span>
<span class="co"># B 21.40 21.90 30.40 24.00 25.50 60.00 10</span>
<span class="co"># C 1.97 1.98 2.12 2.05 2.34 2.43 10</span></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.002 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="cb5"><pre class="downlit">
<span class="kw">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(A = <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),
B = <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),
C = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"Staphylococcus aureus"</span>),
D = <span class="fu"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="st">"Staphylococcaceae"</span>),
E = <span class="fu"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="st">"Bacillales"</span>),
F = <span class="fu"><a href="../reference/mo_property.html">mo_class</a></span>(<span class="st">"Bacilli"</span>),
G = <span class="fu"><a href="../reference/mo_property.html">mo_phylum</a></span>(<span class="st">"Firmicutes"</span>),
H = <span class="fu"><a href="../reference/mo_property.html">mo_kingdom</a></span>(<span class="st">"Bacteria"</span>),
times = <span class="fl">10</span>)
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">3</span>)
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span><span class="op">(</span><span class="st">"aureus"</span><span class="op">)</span>,
B <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"Staphylococcus"</span><span class="op">)</span>,
C <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"Staphylococcus aureus"</span><span class="op">)</span>,
D <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_family</a></span><span class="op">(</span><span class="st">"Staphylococcaceae"</span><span class="op">)</span>,
E <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_order</a></span><span class="op">(</span><span class="st">"Bacillales"</span><span class="op">)</span>,
F <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_class</a></span><span class="op">(</span><span class="st">"Bacilli"</span><span class="op">)</span>,
G <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_phylum</a></span><span class="op">(</span><span class="st">"Firmicutes"</span><span class="op">)</span>,
H <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_kingdom</a></span><span class="op">(</span><span class="st">"Bacteria"</span><span class="op">)</span>,
times <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 1.38 1.57 1.60 1.61 1.67 1.71 10</span>
<span class="co"># B 1.55 1.60 1.73 1.63 1.92 2.05 10</span>
<span class="co"># C 1.39 1.50 1.70 1.62 1.84 2.39 10</span>
<span class="co"># D 1.32 1.51 1.59 1.57 1.61 2.04 10</span>
<span class="co"># E 1.34 1.40 1.52 1.53 1.65 1.66 10</span>
<span class="co"># F 1.28 1.53 1.56 1.60 1.66 1.72 10</span>
<span class="co"># G 1.30 1.33 1.59 1.61 1.74 1.98 10</span>
<span class="co"># H 1.31 1.45 1.62 1.55 1.70 2.46 10</span>
</pre></div>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 1.33 1.57 1.70 1.69 1.83 2.18 10</span>
<span class="co"># B 1.62 1.67 5.34 1.70 2.15 36.90 10</span>
<span class="co"># C 1.43 1.55 1.64 1.59 1.70 2.06 10</span>
<span class="co"># D 1.29 1.44 1.53 1.55 1.66 1.70 10</span>
<span class="co"># E 1.31 1.58 1.68 1.65 1.71 2.11 10</span>
<span class="co"># F 1.54 1.61 1.80 1.67 1.86 2.57 10</span>
<span class="co"># G 1.52 1.62 1.73 1.71 1.77 2.04 10</span>
<span class="co"># H 1.40 1.55 1.70 1.65 1.92 2.03 10</span></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> anyway, 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">
@ -392,34 +317,33 @@ @@ -392,34 +317,33 @@
<a href="#results-in-other-languages" class="anchor"></a>Results in other languages</h3>
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions will have a translated result. This almost does’t take extra time:</p>
<div class="sourceCode" id="cb6"><pre class="downlit">
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"en"</span>) <span class="co"># or just mo_name("CoNS") on an English system</span>
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"en"</span><span class="op">)</span> <span class="co"># or just mo_name("CoNS") on an English system</span>
<span class="co"># [1] "Coagulase-negative Staphylococcus (CoNS)"</span>
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"es"</span>) <span class="co"># or just mo_name("CoNS") on a Spanish system</span>
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"es"</span><span class="op">)</span> <span class="co"># or just mo_name("CoNS") on a Spanish system</span>
<span class="co"># [1] "Staphylococcus coagulasa negativo (SCN)"</span>
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"nl"</span>) <span class="co"># or just mo_name("CoNS") on a Dutch system</span>
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"nl"</span><span class="op">)</span> <span class="co"># or just mo_name("CoNS") on a Dutch system</span>
<span class="co"># [1] "Coagulase-negatieve Staphylococcus (CNS)"</span>
<span class="kw">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span>(en = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"en"</span>),
de = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"de"</span>),
nl = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"nl"</span>),
es = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"es"</span>),
it = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"it"</span>),
fr = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"fr"</span>),
pt = <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"CoNS"</span>, language = <span class="st">"pt"</span>),
times = <span class="fl">100</span>)
<span class="fu"><a href="https://docs.ropensci.org/skimr/reference/print.html">print</a></span>(<span class="kw">run_it</span>, unit = <span class="st">"ms"</span>, signif = <span class="fl">4</span>)
<span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu">microbenchmark</span><span class="op">(</span>en <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"en"</span><span class="op">)</span>,
de <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"de"</span><span class="op">)</span>,
nl <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"nl"</span><span class="op">)</span>,
es <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"es"</span><span class="op">)</span>,
it <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"it"</span><span class="op">)</span>,
fr <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span class="op">=</span> <span class="st">"fr"</span><span class="op">)</span>,
pt <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span><span class="op">(</span><span class="st">"CoNS"</span>, language <span