<!-- Generated by pkgdown: do not edit by hand --><htmllang="en"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><metaname="description"content="CleanupexistingSIRvalues,orinterpretminimuminhibitoryconcentration(MIC)valuesanddiskdiffusiondiametersaccordingtoEUCASTorCLSI.as.sir()transformstheinputtoanewclasssir,whichisanorderedfactorcontainingthelevelsS,SDD,I,R,NI.
All breakpoints used for interpretation are available in our clinical_breakpoints data set."><title>Translate MIC and Disk Diffusion to SIR, or Clean Existing SIR Data — as.sir • AMR (for R)</title><!-- favicons --><linkrel="icon"type="image/png"sizes="16x16"href="../favicon-16x16.png"><linkrel="icon"type="image/png"sizes="32x32"href="../favicon-32x32.png"><linkrel="apple-touch-icon"type="image/png"sizes="180x180"href="../apple-touch-icon.png"><linkrel="apple-touch-icon"type="image/png"sizes="120x120"href="../apple-touch-icon-120x120.png"><linkrel="apple-touch-icon"type="image/png"sizes="76x76"href="../apple-touch-icon-76x76.png"><linkrel="apple-touch-icon"type="image/png"sizes="60x60"href="../apple-touch-icon-60x60.png"><scriptsrc="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><linkhref="../deps/bootstrap-5.3.1/bootstrap.min.css"rel="stylesheet"><scriptsrc="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><linkhref="../deps/Lato-0.4.9/font.css"rel="stylesheet"><linkhref="../deps/Fira_Code-0.4.9/font.css"rel="stylesheet"><!-- Font Awesome icons --><linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css"integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk="crossorigin="anonymous"><linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css"integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw="crossorigin="anonymous"><!-- bootstrap-toc --><scriptsrc="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js"integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo="crossorigin="anonymous"></script><!-- headroom.js --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js"integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js"integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4="crossorigin="anonymous"></script><!-- clipboard.js --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js"integrity="sha512-7O5pXpc0oCRrxk8RUfDYFgn0nO1t+jLuIOQdOMRp4APB7uZ4vSjspzp5y6YDtDs4VzUSTbWzBFZ/LKJhnyFOKw=="crossorigin="anonymous"referrerpolicy="no-referrer"></script><!-- search --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js"integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A=="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js"integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg=="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js"integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww=="crossorigin="anonymous"></script><!-- pkgdown --><scriptsrc="../pkgdown.js"></script><linkhref="../extra.css"rel="stylesheet"><scriptsrc="../extra.js"></script><metaproperty="og:title"content="Translate MIC and Disk Diffusion to SIR, or Clean Existing SIR Data — as.sir"><metaproperty="og:description"content="CleanupexistingSIRvalues,orinterpretminimuminhibitoryconcentration(MIC)valuesanddiskdiffusiondiametersaccordingtoEUCASTorCLSI.as.sir()transformstheinputtoanewclasssir,whichisanorderedfactorcontainingthelevelsS,SDD,I,R,NI.
All breakpoints used for interpretation are available in our clinical_breakpoints data set."><metaproperty="og:image"content="https://msberends.github.io/AMR/logo.svg"><metaname="twitter:card"content="summary_large_image"><metaname="twitter:creator"content="@msberends"><metaname="twitter:site"content="@msberends"><!-- mathjax --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k="crossorigin="anonymous"></script><scriptsrc="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]>
<p>Clean up existing SIR values, or interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI. <code>as.sir()</code> transforms the input to a new class <code>sir</code>, which is an ordered <ahref="https://rdrr.io/r/base/factor.html"class="external-link">factor</a> containing the levels <code>S</code>, <code>SDD</code>, <code>I</code>, <code>R</code>, <code>NI</code>.</p>
<p>These breakpoints are currently implemented:</p><ul><li><p>For <strong>clinical microbiology</strong>: EUCAST 2011-2024 and CLSI 2011-2024;</p></li>
<li><p>For <strong>veterinary microbiology</strong>: EUCAST 2021-2024 and CLSI 2019-2024;</p></li>
<li><p>ECOFFs (Epidemiological cut-off values): EUCAST 2020-2024 and CLSI 2022-2024.</p></li>
<span> mo <spanclass="op">=</span><spanclass="cn">NULL</span>,</span>
<span> ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/deparse.html"class="external-link">deparse</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://rdrr.io/r/base/substitute.html"class="external-link">substitute</a></span><spanclass="op">(</span><spanclass="va">x</span><spanclass="op">)</span><spanclass="op">)</span>,</span>
<span> mo <spanclass="op">=</span><spanclass="cn">NULL</span>,</span>
<span> ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/deparse.html"class="external-link">deparse</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://rdrr.io/r/base/substitute.html"class="external-link">substitute</a></span><spanclass="op">(</span><spanclass="va">x</span><spanclass="op">)</span><spanclass="op">)</span>,</span>
<p>For interpretations of minimum inhibitory concentration (MIC) values and disk diffusion diameters:</p><ul><li><p><strong>CLSI M39: Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data</strong>, 2011-2024, <em>Clinical and Laboratory Standards Institute</em> (CLSI). <ahref="https://clsi.org/standards/products/microbiology/documents/m39/"class="external-link">https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p></li>
<li><p><strong>CLSI M100: Performance Standard for Antimicrobial Susceptibility Testing</strong>, 2011-2024, <em>Clinical and Laboratory Standards Institute</em> (CLSI). <ahref="https://clsi.org/standards/products/microbiology/documents/m100/"class="external-link">https://clsi.org/standards/products/microbiology/documents/m100/</a>.</p></li>
<li><p><strong>CLSI VET01: Performance Standards for Antimicrobial Disk and Dilution Susceptibility Tests for Bacteria Isolated From Animals</strong>, 2019-2024, <em>Clinical and Laboratory Standards Institute</em> (CLSI). <ahref="https://clsi.org/standards/products/veterinary-medicine/documents/vet01//"class="external-link">https://clsi.org/standards/products/veterinary-medicine/documents/vet01//</a>.</p></li>
<li><p><strong>EUCAST Breakpoint tables for interpretation of MICs and zone diameters</strong>, 2011-2024, <em>European Committee on Antimicrobial Susceptibility Testing</em> (EUCAST). <ahref="https://www.eucast.org/clinical_breakpoints"class="external-link">https://www.eucast.org/clinical_breakpoints</a>.</p></li>
<li><p><strong>WHONET</strong> as a source for machine-reading clinical breakpoints ((read more here)https://msberends.github.io/AMR/reference/clinical_breakpoints.html#imported-from-whonet), 1989-2024, <em>WHO Collaborating Centre for Surveillance of Antimicrobial Resistance</em>. <ahref="https://whonet.org/"class="external-link">https://whonet.org/</a>.</p></li>
<dd><p>vector of values (for class <code><ahref="as.mic.html">mic</a></code>: MIC values in mg/L, for class <code><ahref="as.disk.html">disk</a></code>: a disk diffusion radius in millimetres)</p></dd>
<dd><p>for using on a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>: names of columns to apply <code>as.sir()</code> on (supports tidy selection such as <code>column1:column4</code>). Otherwise: arguments passed on to methods.</p></dd>
<dd><p>a case-independent <ahref="https://rdrr.io/r/base/regex.html"class="external-link">regular expression</a> to translate input to this result. This regular expression will be run <em>after</em> all non-letters and whitespaces are removed from the input.</p></dd>
<dd><p>a vector (or column name) with <ahref="https://rdrr.io/r/base/character.html"class="external-link">character</a>s that can be coerced to valid microorganism codes with <code><ahref="as.mo.html">as.mo()</a></code>, can be left empty to determine it automatically</p></dd>
<dd><p>a vector (or column name) with <ahref="https://rdrr.io/r/base/character.html"class="external-link">character</a>s that can be coerced to a valid antimicrobial drug code with <code><ahref="as.ab.html">as.ab()</a></code></p></dd>
<dd><p>defaults to EUCAST 2024 (the latest implemented EUCAST guideline in the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set), but can be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_guideline</a></code>. Currently supports EUCAST (2011-2024) and CLSI (2011-2024), see <em>Details</em>.</p></dd>
<dd><p>(Urinary Tract Infection) a vector (or column name) with <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.sir()</code> on a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, this can also be a column containing <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a>s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See <em>Examples</em>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that MIC values starting with <code>">"</code> (but not <code>">="</code>) must always return "R" , and that MIC values starting with <code>"<"</code> (but not <code>"<="</code>) must always return "S"</p></dd>
<dd><p><em>(only useful when using a EUCAST guideline)</em> a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in <em>Klebsiella</em> species. Determination is based on the <ahref="intrinsic_resistant.html">intrinsic_resistant</a> data set, that itself is based on <ahref="https://www.eucast.org/expert_rules_and_expected_phenotypes"class="external-link">'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3</a> (2021).</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a> to be used for interpretation, which defaults to the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set (same column names and column types). Please note that the <code>guideline</code> argument will be ignored when <code>reference_data</code> is manually set.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that clinical breakpoints for screening are allowed - the default is <code>FALSE</code>. Can also be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_include_screening</a></code>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is <code>TRUE</code>. Can also be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_include_PKPD</a></code>.</p></dd>
<dd><p>the type of breakpoints to use, either "ECOFF", "animal", or "human". ECOFF stands for Epidemiological Cut-Off values. The default is <code>"human"</code>, which can also be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_breakpoint_type</a></code>. If <code>host</code> is set to values of veterinary species, this will automatically be set to <code>"animal"</code>.</p></dd>
<dt>host</dt>
<dd><p>a vector (or column name) with <ahref="https://rdrr.io/r/base/character.html"class="external-link">character</a>s to indicate the host. Only useful for veterinary breakpoints, as it requires <code>breakpoint_type = "animal"</code>. The values can be any text resembling the animal species, even in any of the 20 supported languages of this package. For foreign languages, be sure to set the language with <code><ahref="translate.html">set_AMR_locale()</a></code> (though it will be automatically guessed based on the system language).</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that all notes should be printed during interpretation of MIC values or disk diffusion values.</p></dd>
<dd><p>column name of the names or codes of the microorganisms (see <code><ahref="as.mo.html">as.mo()</a></code>) - the default is the first column of class <code><ahref="as.mo.html">mo</a></code>. Values will be coerced using <code><ahref="as.mo.html">as.mo()</a></code>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate whether previously stored results should be forgotten after returning the 'logbook' with results</p></dd>
<p><em>Note: The clinical breakpoints in this package were validated through, and imported from, <ahref="https://whonet.org"class="external-link">WHONET</a>. The public use of this <code>AMR</code> package has been endorsed by both CLSI and EUCAST. See <ahref="clinical_breakpoints.html">clinical_breakpoints</a> for more information.</em></p><divclass="section">
<p>The <code>as.sir()</code> function can work in four ways:</p><ol><li><p>For <strong>cleaning raw / untransformed data</strong>. The data will be cleaned to only contain valid values, namely: <strong>S</strong> for susceptible, <strong>I</strong> for intermediate or 'susceptible, increased exposure', <strong>R</strong> for resistant, <strong>NI</strong> for non-interpretable, and <strong>SDD</strong> for susceptible dose-dependent. Each of these can be set using a <ahref="https://rdrr.io/r/base/regex.html"class="external-link">regular expression</a>. Furthermore, <code>as.sir()</code> will try its best to clean with some intelligence. For example, mixed values with SIR interpretations and MIC values such as <code>"<0.25; S"</code> will be coerced to <code>"S"</code>. Combined interpretations for multiple test methods (as seen in laboratory records) such as <code>"S; S"</code> will be coerced to <code>"S"</code>, but a value like <code>"S; I"</code> will return <code>NA</code> with a warning that the input is invalid.</p></li>
<li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><ahref="as.mic.html">as.mic()</a></code>, that also gives your columns the new data class <code><ahref="as.mic.html">mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, SIR interpretation can be done very easily with either:</p>
<span><spanclass="va">your_data</span><spanclass="op"><ahref="https://magrittr.tidyverse.org/reference/pipe.html"class="external-link">%>%</a></span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_if</a></span><spanclass="op">(</span><spanclass="va">is.mic</span>, <spanclass="va">as.sir</span>, ab <spanclass="op">=</span><spanclass="st">"column_with_antibiotics"</span>, mo <spanclass="op">=</span><spanclass="st">"column_with_microorganisms"</span><spanclass="op">)</span></span>
<span><spanclass="va">your_data</span><spanclass="op"><ahref="https://magrittr.tidyverse.org/reference/pipe.html"class="external-link">%>%</a></span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_if</a></span><spanclass="op">(</span><spanclass="va">is.mic</span>, <spanclass="va">as.sir</span>, ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/c.html"class="external-link">c</a></span><spanclass="op">(</span><spanclass="st">"cipro"</span>, <spanclass="st">"ampicillin"</span>, <spanclass="va">...</span><spanclass="op">)</span>, mo <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/c.html"class="external-link">c</a></span><spanclass="op">(</span><spanclass="st">"E. coli"</span>, <spanclass="st">"K. pneumoniae"</span>, <spanclass="va">...</span><spanclass="op">)</span><spanclass="op">)</span></span>
<span></span>
<span><spanclass="co"># for veterinary breakpoints, also set `host`:</span></span>
<li><p>Operators like "<=" will be stripped before interpretation. When using <code>conserve_capped_values = TRUE</code>, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (<code>conserve_capped_values = FALSE</code>) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".</p></li>
<li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><ahref="as.disk.html">as.disk()</a></code>, that also gives your columns the new data class <code><ahref="as.disk.html">disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, SIR interpretation can be done very easily with either:</p>
<span><spanclass="va">your_data</span><spanclass="op"><ahref="https://magrittr.tidyverse.org/reference/pipe.html"class="external-link">%>%</a></span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_if</a></span><spanclass="op">(</span><spanclass="va">is.disk</span>, <spanclass="va">as.sir</span>, ab <spanclass="op">=</span><spanclass="st">"column_with_antibiotics"</span>, mo <spanclass="op">=</span><spanclass="st">"column_with_microorganisms"</span><spanclass="op">)</span></span>
<span><spanclass="va">your_data</span><spanclass="op"><ahref="https://magrittr.tidyverse.org/reference/pipe.html"class="external-link">%>%</a></span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_if</a></span><spanclass="op">(</span><spanclass="va">is.disk</span>, <spanclass="va">as.sir</span>, ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/c.html"class="external-link">c</a></span><spanclass="op">(</span><spanclass="st">"cipro"</span>, <spanclass="st">"ampicillin"</span>, <spanclass="va">...</span><spanclass="op">)</span>, mo <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/c.html"class="external-link">c</a></span><spanclass="op">(</span><spanclass="st">"E. coli"</span>, <spanclass="st">"K. pneumoniae"</span>, <spanclass="va">...</span><spanclass="op">)</span><spanclass="op">)</span></span>
<span></span>
<span><spanclass="co"># for veterinary breakpoints, also set `host`:</span></span>
<li><p>For <strong>interpreting a complete data set</strong>, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running <code>as.sir(your_data)</code>.</p></li>
</ol><p><strong>For points 2, 3 and 4: Use <code>sir_interpretation_history()</code></strong> to retrieve a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a> (or <ahref="https://tibble.tidyverse.org/reference/tibble.html"class="external-link">tibble</a> if the <code>tibble</code> package is installed) with all results of the last <code>as.sir()</code> call.</p>
<p>For interpreting MIC values as well as disk diffusion diameters, currently implemented guidelines are for <strong>clinical microbiology</strong>: EUCAST 2011-2024 and CLSI 2011-2024, and for <strong>veterinary microbiology</strong>: EUCAST 2021-2024 and CLSI 2019-2024.</p>
<p>Thus, the <code>guideline</code> argument must be set to e.g., <code>"EUCAST 2024"</code> or <code>"CLSI 2024"</code>. By simply using <code>"EUCAST"</code> (the default) or <code>"CLSI"</code> as input, the latest included version of that guideline will automatically be selected. You can set your own data set using the <code>reference_data</code> argument. The <code>guideline</code> argument will then be ignored.</p>
<p>You can set the default guideline with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_guideline</a></code> (e.g. in your <code>.Rprofile</code> file), such as:</p>
<p>After using <code>as.sir()</code>, you can use the <code><ahref="eucast_rules.html">eucast_rules()</a></code> defined by EUCAST to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
<p>The repository of this package <ahref="https://github.com/msberends/AMR/blob/main/data-raw/clinical_breakpoints.txt"class="external-link">contains a machine-readable version</a> of all guidelines. This is a CSV file consisting of 34 085 rows and 13 columns. This file is machine-readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial drug and the microorganism. <strong>This allows for easy implementation of these rules in laboratory information systems (LIS)</strong>. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed.</p>
<p>The function <code>is.sir()</code> detects if the input contains class <code>sir</code>. If the input is a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, it iterates over all columns and returns a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> vector.</p>
<p>The base R function <code><ahref="https://rdrr.io/r/base/double.html"class="external-link">as.double()</a></code> can be used to retrieve quantitative values from a <code>sir</code> object: <code>"S"</code> = 1, <code>"I"</code>/<code>"SDD"</code> = 2, <code>"R"</code> = 3. All other values are rendered <code>NA</code> . <strong>Note:</strong> Do not use <code><ahref="https://rdrr.io/r/base/integer.html"class="external-link">as.integer()</a></code>, since that (because of how R works internally) will return the factor level indices, and not these aforementioned quantitative values.</p>
<p>The function <code>is_sir_eligible()</code> returns <code>TRUE</code> when a column contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R and/or NI and/or SDD), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> argument. If the input is a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, it iterates over all columns and returns a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> vector.</p>
<p><code>NA_sir_</code> is a missing value of the new <code>sir</code> class, analogous to e.g. base <spanstyle="R">R</span>'s <code><ahref="https://rdrr.io/r/base/NA.html"class="external-link">NA_character_</a></code>.</p>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I, and R as shown below (<ahref="https://www.eucast.org/newsiandr"class="external-link">https://www.eucast.org/newsiandr</a>):</p><ul><li><p><strong>S - Susceptible, standard dosing regimen</strong><br>
A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
A microorganism is categorised as "Susceptible, Increased exposure</em>" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R = Resistant</strong><br>
A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p><ul><li><p><em>Exposure</em> is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.</p></li>
</ul><p>This AMR package honours this insight. Use <code><ahref="proportion.html">susceptibility()</a></code> (equal to <code><ahref="proportion.html">proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code><ahref="count.html">count_susceptible()</a></code> (equal to <code><ahref="count.html">count_SI()</a></code>) to count susceptible isolates.</p>
<h2id="reference-data-publicly-available">Reference Data Publicly Available<aclass="anchor"aria-label="anchor"href="#reference-data-publicly-available"></a></h2>
<p>All data sets in this <code>AMR</code> package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, SAS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit <ahref="https://msberends.github.io/AMR/articles/datasets.html">our website for the download links</a>. The actual files are of course available on <ahref="https://github.com/msberends/AMR/tree/main/data-raw"class="external-link">our GitHub repository</a>.</p>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 1</span> 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 2</span> 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 3</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 4</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 5</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 6</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 7</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 8</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 9</span> 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;">10</span> 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA </span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://rdrr.io/r/base/summary.html"class="external-link">summary</a></span><spanclass="op">(</span><spanclass="va">example_isolates</span><spanclass="op">)</span><spanclass="co"># see all SIR results at a glance</span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_at</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/vars.html"class="external-link">vars</a></span><spanclass="op">(</span><spanclass="va">cipro</span><spanclass="op">:</span><spanclass="va">genta</span><spanclass="op">)</span>, <spanclass="va">as.sir</span>, mo <spanclass="op">=</span><spanclass="st">"E. coli"</span>, uti <spanclass="op">=</span><spanclass="cn">TRUE</span><spanclass="op">)</span></span></span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Returned an empty result, which is unexpected. Are all of mo, ab, and host set and available?</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), CLSI 2024...</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> OK </span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Using dogs breakpoints since cattle for gentamicin (GEN) in Escherichia coli are not available.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Assuming breakpoint_type = "animal", since host is set.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Please note that in the absence of specific veterinary breakpoints for</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> certain animal hosts, breakpoints for dogs, cattle, swine, cats, horse,</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> aquatic, and poultry, in that order, are used as substitutes.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> Interpreting MIC values: 'amoxicillin' (AMX), 'cipro' (CIP, ciprofloxacin),</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> 'tobra' (TOB, tobramycin), and 'genta' (GEN, gentamicin) based on column</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Using dogs breakpoints since cattle for gentamicin (GEN) in Escherichia coli are not available.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Assuming breakpoint_type = "animal", since host is set.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Please note that in the absence of specific veterinary breakpoints for</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> certain animal hosts, breakpoints for dogs, cattle, swine, cats, horse,</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> aquatic, and poultry, in that order, are used as substitutes.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> Interpreting MIC values: 'antibiotic' (TESTAB, test Antibiotic), CLSI</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Breakpoints for nitrofurantoin (NIT) in Escherichia coli are only available for (uncomplicated) urinary tract infections (UTI); assuming uti = TRUE.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Assuming value "urine" in column 'specimen' reflects a urinary tract</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Breakpoints for nitrofurantoin (NIT) in Escherichia coli are only available for (uncomplicated) urinary tract infections (UTI); assuming uti = TRUE.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span>ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> all the details of the breakpoint interpretations.</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), EUCAST 2024...</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> OK </span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin), EUCAST</span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.</span>
<spanclass="r-in"><span> x <spanclass="op">=</span><spanclass="fu"><ahref="as.mic.html">as.mic</a></span><spanclass="op">(</span><spanclass="fl">2</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> mo <spanclass="op">=</span><spanclass="fu"><ahref="as.mo.html">as.mo</a></span><spanclass="op">(</span><spanclass="st">"S. pneumoniae"</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> ab <spanclass="op">=</span><spanclass="st">"AMP"</span>,</span></span>
<spanclass="r-msg co"><spanclass="r-pr">#></span> • Multiple breakpoints available for ampicillin (AMP) in Streptococcus pneumoniae - assuming body site 'Non-meningitis'.</span>
<spanclass="r-in"><span> x <spanclass="op">=</span><spanclass="fu"><ahref="as.disk.html">as.disk</a></span><spanclass="op">(</span><spanclass="fl">18</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> mo <spanclass="op">=</span><spanclass="st">"Strep pneu"</span>, <spanclass="co"># `mo` will be coerced with as.mo()</span></span></span>
<spanclass="r-in"><span> ab <spanclass="op">=</span><spanclass="st">"ampicillin"</span>, <spanclass="co"># and `ab` with as.ab()</span></span></span>
<spanclass="r-wrn co"><spanclass="r-pr">#></span><spanclass="warning">Warning: </span>in as.sir(): 3 results in column '30' truncated (38%) that were invalid</span>
<spanclass="r-in"><span><spanclass="fu"><ahref="plot.html">plot</a></span><spanclass="op">(</span><spanclass="va">sir_data</span><spanclass="op">)</span><spanclass="co"># for percentages</span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://rdrr.io/r/graphics/barplot.html"class="external-link">barplot</a></span><spanclass="op">(</span><spanclass="va">sir_data</span><spanclass="op">)</span><spanclass="co"># for frequencies</span></span></span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 1</span> 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 2</span> 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 3</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 4</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 5</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 6</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 7</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 8</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 9</span> 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;">10</span> 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA </span>
<p><code>AMR</code> (for R). Free and open-source, licenced under the <atarget="_blank"href="https://github.com/msberends/AMR/blob/main/LICENSE"class="external-link">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <atarget="_blank"href="https://www.rug.nl"class="external-link">University of Groningen</a> and <atarget="_blank"href="https://www.umcg.nl"class="external-link">University Medical Center Groningen</a> in The Netherlands.</p>