2019-01-11 20:37:23 +01:00
<!DOCTYPE html>
2019-10-13 09:31:58 +02:00
<!-- Generated by pkgdown: do not edit by hand --> < html lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< meta charset = "utf-8" >
2019-01-11 20:37:23 +01:00
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > Benchmarks • AMR (for R)< / title >
2019-10-13 09:31:58 +02:00
<!-- favicons --> < link rel = "icon" type = "image/png" sizes = "16x16" href = "../favicon-16x16.png" >
2019-01-11 20:37:23 +01:00
< link rel = "icon" type = "image/png" sizes = "32x32" href = "../favicon-32x32.png" >
2019-10-13 09:31:58 +02:00
< link rel = "apple-touch-icon" type = "image/png" sizes = "180x180" href = "../apple-touch-icon.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "120x120" href = "../apple-touch-icon-120x120.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "76x76" href = "../apple-touch-icon-76x76.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "60x60" href = "../apple-touch-icon-60x60.png" >
2020-04-13 21:09:56 +02:00
<!-- jquery --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity = "sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin = "anonymous" > < / script > <!-- Bootstrap --> < link href = "https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css" rel = "stylesheet" crossorigin = "anonymous" >
2020-04-17 19:16:30 +02:00
< script src = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity = "sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin = "anonymous" > < / script > <!-- bootstrap - toc --> < link rel = "stylesheet" href = "../bootstrap-toc.css" >
< script src = "../bootstrap-toc.js" > < / script > <!-- Font Awesome icons --> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity = "sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin = "anonymous" >
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity = "sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin = "anonymous" >
<!-- clipboard.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity = "sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin = "anonymous" > < / script > <!-- headroom.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity = "sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity = "sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin = "anonymous" > < / script > <!-- pkgdown --> < link href = "../pkgdown.css" rel = "stylesheet" >
2020-02-23 20:56:11 +01:00
< script src = "../pkgdown.js" > < / script > < link href = "../extra.css" rel = "stylesheet" >
2019-10-13 09:31:58 +02:00
< script src = "../extra.js" > < / script > < meta property = "og:title" content = "Benchmarks" >
2020-04-13 21:09:56 +02:00
< meta property = "og:description" content = "AMR" >
2020-07-09 14:12:11 +02:00
< meta property = "og:image" content = "https://msberends.github.io/AMR/logo.svg" >
2019-10-13 09:31:58 +02:00
<!-- mathjax --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity = "sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity = "sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin = "anonymous" > < / script > <!-- [if lt IE 9]>
2019-01-11 20:37:23 +01:00
< script src = "https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js" > < / script >
< script src = "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" > < / script >
<![endif]-->
2019-10-13 09:31:58 +02:00
< / head >
2020-04-17 19:16:30 +02:00
< body data-spy = "scroll" data-target = "#toc" >
2019-01-11 20:37:23 +01:00
< div class = "container template-article" >
2019-10-13 09:31:58 +02:00
< header > < div class = "navbar navbar-default navbar-fixed-top" role = "navigation" >
2019-01-11 20:37:23 +01:00
< div class = "container" >
< div class = "navbar-header" >
< button type = "button" class = "navbar-toggle collapsed" data-toggle = "collapse" data-target = "#navbar" aria-expanded = "false" >
< span class = "sr-only" > Toggle navigation< / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< / button >
< span class = "navbar-brand" >
< a class = "navbar-link" href = "../index.html" > AMR (for R)< / a >
2020-08-17 21:49:58 +02:00
< span class = "version label label-default" data-toggle = "tooltip" data-placement = "bottom" title = "Latest development version" > 1.3.0.9005< / span >
2019-01-11 20:37:23 +01:00
< / span >
< / div >
< div id = "navbar" class = "navbar-collapse collapse" >
< ul class = "nav navbar-nav" >
2019-10-13 09:31:58 +02:00
< li >
2019-01-11 20:37:23 +01:00
< a href = "../index.html" >
< span class = "fa fa-home" > < / span >
Home
< / a >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" role = "button" aria-expanded = "false" >
< span class = "fa fa-question-circle" > < / span >
How to
< span class = "caret" > < / span >
< / a >
< ul class = "dropdown-menu" role = "menu" >
2019-10-13 09:31:58 +02:00
< li >
2019-01-11 20:37:23 +01:00
< a href = "../articles/AMR.html" >
< span class = "fa fa-directions" > < / span >
Conduct AMR analysis
< / a >
< / li >
< li >
2019-02-14 10:23:51 +01:00
< a href = "../articles/resistance_predict.html" >
2019-01-11 20:37:23 +01:00
< span class = "fa fa-dice" > < / span >
Predict antimicrobial resistance
< / a >
< / li >
2020-08-17 21:49:58 +02:00
< li >
< a href = "../articles/datasets.html" >
< span class = "fa fa-database" > < / span >
Download our reference data sets for own use
< / a >
< / li >
2020-03-07 21:48:21 +01:00
< li >
< a href = "../articles/PCA.html" >
< span class = "fa fa-compress" > < / span >
Conduct principal component analysis for AMR
< / a >
< / li >
2019-05-23 16:58:59 +02:00
< li >
< a href = "../articles/MDR.html" >
< span class = "fa fa-skull-crossbones" > < / span >
Determine multi-drug resistance (MDR)
< / a >
< / li >
2019-01-29 00:06:50 +01:00
< li >
< a href = "../articles/WHONET.html" >
< span class = "fa fa-globe-americas" > < / span >
Work with WHONET data
< / a >
< / li >
2019-02-14 15:18:17 +01:00
< li >
< a href = "../articles/SPSS.html" >
< span class = "fa fa-file-upload" > < / span >
Import data from SPSS/SAS/Stata
< / a >
< / li >
2019-01-11 20:37:23 +01:00
< li >
< a href = "../articles/EUCAST.html" >
< span class = "fa fa-exchange-alt" > < / span >
Apply EUCAST rules
< / a >
< / li >
< li >
2019-02-14 10:23:51 +01:00
< a href = "../reference/mo_property.html" >
2019-01-11 20:37:23 +01:00
< span class = "fa fa-bug" > < / span >
Get properties of a microorganism
< / a >
< / li >
< li >
2019-05-10 16:44:59 +02:00
< a href = "../reference/ab_property.html" >
2019-01-11 20:37:23 +01:00
< span class = "fa fa-capsules" > < / span >
Get properties of an antibiotic
< / a >
< / li >
< li >
< a href = "../articles/benchmarks.html" >
< span class = "fa fa-shipping-fast" > < / span >
Other: benchmarks
< / a >
< / li >
< / ul >
< / li >
< li >
2020-07-28 18:39:57 +02:00
< a href = "../reference/index.html" >
2019-01-11 20:37:23 +01:00
< span class = "fa fa-book-open" > < / span >
Manual
< / a >
< / li >
< li >
< a href = "../authors.html" >
< span class = "fa fa-users" > < / span >
Authors
< / a >
< / li >
< li >
2020-07-28 18:39:57 +02:00
< a href = "../news/index.html" >
2019-01-11 20:37:23 +01:00
< span class = "far fa far fa-newspaper" > < / span >
Changelog
< / a >
< / li >
< / ul >
2019-10-13 09:31:58 +02:00
< ul class = "nav navbar-nav navbar-right" >
< li >
2020-07-09 14:12:11 +02:00
< a href = "https://github.com/msberends/AMR" >
< span class = "fab fa fab fa-github" > < / span >
2019-01-11 20:37:23 +01:00
Source Code
< / a >
< / li >
< li >
2020-07-28 18:39:57 +02:00
< a href = "../survey.html" >
< span class = "fa fa-clipboard-list" > < / span >
2019-01-11 20:37:23 +01:00
2020-07-28 18:39:57 +02:00
Survey
2019-01-11 20:37:23 +01:00
< / a >
< / li >
< / ul >
2019-10-13 09:31:58 +02:00
< / div >
<!-- /.nav - collapse -->
< / div >
<!-- /.container -->
< / div >
<!-- /.navbar -->
2019-01-11 20:37:23 +01:00
2019-09-23 13:53:50 +02:00
2020-07-09 14:12:11 +02:00
< / header > < script src = "benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js" > < / script > < div class = "row" >
2019-01-11 20:37:23 +01:00
< div class = "col-md-9 contents" >
< div class = "page-header toc-ignore" >
2020-04-17 19:16:30 +02:00
< h1 data-toc-skip > Benchmarks< / h1 >
2019-01-11 20:37:23 +01:00
2020-07-09 14:12:11 +02:00
< small class = "dont-index" > Source: < a href = "https://github.com/msberends/AMR/blob/master/vignettes/benchmarks.Rmd" > < code > vignettes/benchmarks.Rmd< / code > < / a > < / small >
2019-01-11 20:37:23 +01:00
< div class = "hidden name" > < code > benchmarks.Rmd< / code > < / div >
< / div >
2019-10-13 09:31:58 +02:00
< 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 >
2020-05-18 10:30:53 +02:00
< 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 >
2020-08-10 12:46:03 +02:00
< div class = "sourceCode" id = "cb1" > < pre class = "downlit" >
< span class = "kw" > microbenchmark< / span > < span class = "op" > < -< / 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 >
2019-12-20 15:05:58 +01:00
< 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 >
2019-12-20 21:06:39 +01:00
< 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 >
2019-03-06 14:39:02 +01:00
< p > But the calculation time differs a lot:< / p >
2020-08-10 12:46:03 +02:00
< div class = "sourceCode" id = "cb2" > < pre class = "downlit" >
< span class = "kw" > S.aureus< / span > < span class = "op" > < -< / span > < span class = "fu" > microbenchmark< / span > (
2020-04-17 19:16:30 +02:00
< 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 >
< span class = "fu" > < a href = "../reference/as.mo.html" > as.mo< / a > < / span > (< span class = "fl" > 22242419< / span > ), < span class = "co" > # Catalogue of Life ID< / span >
2020-08-10 12:46:03 +02:00
times = < span class = "fl" > 10< / span > )
< span class = "fu" > < a href = "https://rdrr.io/r/base/print.html" > print< / a > < / span > (< span class = "kw" > S.aureus< / span > , unit = < span class = "st" > "ms"< / span > , signif = < span class = "fl" > 2< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # Unit: milliseconds< / span >
2020-08-17 21:49:58 +02:00
< span class = "co" > # expr min lq mean median uq max neval< / span >
< span class = "co" > # as.mo("sau") 8.8 10.0 24 12 38 57 10< / span >
< span class = "co" > # as.mo("stau") 170.0 170.0 180 170 190 210 10< / span >
< span class = "co" > # as.mo("STAU") 160.0 170.0 180 170 200 220 10< / span >
< span class = "co" > # as.mo("staaur") 9.6 10.0 13 11 12 36 10< / span >
< span class = "co" > # as.mo("STAAUR") 10.0 10.0 25 12 34 80 10< / span >
< span class = "co" > # as.mo("S. aureus") 14.0 15.0 21 15 18 47 10< / span >
< span class = "co" > # as.mo("S aureus") 12.0 15.0 21 16 18 45 10< / span >
< span class = "co" > # as.mo("Staphylococcus aureus") 8.9 9.4 15 11 12 37 10< / span >
< span class = "co" > # as.mo("Staphylococcus aureus (MRSA)") 900.0 920.0 940 940 960 1000 10< / span >
< span class = "co" > # as.mo("Sthafilokkockus aaureuz") 410.0 420.0 450 450 470 520 10< / span >
< span class = "co" > # as.mo("MRSA") 8.8 10.0 16 11 12 38 10< / span >
< span class = "co" > # as.mo("VISA") 13.0 16.0 27 19 41 47 10< / span >
< span class = "co" > # as.mo("VRSA") 13.0 16.0 22 18 19 42 10< / span >
< span class = "co" > # as.mo(22242419) 140.0 140.0 150 140 160 170 10< / span >
2020-08-10 12:46:03 +02:00
< / pre > < / div >
2020-02-01 15:09:36 +01:00
< 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.< / p >
2020-08-17 21:49:58 +02:00
< p > To improve performance, two important calculations take almost no time at all: < strong > repetitive results< / strong > and < strong > already precalculated results< / strong > .< / p >
2019-01-11 20:37:23 +01:00
< div id = "repetitive-results" class = "section level3" >
2019-10-13 09:31:58 +02:00
< h3 class = "hasAnchor" >
< a href = "#repetitive-results" class = "anchor" > < / a > Repetitive results< / h3 >
< 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 >
2020-08-17 21:49:58 +02:00
< div class = "sourceCode" id = "cb3" > < pre class = "downlit" >
2020-08-10 12:46:03 +02:00
< span class = "co" > # take all MO codes from the example_isolates data set< / span >
< span class = "kw" > x< / span > < span class = "op" > < -< / span > < span class = "kw" > example_isolates< / span > < span class = "op" > $< / span > < span class = "kw" > mo< / span > < span class = "op" > %> %< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # keep only the unique ones< / span >
2020-08-10 12:46:03 +02:00
< span class = "fu" > < a href = "https://rdrr.io/r/base/unique.html" > unique< / a > < / span > () < span class = "op" > %> %< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # pick 50 of them at random< / span >
2020-08-10 12:46:03 +02:00
< span class = "fu" > < a href = "https://rdrr.io/r/base/sample.html" > sample< / a > < / span > (< span class = "fl" > 50< / span > ) < span class = "op" > %> %< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # paste that 10,000 times< / span >
2020-08-10 12:46:03 +02:00
< span class = "fu" > < a href = "https://rdrr.io/r/base/rep.html" > rep< / a > < / span > (< span class = "fl" > 10000< / span > ) < span class = "op" > %> %< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # scramble it< / span >
2020-07-09 14:12:11 +02:00
< span class = "fu" > < a href = "https://rdrr.io/r/base/sample.html" > sample< / a > < / span > ()
2020-08-10 12:46:03 +02:00
2020-04-17 19:16:30 +02:00
< span class = "co" > # got indeed 50 times 10,000 = half a million?< / span >
2020-08-10 12:46:03 +02:00
< span class = "fu" > < a href = "https://rdrr.io/r/base/length.html" > length< / a > < / span > (< span class = "kw" > x< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # [1] 500000< / span >
< span class = "co" > # and how many unique values do we have?< / span >
2020-08-10 12:46:03 +02:00
< span class = "fu" > < a href = "https://dplyr.tidyverse.org/reference/n_distinct.html" > n_distinct< / a > < / span > (< span class = "kw" > x< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # [1] 50< / span >
< span class = "co" > # now let's see:< / span >
2020-08-10 12:46:03 +02:00
< span class = "kw" > run_it< / span > < span class = "op" > < -< / 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://rdrr.io/r/base/print.html" > print< / a > < / span > (< span class = "kw" > run_it< / span > , unit = < span class = "st" > "ms"< / span > , signif = < span class = "fl" > 3< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # Unit: milliseconds< / span >
< span class = "co" > # expr min lq mean median uq max neval< / span >
2020-08-17 21:49:58 +02:00
< span class = "co" > # mo_name(x) 1810 1850 1980 1940 2130 2230 10< / span >
2020-08-10 12:46:03 +02:00
< / pre > < / div >
2020-08-17 21:49:58 +02:00
< p > So transforming 500,000 values (!!) of 50 unique values only takes 1.94 seconds. You only lose time on your unique input values.< / p >
2019-01-11 20:37:23 +01:00
< / div >
< div id = "precalculated-results" class = "section level3" >
2019-10-13 09:31:58 +02:00
< 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 >
2020-08-17 21:49:58 +02:00
< div class = "sourceCode" id = "cb4" > < pre class = "downlit" >
2020-08-10 12:46:03 +02:00
< span class = "kw" > run_it< / span > < span class = "op" > < -< / span > < span class = "fu" > microbenchmark< / span > (A = < span class = "fu" > < a href = "../reference/mo_property.html" > mo_name< / a > < / span > (< span class = "st" > "B_STPHY_AURS"< / 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 = "fu" > < a href = "https://rdrr.io/r/base/print.html" > print< / a > < / span > (< span class = "kw" > run_it< / span > , unit = < span class = "st" > "ms"< / span > , signif = < span class = "fl" > 3< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # Unit: milliseconds< / span >
2020-08-17 21:49:58 +02:00
< span class = "co" > # expr min lq mean median uq max neval< / span >
< span class = "co" > # A 5.080 5.220 5.81 5.66 6.46 7.16 10< / span >
< span class = "co" > # B 10.000 10.200 14.40 10.60 11.30 49.00 10< / span >
< span class = "co" > # C 0.862 0.875 1.04 1.05 1.14 1.40 10< / span >
2020-08-10 12:46:03 +02:00
< / pre > < / div >
2020-08-17 21:49:58 +02:00
< p > So going from < code > < a href = "../reference/mo_property.html" > mo_name("Staphylococcus aureus")< / a > < / code > to < code > "Staphylococcus aureus"< / code > takes 0.001 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" >
2020-08-10 12:46:03 +02:00
< span class = "kw" > run_it< / span > < span class = "op" > < -< / 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://rdrr.io/r/base/print.html" > print< / a > < / span > (< span class = "kw" > run_it< / span > , unit = < span class = "st" > "ms"< / span > , signif = < span class = "fl" > 3< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # Unit: milliseconds< / span >
2020-08-17 21:49:58 +02:00
< span class = "co" > # expr min lq mean median uq max neval< / span >
< span class = "co" > # A 0.869 0.889 0.951 0.904 1.010 1.19 10< / span >
< span class = "co" > # B 0.837 0.873 0.977 0.937 1.010 1.36 10< / span >
< span class = "co" > # C 0.869 0.874 1.020 0.921 1.130 1.40 10< / span >
< span class = "co" > # D 0.829 0.858 0.898 0.862 0.873 1.21 10< / span >
< span class = "co" > # E 0.862 0.870 0.983 0.918 1.050 1.36 10< / span >
< span class = "co" > # F 0.841 0.850 0.915 0.867 0.907 1.24 10< / span >
< span class = "co" > # G 0.842 0.851 0.940 0.898 1.000 1.16 10< / span >
< span class = "co" > # H 0.854 0.864 1.030 0.920 1.170 1.60 10< / span >
2020-08-10 12:46:03 +02:00
< / pre > < / div >
2020-02-01 15:09:36 +01:00
< 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 >
2019-01-11 20:37:23 +01:00
< / div >
< div id = "results-in-other-languages" class = "section level3" >
2019-10-13 09:31:58 +02:00
< h3 class = "hasAnchor" >
< a href = "#results-in-other-languages" class = "anchor" > < / a > Results in other languages< / h3 >
2019-02-20 10:38:24 +01:00
< 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 >
2020-08-17 21:49:58 +02:00
< div class = "sourceCode" id = "cb6" > < pre class = "downlit" >
2020-08-10 12:46:03 +02:00
< 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 >
2020-04-17 19:16:30 +02:00
< span class = "co" > # [1] "Coagulase-negative Staphylococcus (CoNS)"< / span >
2020-08-10 12:46:03 +02:00
< 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 >
2020-04-17 19:16:30 +02:00
< span class = "co" > # [1] "Staphylococcus coagulasa negativo (SCN)"< / span >
2020-08-10 12:46:03 +02:00
< 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 >
2020-04-17 19:16:30 +02:00
< span class = "co" > # [1] "Coagulase-negatieve Staphylococcus (CNS)"< / span >
2020-08-10 12:46:03 +02:00
< span class = "kw" > run_it< / span > < span class = "op" > < -< / 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://rdrr.io/r/base/print.html" > print< / a > < / span > (< span class = "kw" > run_it< / span > , unit = < span class = "st" > "ms"< / span > , signif = < span class = "fl" > 4< / span > )
2020-04-17 19:16:30 +02:00
< span class = "co" > # Unit: milliseconds< / span >
2020-08-17 21:49:58 +02:00
< span class = "co" > # expr min lq mean median uq max neval< / span >
< span class = "co" > # en 10.72 11.54 15.34 12.76 13.82 44.53 100< / span >
< span class = "co" > # de 11.47 12.77 17.24 13.60 14.78 55.48 100< / span >
< span class = "co" > # nl 14.58 15.91 19.06 16.96 18.46 46.24 100< / span >
< span class = "co" > # es 11.24 11.96 16.86 13.17 14.70 50.05 100< / span >
< span class = "co" > # it 11.35 12.42 17.79 13.52 16.28 50.31 100< / span >
< span class = "co" > # fr 11.41 12.29 17.08 13.43 15.44 53.91 100< / span >
< span class = "co" > # pt 11.34 12.06 16.23 13.25 14.80 51.96 100< / span >
2020-08-10 12:46:03 +02:00
< / pre > < / div >
2019-01-11 20:37:23 +01:00
< p > Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.< / p >
< / div >
< / div >
2020-04-13 21:09:56 +02:00
< div class = "col-md-3 hidden-xs hidden-sm" id = "pkgdown-sidebar" >
2019-10-13 09:31:58 +02:00
2019-01-11 20:37:23 +01:00
< / div >
< / div >
2019-10-13 09:31:58 +02:00
< footer > < div class = "copyright" >
2020-01-26 20:38:54 +01:00
< p > Developed by < a href = "https://www.rug.nl/staff/m.s.berends/" > Matthijs S. Berends< / a > , < a href = "https://www.rug.nl/staff/c.f.luz/" > Christian F. Luz< / a > , < a href = "https://www.rug.nl/staff/a.w.friedrich/" > Alexander W. Friedrich< / a > , < a href = "https://www.rug.nl/staff/b.sinha/" > Bhanu N. M. Sinha< / a > , < a href = "https://www.rug.nl/staff/c.j.albers/" > Casper J. Albers< / a > , < a href = "https://www.rug.nl/staff/c.glasner/" > Corinna Glasner< / a > .< / p >
2019-01-11 20:37:23 +01:00
< / div >
< div class = "pkgdown" >
2020-08-10 12:46:03 +02:00
< p > Site built with < a href = "https://pkgdown.r-lib.org/" > pkgdown< / a > 1.5.1.9000.< / p >
2019-01-11 20:37:23 +01:00
< / div >
2019-10-13 09:31:58 +02:00
2019-01-11 20:37:23 +01:00
< / footer >
2019-10-13 09:31:58 +02:00
< / div >
2019-01-11 20:37:23 +01:00
2020-02-23 20:56:11 +01:00
< / body >
2019-01-11 20:37:23 +01:00
< / html >