* Support for LOINC codes in the `antibiotics` data set. Use `ab_loinc()` to retrieve LOINC codes, or use a LOINC code for input in any `ab_*` function:
* Support for LOINC and SNOMED codes
* Support for LOINC codes in the `antibiotics` data set. Use `ab_loinc()` to retrieve LOINC codes, or use a LOINC code for input in any `ab_*` function:
* The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This **allows machine reading these guidelines**, which is currently almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
* Support for SNOMED CT codes in the `microorganisms` data set. Use `mo_snomed()` to retrieve SNOMED codes, or use a SNOMED code for input in any `mo_*` function:
```r
mo_snomed("S. aureus")
#> [1] 115329001 3092008 113961008
mo_name(115329001)
#> [1] "Staphylococcus aureus"
mo_gramstain(115329001)
#> [1] "Gram-positive"
```
* The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This **allows for machine reading these guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
### Changes
### Changes
* Bugfix for some WHONET microorganism codes that were not interpreted correctly when using `as.rsi()`
* Bugfix for some WHONET microorganism codes that were not interpreted correctly when using `as.rsi()`
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using [as.mo()].
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using [as.mo()].
#' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection catalogue_of_life Catalogue of Life
#' @format A [`data.frame`] with 69,447 observations and 16 variables:
#' @format A [`data.frame`] with 69,447 observations and 17 variables:
#' - `mo`\cr ID of microorganism as used by this package
#' - `mo`\cr ID of microorganism as used by this package
#' - `col_id`\cr Catalogue of Life ID
#' - `col_id`\cr Catalogue of Life ID
#' - `fullname`\cr Full name, like `"Escherichia coli"`
#' - `fullname`\cr Full name, like `"Escherichia coli"`
@ -79,6 +79,7 @@
#' - `species_id`\cr ID of the species as used by the Catalogue of Life
#' - `species_id`\cr ID of the species as used by the Catalogue of Life
#' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added"
#' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added"
#' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
#' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
#' - `snomed`\cr SNOMED code of the microorganism. Use [mo_snomed()] to retrieve it quickly, see [mo_property()].
#' @details Manually added were:
#' @details Manually added were:
#' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
#' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
@ -145,7 +146,7 @@ catalogue_of_life <- list(
#' - `gender`\cr gender of the patient
#' - `gender`\cr gender of the patient
#' - `patient_id`\cr ID of the patient
#' - `patient_id`\cr ID of the patient
#' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms]
#' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms]
#' - `PEN:RIF`\cr 40 different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in [antibiotics] data set and can be translated with [ab_name()]
#' - `PEN:RIF`\cr 40 different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in the [antibiotics] data set and can be translated with [ab_name()]
#' @inheritSection AMR Read more on our website!
#' @inheritSection AMR Read more on our website!
"example_isolates"
"example_isolates"
@ -182,9 +183,9 @@ catalogue_of_life <- list(
#' @inheritSection AMR Read more on our website!
#' @inheritSection AMR Read more on our website!
"WHONET"
"WHONET"
#' Data set for RSI interpretation
#' Data set for R/SI interpretation
#'
#'
#' Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use [as.rsi()] to transform MICs or disks measurements to RSI values.
#' Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use [as.rsi()] to transform MICs or disks measurements to R/SI values.
#' @format A [`data.frame`] with 13,975 observations and 9 variables:
#' @format A [`data.frame`] with 13,975 observations and 9 variables:
#' - `guideline`\cr Name of the guideline
#' - `guideline`\cr Name of the guideline
#' - `method`\cr Either "MIC" or "DISK"
#' - `method`\cr Either "MIC" or "DISK"
@ -195,32 +196,7 @@ catalogue_of_life <- list(
#' - `disk_dose`\cr Dose of the used disk diffusion method
#' - `disk_dose`\cr Dose of the used disk diffusion method
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimeters that leads to "S"
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimeters that leads to "S"
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimeters that leads to "R"
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimeters that leads to "R"
#' @details The repository of this `AMR` package contains a file comprising this exact data set: [https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt]. This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
#' @inheritSection AMR Read more on our website!
#' @inheritSection AMR Read more on our website!
"rsi_translation"
"rsi_translation"
# transforms data set to data.frame with only ASCII values, to comply with CRAN policies
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.9.0.9015</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.9.0.9016</span>
</span>
</span>
</div>
</div>
@ -200,7 +200,7 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<ahref="#what-is-amr-for-r"class="anchor"></a>What is <code>AMR</code> (for R)?</h3>
<ahref="#what-is-amr-for-r"class="anchor"></a>What is <code>AMR</code> (for R)?</h3>
<p><em>(<helptitle="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <ahref="./articles/AMR.html">continue reading here to get started</a>.</em></p>
<p><em>(<helptitle="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <ahref="./articles/AMR.html">continue reading here to get started</a>.</em></p>
<p><code>AMR</code> is a free and open-source <ahref="https://www.r-project.org">R package</a> to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. <strong>Our aim is to provide a standard</strong> for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.</p>
<p><code>AMR</code> is a free and open-source <ahref="https://www.r-project.org">R package</a> to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. <strong>Our aim is to provide a standard</strong> for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.</p>
<p>After installing this package, R knows <ahref="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <ahref="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code (including ATC and LOINC), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
<p>After installing this package, R knows <ahref="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <ahref="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code (including ATC, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
<p>We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is <ahref="./news">actively maintained</a> and is free software (see <ahref="#copyright">Copyright</a>).</p>
<p>We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is <ahref="./news">actively maintained</a> and is free software (see <ahref="#copyright">Copyright</a>).</p>
<divclass="main-content">
<divclass="main-content">
<p>
<p>
@ -238,35 +238,25 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<li>Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) (<ahref="./reference/ab_property.html">manual</a>)</li>
<li>Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) (<ahref="./reference/ab_property.html">manual</a>)</li>
<li>Getting SNOMED codes of a microorganism, or get its name associated with a SNOMED code (<ahref="./reference/mo_property.html">manual</a>)</li>
<li>Getting LOINC codes of an antibiotic, or get its name associated with a LOINC code (<ahref="./reference/ab_property.html">manual</a>)</li>
<li>Getting LOINC codes of an antibiotic, or get its name associated with a LOINC code (<ahref="./reference/ab_property.html">manual</a>)</li>
<li>Machine reading the EUCAST and CLSI guidelines from 2011-2019 to translate MIC values and disk diffusion diameters to R/SI (<ahref="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt">link</a>)</li>
<li>Machine reading the EUCAST and CLSI guidelines from 2011-2019 to translate MIC values and disk diffusion diameters to R/SI (<ahref="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt">link</a>)</li>
</ul>
</ul>
<p>This package is ready-to-use for a professional environment by specialists in the following fields:</p>
<p>This package is ready-to-use for specialists in many fields:</p>
<p>Medical Microbiology</p>
<ul>
<ul>
<li>Epidemiologists (both clinical microbiological and research)</li>
<li>Epidemiologists (both clinical microbiological and research)</li>
<li>Research Microbiologists</li>
<li>(Research) Microbiologists</li>
<li>Biomedical Researchers</li>
<li>Biomedical Researchers</li>
<li>Research Pharmacologists</li>
<li>Research Pharmacologists</li>
<li>Data Scientists / Data Analysts</li>
<li>Data Scientists / Data Analysts</li>
</ul>
<li>Statisticians</li>
<p>Veterinary Microbiology</p>
<li>Bioinformaticians</li>
<ul>
<li>Research Veterinarians</li>
<li>Research Veterinarians</li>
<li>Veterinary Epidemiologists</li>
<li>Veterinary Epidemiologists</li>
</ul>
<p>Microbial Ecology</p>
<ul>
<li>Soil Microbiologists</li>
<li>Soil Microbiologists</li>
<li>Extremophile Researchers</li>
<li>Extremophile Researchers</li>
<li>Astrobiologists</li>
<li>Astrobiologists</li>
</ul>
</ul>
<p>Developers</p>
<ul>
<li>Package developers for R</li>
<li>Software developers</li>
<li>Web application / Shiny developers</li>
</ul>
</div>
</div>
<divid="get-this-package"class="section level3">
<divid="get-this-package"class="section level3">
<h3class="hasAnchor">
<h3class="hasAnchor">
@ -338,8 +328,8 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
</ul>
</ul>
</li>
</li>
<li>Use <code><ahref="reference/mdro.html">mdro()</a></code> to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos <em>et al.</em> (2012, <ahref="https://www.ncbi.nlm.nih.gov/pubmed/?term=21793988">PMID 21793988</a>), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.</li>
<li>Use <code><ahref="reference/mdro.html">mdro()</a></code> to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos <em>et al.</em> (2012, <ahref="https://www.ncbi.nlm.nih.gov/pubmed/?term=21793988">PMID 21793988</a>), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.</li>
<li>The <ahref="./reference/microorganisms.html">data set microorganisms</a> contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g.different antibiotics per Gram stain. The package also contains functions to look up values in this data set like <code><ahref="reference/mo_property.html">mo_genus()</a></code>, <code><ahref="reference/mo_property.html">mo_family()</a></code>, <code><ahref="reference/mo_property.html">mo_gramstain()</a></code> or even <code><ahref="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><ahref="reference/as.mo.html">as.mo()</a></code> internally, they also use the same intelligent rules for determination. For example, <code><ahref="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><ahref="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.</li>
<li>The <ahref="./reference/microorganisms.html">data set microorganisms</a> contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g.different antibiotics per Gram stain. The package also contains functions to look up values in this data set like <code><ahref="reference/mo_property.html">mo_genus()</a></code>, <code><ahref="reference/mo_property.html">mo_family()</a></code>, <code><ahref="reference/mo_property.html">mo_gramstain()</a></code> or even <code><ahref="reference/mo_property.html">mo_phylum()</a></code>. Use <code><ahref="reference/mo_property.html">mo_snomed()</a></code> to look up any SNOMED CT code associated with a microorganism. As all these function use <code><ahref="reference/as.mo.html">as.mo()</a></code> internally, they also use the same intelligent rules for determination. For example, <code><ahref="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><ahref="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.</li>
<li>The <ahref="./reference/antibiotics.html">data set antibiotics</a> contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like <code><ahref="reference/ab_property.html">ab_name()</a></code>, <code><ahref="reference/ab_property.html">ab_group()</a></code>, <code><ahref="reference/ab_property.html">ab_atc()</a></code> and <code><ahref="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><ahref="reference/as.ab.html">as.ab()</a></code> internally so they support the same intelligent rules to guess the most probable result. For example, <code><ahref="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><ahref="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><ahref="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
<li>The <ahref="./reference/antibiotics.html">data set antibiotics</a> contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, LOINC code, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like <code><ahref="reference/ab_property.html">ab_name()</a></code>, <code><ahref="reference/ab_property.html">ab_group()</a></code>, <code><ahref="reference/ab_property.html">ab_atc()</a></code>, <code><ahref="reference/ab_property.html">ab_loinc()</a></code> and <code><ahref="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><ahref="reference/as.ab.html">as.ab()</a></code> internally so they support the same intelligent rules to guess the most probable result. For example, <code><ahref="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><ahref="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><ahref="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><ahref="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use a LOINC code for input in any <code>ab_*</code> function:</p>
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><ahref="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use a LOINC code for input in any <code>ab_*</code> function:</p>
<li><p>The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: <ahref="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt"class="uri">https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt</a>. This <strong>allows machine reading these guidelines</strong>, which is currently almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.</p></li>
<li>
<p>Support for SNOMED CT codes in the <code>microorganisms</code> data set. Use <code><ahref="../reference/mo_property.html">mo_snomed()</a></code> to retrieve SNOMED codes, or use a SNOMED code for input in any <code>mo_*</code> function:</p>
<li>The repository of this package now contains a clean version of the EUCAST and CLSI guidelines from 2011-2019 to translate MIC and disk diffusion values to R/SI: <ahref="https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt"class="uri">https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt</a>. This <strong>allows for machine reading these guidelines</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.</li>
</ul>
</ul>
</div>
</div>
<divid="changes"class="section level3">
<divid="changes"class="section level3">
@ -299,9 +312,9 @@
<ul>
<ul>
<li>
<li>
<p>If you were dependent on the old Enterobacteriaceae family e.g.by using in your code:</p>
<p>If you were dependent on the old Enterobacteriaceae family e.g.by using in your code:</p>
<p>Functions <code><ahref="../reference/proportion.html">susceptibility()</a></code> and <code><ahref="../reference/proportion.html">resistance()</a></code> as aliases of <code><ahref="../reference/proportion.html">proportion_SI()</a></code> and <code><ahref="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
<p>Functions <code><ahref="../reference/proportion.html">susceptibility()</a></code> and <code><ahref="../reference/proportion.html">resistance()</a></code> as aliases of <code><ahref="../reference/proportion.html">proportion_SI()</a></code> and <code><ahref="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
<li>Support for a new MDRO guideline: Magiorakos AP, Srinivasan A <em>et al.</em> “Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance.” Clinical Microbiology and Infection (2012).
<li>Support for a new MDRO guideline: Magiorakos AP, Srinivasan A <em>et al.</em> “Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance.” Clinical Microbiology and Infection (2012).
<ul>
<ul>
@ -339,16 +352,16 @@
<li>More intelligent way of coping with some consonants like “l” and “r”</li>
<li>More intelligent way of coping with some consonants like “l” and “r”</li>
<li>
<li>
<p>Added a score (a certainty percentage) to <code><ahref="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <ahref="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a>:</p>
<p>Added a score (a certainty percentage) to <code><ahref="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <ahref="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a>:</p>
<aclass="sourceLine"id="cb5-4" data-line-number="4"><spanclass="co">#> Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<aclass="sourceLine"id="cb6-4" data-line-number="4"><spanclass="co">#> Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<aclass="sourceLine"id="cb5-5" data-line-number="5"><spanclass="co">#> Class 'mo'</span></a>
<aclass="sourceLine"id="cb6-5" data-line-number="5"><spanclass="co">#> Class 'mo'</span></a>
<p>Determination of first isolates now <strong>excludes</strong> all ‘unknown’ microorganisms at default, i.e.microbial code <code>"UNKNOWN"</code>. They can be included with the new parameter <code>include_unknown</code>:</p>
<p>Determination of first isolates now <strong>excludes</strong> all ‘unknown’ microorganisms at default, i.e.microbial code <code>"UNKNOWN"</code>. They can be included with the new parameter <code>include_unknown</code>:</p>
For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of ‘unknown’ microorganisms that were included or excluded.</li>
For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of ‘unknown’ microorganisms that were included or excluded.</li>
<li>
<li>
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
<divclass="sourceCode"id="cb7"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb7-1" data-line-number="1"><spanclass="co"># how it works in base R:</span></a>
<divclass="sourceCode"id="cb8"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb8-1" data-line-number="1"><spanclass="co"># how it works in base R:</span></a>
<aclass="sourceLine"id="cb7-11" data-line-number="11"><spanclass="co">#> invalid microorganism code, NA generated</span></a></code></pre></div>
<aclass="sourceLine"id="cb8-11" data-line-number="11"><spanclass="co">#> invalid microorganism code, NA generated</span></a></code></pre></div>
This is important, because a value like <code>"testvalue"</code> could never be understood by e.g. <code><ahref="../reference/mo_property.html">mo_name()</a></code>, although the class would suggest a valid microbial code.</li>
This is important, because a value like <code>"testvalue"</code> could never be understood by e.g. <code><ahref="../reference/mo_property.html">mo_name()</a></code>, although the class would suggest a valid microbial code.</li>
<li>Function <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <ahref="https://github.com/msberends/clean"><code>clean</code></a> (<ahref="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</li>
<li>Function <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <ahref="https://github.com/msberends/clean"><code>clean</code></a> (<ahref="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
@ -422,55 +435,55 @@ This is important, because a value like <code>"testvalue"</code> could never be
<ul>
<ul>
<li>
<li>
<p>Function <code><ahref="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><ahref="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
<p>Function <code><ahref="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><ahref="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
<aclass="sourceLine"id="cb8-2" data-line-number="2"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `mo` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb9-2" data-line-number="2"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `mo` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb8-4" data-line-number="4"><spanclass="co">#> mo ab S I R total</span></a>
<aclass="sourceLine"id="cb9-4" data-line-number="4"><spanclass="co">#> mo ab S I R total</span></a>
<aclass="sourceLine"id="cb8-5" data-line-number="5"><spanclass="co">#> 1 A. baumannii AMC 0 0 3 3</span></a>
<aclass="sourceLine"id="cb9-5" data-line-number="5"><spanclass="co">#> 1 A. baumannii AMC 0 0 3 3</span></a>
<aclass="sourceLine"id="cb8-6" data-line-number="6"><spanclass="co">#> 2 A. baumannii AMK 0 0 0 0</span></a>
<aclass="sourceLine"id="cb9-6" data-line-number="6"><spanclass="co">#> 2 A. baumannii AMK 0 0 0 0</span></a>
<aclass="sourceLine"id="cb8-7" data-line-number="7"><spanclass="co">#> 3 A. baumannii AMP 0 0 3 3</span></a>
<aclass="sourceLine"id="cb9-7" data-line-number="7"><spanclass="co">#> 3 A. baumannii AMP 0 0 3 3</span></a>
<aclass="sourceLine"id="cb8-8" data-line-number="8"><spanclass="co">#> 4 A. baumannii AMX 0 0 3 3</span></a>
<aclass="sourceLine"id="cb9-8" data-line-number="8"><spanclass="co">#> 4 A. baumannii AMX 0 0 3 3</span></a>
<aclass="sourceLine"id="cb8-9" data-line-number="9"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<aclass="sourceLine"id="cb9-9" data-line-number="9"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<aclass="sourceLine"id="cb8-11" data-line-number="11"><spanclass="co"># change the transformation with the FUN argument to anything you like:</span></a>
<aclass="sourceLine"id="cb9-11" data-line-number="11"><spanclass="co"># change the transformation with the FUN argument to anything you like:</span></a>
<aclass="sourceLine"id="cb8-13" data-line-number="13"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `mo` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb9-13" data-line-number="13"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column `mo` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb8-20" data-line-number="20"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<aclass="sourceLine"id="cb9-20" data-line-number="20"><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<p>You can format this to a printable format, ready for reporting or exporting to e.g.Excel with the base R <code><ahref="https://rdrr.io/r/base/format.html">format()</a></code> function:</p>
<p>You can format this to a printable format, ready for reporting or exporting to e.g.Excel with the base R <code><ahref="https://rdrr.io/r/base/format.html">format()</a></code> function:</p>
<p>Additional way to calculate co-resistance, i.e.when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
<p>Additional way to calculate co-resistance, i.e.when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
Since this is a major change, usage of the old <code>also_single_tested</code> will throw an informative error that it has been replaced by <code>only_all_tested</code>.</li>
Since this is a major change, usage of the old <code>also_single_tested</code> will throw an informative error that it has been replaced by <code>only_all_tested</code>.</li>
<li>
<li>
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code><code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code><code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
<divclass="sourceCode"id="cb11"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb11-1" data-line-number="1"><spanclass="co"># (run this on your own console, as this page does not support colour printing)</span></a>
<divclass="sourceCode"id="cb12"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb12-1" data-line-number="1"><spanclass="co"># (run this on your own console, as this page does not support colour printing)</span></a>
@ -547,14 +560,14 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<ul>
<ul>
<li>
<li>
<p>Function <code><ahref="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><ahref="../reference/count.html">count_df()</a></code> and <code><ahref="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
<p>Function <code><ahref="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><ahref="../reference/count.html">count_df()</a></code> and <code><ahref="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
<li>Function <code><ahref="../reference/mo_property.html">mo_info()</a></code> as an analogy to <code><ahref="../reference/ab_property.html">ab_info()</a></code>. The <code><ahref="../reference/mo_property.html">mo_info()</a></code> prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism</li>
<li>Function <code><ahref="../reference/mo_property.html">mo_info()</a></code> as an analogy to <code><ahref="../reference/ab_property.html">ab_info()</a></code>. The <code><ahref="../reference/mo_property.html">mo_info()</a></code> prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism</li>
<li><p>Function <code><ahref="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
<li><p>Function <code><ahref="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
<aclass="sourceLine"id="cb16-2" data-line-number="2"><spanclass="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<aclass="sourceLine"id="cb17-2" data-line-number="2"><spanclass="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<aclass="sourceLine"id="cb16-4" data-line-number="4"><spanclass="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
<aclass="sourceLine"id="cb17-4" data-line-number="4"><spanclass="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
</li>
</li>
<li>
<li>
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
These functions use <code>as.atc()</code> internally. The old <code>atc_property</code> has been renamed <code><ahref="../reference/atc_online.html">atc_online_property()</a></code>. This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class <code>atc</code> or must be coerable to this class. Properties of these classes should start with the same class name, analogous to <code><ahref="../reference/as.mo.html">as.mo()</a></code> and e.g. <code>mo_genus</code>.</li>
These functions use <code>as.atc()</code> internally. The old <code>atc_property</code> has been renamed <code><ahref="../reference/atc_online.html">atc_online_property()</a></code>. This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class <code>atc</code> or must be coerable to this class. Properties of these classes should start with the same class name, analogous to <code><ahref="../reference/as.mo.html">as.mo()</a></code> and e.g. <code>mo_genus</code>.</li>
<li>New functions <code><ahref="../reference/mo_source.html">set_mo_source()</a></code> and <code><ahref="../reference/mo_source.html">get_mo_source()</a></code> to use your own predefined MO codes as input for <code><ahref="../reference/as.mo.html">as.mo()</a></code> and consequently all <code>mo_*</code> functions</li>
<li>New functions <code><ahref="../reference/mo_source.html">set_mo_source()</a></code> and <code><ahref="../reference/mo_source.html">get_mo_source()</a></code> to use your own predefined MO codes as input for <code><ahref="../reference/as.mo.html">as.mo()</a></code> and consequently all <code>mo_*</code> functions</li>
<li>Support for the upcoming <ahref="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
<li>Support for the upcoming <ahref="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
@ -805,20 +818,20 @@ These functions use <code>as.atc()</code> internally. The old <code>atc_property
<li>New function <code><ahref="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
<li>New function <code><ahref="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
<li>
<li>
<p>New function <code><ahref="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><ahref="https://rdrr.io/r/graphics/plot.html">plot()</a></code> function can now be used for resistance prediction calculated with <code><ahref="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
<p>New function <code><ahref="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><ahref="https://rdrr.io/r/graphics/plot.html">plot()</a></code> function can now be used for resistance prediction calculated with <code><ahref="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
<p>Functions <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><ahref="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
<p>Functions <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><ahref="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
<li>New function <code><ahref="../reference/availability.html">availability()</a></code> to check the number of available (non-empty) results in a <code>data.frame</code>
<li>New function <code><ahref="../reference/availability.html">availability()</a></code> to check the number of available (non-empty) results in a <code>data.frame</code>
</li>
</li>
@ -847,33 +860,33 @@ These functions use <code>as.atc()</code> internally. The old <code>atc_property
<ul>
<ul>
<li>
<li>
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><ahref="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><ahref="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
Using <code><ahref="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a></code> could lead to very unreliable results.</li>
Using <code><ahref="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a></code> could lead to very unreliable results.</li>
<li>Implemented the latest publication of Becker <em>et al.</em> (2019), for categorising coagulase-negative <em>Staphylococci</em>
<li>Implemented the latest publication of Becker <em>et al.</em> (2019), for categorising coagulase-negative <em>Staphylococci</em>
</li>
</li>
<li>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</li>
<li>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</li>
<li>
<li>
<p>Incoercible results will now be considered ‘unknown’, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
<p>Incoercible results will now be considered ‘unknown’, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
<aclass="sourceLine"id="cb23-3" data-line-number="3"><spanclass="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
<aclass="sourceLine"id="cb24-3" data-line-number="3"><spanclass="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
<li>Fix for vector containing only empty values</li>
<li>Fix for vector containing only empty values</li>
<li>Finds better results when input is in other languages</li>
<li>Finds better results when input is in other languages</li>
@ -919,19 +932,19 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<ul>
<ul>
<li>
<li>
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
<divclass="sourceCode"id="cb24"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb24-1" data-line-number="1"><spanclass="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
<divclass="sourceCode"id="cb25"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb25-1" data-line-number="1"><spanclass="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
<aclass="sourceLine"id="cb24-2" data-line-number="2"><spanclass="co"># OLD WAY</span></a>
<aclass="sourceLine"id="cb25-2" data-line-number="2"><spanclass="co"># OLD WAY</span></a>
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs.IR (susceptible vs.non-susceptible)</li>
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs.IR (susceptible vs.non-susceptible)</li>
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
@ -1022,15 +1035,15 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<aclass="sourceLine"id="cb27-3" data-line-number="3"><spanclass="st"></span><spanclass="kw"><ahref="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<spanclass="op">-</span>count, <spanclass="op">-</span>cum_count) <spanclass="co"># only get item, percent, cum_percent</span></a></code></pre></div>
<aclass="sourceLine"id="cb28-3" data-line-number="3"><spanclass="st"></span><spanclass="kw"><ahref="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<spanclass="op">-</span>count, <spanclass="op">-</span>cum_count) <spanclass="co"># only get item, percent, cum_percent</span></a></code></pre></div>
</li>
</li>
<li>Check for <code><ahref="https://hms.tidyverse.org/reference/Deprecated.html">hms::is.hms</a></code>
<li>Check for <code><ahref="https://hms.tidyverse.org/reference/Deprecated.html">hms::is.hms</a></code>
</li>
</li>
@ -1110,18 +1123,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
</li>
</ul>
</ul>
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates
<ul>
<ul>
@ -1132,18 +1145,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
</li>
<li>
<li>
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
<aclass="sourceLine"id="cb30-5" data-line-number="5"><spanclass="kw"><ahref="../reference/as.mo.html">as.mo</a></span>(<spanclass="st">"S group A"</span>)</a>
<aclass="sourceLine"id="cb31-5" data-line-number="5"><spanclass="kw"><ahref="../reference/as.mo.html">as.mo</a></span>(<spanclass="st">"S group A"</span>)</a>
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:
@ -1171,12 +1184,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
<li>
<li>
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
<li>For <code>first_isolate</code>, rows will be ignored when there’s no species available</li>
<li>For <code>first_isolate</code>, rows will be ignored when there’s no species available</li>
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
@ -1187,13 +1200,13 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
</li>
<li>
<li>
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
<li>Edited <code>ggplot_rsi</code> and <code>geom_rsi</code> so they can cope with <code>count_df</code>. The new <code>fun</code> parameter has value <code>portion_df</code> at default, but can be set to <code>count_df</code>.</li>
<li>Edited <code>ggplot_rsi</code> and <code>geom_rsi</code> so they can cope with <code>count_df</code>. The new <code>fun</code> parameter has value <code>portion_df</code> at default, but can be set to <code>count_df</code>.</li>
<li>Fix for <code>ggplot_rsi</code> when the <code>ggplot2</code> package was not loaded</li>
<li>Fix for <code>ggplot_rsi</code> when the <code>ggplot2</code> package was not loaded</li>
@ -1207,12 +1220,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
</li>
<li>
<li>
<p>Support for types (classes) list and matrix for <code>freq</code></p>
<p>Support for types (classes) list and matrix for <code>freq</code></p>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.9.0.9013</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.9.0.9016</span>
</span>
</span>
</div>
</div>
@ -252,7 +252,7 @@
<li><p><code>gender</code><br/> gender of the patient</p></li>
<li><p><code>gender</code><br/> gender of the patient</p></li>
<li><p><code>patient_id</code><br/> ID of the patient</p></li>
<li><p><code>patient_id</code><br/> ID of the patient</p></li>
<li><p><code>mo</code><br/> ID of microorganism created with <code><ahref='as.mo.html'>as.mo()</a></code>, see also <ahref='microorganisms.html'>microorganisms</a></p></li>
<li><p><code>mo</code><br/> ID of microorganism created with <code><ahref='as.mo.html'>as.mo()</a></code>, see also <ahref='microorganisms.html'>microorganisms</a></p></li>
<li><p><code>PEN:RIF</code><br/> 40 different antibiotics with class <code><ahref='as.rsi.html'>rsi</a></code> (see <code><ahref='as.rsi.html'>as.rsi()</a></code>); these column names occur in <ahref='antibiotics.html'>antibiotics</a> data set and can be translated with <code><ahref='ab_property.html'>ab_name()</a></code></p></li>
<li><p><code>PEN:RIF</code><br/> 40 different antibiotics with class <code><ahref='as.rsi.html'>rsi</a></code> (see <code><ahref='as.rsi.html'>as.rsi()</a></code>); these column names occur in the <ahref='antibiotics.html'>antibiotics</a> data set and can be translated with <code><ahref='ab_property.html'>ab_name()</a></code></p></li>
</ul>
</ul>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
<p>A <code><ahref='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 69,447 observations and 16 variables:</p><ul>
<p>A <code><ahref='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 69,447 observations and 17 variables:</p><ul>
<li><p><code>mo</code><br/> ID of microorganism as used by this package</p></li>
<li><p><code>mo</code><br/> ID of microorganism as used by this package</p></li>
<li><p><code>col_id</code><br/> Catalogue of Life ID</p></li>
<li><p><code>col_id</code><br/> Catalogue of Life ID</p></li>
<li><p><code>fullname</code><br/> Full name, like <code>"Escherichia coli"</code></p></li>
<li><p><code>fullname</code><br/> Full name, like <code>"Escherichia coli"</code></p></li>
@ -252,6 +252,7 @@
<li><p><code>species_id</code><br/> ID of the species as used by the Catalogue of Life</p></li>
<li><p><code>species_id</code><br/> ID of the species as used by the Catalogue of Life</p></li>
<li><p><code>source</code><br/> Either "CoL", "DSMZ" (see Source) or "manually added"</p></li>
<li><p><code>source</code><br/> Either "CoL", "DSMZ" (see Source) or "manually added"</p></li>
<li><p><code>prevalence</code><br/> Prevalence of the microorganism, see <code><ahref='as.mo.html'>as.mo()</a></code></p></li>
<li><p><code>prevalence</code><br/> Prevalence of the microorganism, see <code><ahref='as.mo.html'>as.mo()</a></code></p></li>
<li><p><code>snomed</code><br/> SNOMED code of the microorganism. Use <code><ahref='mo_property.html'>mo_snomed()</a></code> to retrieve it quickly, see <code><ahref='mo_property.html'>mo_property()</a></code>.</p></li>
<metaproperty="og:title"content="Data set for RSI interpretation — rsi_translation" />
<metaproperty="og:title"content="Data set for R/SI interpretation — rsi_translation" />
<metaproperty="og:description"content="Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use as.rsi() to transform MICs or disks measurements to RSI values." />
<metaproperty="og:description"content="Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use as.rsi() to transform MICs or disks measurements to R/SI values." />
<p>Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use <code><ahref='as.rsi.html'>as.rsi()</a></code> to transform MICs or disks measurements to RSI values.</p>
<p>Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use <code><ahref='as.rsi.html'>as.rsi()</a></code> to transform MICs or disks measurements to R/SI values.</p>
<p>The repository of this <code>AMR</code> package contains a file comprising this exact data set: https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This file <strong>allows for machine reading EUCAST and CLSI guidelines</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.</p>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -264,6 +267,7 @@
<h2>Contents</h2>
<h2>Contents</h2>
<ulclass="nav nav-pills nav-stacked">
<ulclass="nav nav-pills nav-stacked">
<li><ahref="#format">Format</a></li>
<li><ahref="#format">Format</a></li>
<li><ahref="#details">Details</a></li>
<li><ahref="#read-more-on-our-website-">Read more on our website!</a></li>
<li><ahref="#read-more-on-our-website-">Read more on our website!</a></li>
`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. **Our aim is to provide a standard** for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. **Our aim is to provide a standard** for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
After installing this package, R knows [**~70,000 distinct microbial species**](./reference/microorganisms.html) and all [**~550 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) by name and code (including ATC and LOINC), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.
After installing this package, R knows [**~70,000 distinct microbial species**](./reference/microorganisms.html) and all [**~550 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) by name and code (including ATC, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.
We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is [actively maintained](./news) and is free software (see [Copyright](#copyright)).
We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is [actively maintained](./news) and is free software (see [Copyright](#copyright)).
@ -48,36 +48,25 @@ This package can be used for:
* Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) ([manual](./reference/ab_property.html))
* Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) ([manual](./reference/ab_property.html))
* Getting SNOMED codes of a microorganism, or get its name associated with a SNOMED code ([manual](./reference/mo_property.html))
* Getting LOINC codes of an antibiotic, or get its name associated with a LOINC code ([manual](./reference/ab_property.html))
* Getting LOINC codes of an antibiotic, or get its name associated with a LOINC code ([manual](./reference/ab_property.html))
* Machine reading the EUCAST and CLSI guidelines from 2011-2019 to translate MIC values and disk diffusion diameters to R/SI ([link](https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt))
* Machine reading the EUCAST and CLSI guidelines from 2011-2019 to translate MIC values and disk diffusion diameters to R/SI ([link](https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt))
This package is ready-to-use for a professional environment by specialists in the following fields:
This package is ready-to-use for specialists in many fields:
Medical Microbiology
* Epidemiologists (both clinical microbiological and research)
* Epidemiologists (both clinical microbiological and research)
* Research Microbiologists
* (Research) Microbiologists
* Biomedical Researchers
* Biomedical Researchers
* Research Pharmacologists
* Research Pharmacologists
* Data Scientists / Data Analysts
* Data Scientists / Data Analysts
* Statisticians
Veterinary Microbiology
* Bioinformaticians
* Research Veterinarians
* Research Veterinarians
* Veterinary Epidemiologists
* Veterinary Epidemiologists
Microbial Ecology
* Soil Microbiologists
* Soil Microbiologists
* Extremophile Researchers
* Extremophile Researchers
* Astrobiologists
* Astrobiologists
Developers
* Package developers for R
* Software developers
* Web application / Shiny developers
### Get this package
### Get this package
#### Latest released version
#### Latest released version
@ -143,8 +132,8 @@ The `AMR` package basically does four important things:
* Use `first_isolate()` to identify the first isolates of every patient [using guidelines from the CLSI](https://clsi.org/standards/products/microbiology/documents/m39/) (Clinical and Laboratory Standards Institute).
* Use `first_isolate()` to identify the first isolates of every patient [using guidelines from the CLSI](https://clsi.org/standards/products/microbiology/documents/m39/) (Clinical and Laboratory Standards Institute).
* You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
* You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
* Use `mdro()` to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos *et al.* (2012, [PMID 21793988](https://www.ncbi.nlm.nih.gov/pubmed/?term=21793988)), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.
* Use `mdro()` to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos *et al.* (2012, [PMID 21793988](https://www.ncbi.nlm.nih.gov/pubmed/?term=21793988)), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.
* The [data set microorganisms](./reference/microorganisms.html) contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus()`, `mo_family()`, `mo_gramstain()` or even `mo_phylum()`. As they use `as.mo()` internally, they also use the same intelligent rules for determination. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
* The [data set microorganisms](./reference/microorganisms.html) contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus()`, `mo_family()`, `mo_gramstain()` or even `mo_phylum()`. Use `mo_snomed()` to look up any SNOMED CT code associated with a microorganism. As all these function use `as.mo()` internally, they also use the same intelligent rules for determination. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
* The [data set antibiotics](./reference/antibiotics.html) contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like `ab_name()`, `ab_group()`, `ab_atc()` and `ab_tradenames()` to look up values. The `ab_*` functions use `as.ab()` internally so they support the same intelligent rules to guess the most probable result. For example, `ab_name("Fluclox")`, `ab_name("Floxapen")` and `ab_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data.
* The [data set antibiotics](./reference/antibiotics.html) contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, LOINC code, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like `ab_name()`, `ab_group()`, `ab_atc()`, `ab_loinc()` and `ab_tradenames()` to look up values. The `ab_*` functions use `as.ab()` internally so they support the same intelligent rules to guess the most probable result. For example, `ab_name("Fluclox")`, `ab_name("Floxapen")` and `ab_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data.
3. It **analyses the data** with convenient functions that use well-known methods.
3. It **analyses the data** with convenient functions that use well-known methods.
\item \code{mo}\cr ID of microorganism created with \code{\link[=as.mo]{as.mo()}}, see also \link{microorganisms}
\item \code{mo}\cr ID of microorganism created with \code{\link[=as.mo]{as.mo()}}, see also \link{microorganisms}
\item \code{PEN:RIF}\cr 40 different antibiotics with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}}); these column names occur in \link{antibiotics} data set and can be translated with \code{\link[=ab_name]{ab_name()}}
\item \code{PEN:RIF}\cr 40 different antibiotics with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}}); these column names occur in the \link{antibiotics} data set and can be translated with \code{\link[=ab_name]{ab_name()}}
\format{A \code{\link{data.frame}} with 69,447 observations and 16 variables:
\format{A \code{\link{data.frame}} with 69,447 observations and 17 variables:
\itemize{
\itemize{
\item \code{mo}\cr ID of microorganism as used by this package
\item \code{mo}\cr ID of microorganism as used by this package
\item \code{col_id}\cr Catalogue of Life ID
\item \code{col_id}\cr Catalogue of Life ID
@ -15,6 +15,7 @@
\item \code{species_id}\cr ID of the species as used by the Catalogue of Life
\item \code{species_id}\cr ID of the species as used by the Catalogue of Life
\item \code{source}\cr Either "CoL", "DSMZ" (see Source) or "manually added"
\item \code{source}\cr Either "CoL", "DSMZ" (see Source) or "manually added"
\item \code{prevalence}\cr Prevalence of the microorganism, see \code{\link[=as.mo]{as.mo()}}
\item \code{prevalence}\cr Prevalence of the microorganism, see \code{\link[=as.mo]{as.mo()}}
\item \code{snomed}\cr SNOMED code of the microorganism. Use \code{\link[=mo_snomed]{mo_snomed()}} to retrieve it quickly, see \code{\link[=mo_property]{mo_property()}}.
}}
}}
\source{
\source{
Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}).
Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}).
\format{A \code{\link{data.frame}} with 13,975 observations and 9 variables:
\format{A \code{\link{data.frame}} with 13,975 observations and 9 variables:
\itemize{
\itemize{
\item \code{guideline}\cr Name of the guideline
\item \code{guideline}\cr Name of the guideline
@ -20,7 +20,10 @@
rsi_translation
rsi_translation
}
}
\description{
\description{
Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link[=as.rsi]{as.rsi()}} to transform MICs or disks measurements to RSI values.
Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link[=as.rsi]{as.rsi()}} to transform MICs or disks measurements to R/SI values.
}
\details{
The repository of this \code{AMR} package contains a file comprising this exact data set: \link{https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}. This file \strong{allows for machine reading EUCAST and CLSI guidelines}, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.