<title>4 AMR - An R Package for Working with Antimicrobial Resistance Data | A New Instrument for Microbial Epidemiology</title>
<metaname="description"content="This is the integral PhD thesis ‘A New Instrument for Microbial Epidemiology’ (DOI 10.33612/diss.177417131) by Matthijs S. Berends, which was defended publicly at the University of Groningen, the Netherlands, on 25 August 2021."/>
<metaname="generator"content="bookdown 0.22 and GitBook 2.6.7"/>
<metaproperty="og:title"content="4 AMR - An R Package for Working with Antimicrobial Resistance Data | A New Instrument for Microbial Epidemiology"/>
<metaproperty="og:description"content="This is the integral PhD thesis ‘A New Instrument for Microbial Epidemiology’ (DOI 10.33612/diss.177417131) by Matthijs S. Berends, which was defended publicly at the University of Groningen, the Netherlands, on 25 August 2021."/>
<metaname="twitter:title"content="4 AMR - An R Package for Working with Antimicrobial Resistance Data | A New Instrument for Microbial Epidemiology"/>
<metaname="twitter:description"content="This is the integral PhD thesis ‘A New Instrument for Microbial Epidemiology’ (DOI 10.33612/diss.177417131) by Matthijs S. Berends, which was defended publicly at the University of Groningen, the Netherlands, on 25 August 2021."/>
<liclass="chapter"data-level="1"data-path="ch01-introduction.html"><ahref="ch01-introduction.html"><iclass="fa fa-check"></i><b>1</b> General Introduction</a>
<liclass="chapter"data-level="1.2.2"data-path="ch01-introduction.html"><ahref="ch01-introduction.html#interpretation-of-raw-results"><iclass="fa fa-check"></i><b>1.2.2</b> Interpretation of raw results</a></li>
<liclass="chapter"data-level="1.3"data-path="ch01-introduction.html"><ahref="ch01-introduction.html#data-analysis-using-r"><iclass="fa fa-check"></i><b>1.3</b> Data analysis using R</a></li>
<liclass="chapter"data-level="1.4"data-path="ch01-introduction.html"><ahref="ch01-introduction.html#setting-for-this-thesis"><iclass="fa fa-check"></i><b>1.4</b> Setting for this thesis</a></li>
<liclass="chapter"data-level="1.5"data-path="ch01-introduction.html"><ahref="ch01-introduction.html#aim-of-this-thesis-and-introduction-to-its-chapters"><iclass="fa fa-check"></i><b>1.5</b> Aim of this thesis and introduction to its chapters</a></li>
<liclass="chapter"data-level="2"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html"><iclass="fa fa-check"></i><b>2</b> Diagnostic Stewardship: Sense or Nonsense?!</a>
<liclass="chapter"data-level="2.1.1"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#case-1"><iclass="fa fa-check"></i><b>2.1.1</b> Case 1</a></li>
<liclass="chapter"data-level="2.1.2"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#case-2"><iclass="fa fa-check"></i><b>2.1.2</b> Case 2</a></li>
</ul></li>
<liclass="chapter"data-level="2.2"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#the-general-concept"><iclass="fa fa-check"></i><b>2.2</b> The general concept</a>
<liclass="chapter"data-level="2.2.2"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#dsp-in-the-microbiological-laboratory"><iclass="fa fa-check"></i><b>2.2.2</b> DSP in the microbiological laboratory</a></li>
<liclass="chapter"data-level="2.2.3"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#dsp-as-process-optimisation"><iclass="fa fa-check"></i><b>2.2.3</b> DSP as process optimisation</a></li>
<liclass="chapter"data-level="2.2.4"data-path="ch02-diagnostic-stewardship.html"><ahref="ch02-diagnostic-stewardship.html#multidisciplinary-aspects-of-dsp-and-infection-management"><iclass="fa fa-check"></i><b>2.2.4</b> Multidisciplinary aspects of DSP and infection management</a></li>
<liclass="chapter"data-level="3"data-path="ch03-introducing-new-method.html"><ahref="ch03-introducing-new-method.html"><iclass="fa fa-check"></i><b>3</b> Introducing a New, Free, and Independent Method for Standardised, Reproducible and Reliable Analyses of Antimicrobial Resistance Data</a>
<liclass="chapter"data-level="3.2"data-path="ch03-introducing-new-method.html"><ahref="ch03-introducing-new-method.html#standardising-amr-data-analysis"><iclass="fa fa-check"></i><b>3.2</b> Standardising AMR data analysis</a></li>
<liclass="chapter"data-level="3.3"data-path="ch03-introducing-new-method.html"><ahref="ch03-introducing-new-method.html#comparison-with-existing-software-methods"><iclass="fa fa-check"></i><b>3.3</b> Comparison with existing software methods</a></li>
<liclass="chapter"data-level="3.4"data-path="ch03-introducing-new-method.html"><ahref="ch03-introducing-new-method.html#user-feedback"><iclass="fa fa-check"></i><b>3.4</b> User feedback</a></li>
<liclass="chapter"data-level="4"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html"><iclass="fa fa-check"></i><b>4</b><code>AMR</code> - An <code>R</code> Package for Working with Antimicrobial Resistance Data</a>
<liclass="chapter"data-level="4.3"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#antimicrobial-resistance-data-transformation"><iclass="fa fa-check"></i><b>4.3</b> Antimicrobial resistance data transformation</a>
<ul>
<liclass="chapter"data-level="4.3.1"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#working-with-taxonomically-valid-microorganism-names"><iclass="fa fa-check"></i><b>4.3.1</b> Working with taxonomically valid microorganism names</a></li>
<liclass="chapter"data-level="4.3.2"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#working-with-antimicrobial-names-or-codes"><iclass="fa fa-check"></i><b>4.3.2</b> Working with antimicrobial names or codes</a></li>
<liclass="chapter"data-level="4.3.3"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#working-with-antimicrobial-susceptibility-test-results"><iclass="fa fa-check"></i><b>4.3.3</b> Working with antimicrobial susceptibility test results</a></li>
<liclass="chapter"data-level="4.3.4"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#interpretative-rules-by-eucast"><iclass="fa fa-check"></i><b>4.3.4</b> Interpretative rules by EUCAST</a></li>
<liclass="chapter"data-level="4.3.5"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#working-with-defined-daily-doses-ddd"><iclass="fa fa-check"></i><b>4.3.5</b> Working with defined daily doses (DDD)</a></li>
<liclass="chapter"data-level="4.4.1"data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#determining-first-isolates"><iclass="fa fa-check"></i><b>4.4.1</b> Determining first isolates</a></li>
<liclass="chapter"data-level=""data-path="ch04-amr-r-package.html"><ahref="ch04-amr-r-package.html#appendix-a-included-data-sets"><iclass="fa fa-check"></i>Appendix A: Included Data Sets</a></li>
</ul></li>
<liclass="chapter"data-level="5"data-path="ch05-radar.html"><ahref="ch05-radar.html"><iclass="fa fa-check"></i><b>5</b> Rapid Analysis of Diagnostic and Antimicrobial Patterns in R (RadaR): Interactive Open-Source Software App for Infection Management and Antimicrobial Stewardship</a>
<liclass="chapter"data-level="5.3.3"data-path="ch05-radar.html"><ahref="ch05-radar.html#development-process"><iclass="fa fa-check"></i><b>5.3.3</b> Development Process</a></li>
<liclass="chapter"data-level="5.4.1"data-path="ch05-radar.html"><ahref="ch05-radar.html#principal-findings"><iclass="fa fa-check"></i><b>5.4.1</b> Principal Findings</a></li>
<liclass="chapter"data-level=""data-path="ch05-radar.html"><ahref="ch05-radar.html#conflicts-of-interests"><iclass="fa fa-check"></i>Conflicts of interests</a></li>
<liclass="chapter"data-level="6"data-path="ch06-radar2.html"><ahref="ch06-radar2.html"><iclass="fa fa-check"></i><b>6</b> Better Antimicrobial Resistance Data Analysis and Reporting in Less Time</a>
<liclass="chapter"data-level="6.2.1"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#study-setup"><iclass="fa fa-check"></i><b>6.2.1</b> Study setup</a></li>
<liclass="chapter"data-level="6.2.2"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#amr-data"><iclass="fa fa-check"></i><b>6.2.2</b> AMR data</a></li>
<liclass="chapter"data-level="6.2.3"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#amr-data-analysis-and-reporting"><iclass="fa fa-check"></i><b>6.2.3</b> AMR data analysis and reporting</a></li>
<liclass="chapter"data-level="6.2.4"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#study-participants"><iclass="fa fa-check"></i><b>6.2.4</b> Study participants</a></li>
<liclass="chapter"data-level="6.2.5"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#study-execution-and-data"><iclass="fa fa-check"></i><b>6.2.5</b> Study execution and data</a></li>
<liclass="chapter"data-level="6.2.6"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#evaluation-and-study-data-analysis"><iclass="fa fa-check"></i><b>6.2.6</b> Evaluation and study data analysis</a></li>
<liclass="chapter"data-level="6.3.1"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#study-participants-1"><iclass="fa fa-check"></i><b>6.3.1</b> Study participants</a></li>
<liclass="chapter"data-level="6.3.2"data-path="ch06-radar2.html"><ahref="ch06-radar2.html#effectiveness-and-accuracy"><iclass="fa fa-check"></i><b>6.3.2</b> Effectiveness and accuracy</a></li>
<liclass="chapter"data-level=""data-path="ch06-radar2.html"><ahref="ch06-radar2.html#conflict-of-interest"><iclass="fa fa-check"></i>Conflict of interest</a></li>
<h1><spanclass="header-section-number">4</span><code>AMR</code> - An <code>R</code> Package for Working with Antimicrobial Resistance Data</h1>
<p>
Accepted in Journal of Statistical Software (ahead of print)
<note>
(as of date of PhD defence: 25 August 2021)
</note>
</p>
<p>Berends MS <sup>1,2</sup>*, Luz CF <sup>2</sup>*, Friedrich AW <sup>2</sup>, Sinha BNM <sup>2</sup>, Albers CJ <sup>3</sup>, Glasner C <sup>2</sup></p>
<olstyle="list-style-type: decimal">
<li>Certe Medical Diagnostics and Advice Foundation, Groningen, the Netherlands</li>
<li>University of Groningen, University Medical Center Groningen, Department of Medical Microbiology and Infection Prevention, Groningen, the Netherlands</li>
<li>University of Groningen, Heymans Institute for Psychological Research, Groningen, the Netherlands</li>
<p>Antimicrobial resistance is an increasing threat to global health. Evidence for this trend is generated in microbiological laboratories through testing microorganisms for resistance against antimicrobial agents. International standards and guidelines are in place for this process as well as for reporting data on (inter-)national levels. However, there is a gap in the availability of standardised and reproducible tools for working with laboratory data to produce the required reports. It is known that extensive efforts in data cleaning and validation are required when working with data from laboratory information systems. Furthermore, the global spread and relevance of antimicrobial resistance demands to incorporate international reference data in the analysis process. In this paper, we introduce the <code>AMR</code> package for<code>R</code> that aims at closing this gap by providing tools to simplify antimicrobial resistance data cleaning and analysis, while incorporating international guidelines and scientifically reliable reference data. The <code>AMR</code> package enables standardised and reproducible antimicrobial resistance analyses, including the application of evidence-based rules, determination of first isolates, translation of various codes for microorganisms and antimicrobial agents, determination of (multi-drug) resistant microorganisms, and calculation of antimicrobial resistance, prevalence and future trends. The <code>AMR</code> package works independently of any laboratory information system and provides several functions to integrate into international workflows (e.g., WHONET software provided by the World Health Organization).</p>
<p>Antimicrobial resistance is a global health problem and of great concern for human medicine, veterinary medicine, and the environment alike. It is associated with significant burdens to both patients and health care systems. Current estimates show the immense dimensions we are already facing, such as claiming at least 50,000 lives due to antimicrobial resistance each year across Europe and the US alone <sup>[1]</sup>. Although estimates for the burden through antimicrobial resistance and their predictions are disputed <sup>[2]</sup> the rising trend is undeniable <sup>[3]</sup>, thus calling for worldwide efforts on tackling this problem.</p>
<p>Surveillance programs and reliable data are key for controlling and streamlining these efforts. Surveillance data of antimicrobial resistance at higher levels (national or international) usually comprise aggregated numbers. The basis of this information is generated and stored at local microbiological laboratories where isolated microorganisms are tested for their susceptibility to a whole range of antimicrobial agents. The efficacy of these agents against microorganisms is nowadays interpreted as follows <sup>[4]</sup>:</p>
<ul>
<li>R (“resistant”) - there is a high likelihood of therapeutic failure;</li>
<li>S (“susceptible, standard dosing regimen”) - there is a high likelihood of therapeutic success using a standard dosing regimen of an antimicrobial agent;</li>
<li>I (“susceptible, increased exposure”) - there is a high likelihood of therapeutic success, but only when exposure to an antimicrobial agent is increased by adjusting the dosing regimen or its concentration at the site of infection.</li>
</ul>
<p>Generally, antimicrobial resistance is defined as the proportion of resistant microorganisms (R) among all tested microorganisms of the same species (R + S + I). Today, the two major guideline institutes to define the international standards on antimicrobial resistance are the European Committee on Antimicrobial Susceptibility Testing (EUCAST) <sup>[5]</sup> and the Clinical and Laboratory Standards Institute (CLSI) <sup>[6]</sup>. The guidelines from these two institutes are adopted by 94% of all countries reporting antimicrobial resistance to the WHO <sup>[7]</sup>.</p>
<p>Although these standardised guidelines are in place on the laboratory level for the data generation process, stored data in laboratory information systems are often not yet suitable for data analysis. Laboratory information systems are often designed to fit billing purposes rather than epidemiological data analysis. Furthermore, (inter-)national surveillance is hindered by inadequate standardisation of epidemiological definitions, different types of samples and data collection, settings included, microbiological testing methods (including susceptibility testing), and data sharing policies <sup>[8]</sup>. The necessity of accurate data analysis in the field of antimicrobial resistance has just recently been further underlined <sup>[9]</sup>. Antimicrobial resistance analyses require a thorough understanding of microbiological tests and their results, the biological taxonomy of microorganisms, the clinical and epidemiological relevance of the results, their pharmaceutical implications, and (inter-)national standards and guidelines for working with and reporting antimicrobial resistance.</p>
<p>Here, we describe the <code>AMR</code> package for<code>R</code><sup>[10]</sup>, which has been developed to standardise clean and reproducible antimicrobial resistance data analyses using international standardised recommendations <sup>[5,6]</sup> while incorporating scientifically reliable reference data about valid laboratory outcome, antimicrobial agents, and the complete biological taxonomy of microorganisms. The <code>AMR</code> package provides solutions and support for these aspects while being independent of underlying laboratory information systems, thereby democratising the analysis process. Developed in<code>R</code> and available on the Comprehensive<code>R</code> Archive Network (CRAN) since February 22nd 2018 <sup>[11]</sup>, the <code>AMR</code> package enables reproducible workflows as described in other fields, such as environmental science <sup>[12]</sup>. The <code>AMR</code> package provides a new technical instrument to aid in curbing the global threat of antimicrobial resistance. Furthermore, local, and regional data in the laboratories can now become relevant in any setting for public health.</p>
<p>While no other packages<code>R</code> package with the purpose of dealing with antimicrobial resistance data are available on CRAN or Bioconductor, the <code>AMR</code> package may be integrated in workflows of related packages. For example, the<code>R</code> Epidemics Consortium (RECON) provides high-quality packages for data analysis in infectious disease outbreaks or epidemics (for example incidence and epicontacts) <sup>[13,14]</sup>. In addition, on the laboratory side the antibioticR package provides approaches to work with disc diffusion zone diameter and minimum inhibitory concentration data from environment samples <sup>[15]</sup>. We aim at providing a comprehensive and standardised toolbox for antimicrobial resistance data processing and analysis, with a focus on microbiological, clinical, and epidemiological purposes that was yet missing.</p>
<p>The following sections describe the functionality of the <code>AMR</code> package according to its core functionalities for transforming, enhancing, and analysing antimicrobial resistance data using scientifically reliable reference data.</p>
<p>Microbiological tests can be performed on different specimens, such as blood or urine samples or nasal swabs. After arrival at the microbiological laboratory, the specimens are traditionally cultured on specific media, such as blood agar. If a microorganism can be isolated from these media, it is tested against several antimicrobial agents. Based on the minimal inhibitory concentration (MIC) of the respective agent and interpretation guidelines, such as guidelines by EUCAST <sup>[5]</sup> and CLSI <sup>[6]</sup>, test results are reported as “resistant” (R), “susceptible” (S) or “susceptible, increased exposure” (I). A typical data structure is illustrated in Table 1 <sup>[5]</sup>.</p>
<pclass="tbl-caption">
Table 1. Example of an antimicrobial resistance report.
<p>The <code>AMR</code> package aims at providing a standardised and automated way of cleaning, transforming, and enhancing these typical data structures (Table 1 and 2), independent of the underlying data source. Processed data would be similar to Table 3 that highlights several package functionalities in the sections below.</p>
<h3><spanclass="header-section-number">4.3.1</span> Working with taxonomically valid microorganism names</h3>
<p>Coercing 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. To this end, the <code>AMR</code> package includes all microbial entries from The Catalogue of Life (<ahref="http://www.catalogueoflife.org"class="uri">http://www.catalogueoflife.org</a>), the most comprehensive and authoritative global index of species currently available <sup>[16]</sup>. It holds essential information on the names, relationships, and distributions of more than 1.9 million species. The integration of it into the <code>AMR</code> package is described in Appendix A.</p>
<p>The <code>as.mo()</code> function makes use of this underlying data to transform a vector of characters to a new class `<code>‘mo’</code> of taxonomically valid microorganism name. The resulting values are microbial IDs, which are human-readable for the trained eye and contain information about the taxonomic kingdom, genus, species, and subspecies (Figure 1).</p>
<imgsrc="images/04-01.jpg"alt="The structure of a typical microbial ID as used in the `AMR` package. An ID consists of two to four elements, separated by an underscore. The first element is the abbreviation of the taxonomic kingdom. The remaining elements consist of abbreviations of the lowest taxonomic levels of every microorganism: genus, species (if available) and subspecies (if available). Abbreviations used for the microbial IDs of microorganism names were created using the base` R` function `abbreviate()`."width="66%"/>
<pclass="caption">
Figure 4.1: The structure of a typical microbial ID as used in the <code>AMR</code> package. An ID consists of two to four elements, separated by an underscore. The first element is the abbreviation of the taxonomic kingdom. The remaining elements consist of abbreviations of the lowest taxonomic levels of every microorganism: genus, species (if available) and subspecies (if available). Abbreviations used for the microbial IDs of microorganism names were created using the base<code>R</code> function <code>abbreviate()</code>.
</p>
</div>
<p>The <code>as.mo()</code> function compares the user input with taxonomically valid microorganism names, rates the matching with a score and returns results based on the highest score. This matching score (<spanclass="math inline">\(m\)</span>), ranging from <spanclass="math inline">\(0\)</span> to <spanclass="math inline">\(1\)</span>, is calculated using the following equation:</p>
<li><spanclass="math inline">\(x\)</span> is the user input;</li>
<li><spanclass="math inline">\(n\)</span> is a taxonomic name (genus, species, and subspecies);</li>
<li><spanclass="math inline">\(l_n\)</span> is the length of <spanclass="math inline">\(n\)</span>;</li>
<li>lev is the Levenshtein distance function <sup>[17]</sup>, which counts any insertion, deletion and substitution as <spanclass="math inline">\(1\)</span> that is needed to change <spanclass="math inline">\(x\)</span> into <spanclass="math inline">\(n\)</span>;</li>
<li><spanclass="math inline">\(p_n\)</span> is the human pathogenic prevalence group of <spanclass="math inline">\(n\)</span>, as described below;</li>
<li><spanclass="math inline">\(k_n\)</span> is the taxonomic kingdom of <spanclass="math inline">\(n\)</span>, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.</li>
</ul>
<p>The grouping into human pathogenic prevalence (<spanclass="math inline">\(p\)</span>) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence <sup>[7,18,19]</sup>. <strong>Group 1</strong> (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is <em>Enterococcus</em>, <em>Staphylococcus</em> or <em>Streptococcus</em>. This group consequently contains all common Gram-negative bacteria, such as <em>Pseudomonas</em> and <em>Legionella</em> and all species within the order Enterobacterales. <strong>Group 2</strong> consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is <em>Absidia</em>, <em>Acremonium</em>, <em>Actinotignum</em>, <em>Alternaria</em>, <em>Anaerosalibacter</em>, <em>Apophysomyces</em>, <em>Arachnia</em>, <em>Aspergillus</em>, <em>Aureobacterium</em>, <em>Aureobasidium</em>, <em>Bacteroides</em>, <em>Basidiobolus</em>, <em>Beauveria</em>, <em>Blastocystis</em>, <em>Branhamella</em>, <em>Calymmatobacterium</em>, <em>Candida</em>, <em>Capnocytophaga</em>, <em>Catabacter</em>, <em>Chaetomium</em>, <em>Chryseobacterium</em>, <em>Chryseomonas</em>, <em>Chrysonilia</em>, <em>Cladophialophora</em>, <em>Cladosporium</em>, <em>Conidiobolus</em>, <em>Cryptococcus</em>, <em>Curvularia</em>, <em>Exophiala</em>, <em>Exserohilum</em>, <em>Flavobacterium</em>, <em>Fonsecaea</em>, <em>Fusarium</em>, <em>Fusobacterium</em>, <em>Hendersonula</em>, <em>Hypomyces</em>, <em>Koserella</em>, <em>Lelliottia</em>, <em>Leptosphaeria</em>, <em>Leptotrichia</em>, <em>Malassezia</em>, <em>Malbranchea</em>, <em>Mortierella</em>, <em>Mucor</em>, <em>Mycocentrospora</em>, <em>Mycoplasma</em>, <em>Nectria</em>, <em>Ochroconis</em>, <em>Oidiodendron</em>, <em>Phoma</em>, <em>Piedraia</em>, <em>Pithomyces</em>, <em>Pityrosporum</em>, <em>Prevotella</em>, <em>Pseudallescheria</em>, <em>Rhizomucor</em>, <em>Rhizopus</em>, <em>Rhodotorula</em>, <em>Scolecobasidium</em>, <em>Scopulariopsis</em>, <em>Scytalidium</em>, <em>Sporobolomyces</em>, <em>Stachybotrys</em>, <em>Stomatococcus</em>, <em>Treponema</em>, <em>Trichoderma</em>, <em>Trichophyton</em>, <em>Trichosporon</em>, <em>Tritirachium</em> or <em>Ureaplasma</em>. <strong>Group 3</strong> consists of all other microorganisms.</p>
<p>This will lead to the effect that e.g., <code>"E. coli"</code> will return the microbial ID of <em>Escherichia coli</em> (<spanclass="math inline">\(m = 0.688\)</span>, a highly prevalent microorganism found in humans) and not <em>Entamoeba coli</em> (<spanclass="math inline">\(m = 0.079\)</span>, a less prevalent microorganism in humans), although the latter would alphabetically come first. The matching score function is for users available as <code>mo_matching_score()</code>.</p>
<p>If any coercion rules are applied, a warning is printed to the console and scores can be reviewed by calling <code>mo_uncertainties()</code>, that prints all other matches with their matching scores. Users can furthermore control the coercion rules by setting the allow_uncertain argument in the <code>as.mo()</code> function. The following values or levels can be used:</p>
<ul>
<li><code>0</code>: no additional rules are applied;</li>
<li><code>1</code>: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;</li>
<li><code>2</code>: allow all of 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;</li>
<li><code>3</code>: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name;</li>
<li><code>TRUE</code> (default): equivalent to <code>2</code>;</li>
<li><code>FALSE</code>: equivalent to <code>0</code>.</li>
</ul>
<p>To support organisation specific microbial IDs, users can specify a custom reference <code>‘data.frame’</code>, by using <code>as.mo(..., reference_df = ...)</code>. This process can also be automated by users with the <code>set_mo_source()</code> function.</p>
<h4><spanclass="header-section-number">4.3.1.1</span> Properties of microorganisms</h4>
<p>The package contains functions to return a specific (taxonomic) property of a microorganism from the <code>microorganisms</code> data set (see Appendix A). Functions that start with <code>mo_*</code> can be used to retrieve the most recently defined taxonomic properties of any microorganism quickly and conveniently. These functions rely on the <code>as.mo()</code> function internally: <code>mo_name()</code>, <code>mo_fullname()</code>, <code>mo_shortname()</code>, <code>mo_subspecies()</code>, <code>mo_species()</code>, <code>mo_genus()</code>, <code>mo_family()</code>, <code>mo_order()</code>, <code>mo_class()</code>, <code>mo_phylum()</code>, <code>mo_kingdom()</code>, <code>mo_type()</code>, <code>mo_gramstain()</code>, <code>mo_ref()</code>, <code>mo_authors()</code>, <code>mo_year()</code>, <code>mo_rank()</code>, <code>mo_taxonomy()</code>, <code>mo_synonyms()</code>, <code>mo_info()</code> and <code>mo_url()</code>. Determination of the Gram stain, by using <code>mo_gramstain()</code>, is based on the taxonomic subkingdom and phylum. According to Cavalier-Smith <sup>[20]</sup>, who defined the subkingdoms Negibacteria and Posibacteria, only the following phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. Bacteria from these phyla are considered Gram-positive - all other bacteria are considered Gram-negative. Gram stains are only relevant for species within the kingdom of Bacteria. For species outside this kingdom, <code>mo_gramstain()</code> will return <code>NA</code>.</p>
<h3><spanclass="header-section-number">4.3.2</span> Working with antimicrobial names or codes</h3>
<p>The <code>AMR</code> package includes the <code>antibiotics</code> data set, which comprises common laboratory information system codes, official names, ATC (Anatomical Therapeutic Chemical) codes, defined daily doses (DDD) and more than 5,000 trade names of 456 antimicrobial agents (see Appendix A). The ATC code system and the reference list for DDDs have been developed and made available by the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC) to standardise pharmaceutical classifications <sup>[21]</sup>. All agents in the <code>antibiotics</code> data set have a unique antimicrobial ID, which is based on abbreviations used by the European Antimicrobial Resistance Surveillance Network (EARS-Net), the largest publicly funded system for antimicrobial resistance surveillance in Europe <sup>[22]</sup>. Furthermore, the <code>AMR</code> package includes the antivirals data seta containing antiviral agents, which is also described in Appendix A.</p>
<h4><spanclass="header-section-number">4.3.2.1</span> Properties of antimicrobial agents</h4>
<p>It is a common task in microbiological data analyses (and other clinical or epidemiological fields) to work with different antimicrobial agents. The <code>AMR</code> package provides several functions to translate inputs such as ATC codes, abbreviations, or names in any direction. Using <code>as.ab()</code>, any input will be transformed to an antimicrobial ID of class <code>‘ab’</code>. Helper functions are available to get specific properties of antimicrobial IDs, such as <code>ab_name()</code> for getting the official name, <code>ab_atc()</code> for the ATC code, or <code>ab_cid()</code> for the CID (Compound ID) used by PubChem <sup>[23]</sup>. Trade names can be also used as input. For example, the input values “Amoxil,” “dispermox,” “amox” and “J01CA04” all return the ID of amoxicillin (AMX):</p>
<h4><spanclass="header-section-number">4.3.2.2</span> Filtering data based on classes of antimicrobial agents</h4>
<p>The application of the ATC classification system also enables grouping of antimicrobial agents for data analyses. Data sets with microbial isolates can be filtered on isolates with specific results for tested antimicrobial agents in a specific antimicrobial class. For example, using <code>filter_carbapenems(result = "R")</code> returns data of all isolates with tested resistance to any of the 14 available antimicrobial agents in in the group of carbapenems according to the <code>antibiotics</code> data set.</p>
<h3><spanclass="header-section-number">4.3.3</span> Working with antimicrobial susceptibility test results</h3>
<p>Minimal inhibitory concentrations (MIC) are susceptibility test results measured by microbiological laboratory equipment to determine at which minimum antimicrobial drug concentration 99.9% of a microorganism is inhibited in growth. These concentrations are often capped at a minimum and maximum, for example ≤0.02 µg/ml and ≥32 µg/ml, respectively. The <code>‘mic’</code> class, an ordered <code>‘factor’</code> containing valid MIC values, keeps these operators while still ordering all possible outcomes correctly so that e.g., “<=0.02” will be considered lower than “0.04.”</p>
<p>Another susceptibility testing method is the use of drug diffusion disks, which are small tablets containing a specified concentration of an antimicrobial agent. These disks are applied onto a solid growth medium or a specific agar plate. After 24 hours of incubation, the diameter of the growth inhibition around a disk can be measured in millimetres with a ruler. The <code>‘disk’</code> class can be used to clean these kinds of measurements, since they should always be valid numeric values between 6 and 50. The supported minima and maxima of valid values for both classes, <code>‘mic’</code> and <code>‘disk’</code>, are displayed in Table 4.</p>
<pclass="tbl-caption">
Table 4. Antimicrobial susceptibility test classes.
<p>The higher the MIC or the smaller the growth inhibition diameter, the more active substance of an antimicrobial agent is needed to inhibit cell growth, i.e.the higher the antimicrobial resistance against the tested antimicrobial agent. At high MICs and small diameters, guidelines interpret the microorganism as “resistant” (R) to the tested antimicrobial agent. At low MICs and wide diameters, guidelines interpret the microorganism as “susceptible” (S) to the tested antimicrobial agent. In between, the microorganism is classified as “susceptible, increased exposure” (I). For these three interpretations the <code>‘rsi’</code> class has been developed. When using <code>as.rsi()</code> on MIC values (of class <code>‘mic’</code>) or disk diffusion diameters (of class <code>‘disk’</code>), the values will be interpreted according to the guidelines from the CLSI or EUCAST (all guidelines between 2011 and 2020 are included in the <code>AMR</code> package) <sup>[24,25]</sup>. Guidelines can be changed by setting the guidelines argument.</p>
<divclass="sourceCode"id="cb2"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb2-1"><ahref="ch04-amr-r-package.html#cb2-1"aria-hidden="true"tabindex="-1"></a><spanclass="co"># Low MIC value</span></span>
<p>When using the <code>as.rsi()</code> function on existing antimicrobial interpretations, it tries to coerce the input to the values “R,” “S” or “I.” These values can in turn be used to calculate the proportion of antimicrobial resistance.</p>
<h3><spanclass="header-section-number">4.3.4</span> Interpretative rules by EUCAST</h3>
<p>Next to supplying guidelines to interpret raw MIC values, EUCAST has developed a set of expert rules to assist clinical microbiologists in the interpretation and reporting of antimicrobial susceptibility tests <sup>[5]</sup>. The rules comprise assistance on intrinsic resistance, exceptional phenotypes, and interpretive rules. The <code>AMR</code> package covers intrinsic resistant and interpretive rules for data transformation and standardisation purposes. The first prevents false susceptibility reporting by providing a list of organisms with known intrinsic resistance to specific antimicrobial agents (e.g., cephalosporin resistance of all enterococci). Interpretative rules apply inference from established resistance mechanisms <sup>[26-29]</sup>. Both groups of rules are based on classic IF THEN statements (e.g., IF Enterococcus spp. resistant to ampicillin THEN also report as resistant to imipenem). Some rules provide assistance for further actions when certain resistance has been detected, i.e., performing additional testing of the isolated microorganism. The <code>AMR</code> package function <code>eucast_rules()</code> can apply all EUCAST rules that do not rely on additional clinical information, such as additional information on patients’ diagnoses. Table 2 and 3 highlight the transformation for the reporting of AMX = S in patient_id = 000003 to the correct report according to EUCAST rules of AMX = R. Of note, however, EUCAST rules overwrite original data to correct for the difference in how antimicrobial agents affect the tested microorganism in vitro (in the laboratory) and in vivo (in the human body). This requires users to closely collaborate with the data source provider to ensure correct versioning, backward compatibility, reproducibility, and taking into account specific local regulation for resistance reporting. Typical scenarios where changes to the original data points apply include in vitro test results indicating susceptibility when resistance in vivo is known. The changes are based on scientific consensus to ensure reliable high-quality reporting of antimicrobial susceptibility results. All changes to the data are printed to the console and can also be reviewed in detail by setting the argument <code>eucast_rules(..., verbose = TRUE)</code>.</p>
<p>EUCAST rules are subject to regular updates which are implemented into the <code>AMR</code> package by the <code>AMR</code> maintenance team shortly after publication. The <code>eucast_rules()</code> function supports versioning of the rules. The arguments version_breakpoints and version_expertrules can be set to current or previous versions. By default, the <code>eucast_rules()</code> function uses the latest implemented version.</p>
<h3><spanclass="header-section-number">4.3.5</span> Working with defined daily doses (DDD)</h3>
<p>DDDs are essential for standardising antimicrobial consumption analysis, for inter-institutional or international comparison. The official DDDs are published by the WHOCC <sup>[36]</sup>. Updates to the official publication are monitored by the <code>AMR</code> maintenance team and implemented in the <code>antibiotics</code> data set included in the <code>AMR</code> package. Other metrics exist such as the recommended daily dose (RDD) or the prescribed daily dose (PDD). However, DDDs are the only metric that is independent of a patient’s disease and therapeutic choices and thus suitable for the <code>AMR</code> package.</p>
<p>Functions from the <code>atc_online_*()</code> family take any text as input that can be coerced with <code>as.ab()</code> (i.e., to class <code>‘ab’</code>). Next, the functions access the WHOCC online registry <sup>[30]</sup> (internet connection required) and download the property defined in the arguments (e.g., administration = “O” or administration = “P” for oral or parenteral administration and property = “ddd” or property = “groups” to get DDD or the group of the selected antimicrobial defined by its ATC code).</p>
<h3><spanclass="header-section-number">4.4.1</span> Determining first isolates</h3>
<p>Determining antimicrobial resistance or susceptibility can be done for a single agent (mono- therapy) or multiple agents (combination therapy). The calculation of antimicrobial resistance statistics is dependent on two prerequisites: the data should only comprise the first isolates and a minimum required number of 30 isolates should be met for every stratum in further analysis <sup>[6]</sup>.</p>
<p>An isolate is a microorganism strain cultivated on specified growth media in a laboratory, so its phenotype can be determined. First isolates are isolates of any species found first in a patient per episode, regardless of the body site or the type of specimen (such as blood or urine) <sup>[6]</sup>. The selection on first isolates (using function <code>first_isolate()</code>) is important to prevent selection bias, as it would lead to overestimated or underestimated resistance to an antimicrobial agent. For example, if a patient is admitted with a multi-drug resistant microorganism and that microorganism is found in five different blood cultures the following week, it would overestimate resistance if all isolates were to be included in the analysis.</p>
<p>The episode in days can be set with the argument episode_days, which defaults to 365 as suggested by the CLSI guideline <sup>[6]</sup>.</p>
<p>Definitions of multi-drug resistant organisms (MDRO) are regulated by national and international expert groups and differ between nations. The <code>AMR</code> package provides the functionality to quickly identify MDROs in a data set using the <code>mdro()</code> function. Guidelines can be set with the argument guideline. At default, it applies the guideline as proposed by Magiorakos <em>et al.</em><sup>[31]</sup>. Their work describes the definitions for bacteria being <code>‘MDR’</code> (multi-drug-resistant), <code>‘XDR’</code> (extensively drug-resistant) or <code>‘PDR’</code> (pan-drug-resistant). These definitions are widely adopted <sup>[32]</sup> and known in the field of medical microbiology.</p>
<p>Other guidelines currently supported are the international EUCAST guideline (guideline = “EUCAST” <sup>[33]</sup>), the international WHO guideline on the management of drug-resistant tuberculosis (guideline = “TB” <sup>[34]</sup>), and the national guidelines of The Netherlands (guideline = “NL” <sup>[35]</sup>), and Germany (guideline = “DE” <sup>[36]</sup>).</p>
<p>Some guidelines require a minimum availability of tested antimicrobial agents per isolate. This is needed to prevent false-negatives, since no reliable determination can be performed on only a few test results. This required minimum defaults to 50%, but can be set by the user with the pct_minimum_classes. Isolates that do not meet this requirement will be skipped for determination and will return <code>NA</code> (not applicable), with an informative warning printed to the console.</p>
<p>The rules are applied per row of the data. The <code>mdro()</code> function automatically identifies the variables containing the microorganism codes and antimicrobial agents based on the <code>guess_ab_col()</code> function. Following the guideline set by the user, it analyses the specific antimicrobial resistance of a microorganism and flags that microorganism accordingly. The outcome is demonstrated in Table 5, where the first row is an MDRO according to the Dutch guidelines <sup>[35]</sup>.</p>
<pclass="tbl-caption">
Table 5. Example of a multi-drug resistant organism (MDRO) in a data set identified by applying Dutch guidelines.
<p>Tuberculosis is a major threat to global health caused by Mycobacterium tuberculosis (MTB) and is one of the top ten causes of death worldwide <sup>[37]</sup>. Exceptional antimicrobial resistance in MTB is therefore of special interest. To this end, the international WHO guideline for the classification of drug resistance in MTB <sup>[34]</sup> is included in the <code>AMR</code> package. The <code>mdr_tb()</code> function is a convenient wrapper around <code>mdro(..., guideline = "TB")</code>, which returns an other ordered <code>‘factor’</code> than other <code>mdro()</code> functions. The output will contain the <code>‘factor’</code> levels <code>‘Negative’</code><<code>‘Mono-resistant’</code><<code>‘Poly-resistant’</code><<code>‘Multi-drug-resistant’</code><<code>‘Extensively drug-resistant’</code>, following the WHO guideline.</p>
<h3><spanclass="header-section-number">4.5.1</span> Calculation of antimicrobial resistance</h3>
<p>The <code>AMR</code> package contains several functions for fast and simple resistance calculations of bacterial or fungal isolates. A minimum number of available isolates is needed for the reliability of the outcome. The CLSI guideline suggests a minimum of 30 available first isolates irrespective of the type of statistical analysis <sup>[6]</sup>. Therefore, this number is used as the default setting for any function in the package that calculates antimicrobial resistance or susceptibility, which can be changed with the minimum argument in all applicable functions.</p>
<p>The <code>AMR</code> package relies on the concept of tidy data <sup>[38]</sup>, although not strictly following its rules (one row per test rather than one row per observation). Function names to calculate the number of available isolates follow these general resistance interpretation standards with <code>count_S()</code>, <code>count_I()</code>, and <code>count_R()</code> respectively. Combinations of antimicrobial resistance interpretations can be counted with <code>count_SI()</code> and <code>count_IR()</code>. All these functions take a vector of interpretations of the class <code>‘rsi’</code> (as discussed above) or are internally transformed with <code>as.rsi()</code>. The returned value is the sum of the respective interpretation in the selected test column. All <code>count_*()</code> functions support quasi-quotation with pipes, grouped variables, and can be used with <code>dplyr::summarise()</code><sup>[39]</sup>.</p>
<p>Calculation of antimicrobial resistance is carried out by counting the number of first resistant isolates (interpretation of “R”) and dividing it by the number of all first isolates, see Equation 2. This is implemented in the <code>proportion_R()</code> function. To calculate antimicrobial susceptibility, the number of susceptible first isolates (interpretation of “S” and “I”) has to be counted and divided by the number of all first isolates, which is implemented in the <code>proportion_SI()</code> function. For convenience, the <code>resistance()</code> function is an alias of the <code>proportion_R()</code> function, and the <code>susceptibility()</code> function is an alias of the <code>proportion_SI()</code> function.</p>
<p>The functions <code>proportion_R()</code>, <code>proportion_IR()</code>, <code>proportion_I()</code>, <code>proportion_SI()</code>, and <code>proportion_S()</code> follow the same logic as the <code>count_*()</code> functions and all return a vector of class <code>‘double’</code> with a value between 0 and 1. The argument <code>minimum</code> defines the minimal allowed number of available (tested) isolates (default: <code>minimum</code> = 30). Any number below the set minimum will return <code>NA</code> with a warning.</p>
<p>For calculating the proportion (<spanclass="math inline">\(P\)</span>) of antimicrobial resistance or susceptibility to one antimicrobial agent, the following equation is used:</p>
<p>where <spanclass="math inline">\(P\)</span> is the proportion of outcome <spanclass="math inline">\(o\)</span> (that is either “R,” “S,” “I,” or a combination of two of them), where <spanclass="math inline">\(x\)</span> is a character vector of length <spanclass="math inline">\(k\)</span> only consisting of values “R,” “S,” or “I” and <spanclass="math inline">\([x_i \in o]\)</span> is the indicator function, returning <spanclass="math inline">\(1\)</span> if the indicator function is true and <spanclass="math inline">\(0\)</span> otherwise. The denominator must include the collection <spanclass="math inline">\(\{R,S,I\}\)</span> so that ’<code>wrong’</code> elements in <spanclass="math inline">\(x\)</span> (i.e., elements not being “R,” “S,” or “I”) will not be counted. Thus, the theoretical antimicrobial susceptibility of the vector <spanclass="math inline">\(x = \{S,S,I,R,R\}\)</span> is:</p>
<p><spanclass="math display">\[P_{(x, o = \{S, I\})} = \frac{3}{5} = 0.6\]</span></p>
<p>For the proportion of empiric susceptibility (<spanclass="math inline">\(s\)</span>) for more than one antimicrobial agent, the calculation can be carried out in two ways (Table 6).</p>
<pclass="tbl-caption">
Table 6. Example calculation for determining empiric susceptibility (%SI) for more than one antimicrobial agent.
<p>The first method is to count the total number of first isolates where at least one agent was tested as “S” or “I” and divide it by the number of first isolates tested where any of the agents was tested (Equation 4). This method will be used when setting <code>only_all_tested = FALSE</code> in the <code>susceptibility()</code> function:</p>
<p>where <spanclass="math inline">\(x\)</span> is a character vector only consisting of values “R,” “S,” or “I” (i.e., ’<code>agent A’</code>) and <spanclass="math inline">\(y\)</span> is another character vector only consisting of values “R,” “S,” or “I” (i.e., ’<code>agent B’</code>).</p>
<p>The second method is to count the total number of first isolates where at least one agent was tested as “S” or “I” and where all agents were tested divided by the number of first isolates tested where all of the agents were tested (Equation 5). This method will be used when setting <code>only_all_tested = TRUE</code> in the <code>susceptibility()</code> function:</p>
<p>Based on Equation 2, the overall resistance and susceptibility of antimicrobial agents like gentamicin (GEN) and amoxicillin (AMX) can be calculated using the following syntax. The <code>example_isolates</code> data set is an example data set included in the <code>AMR</code> package, see Appendix A. The <code>n_rsi()</code> function is analogous to the <code>n()</code> function of the <code>dplyr</code> package. It counts the number of available isolates, but only includes observations with valid antimicrobial results (i.e., “R,” “S,” or “I”):</p>
<p>This output reads: the resistance to gentamicin of all isolates in the <code>example_isolates</code> data set is <spanclass="math inline">\(P{(x = GEN, o = \{R\})} = 24.6\%\)</span>, based on <spanclass="math inline">\(1855\)</span> out of <spanclass="math inline">\(2000\)</span> available isolates. This means that the susceptibility is <spanclass="math inline">\(P{(x = GEN, o = \{S,I\})} = 75.4\%\)</span>. The susceptibility to amoxicillin is <spanclass="math inline">\(P{(x = AMX, o = \{S,I\})} = 40.4\%\)</span> based on <spanclass="math inline">\(1350\)</span> isolates.</p>
<p>To calculate the effect of combination therapy, i.e., treating patients with multiple agents at the same time, all <code>proportion_*()</code> functions can handle multiple variables as arguments as defined in Equation 4 and 5. For example, to calculate the empiric susceptibility of a combination therapy comprising gentamicin (GEN) and amoxicillin (AMX):</p>
<p>This leads to the conclusion that combining gentamicin with amoxicillin would cover <spanclass="math inline">\(s{(x = GEN, y = AMX)} = 93.2\%\)</span> based on <spanclass="math inline">\(1921\)</span> out of <spanclass="math inline">\(2000\)</span> available isolates, which is <spanclass="math inline">\(17.8\%\)</span> more than when treating with gentamicin alone (<spanclass="math inline">\(P{(x = GEN, o = \{S,I\})} = 75.4\%\)</span>). With these functions, exact calculations can be done to evaluate the empiric success of treating infections with one or more antimicrobial agents.</p>
<p>The <code>AMR</code> package follows the rationale of tidyverse packages as authored by Wickham <em>et al.</em><sup>[40]</sup>. Most functions take a <code>‘data.frame’</code> or <code>‘tibble’</code> as input, support piping (%>%) operations, can work with quasi-quotations, and can be integrated into <code>dplyr</code> workflows, such as <code>mutate()</code> to create new variables and <code>group_by()</code> to group by variables. Although the <code>AMR</code> package integrates well into tidyverse workflows, it can also be used with base <code>R</code>only. To this extent, the <code>AMR</code> package was developed to be independent of any other <code>R</code>package to ensure and maintain sustainability.</p>
<p>The <code>AMR</code> package supports multiple languages. Currently supported languages are English, Dutch, French, German, Italian, Portuguese, and Spanish. The system language will be used if the language is supported but can be overwritten with <code>options(AMR_locale = ...)</code>. Multi-language support affects language-dependent output of functions such as <code>mo_name()</code>, <code>mo_gramstain()</code>, <code>mo_type()</code>, and <code>ab_name()</code>.</p>
<p>The <code>AMR</code> package uses S3 classes, object oriented (OO) systems available in R. They allow different types of output based on the user input. The <code>AMR</code> package introduces 5 S3 classes (<code>‘mo’</code>, <code>‘ab’</code>, <code>‘rsi’</code>, <code>‘mic’</code>, and <code>‘disk’</code>) to increase the convenience when working with antimicrobial susceptibility data.</p>
<p>We consider the problem of working with antimicrobial resistance data from three different hospitals between 2011-01-01 and 2020-01-01. After loading the <code>AMR</code> package and additional tidyverse packages to allow transformation and plotting, we load the <code>example_isolates</code>_unclean example data from the <code>AMR</code> package into the global environment and assign it a new name.</p>
<p>The data contains 3,000 observations of 8 variables from 3 hospitals. The “bacteria” variable comprises 12 unique elements. However, they appear to encode the same information in different formats (’<code>E. coli’</code>, ’<code>K. pneumoniae’</code>, ’<code>S. aureus’</code>, ’<code>S. pneumoniae’</code>, ’<code>klepne’</code>, ’<code>strpne’</code>, ’<code>esccol’</code>, ’<code>staaur’</code>, ’<code>Escherichia coli’</code>, ’<code>Staphylococcus aureus’</code>, ’<code>Streptococcus pneumoniae’</code>, ’<code>Klebsiella pneumoniae’</code>). We can use the <code>as.mo()</code> function to standardise the bacterial codes and add a variable with the official scientific name. The correct transformation of the bacterial codes can be reviewed by calling the <code>mo_uncertainties()</code> function.</p>
<divclass="sourceCode"id="cb7"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb7-1"><ahref="ch04-amr-r-package.html#cb7-1"aria-hidden="true"tabindex="-1"></a>data <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<p>In a next step, we can further enrich the data with additional microbial taxonomic data based on the “bacteria” variable, such as Gram-stain and microorganism family.</p>
<divclass="sourceCode"id="cb8"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb8-1"><ahref="ch04-amr-r-package.html#cb8-1"aria-hidden="true"tabindex="-1"></a>data <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<p>The variables “AMX,” “AMC,” “CIP,” and “GEN” contain antimicrobial susceptibility test results. The abbreviations stand for the tested antimicrobial agent. The official names and additional information about the antimicrobial agents can be checked with the <code>ab_info()</code> function from the <code>AMR</code> package.</p>
<p>In a data set containing antimicrobial names or codes (e.g., antimicrobial prescription data), the <code>as.ab()</code> function can be used to transform all values to valid antimicrobial codes. Extra columns with the official name and the defined daily dose (DDD) for intravenous administration could be added using <code>ab_name()</code> and <code>ab_ddd()</code>.</p>
<p>Coming back to the cleaning of the data, the columns for the antimicrobial susceptibility test results (“AMX,” “AMC,” “CIP,” “GEN”) need to be checked to contain only standard values (“R,” “S,” “I”).</p>
<spanid="cb11-10"><ahref="ch04-amr-r-package.html#cb11-10"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 1 < 0.5 S 143</span></span>
<spanid="cb11-11"><ahref="ch04-amr-r-package.html#cb11-11"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 2 I 1105</span></span>
<spanid="cb11-12"><ahref="ch04-amr-r-package.html#cb11-12"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 3 R 4607</span></span>
<spanid="cb11-13"><ahref="ch04-amr-r-package.html#cb11-13"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 4 S 6145</span></span></code></pre></div>
<p>The values contain some mixed values. The <code>as.rsi()</code> function can be used to clean these values and to assign a new class (<code>‘rsi’</code>) for further use of AMR functions.</p>
<divclass="sourceCode"id="cb12"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb12-1"><ahref="ch04-amr-r-package.html#cb12-1"aria-hidden="true"tabindex="-1"></a>data <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<spanid="cb12-13"><ahref="ch04-amr-r-package.html#cb12-13"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 1 S 6288</span></span>
<spanid="cb12-14"><ahref="ch04-amr-r-package.html#cb12-14"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 2 I 1105</span></span>
<spanid="cb12-15"><ahref="ch04-amr-r-package.html#cb12-15"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 3 R 4607</span></span></code></pre></div>
<p>After this transformation, the <code>eucast_rules()</code> function can be applied to apply the latest resistance reporting guidelines.</p>
<divclass="sourceCode"id="cb13"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb13-1"><ahref="ch04-amr-r-package.html#cb13-1"aria-hidden="true"tabindex="-1"></a>data <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<p>The output to the console lists the changes made to data:</p>
<divclass="sourceCode"id="cb14"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb14-1"><ahref="ch04-amr-r-package.html#cb14-1"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> The rules affected 508 out of 3,000 rows, making a total of 657 edits</span></span>
<spanid="cb14-2"><ahref="ch04-amr-r-package.html#cb14-2"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> => added 0 test results</span></span>
<spanid="cb14-4"><ahref="ch04-amr-r-package.html#cb14-4"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> => changed 657 test results</span></span>
<spanid="cb14-5"><ahref="ch04-amr-r-package.html#cb14-5"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 11 test results changed from "S" to "I"</span></span>
<spanid="cb14-6"><ahref="ch04-amr-r-package.html#cb14-6"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 473 test results changed from "S" to "R"</span></span>
<spanid="cb14-7"><ahref="ch04-amr-r-package.html#cb14-7"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 85 test results changed from "I" to "R"</span></span>
<spanid="cb14-8"><ahref="ch04-amr-r-package.html#cb14-8"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 19 test results changed from "I" to "S"</span></span>
<spanid="cb14-9"><ahref="ch04-amr-r-package.html#cb14-9"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 33 test results changed from "R" to "I"</span></span>
<spanid="cb14-10"><ahref="ch04-amr-r-package.html#cb14-10"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> - 36 test results changed from "R" to "S"</span></span></code></pre></div>
<p>The data is now clean and ready for further analysis, for example, the identification of multi-drug resistant microorganisms. In this example, we use the Dutch guideline to determine multi-drug resistance <sup>[35]</sup>.</p>
<divclass="sourceCode"id="cb15"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb15-1"><ahref="ch04-amr-r-package.html#cb15-1"aria-hidden="true"tabindex="-1"></a>data <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<p>According to the Dutch guideline, 484 (395 + 89) multi-drug resistant microorganisms were found in 3,000 tested isolates. No multi-drug resistance was found in Staphylococcus aureus and Streptococcus pneumoniae.</p>
<p>As described in Section 4.4.1, the identification of first isolates is essential for the reporting of resistance patterns. Using the <code>filter_first_isolate()</code> function and <code>proportion_df()</code> in combination with <code>group_by()</code>, we get a complete resistance analysis per hospital, bacteria, first isolate, and tested antimicrobial agent in one call:</p>
<divclass="sourceCode"id="cb16"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb16-1"><ahref="ch04-amr-r-package.html#cb16-1"aria-hidden="true"tabindex="-1"></a>resistance_proportion <spanclass="ot"><-</span> data <spanclass="sc">%>%</span></span>
<spanid="cb16-8"><ahref="ch04-amr-r-package.html#cb16-8"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 1 A Amoxicillin SI 0.5773050</span></span>
<spanid="cb16-9"><ahref="ch04-amr-r-package.html#cb16-9"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 2 A Amoxicillin R 0.4226950</span></span>
<spanid="cb16-10"><ahref="ch04-amr-r-package.html#cb16-10"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 3 A Amoxicillin/clavulanic acid SI 0.8085106</span></span>
<spanid="cb16-11"><ahref="ch04-amr-r-package.html#cb16-11"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 4 A Amoxicillin/clavulanic acid R 0.1914894</span></span>
<spanid="cb16-12"><ahref="ch04-amr-r-package.html#cb16-12"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 5 A Ciprofloxacin SI 0.8042553</span></span>
<spanid="cb16-13"><ahref="ch04-amr-r-package.html#cb16-13"aria-hidden="true"tabindex="-1"></a><spanclass="co">#> 6 A Ciprofloxacin R 0.1957447</span></span></code></pre></div>
<p>From the console we get the information how many first isolates were identified and used in the filter.</p>
<p>From here on, the data is ready for further analysis with functions for plotting (e.g., the <code>ggplot2</code> package <sup>[41]</sup>), AMR extension functions for base <code>R</code>(e.g., <code>summary()</code>, <code>plot()</code>), or <code>AMR</code> helper functions for plotting and basic modelling (e.g., <code>ggplot_rsi()</code>, <code>geom_rsi()</code>, <code>resistance_predict()</code>).</p>
<p>For the first time, a free and open-source software solution is available to cover all aspects of working with antimicrobial resistance data. The <code>AMR</code> package provides functionalities that enable standardised and reproducible workflows from raw laboratory data to publishable results, for research and clinical workflows alike. In the field of clinical microbiology and infectious diseases, research and clinical workflows are closely linked. For example, a performed research study on the prevalence of antimicrobial-resistant bacteria can have direct implications on the choice of antimicrobial agents for the treatment of patients. The <code>AMR</code> package was developed to be used in any research or clinical setting where the data analysis on microorganisms, antimicrobial resistance, antimicrobial agents is required.</p>
<p>Both, researchers and clinicians rely on the data from electronic laboratory information systems (LIS) where laboratory test results are processed, stored, and archived. Although some commercial solutions exist to conduct medical microbiological data analysis, these solutions are not comprehensive enough to apply antimicrobial resistance analysis for any clinical or research setting. Costs of these tools are a further constraint in resource-limited settings. Moreover, researchers and clinicians that require data from multiple LIS sources to be used in multi-center studies experience major barriers which cannot be solved by available commercial solutions.</p>
<p>Firstly, simple codes for microorganisms show substantial differences between different LIS and presumably correct taxonomic names are often misspelled or outdated. We analysed the taxonomic names of bacteria used in reports from seven different public health institutions that perform microbiological diagnostics in the Netherlands and compared them with an official scientific up-to-date source for microbial taxonomy, the Catalogue of Life <sup>[16]</sup>. These institutions cover microbiological diagnostics for hospitals and primary care for 15% of the total Dutch population. All institutions reported outdated taxonomic names with a maximum lag ranging between 34 and 41 years. Given that antimicrobial resistance guidelines are strongly based on the microbial taxonomy (some rules only apply to a specific genus, other rules apply to a specific family), it is crucial that this information is correct and timely updated. All institutions admitted that there was no standard operating procedure to maintain their taxonomic reference data. Implementing and maintaining the taxonomic data for these and other institutions has been challenging, since no common machine-readable, reliable and up-to-date resource for the microbial taxonomy was publicly available. For reliable reference data about antimicrobial agents, this also holds true. The <code>AMR</code> package provides machine-readable reference data files for the complete microbial taxonomy and for more than 500 antimicrobial agents. Using functions starting with <code>mo_*</code> and <code>ab_*</code>, names of microorganisms and antimicrobial agents can be translated between different LIS codes or other forms of text codes for microorganisms and consequently allows to merge data sets from different sites with little effort.</p>
<p>Secondly, antimicrobial resistance interpretation guidelines <sup>[5,6]</sup> and taxonomic definitions of microorganisms are under constant change and are continually published in dedicated peer-reviewed journals. This is further complicated by differences between local, regional, and national guidelines. Yet, comparability and reproducibility across setting and time are key in research and clinics. The <code>AMR</code> package functions <code>eucast_rules()</code> (to apply guidelines to data), <code>mdro()</code> (to check for multi-drug resistance according to guidelines), or <code>first_isolate()</code> (to determine first isolates according to guidelines) address the needs to standardise comparability, and empower data analysts beyond the capabilities of their local LIS. The <code>AMR</code> package can be used as an extra layer of data validation when retrieving raw data from a LIS. Overall, the functionality of the <code>AMR</code> package has the potential to improve data validity in clinical settings, to ease multi-center study workflows, and to foster research reporting practices. The inherent global nature of antimicrobial resistances requires researchers, clinicians, and policy makers to reach beyond the borders of their local laboratory. The <code>AMR</code> package can build the bridge to link these sources and further encourages open science principles through its open-source approach.</p>
<p>The <code>AMR</code> package also has limitations. It does not introduce novel statistical tests or models, nor does it add additional analytical approaches for AMR research. The calculation of the proportion of susceptibility for more than one antimicrobial agent simultaneously (see Section 4.5.1) seems simple but is subject to unclear reporting in clinical practice <sup>[42,43]</sup>. The lack of clearly defined algorithms can lead to the effect that co-resistance rates for more than one antimicrobial agent are dropped altogether <sup>[44]</sup>. The inclusion of isolates that are tested for some agents (only_all_tested = FALSE) or only isolates tested for all agents (only_all_tested = TRUE) can have an imminent clinical impact on patient care, if one combination of antimicrobial agents is preferred over another. Therefore, the <code>AMR</code> package provides different algorithms to standardise this crucial calculation. Unfortunately, unambiguous methodology for determining the right algorithm is lacking in scientific literature. An analysis on the algorithms used in the <code>AMR</code> package and their clinical impact is in preparation.</p>
<p>Reliable information about antimicrobial resistance is vital for clinical decision-making in infectious diseases, since the outcome of local antimicrobial resistance analyses support medical professionals/clinicians in the treatment choices for their patients. Moreover, when this information can be reliably stratified by, for example, year, hospital, and type of patients, new information can lead to new insights for choosing the best antimicrobial therapy for patients suffering from infections. The <code>AMR</code> package enables this by providing all required analysis tools and can therefore empower decision-making in infectious management. The <code>AMR</code> package is already being applied to this end in six hospitals in the Netherlands. The choice of empirical antimicrobial treatment (meaning; choosing the initial therapy at a time of not knowing the infection-causing pathogen) for septic non-post-surgical patients has been altered in at least one Dutch hospital, by analysing antimicrobial resistance data with the <code>AMR</code> package. The clinical effect of this adjustment is being studied at the moment. To improve the quality of such analyses, planned future developments comprise the implementations of an imputation algorithm specifically for antimicrobial agents, and method guidance for applying prediction modelling in a health care setting based on patient-specific properties.</p>
<p>Since the first package release, users from different public and private settings have been suggesting additional functionalities, in particular, the incorporation of country- or time- specific guidelines (e.g., Magiorakos <em>et al.</em><sup>[31]</sup>). This community-centred development will be continued and maintained by researchers at the University Medical Center Groningen and data scientists at Certe Medical Diagnostics and Advice, both non-profit public health organisations located in Groningen, the Netherlands. Moreover, a group of contributors from five different Dutch health care institutions has been formed at the Dutch Association for Medical Microbiology (Nederlandse Vereniging voor Medische Microbiologie - NVMM) that also peer-review major changes to the package, including the implementation of guideline updates. This way, updates required for scientific developments as well as maintaining consistent reproducibility are ensured. Updates to databases and guidelines included in the <code>AMR</code> package are incorporated on a regular and automated basis, while preserving version control. Any function making use of guidelines (e.g., <code>eucast_rules()</code>) refers to the latest implemented version of the guideline by default.</p>
<p>The aim of the <code>AMR</code> package is to provide a comprehensive toolbox of solutions for antimicrobial resistance data processing and analysis on an institution- and country-independent scale for clinical practice and research that are required according to international standards, but were not available to date.</p>
<p>The results in this paper were obtained using <code>R</code>4.0.2 in RStudio 1.3.1093 <sup>[45]</sup> with the <code>AMR</code> package 1.5.0, running under macOS Catalina 10.15.</p>
<p><code>R</code>itself and all packages used are available from the Comprehensive <code>R</code>Archive Network (CRAN) at <ahref="https://CRAN.R-project.org/"class="uri">https://CRAN.R-project.org/</a>. All development versions of the <code>AMR</code> package are available at <ahref="https://github.com/msberends/AMR/"class="uri">https://github.com/msberends/AMR/</a>.</p>
<p>The authors Matthijs S. Berends and Christian F. Luz contributed equally to this publication.</p>
<p>For their contributions to the development of the <code>AMR</code> package, we would like to thank (in alphabetical order) Judith M. Fonville, Erwin E.A. Hassing, Eric H.L.C.M. Hazenberg, Gwen Knight, Annick Lenglet, Bart C. Meijer, Sofia Ny, Rogier P. Schade, Dennis Souverein, and Anthony Underwood.</p>
<p>The development of the <code>AMR</code> package was partly supported by the INTERREG V A (202085) funded project EurHealth-1Health (<ahref="http://www.eurhealth1health.eu"class="uri">http://www.eurhealth1health.eu</a>), part of a Dutch-German cross-border network supported by the European Commission, the Dutch Ministry of Health, Welfare and Sport, the Ministry of Economy, Innovation, Digitalisation and Energy of the German Federal State of North Rhine-Westphalia and the Ministry for National and European Affairs and Regional Development of Lower Saxony.</p>
<p>Furthermore, the <code>AMR</code> package was developed as part of a project funded by the European Commission Horizon 2020 Framework Marie Skłodowska-Curie Actions (grant agreement number: 713660-PRONKJEWAIL-H2020-MSCA-COFUND-2015).</p>
<p>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</p>
<li>O’Neill J. Review on antimicrobial resistance: tackling a crisis for the health and wealth of nations. London: Wellcome Trust; 2014.</li>
<li>De Kraker MEA, Stewardson AJ, Harbarth S. Will 10 million people die a year due to antimicrobial resistance by 2050? PLoS Med 2016;13:e1002184.</li>
<li>Centers for Disease Control and Prevention. AR threats report: antibiotic resistance threats in the United States, 2019. Atlanta: Centers for Disease Control and Prevention; 2019.</li>
<li>The European Committee on Antimicrobial Susceptibility Testing. New definitions of S, I and R from 2019; 2019. <ahref="https://www.eucast.org/newsiandr/"class="uri">https://www.eucast.org/newsiandr/</a>.</li>
<li>Leclercq R, Cantón R, Brown DFJ, Giske CG, Heisig P, MacGowan AP, <em>et al.</em> EUCAST Expert Rules In Antimicrobial Susceptibility Testing. Clin Microbiol Infect 2013;19:141–160.</li>
<li>Clinical and Laboratory Standards Institute. M39-A4, analysis and presentation of cumulative antimicrobial susceptibility test data, 4th edition. Pittsburgh: Clinical and Laboratory Standards Institute; 2014.</li>
<li>World Health Organization. Global antimicrobial resistance surveillance system (GLASS) report: early implementation 2017-2018. Geneva: World Health Organization; 2018.</li>
<li>Tacconelli E, Sifakis F, Harbarth S, Schrijver R, van Mourik M, Voss A, <em>et al.</em> Surveillance for control of antimicrobial resistance. Lancet Infect Dis 2018;18:e99–e106.</li>
<li>Limmathurotsakul D, Dunachie S, Fukuda K, Feasey NA, Okeke IN, Holmes AH, <em>et al.</em> Improving the estimation of the global burden of antimicrobial resistant infections. Lancet Infect Dis 2019;19:e392–8.</li>
<li>R Core Team. R: A language and environment for statistical computing. Vienna: R Foundation for Statistical Computing; 2019.</li>
<li>Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C. AMR: Antimicrobial resistance analysis. R package version 1.5.0; 2020. <ahref="https://CRAN"class="uri">https://CRAN</a>. R-project.org/package=AMR.</li>
<li>Lowndes JSS, Best BD, Scarborough C, Afflerbach JC, Frazier MR, O’Hara CC, <em>et al.</em> Our path to better science in less time using open data science tools. Nat Ecol Evol 2017;1:160.</li>
<li>Jombart T, Kamvar ZN, FitzJohn R, Cai J, Bhatia S, Schumacher J, <em>et al.</em> incidence: compute, handle, plot and model incidence of dated events. R package version 1.7.3; 2020. <ahref="https://doi.org/10.5281/zenodo.2584018"class="uri">https://doi.org/10.5281/zenodo.2584018</a>.</li>
<li>Nagraj V, Jombart T, Randhawa N, Sudre B, Campbell F, Crellen T. epicontacts: handling, visualisation and analysis of epidemiological contacts. R package version 1.1.0 2017. <ahref="https://CRAN.R-project.org/package=epicontacts"class="uri">https://CRAN.R-project.org/package=epicontacts</a>.</li>
<li>Petzoldt T. antbioticR: Analysis of Antibiotic Resistance Data. R package version 0.3.2; 2019. <ahref="https://github.com/tpetzoldt/antibioticR"class="uri">https://github.com/tpetzoldt/antibioticR</a>.</li>
<li>Roskov Y, Ower G, Orrell T, Nicolson D, Bailly N, Kirk PM, <em>et al.</em> Species 2000 & ITIS catalogue of life; 2019. www.catalogueoflife.org/col.</li>
<li>Levenshtein VI.Binary codes capable of correcting deletions, insertions, and reversals. Soviet physics doklady 1966;10:707–710.</li>
<li>De Greeff SC, Mouton JW, Schoffelen AF, Verduin CM (2019). “NethMap 2019: consumption of antimicrobial agents and antimicrobial resistance among medically important bacteria in the Netherlands in 2019/ MARAN 2019: monitoring of antimicrobial resistance and antibiotic usage in animals in the Netherlands in 2019. Bilthoven: Rijksinstituut voor Volksgezondheid en Milieu; 2020.</li>
<li>European Centre for Disease Prevention and Control. European antimicrobial resistance surveillance network (EARS-Net); 2010. <ahref="https://ecdc.europa.eu/en/about-us/partnerships-and-networks/disease-and-laboratory-networks/ears-net"class="uri">https://ecdc.europa.eu/en/about-us/partnerships-and-networks/disease-and-laboratory-networks/ears-net</a>.</li>
<li>Cavalier-Smith T. The neomuran origin of archaebacteria, the negibacterial root of the universal tree and bacterial megaclassification. Int J Syst Evol Microbiol 2002;52:7–76.</li>
<li>WHO Collaborating Centre for Drug Statistics Methodology. Guidelines for ATC classification and DDD assignment 2019. Oslo: WHO Collaborating Centre for Drug Statistics Methodology; 2019.</li>
<li>European Centre for Disease Prevention and Control. Antimicrobial resistance (AMR) reporting protocol 2018. European antimicrobial resistance surveillance network (EARS-Net) surveillance data for 2017. Stockholm: European Centre for Disease Prevention and Control; 2018.</li>
<li>Kim S, Chen J, Cheng T, Gindulyte A, He J, He S, <em>et al.</em> PubChem 2019 update: improved access to chemical data. Nucleic Acids Res 2019;47:D1102–9.</li>
<li>Clinical and Laboratory Standards Institute. Susceptibility testing of infectious agents and evaluation of performance of antimicrobial susceptibility test devices – part 1, 2nd edition. Pittsburgh: Clinical and Laboratory Standards Institute; 2019</li>
<li>The European Committee on Antimicrobial Susceptibility Testing. breakpoint tables for interpretation of mics and zone diameters, version 10.0, 2020; 2020. <ahref="http://www.eucast.org/clinical_breakpoints/"class="uri">http://www.eucast.org/clinical_breakpoints/</a>.</li>
<li>Winstanley T, Courvalin P. Expert systems in clinical microbiology. Clin Microbiol Rev 2011;24:515–556.</li>
<li>Courvalin P. Interpretive reading of antimicrobial susceptibility tests. Molecular analysis and therapeutic interpretation of in vitro tests to improve antibiotic therapy. ASM American Society for Microbiology News 1992;58:368–75.</li>
<li>Courvalin P. Interpretive reading of in vitro antibiotic susceptibility tests (the antibiogramme). Clin Microbiol Infect 1996;2 Suppl 1:S26–34.</li>
<li>Livermore DM, Winstanley TG, Shannon KP. Interpretative reading: recognizing the unusual and inferring resistance mechanisms from resistance phenotypes. J Antimicrob Chemother 2001;48 Suppl 1:87–102.</li>
<li>WHO Collaborating Center for Drug Statistics Methodology. ATC/DDD index; 2019 <ahref="https://www.whocc.no/atc_ddd_index/"class="uri">https://www.whocc.no/atc_ddd_index/</a></li>
<li>Magiorakos A-P, Srinivasan A, Carey RB, Carmeli Y, Falagas ME, Giske CG, <em>et al.</em> Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance. Clin Microbiol Infect 2012;18:268–81.</li>
<li>European Committee on Antimicrobial Susceptibility Testing (2016). EUCAST expert rules, intrinsic resistance and exceptional phenotypes tables. Version 3.1, 2016; 2016. <ahref="http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/"class="uri">http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/</a> Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf.</li>
<li>World Health Organization. Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis. Geneva: World Health Organization; 2014.</li>
<li>Müller J, Voss A, Köck R, Sinha B, Rossen JW, Kaase M, <em>et al.</em> Cross-border comparison of the Dutch and German guidelines on multidrug-resistant Gram-negative microorganisms. Antimicrob Resist Infect Control 2015;4:7.</li>
<li>World Health Organization. Global Tuberculosis Report 2018. Geneva: World Health Organization; 2018.</li>
<li>Wickham H. Tidy data. J Stat Softw 2014;59:1–23.</li>
<li>Wickham H, François R, Henry L, Müller K. dplyr: a grammar of data manipulation. R package version 1.0.2; 2020.</li>
<li>Wickham H, Averick M, Bryan J, Chang W, McGowan L, François R, <em>et al.</em> Welcome to the tidyverse. J Open Source Softw 2019;4:1686.</li>
<li>Wickham H. ggplot2: elegant graphics for data analysis. New York: Springer; 2009.</li>
<li>Schechner V, Temkin E, Harbarth S, Carmeli Y, Schwaber MJ. Epidemiological interpretation of studies examining the effect of antibiotic usage on resistance. Clin Microbiol Rev 2013;26:289–307.</li>
<li>Ma J, Li N, Liu Y, Wang C, Liu X, Chen S, <em>et al.</em> Antimicrobial resistance patterns, clinical features, and risk factors for septic shock and death of nosocomial E. coli bacteremia in adult patients with hematological disease. Medicine 2017;96:e6959.</li>
<li>Baur D, Gladstone BP, Burkert F, Carrara E, Foschi F, Döbele S, <em>et al.</em> Effect of antibiotic stewardship on the incidence of infection and colonisation with antibiotic-resistant bacteria and Clostridium difficile infection: a systematic review and meta-analysis. Lancet Infect Dis 2017;17:990–1001.</li>
<li>RStudio Team. RStudio: integrated development environment for R; 2020. <ahref="http://www.rstudio.com/"class="uri">http://www.rstudio.com/</a>.</li>
<li>WHO Collaborating Centre for Surveillance of Antimicrobial Resistance. WHONET; 2019. <ahref="http://www.whonet.org/"class="uri">http://www.whonet.org/</a></li>
<p>A <code>‘data.frame’</code> containing 67,151 (sub)species with 16 columns comprising their complete microbial taxonomy according to the Catalogue of Life <sup>[16]</sup>. Included microorganisms and their complete taxonomic tree of all included (sub)species from kingdom to subspecies with year of scientific publication and responsible author(s):</p>
<ul>
<li>All 55,415 (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa;</li>
<li>All 9,582 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales;</li>
<li>All 2,153 (sub)species from 47 other relevant genera from the kingdom of Animalia (like Strongyloides and Taenia);</li>
<li>All 12,708 previously accepted names of included (sub)species that have been taxonomically renamed.</li>
</ul>
<p>The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, such as mushrooms). Therefore, not all fungi fit the scope of the <code>AMR</code> package. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (such as all species of Aspergillus, Candida, Cryptococcus, Histoplasma, Pneumocystis, Saccharomyces and Trichophyton).</p></li>
<li><p><code>antibiotics</code></p>
<p>A <code>‘data.frame’</code> containing 456 antibiotic agents with 14 columns. All entries in this data set have three different identifiers: a human readable EARS-Net code (as used by ECDC <sup>[19]</sup> and WHONET <sup>[46]</sup> and primarily used by this package), an ATC code (as used by the WHO <sup>[21]</sup>), and a CID code (Compound ID, as used by PubChem <sup>[23]</sup>). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Other properties in this data set are derived from one or more of these codes, such as official names of pharmacological and chemical subgroups, and defined daily doses (DDD).</p></li>
<li><p><code>antivirals</code></p>
<p>A <code>‘data.frame’</code> containing 102 antiviral agents with 9 columns. Like the <code>antibiotics</code> data set, it contains ATC codes (as used by the WHO <sup>[21]</sup>), and a CID code (Compound ID, as used by PubChem <sup>[23]</sup>), as well as the official name and defined daily dose (DDD) for each antiviral agent.</p></li>
<li><p><code>example_isolates</code></p>
<p>A <code>‘data.frame’</code> containing test results of 2,000 microbial isolates. The data set reflects real patient data and can be used to practice AMR analysis. It is structured in the typical format of laboratory information systems with one row per isolate and one column per tested antimicrobial agent (i.e., an antibiogram).</p></li>
<li><p><code>example_isolates_unclean</code></p>
<p>A <code>‘data.frame’</code> containing test results of 3,000 microbial isolates that require cleaning up before they can be used for analysis. This data set can be used to practice AMR analysis and is featured in section 4.7.</p></li>
<li><p><code>WHONET</code></p>
<p>A `<code>‘data.frame’</code> containing 500 observations and 53 columns, with the exact same structure as an export file from WHONET 2019 software <sup>[46]</sup>. Such files can be used with the <code>AMR</code> package, as this example data set demonstrates. The antibiotic test results are from the <code>example_isolates</code> data set. All patient names are created using online surname generators and are only in place for practice purposes.</p></li>