(v0.9.0) website fixes
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 0.9.0
|
||||
Date: 2019-11-29
|
||||
Date: 2019-11-30
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(role = c("aut", "cre"),
|
||||
|
5
R/misc.R
@ -117,7 +117,10 @@ search_type_in_df <- function(x, type) {
|
||||
stopifnot_installed_package <- function(package) {
|
||||
# no "utils::installed.packages()" since it requires non-staged install since R 3.6.0
|
||||
# https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html
|
||||
get(".packageName", envir = asNamespace(package))
|
||||
tryCatch(get(".packageName", envir = asNamespace(package)),
|
||||
error = function(e) stop("package '", package, "' required but not installed",
|
||||
' - try to install it with: install.packages("', package, '")',
|
||||
call. = FALSE))
|
||||
return(invisible())
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#' Property of a microorganism
|
||||
#'
|
||||
#' Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with [as.mo()], which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.
|
||||
#' Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*.
|
||||
#' @param x any (vector of) text that can be coerced to a valid microorganism code with [as.mo()]
|
||||
#' @param property one of the column names of the [microorganisms] data set or `"shortname"`
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
@ -32,7 +32,7 @@
|
||||
#' - `mo_ref("Chlamydia psittaci")` will return `"Page, 1968"` (with a warning about the renaming)
|
||||
#' - `mo_ref("Chlamydophila psittaci")` will return `"Everett et al., 1999"` (without a warning)
|
||||
#'
|
||||
#' The Gram stain - [mo_gramstain()] - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value `NA`.
|
||||
#' The Gram stain - [mo_gramstain()] - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value `NA`.
|
||||
#'
|
||||
#' All output will be [translate]d where possible.
|
||||
#'
|
||||
@ -43,7 +43,7 @@
|
||||
#' @name mo_property
|
||||
#' @return
|
||||
#' - An [`integer`] in case of [mo_year()]
|
||||
#' - A [`list`] in case of [mo_taxonomy()]
|
||||
#' - A [`list`] in case of [mo_taxonomy()] and [mo_info()]
|
||||
#' - A named [`character`] in case of [mo_url()]
|
||||
#' - A [`character`] in all other cases
|
||||
#' @export
|
||||
|
@ -41,10 +41,10 @@
|
||||
#' Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
|
||||
#' ```
|
||||
#' | A | B |
|
||||
#' --|--------------------|-------------|
|
||||
#' --|--------------------|--------------|
|
||||
#' 1 | Organisation XYZ | mo |
|
||||
#' 2 | lab_mo_ecoli | B_ESCHR_COL |
|
||||
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
|
||||
#' 2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
|
||||
#' 4 | | |
|
||||
#' ```
|
||||
#'
|
||||
@ -59,7 +59,7 @@
|
||||
#' And now we can use it in our functions:
|
||||
#' ```
|
||||
#' as.mo("lab_mo_ecoli")
|
||||
#' \[1\] B_ESCHR_COLI
|
||||
#' [1] B_ESCHR_COLI
|
||||
#'
|
||||
#' mo_genus("lab_mo_kpneumoniae")
|
||||
#' [1] "Klebsiella"
|
||||
@ -69,7 +69,7 @@
|
||||
#' [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
|
||||
#' ```
|
||||
#'
|
||||
#' If we edit the Excel file to, let's say, this:
|
||||
#' If we edit the Excel file to, let's say, by adding row 4 like this:
|
||||
#' ```
|
||||
#' | A | B |
|
||||
#' --|--------------------|--------------|
|
||||
@ -80,7 +80,7 @@
|
||||
#' 5 | | |
|
||||
#' ```
|
||||
#'
|
||||
#' ...any new usage of an MO function in this package will update your data:
|
||||
#' ...any new usage of an MO function in this package will update your data file:
|
||||
#' ```
|
||||
#' as.mo("lab_mo_ecoli")
|
||||
#' # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
|
||||
@ -90,9 +90,8 @@
|
||||
#' [1] "Staphylococcus"
|
||||
#' ```
|
||||
#'
|
||||
#' To remove the reference completely, just use any of these:
|
||||
#' To remove the reference data file completely, just use `""` or `NULL` as input for `[set_mo_source()]`:
|
||||
#' ```
|
||||
#' set_mo_source("")
|
||||
#' set_mo_source(NULL)
|
||||
#' # Removed mo_source file '~/.mo_source.rds'.
|
||||
#' ```
|
||||
@ -126,9 +125,7 @@ set_mo_source <- function(path) {
|
||||
|
||||
} else if (path %like% "[.]xlsx?$") {
|
||||
# is Excel file (old or new)
|
||||
if (!"readxl" %in% utils::installed.packages()) {
|
||||
stop("Install the 'readxl' package first.")
|
||||
}
|
||||
stopifnot_installed_package("readxl")
|
||||
df <- readxl::read_excel(path)
|
||||
|
||||
} else if (path %like% "[.]tsv$") {
|
||||
@ -219,5 +216,5 @@ mo_source_isvalid <- function(x) {
|
||||
if (!"mo" %in% colnames(x)) {
|
||||
return(FALSE)
|
||||
}
|
||||
all(x$mo %in% c("", AMR::microorganisms$mo))
|
||||
all(x$mo %in% c("", AMR::microorganisms$mo, AMR::microorganisms.translation$mo_old), na.rm = TRUE)
|
||||
}
|
||||
|
@ -187,7 +187,7 @@
|
||||
<h1>How to conduct AMR analysis</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">29 November 2019</h4>
|
||||
<h4 class="date">30 November 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>AMR.Rmd</code></div>
|
||||
@ -196,7 +196,7 @@
|
||||
|
||||
|
||||
|
||||
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 29 November 2019.</p>
|
||||
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 30 November 2019.</p>
|
||||
<div id="introduction" class="section level1">
|
||||
<h1 class="hasAnchor">
|
||||
<a href="#introduction" class="anchor"></a>Introduction</h1>
|
||||
@ -212,21 +212,21 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2019-11-29</td>
|
||||
<td align="center">2019-11-30</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2019-11-29</td>
|
||||
<td align="center">2019-11-30</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2019-11-29</td>
|
||||
<td align="center">2019-11-30</td>
|
||||
<td align="center">efgh</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
@ -321,70 +321,70 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2015-06-06</td>
|
||||
<td align="center">I1</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">2017-05-01</td>
|
||||
<td align="center">L9</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Staphylococcus aureus</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2016-06-07</td>
|
||||
<td align="center">Z6</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Staphylococcus aureus</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">2014-02-04</td>
|
||||
<td align="center">U2</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2013-01-19</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">2016-12-08</td>
|
||||
<td align="center">P9</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2013-10-19</td>
|
||||
<td align="center">M2</td>
|
||||
<td align="center">2014-11-30</td>
|
||||
<td align="center">V1</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Klebsiella pneumoniae</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2011-04-28</td>
|
||||
<td align="center">F10</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">2017-09-12</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Staphylococcus aureus</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2014-02-17</td>
|
||||
<td align="center">I9</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Klebsiella pneumoniae</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">2010-01-31</td>
|
||||
<td align="center">W3</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -406,8 +406,8 @@
|
||||
#
|
||||
# Item Count Percent Cum. Count Cum. Percent
|
||||
# --- ----- ------- -------- ----------- -------------
|
||||
# 1 M 10,446 52.23% 10,446 52.23%
|
||||
# 2 F 9,554 47.77% 20,000 100.00%</code></pre>
|
||||
# 1 M 10,321 51.61% 10,321 51.61%
|
||||
# 2 F 9,679 48.40% 20,000 100.00%</code></pre>
|
||||
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.</p>
|
||||
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">data <-<span class="st"> </span>data <span class="op">%>%</span></a>
|
||||
@ -422,8 +422,8 @@
|
||||
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="co"># Other rules by this AMR package</span></a>
|
||||
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,987 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (122 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,960 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (144 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-9" data-line-number="9"><span class="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-10" data-line-number="10"><span class="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
|
||||
@ -448,14 +448,14 @@
|
||||
<a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Pasteurella multocida (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Staphylococcus (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (1,064 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (997 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Viridans group streptococci (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
|
||||
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,300 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,331 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,722 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,705 values changed)</span></a>
|
||||
<a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
|
||||
@ -463,15 +463,15 @@
|
||||
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
|
||||
<a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># -------------------------------------------------------------------------------</span></a>
|
||||
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,539 out of 20,000 rows, making a total of 8,195 edits</span></a>
|
||||
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,481 out of 20,000 rows, making a total of 8,137 edits</span></a>
|
||||
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># => added 0 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># => changed 8,195 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 125 test results changed from S to I</span></a>
|
||||
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,759 test results changed from S to R</span></a>
|
||||
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,206 test results changed from I to S</span></a>
|
||||
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 324 test results changed from I to R</span></a>
|
||||
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,781 test results changed from R to S</span></a>
|
||||
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># => changed 8,137 test results</span></a>
|
||||
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 115 test results changed from S to I</span></a>
|
||||
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,732 test results changed from S to R</span></a>
|
||||
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,228 test results changed from I to S</span></a>
|
||||
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 330 test results changed from I to R</span></a>
|
||||
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,732 test results changed from R to S</span></a>
|
||||
<a class="sourceLine" id="cb14-56" data-line-number="56"><span class="co"># -------------------------------------------------------------------------------</span></a>
|
||||
<a class="sourceLine" id="cb14-57" data-line-number="57"><span class="co"># </span></a>
|
||||
<a class="sourceLine" id="cb14-58" data-line-number="58"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
|
||||
@ -499,8 +499,8 @@
|
||||
<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
|
||||
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
|
||||
<a class="sourceLine" id="cb16-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
|
||||
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># => Found 5,689 first isolates (28.4% of total)</span></a></code></pre></div>
|
||||
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
|
||||
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># => Found 5,667 first isolates (28.3% of total)</span></a></code></pre></div>
|
||||
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">data_1st <-<span class="st"> </span>data <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb17-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
|
||||
@ -510,7 +510,7 @@
|
||||
<div id="first-weighted-isolates" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
|
||||
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient N6, sorted on date:</p>
|
||||
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient E9, sorted on date:</p>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th align="center">isolate</th>
|
||||
@ -526,10 +526,10 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-23</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-07-16</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -537,43 +537,43 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-04-09</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-23</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-08-26</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-05-12</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-10-17</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">5</td>
|
||||
<td align="center">2010-06-27</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-10-25</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -581,10 +581,10 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-08-09</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-02-27</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -592,51 +592,51 @@
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">7</td>
|
||||
<td align="center">2010-09-01</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-03-15</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2010-10-18</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-03-19</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2011-01-18</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-06-20</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">10</td>
|
||||
<td align="center">2011-02-15</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-12-03</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
|
||||
<p>Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
|
||||
<p>If a column exists with a name like ‘key(…)ab’ the <code><a href="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1">data <-<span class="st"> </span>data <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb19-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">keyab =</span> <span class="kw"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(.)) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
@ -647,7 +647,7 @@
|
||||
<a class="sourceLine" id="cb19-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
|
||||
<a class="sourceLine" id="cb19-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
|
||||
<a class="sourceLine" id="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
|
||||
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># => Found 15,038 first weighted isolates (75.2% of total)</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># => Found 15,044 first weighted isolates (75.2% of total)</span></a></code></pre></div>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th align="center">isolate</th>
|
||||
@ -664,10 +664,10 @@
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-23</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-07-16</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -676,58 +676,58 @@
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-04-09</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-07-22</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-23</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-08-26</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-05-12</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-10-17</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">5</td>
|
||||
<td align="center">2010-06-27</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2010-10-25</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-08-09</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-02-27</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
@ -736,23 +736,23 @@
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">7</td>
|
||||
<td align="center">2010-09-01</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-03-15</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2010-10-18</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-03-19</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
@ -760,35 +760,35 @@
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2011-01-18</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-06-20</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">10</td>
|
||||
<td align="center">2011-02-15</td>
|
||||
<td align="center">N6</td>
|
||||
<td align="center">2011-12-03</td>
|
||||
<td align="center">E9</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Instead of 1, now 9 isolates are flagged. In total, 75.2% of all isolates are marked ‘first weighted’ - 46.7% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
|
||||
<p>Instead of 2, now 7 isolates are flagged. In total, 75.2% of all isolates are marked ‘first weighted’ - 46.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
|
||||
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
|
||||
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data_1st <-<span class="st"> </span>data <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
|
||||
<p>So we end up with 15,038 isolates for analysis.</p>
|
||||
<p>So we end up with 15,044 isolates for analysis.</p>
|
||||
<p>We can remove unneeded columns:</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st <-<span class="st"> </span>data_1st <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
|
||||
@ -813,15 +813,47 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>2</td>
|
||||
<td align="center">2016-06-07</td>
|
||||
<td align="center">Z6</td>
|
||||
<td>3</td>
|
||||
<td align="center">2016-12-08</td>
|
||||
<td align="center">P9</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>4</td>
|
||||
<td align="center">2014-11-30</td>
|
||||
<td align="center">V1</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_KLBSL_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Klebsiella</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>5</td>
|
||||
<td align="center">2017-09-12</td>
|
||||
<td align="center">T5</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_STPHY_AURS</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Staphylococcus</td>
|
||||
@ -829,83 +861,51 @@
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>3</td>
|
||||
<td align="center">2013-01-19</td>
|
||||
<td align="center">D3</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">S</td>
|
||||
<td>6</td>
|
||||
<td align="center">2010-01-31</td>
|
||||
<td align="center">W3</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>5</td>
|
||||
<td align="center">2011-04-28</td>
|
||||
<td align="center">F10</td>
|
||||
<td>7</td>
|
||||
<td align="center">2015-09-28</td>
|
||||
<td align="center">K4</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>6</td>
|
||||
<td align="center">2014-02-17</td>
|
||||
<td align="center">I9</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_KLBSL_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Klebsiella</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>7</td>
|
||||
<td align="center">2016-03-10</td>
|
||||
<td align="center">C8</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>8</td>
|
||||
<td align="center">2014-02-08</td>
|
||||
<td align="center">M8</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">2011-08-30</td>
|
||||
<td align="center">B6</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_STPHY_AURS</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Staphylococcus</td>
|
||||
<td align="center">aureus</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -927,7 +927,7 @@
|
||||
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
|
||||
<p><strong>Frequency table</strong></p>
|
||||
<p>Class: character<br>
|
||||
Length: 15,038 (of which NA: 0 = 0%)<br>
|
||||
Length: 15,044 (of which NA: 0 = 0%)<br>
|
||||
Unique: 4</p>
|
||||
<p>Shortest: 16<br>
|
||||
Longest: 24</p>
|
||||
@ -944,33 +944,33 @@ Longest: 24</p>
|
||||
<tr class="odd">
|
||||
<td align="left">1</td>
|
||||
<td align="left">Escherichia coli</td>
|
||||
<td align="right">7,487</td>
|
||||
<td align="right">49.79%</td>
|
||||
<td align="right">7,487</td>
|
||||
<td align="right">49.79%</td>
|
||||
<td align="right">7,493</td>
|
||||
<td align="right">49.81%</td>
|
||||
<td align="right">7,493</td>
|
||||
<td align="right">49.81%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">2</td>
|
||||
<td align="left">Staphylococcus aureus</td>
|
||||
<td align="right">3,697</td>
|
||||
<td align="right">24.58%</td>
|
||||
<td align="right">11,184</td>
|
||||
<td align="right">74.37%</td>
|
||||
<td align="right">3,718</td>
|
||||
<td align="right">24.71%</td>
|
||||
<td align="right">11,211</td>
|
||||
<td align="right">74.52%</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="left">3</td>
|
||||
<td align="left">Streptococcus pneumoniae</td>
|
||||
<td align="right">2,303</td>
|
||||
<td align="right">15.31%</td>
|
||||
<td align="right">13,487</td>
|
||||
<td align="right">89.69%</td>
|
||||
<td align="right">2,293</td>
|
||||
<td align="right">15.24%</td>
|
||||
<td align="right">13,504</td>
|
||||
<td align="right">89.76%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">4</td>
|
||||
<td align="left">Klebsiella pneumoniae</td>
|
||||
<td align="right">1,551</td>
|
||||
<td align="right">10.31%</td>
|
||||
<td align="right">15,038</td>
|
||||
<td align="right">1,540</td>
|
||||
<td align="right">10.24%</td>
|
||||
<td align="right">15,044</td>
|
||||
<td align="right">100.00%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -982,7 +982,7 @@ Longest: 24</p>
|
||||
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
|
||||
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
|
||||
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX)</a>
|
||||
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4674824</span></a></code></pre></div>
|
||||
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4660994</span></a></code></pre></div>
|
||||
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
@ -995,19 +995,19 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">0.4688268</td>
|
||||
<td align="center">0.4644833</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">0.4681135</td>
|
||||
<td align="center">0.4626231</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">0.4541020</td>
|
||||
<td align="center">0.4616060</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">0.4743044</td>
|
||||
<td align="center">0.4776800</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1025,23 +1025,23 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">0.4688268</td>
|
||||
<td align="center">4475</td>
|
||||
<td align="center">0.4644833</td>
|
||||
<td align="center">4519</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">0.4681135</td>
|
||||
<td align="center">5253</td>
|
||||
<td align="center">0.4626231</td>
|
||||
<td align="center">5177</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">0.4541020</td>
|
||||
<td align="center">2255</td>
|
||||
<td align="center">0.4616060</td>
|
||||
<td align="center">2279</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">0.4743044</td>
|
||||
<td align="center">3055</td>
|
||||
<td align="center">0.4776800</td>
|
||||
<td align="center">3069</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1061,27 +1061,27 @@ Longest: 24</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">0.9244023</td>
|
||||
<td align="center">0.8946173</td>
|
||||
<td align="center">0.9929211</td>
|
||||
<td align="center">0.9253970</td>
|
||||
<td align="center">0.8955025</td>
|
||||
<td align="center">0.9929267</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Klebsiella</td>
|
||||
<td align="center">0.9174726</td>
|
||||
<td align="center">0.8891038</td>
|
||||
<td align="center">0.9929078</td>
|
||||
<td align="center">0.9298701</td>
|
||||
<td align="center">0.9038961</td>
|
||||
<td align="center">0.9967532</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">Staphylococcus</td>
|
||||
<td align="center">0.9193941</td>
|
||||
<td align="center">0.9248039</td>
|
||||
<td align="center">0.9940492</td>
|
||||
<td align="center">0.9276493</td>
|
||||
<td align="center">0.9133943</td>
|
||||
<td align="center">0.9943518</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">Streptococcus</td>
|
||||
<td align="center">0.6070343</td>
|
||||
<td align="center">0.6096816</td>
|
||||
<td align="center">0.0000000</td>
|
||||
<td align="center">0.6070343</td>
|
||||
<td align="center">0.6096816</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
@ -187,7 +187,7 @@
|
||||
<h1>How to work with WHONET data</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">29 November 2019</h4>
|
||||
<h4 class="date">30 November 2019</h4>
|
||||
|
||||
|
||||
<div class="hidden name"><code>WHONET.Rmd</code></div>
|
||||
|
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 234 KiB |
@ -44,7 +44,7 @@
|
||||
.countries_map {
|
||||
float: left;
|
||||
padding: 0 10px 10px 0;
|
||||
max-width: 25%;
|
||||
max-width: 35%;
|
||||
}
|
||||
@media only screen and (max-width: 992px) {
|
||||
.footer_logo {
|
||||
|
@ -191,22 +191,22 @@
|
||||
<div class="page-header"><h1 class="hasAnchor">
|
||||
<a href="#amr-for-r" class="anchor"></a><code>AMR</code> (for R) <img src="./logo.png" align="right" height="120px">
|
||||
</h1></div>
|
||||
<p><em>(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <a href="./articles/AMR.html">continue reading here to get started</a>.</em></p>
|
||||
<blockquote>
|
||||
<p><em>18 October 2019</em><br><strong>METHODS PAPER PREPRINTED</strong><br>
|
||||
A methods paper about this package has been preprinted at bioRxiv. It was updated on 8 November 2019. Please click <a href="https://doi.org/10.1101/810622">here for the publishers page</a>.</p>
|
||||
</blockquote>
|
||||
<hr>
|
||||
<div id="what-is-amr-for-r" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#what-is-amr-for-r" class="anchor"></a>What is <code>AMR</code> (for R)?</h3>
|
||||
<p><code>AMR</code> is a free and open-source <a href="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 properties by using evidence-based methods. After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <a href="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
|
||||
<p><em>(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <a href="./articles/AMR.html">continue reading here to get started</a>.</em></p>
|
||||
<p><code>AMR</code> is a <strong>free and open-source</strong> <a href="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 properties by using evidence-based methods. Our aim is to offer a new 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.</p>
|
||||
<p>After installing this package, R knows <a href="./reference/microorganisms.html"><strong>~70,000 distinct microbial species</strong></a> and all <a href="./reference/antibiotics.html"><strong>~550 antibiotic, antimycotic and antiviral drugs</strong></a> by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.</p>
|
||||
<p>We created this package for both routine 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 <a href="./news">actively maintained</a> and is free software (see <a href="#copyright">Copyright</a>).</p>
|
||||
<div class="main-content">
|
||||
<p>
|
||||
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
|
||||
<strong>Used in over 70 countries</strong><br>
|
||||
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 74 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
|
||||
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 75 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
|
||||
<br><br>
|
||||
</div>
|
||||
<div id="partners" class="section level4">
|
||||
@ -309,7 +309,7 @@ A methods paper about this package has been preprinted at bioRxiv. It was update
|
||||
<div id="whonet-ears-net" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#whonet-ears-net" class="anchor"></a>WHONET / EARS-Net</h4>
|
||||
<p>We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an <a href="./reference/WHONET.html">example data set <code>WHONET</code></a> with the exact same structure as a WHONET export file. Furthermore, this package also contains a <a href="./reference/antibiotics.html">data set <code>antibiotics</code></a> with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.</p>
|
||||
<p>We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an <a href="./reference/WHONET.html">example data set <code>WHONET</code></a> with the exact same structure as a WHONET export file. Furthermore, this package also contains a <a href="./reference/antibiotics.html">data set antibiotics</a> with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.</p>
|
||||
<p>Read our tutorial about <a href="./articles/WHONET.html">how to work with WHONET data here</a>.</p>
|
||||
</div>
|
||||
<div id="overview-of-functions" class="section level4">
|
||||
@ -336,8 +336,8 @@ A methods paper about this package has been preprinted at bioRxiv. It was update
|
||||
</ul>
|
||||
</li>
|
||||
<li>Use <code><a href="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, <a href="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 <a href="./reference/microorganisms.html">data set <code>microorganisms</code></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><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use the same intelligent rules for determination. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="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 <a href="./reference/antibiotics.html">data set <code>antibiotics</code></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><a href="reference/ab_property.html">ab_name()</a></code>, <code><a href="reference/ab_property.html">ab_group()</a></code>, <code><a href="reference/ab_property.html">ab_atc()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="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><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="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 <a href="./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><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use the same intelligent rules for determination. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="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 <a href="./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><a href="reference/ab_property.html">ab_name()</a></code>, <code><a href="reference/ab_property.html">ab_group()</a></code>, <code><a href="reference/ab_property.html">ab_atc()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="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><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="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>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -233,7 +233,7 @@
|
||||
|
||||
<div id="amr-0-9-0" class="section level1">
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-0-9-0" class="anchor"></a>AMR 0.9.0<small> Unreleased </small>
|
||||
<a href="#amr-0-9-0" class="anchor"></a>AMR 0.9.0<small> 2019-11-29 </small>
|
||||
</h1>
|
||||
<div id="breaking" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
|
@ -51,7 +51,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Property of a microorganism — mo_property" />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with as.mo(), which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples." />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. Please see Examples." />
|
||||
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
@ -234,7 +234,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo()</a></code>, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.</p>
|
||||
<p>Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo()</a></code>, which makes it possible to use microbial abbreviations, codes and names as input. Please see <em>Examples</em>.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>mo_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
|
||||
@ -311,7 +311,7 @@
|
||||
|
||||
<ul>
|
||||
<li><p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> in case of <code>mo_year()</code></p></li>
|
||||
<li><p>A <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>mo_taxonomy()</code></p></li>
|
||||
<li><p>A <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>mo_taxonomy()</code> and <code>mo_info()</code></p></li>
|
||||
<li><p>A named <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in case of <code>mo_url()</code></p></li>
|
||||
<li><p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in all other cases</p></li>
|
||||
</ul>
|
||||
@ -324,7 +324,7 @@
|
||||
<li><p><code>mo_ref("Chlamydophila psittaci")</code> will return <code>"Everett et al., 1999"</code> (without a warning)</p></li>
|
||||
</ul>
|
||||
|
||||
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>.</p>
|
||||
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>.</p>
|
||||
<p>All output will be <a href='translate.html'>translate</a>d where possible.</p>
|
||||
<p>The function <code>mo_url()</code> will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.</p>
|
||||
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
|
||||
|
@ -261,10 +261,10 @@ This is the fastest way to have your organisation (or analysis) specific codes p
|
||||
|
||||
|
||||
<p>Imagine this data on a sheet of an Excel file (mo codes were looked up in the <code>microorganisms</code> data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:</p><pre> | A | B |
|
||||
--|--------------------|-------------|
|
||||
--|--------------------|--------------|
|
||||
1 | Organisation XYZ | mo |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COL |
|
||||
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
|
||||
4 | | |
|
||||
</pre>
|
||||
|
||||
@ -274,7 +274,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
|
||||
|
||||
<p>It has now created a file <code>"~/.mo_source.rds"</code> with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.</p>
|
||||
<p>And now we can use it in our functions:</p><pre>as.mo("lab_mo_ecoli")
|
||||
\[1\] B_ESCHR_COLI
|
||||
[1] B_ESCHR_COLI
|
||||
|
||||
mo_genus("lab_mo_kpneumoniae")
|
||||
[1] "Klebsiella"
|
||||
@ -284,7 +284,7 @@ as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
|
||||
[1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
|
||||
</pre>
|
||||
|
||||
<p>If we edit the Excel file to, let's say, this:</p><pre> | A | B |
|
||||
<p>If we edit the Excel file to, let's say, by adding row 4 like this:</p><pre> | A | B |
|
||||
--|--------------------|--------------|
|
||||
1 | Organisation XYZ | mo |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
@ -293,7 +293,7 @@ as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
|
||||
5 | | |
|
||||
</pre>
|
||||
|
||||
<p>...any new usage of an MO function in this package will update your data:</p><pre>as.mo("lab_mo_ecoli")
|
||||
<p>...any new usage of an MO function in this package will update your data file:</p><pre>as.mo("lab_mo_ecoli")
|
||||
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
|
||||
[1] B_ESCHR_COLI
|
||||
|
||||
@ -301,8 +301,7 @@ mo_genus("lab_Staph_aureus")
|
||||
[1] "Staphylococcus"
|
||||
</pre>
|
||||
|
||||
<p>To remove the reference completely, just use any of these:</p><pre>set_mo_source("")
|
||||
set_mo_source(NULL)
|
||||
<p>To remove the reference data file completely, just use <code>""</code> or <code>NULL</code> as input for <code>[set_mo_source()]</code>:</p><pre>set_mo_source(NULL)
|
||||
# Removed mo_source file '~/.mo_source.rds'.
|
||||
</pre>
|
||||
|
||||
|
18
index.md
@ -1,16 +1,16 @@
|
||||
# `AMR` (for R) <img src="./logo.png" align="right" height="120px" />
|
||||
|
||||
*(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please [continue reading here to get started](./articles/AMR.html).*
|
||||
|
||||
> *18 October 2019*
|
||||
> **METHODS PAPER PREPRINTED**
|
||||
> A methods paper about this package has been preprinted at bioRxiv. It was updated on 8 November 2019. Please click [here for the publishers page](https://doi.org/10.1101/810622).
|
||||
|
||||
----
|
||||
|
||||
### What is `AMR` (for R)?
|
||||
|
||||
`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 properties by using evidence-based methods. 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, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
|
||||
*(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please [continue reading here to get started](./articles/AMR.html).*
|
||||
|
||||
`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 properties by using evidence-based methods. Our aim is to offer a new 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, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
|
||||
|
||||
We created this package for both routine 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)).
|
||||
|
||||
@ -18,7 +18,7 @@ We created this package for both routine analysis and academic research (as part
|
||||
<p>
|
||||
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
|
||||
<strong>Used in over 70 countries</strong><br>
|
||||
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 74 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
|
||||
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 75 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
|
||||
</div>
|
||||
|
||||
#### Partners
|
||||
@ -120,7 +120,7 @@ Read more about the data from WHOCC [in our manual](./reference/WHOCC.html).
|
||||
|
||||
#### WHONET / EARS-Net
|
||||
|
||||
We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an [example data set `WHONET`](./reference/WHONET.html) with the exact same structure as a WHONET export file. Furthermore, this package also contains a [data set `antibiotics`](./reference/antibiotics.html) with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.
|
||||
We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an [example data set `WHONET`](./reference/WHONET.html) with the exact same structure as a WHONET export file. Furthermore, this package also contains a [data set antibiotics](./reference/antibiotics.html) with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.
|
||||
|
||||
Read our tutorial about [how to work with WHONET data here](./articles/WHONET.html).
|
||||
|
||||
@ -141,8 +141,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).
|
||||
* 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.
|
||||
* 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 `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 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 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.
|
||||
|
||||
3. It **analyses the data** with convenient functions that use well-known methods.
|
||||
|
||||
|
@ -83,13 +83,13 @@ mo_property(x, property = "fullname", language = get_locale(), ...)
|
||||
\value{
|
||||
\itemize{
|
||||
\item An \code{\link{integer}} in case of \code{\link[=mo_year]{mo_year()}}
|
||||
\item A \code{\link{list}} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}}
|
||||
\item A \code{\link{list}} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}} and \code{\link[=mo_info]{mo_info()}}
|
||||
\item A named \code{\link{character}} in case of \code{\link[=mo_url]{mo_url()}}
|
||||
\item A \code{\link{character}} in all other cases
|
||||
}
|
||||
}
|
||||
\description{
|
||||
Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.
|
||||
Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible to use microbial abbreviations, codes and names as input. Please see \emph{Examples}.
|
||||
}
|
||||
\details{
|
||||
All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{\link[=mo_ref]{mo_ref()}}, \code{\link[=mo_authors]{mo_authors()}} and \code{\link[=mo_year]{mo_year()}}. This leads to the following results:
|
||||
@ -99,7 +99,7 @@ All functions will return the most recently known taxonomic property according t
|
||||
\item \code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)
|
||||
}
|
||||
|
||||
The Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
|
||||
The Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
|
||||
|
||||
All output will be \link{translate}d where possible.
|
||||
|
||||
|
@ -29,10 +29,10 @@ Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The
|
||||
\subsection{How it works}{
|
||||
|
||||
Imagine this data on a sheet of an Excel file (mo codes were looked up in the \code{microorganisms} data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:\preformatted{ | A | B |
|
||||
--|--------------------|-------------|
|
||||
--|--------------------|--------------|
|
||||
1 | Organisation XYZ | mo |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COL |
|
||||
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
|
||||
4 | | |
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ We save it as \code{"home/me/ourcodes.xlsx"}. Now we have to set it as a source:
|
||||
It has now created a file \code{"~/.mo_source.rds"} with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.
|
||||
|
||||
And now we can use it in our functions:\preformatted{as.mo("lab_mo_ecoli")
|
||||
\[1\] B_ESCHR_COLI
|
||||
[1] B_ESCHR_COLI
|
||||
|
||||
mo_genus("lab_mo_kpneumoniae")
|
||||
[1] "Klebsiella"
|
||||
@ -53,7 +53,7 @@ as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
|
||||
[1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
|
||||
}
|
||||
|
||||
If we edit the Excel file to, let's say, this:\preformatted{ | A | B |
|
||||
If we edit the Excel file to, let's say, by adding row 4 like this:\preformatted{ | A | B |
|
||||
--|--------------------|--------------|
|
||||
1 | Organisation XYZ | mo |
|
||||
2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
@ -62,7 +62,7 @@ If we edit the Excel file to, let's say, this:\preformatted{ | A
|
||||
5 | | |
|
||||
}
|
||||
|
||||
...any new usage of an MO function in this package will update your data:\preformatted{as.mo("lab_mo_ecoli")
|
||||
...any new usage of an MO function in this package will update your data file:\preformatted{as.mo("lab_mo_ecoli")
|
||||
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
|
||||
[1] B_ESCHR_COLI
|
||||
|
||||
@ -70,8 +70,7 @@ mo_genus("lab_Staph_aureus")
|
||||
[1] "Staphylococcus"
|
||||
}
|
||||
|
||||
To remove the reference completely, just use any of these:\preformatted{set_mo_source("")
|
||||
set_mo_source(NULL)
|
||||
To remove the reference data file completely, just use \code{""} or \code{NULL} as input for \verb{[set_mo_source()]}:\preformatted{set_mo_source(NULL)
|
||||
# Removed mo_source file '~/.mo_source.rds'.
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
||||
.countries_map {
|
||||
float: left;
|
||||
padding: 0 10px 10px 0;
|
||||
max-width: 25%;
|
||||
max-width: 35%;
|
||||
}
|
||||
@media only screen and (max-width: 992px) {
|
||||
.footer_logo {
|
||||
|
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 234 KiB |