mirror of https://github.com/msberends/AMR
(v1.3.0.9002) intrinsic_resistant data set
parent
7d16bec21f
commit
08d62bb5d5
|
@ -47,7 +47,7 @@ jobs:
|
|||
# - {os: macOS-latest, r: 'oldrel'}
|
||||
# - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: windows-latest, r: 'devel'}
|
||||
- {os: macOS-latest, r: 'devel'}
|
||||
# - {os: macOS-latest, r: 'devel'}
|
||||
# - {os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
# - {os: windows-latest, r: '3.6'}
|
||||
# - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
|
|
10
DESCRIPTION
10
DESCRIPTION
|
@ -1,6 +1,6 @@
|
|||
Package: AMR
|
||||
Version: 1.3.0.9001
|
||||
Date: 2020-08-10
|
||||
Version: 1.3.0.9002
|
||||
Date: 2020-08-14
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(role = c("aut", "cre"),
|
||||
|
@ -21,6 +21,8 @@ Authors@R: c(
|
|||
family = "Hassing", given = c("Erwin", "E.", "A."), email = "e.hassing@certe.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Hazenberg", given = c("Eric", "H.", "L.", "C.", "M."), email = "e.hazenberg@jbz.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Knight", given = "Gwen", email = "gwen.knight@lshtm.ac.uk"),
|
||||
person(role = "ctb",
|
||||
family = "Lenglet", given = "Annick", email = "annick.lenglet@amsterdam.msf.org"),
|
||||
person(role = "ctb",
|
||||
|
@ -28,7 +30,9 @@ Authors@R: c(
|
|||
person(role = "ctb",
|
||||
family = "Ny", given = "Sofia", email = "sofia.ny@folkhalsomyndigheten.se"),
|
||||
person(role = "ctb",
|
||||
family = "Souverein", given = "Dennis", email = "d.souvereing@streeklabhaarlem.nl"))
|
||||
family = "Souverein", given = "Dennis", email = "d.souvereing@streeklabhaarlem.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Underwood", given = "Anthony", email = "au3@sanger.ac.uk"))
|
||||
Description: Functions to simplify the analysis and prediction of Antimicrobial
|
||||
Resistance (AMR) and to work with microbial and antimicrobial properties by
|
||||
using evidence-based methods, like those defined by Leclercq et al. (2013)
|
||||
|
|
23
NEWS.md
23
NEWS.md
|
@ -1,5 +1,18 @@
|
|||
# AMR 1.3.0.9001
|
||||
## <small>Last updated: 10 August 2020</small>
|
||||
# AMR 1.3.0.9002
|
||||
## <small>Last updated: 14 August 2020</small>
|
||||
|
||||
### New
|
||||
* Data set `intrinsic_resistant`. This data set contains all bug-drug combinations where the 'bug' is intrinsic resistant to the 'drug' according to the latest EUCAST insights. It contains just two columns: `microorganism` and `antibiotic`.
|
||||
|
||||
Curious about which enterococci are actually intrinsic resistant to vancomycin?
|
||||
```r
|
||||
library(AMR)
|
||||
library(dplyr)
|
||||
intrinsic_resistant %>%
|
||||
filter(antibiotic == "Vancomycin", microorganism %like% "Enterococcus") %>%
|
||||
pull(microorganism)
|
||||
# [1] "Enterococcus casseliflavus" "Enterococcus gallinarum"
|
||||
```
|
||||
|
||||
### Changed
|
||||
* Support for using `dplyr`'s `across()` in `as.rsi()` to interpret MIC values or disk zone diameters, that now also automatically determines the column with microorganism names or codes.
|
||||
|
@ -8,10 +21,12 @@
|
|||
your_data %>% mutate_if(is.mic, as.rsi)
|
||||
your_data %>% mutate_if(is.disk, as.rsi)
|
||||
|
||||
# since dplyr 1.0.0
|
||||
your_data %>% mutate(across(where(is.mic), as.rsi))
|
||||
# since dplyr 1.0.0
|
||||
your_data %>% mutate(across(where(is.mic), as.rsi))
|
||||
your_data %>% mutate(across(where(is.disk), as.rsi))
|
||||
```
|
||||
* Improved overall speed by tweaking joining functions
|
||||
|
||||
|
||||
# AMR 1.3.0
|
||||
|
||||
|
|
|
@ -48,6 +48,37 @@ distinct.default <- function(.data, ..., .keep_all = FALSE) {
|
|||
distinct.grouped_data <- function(.data, ..., .keep_all = FALSE) {
|
||||
apply_grouped_function(.data, "distinct", ..., .keep_all = .keep_all)
|
||||
}
|
||||
# faster implementation of left_join than using base::merge() by poorman - we use base::match():
|
||||
left_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
||||
if (is.null(by)) {
|
||||
by <- intersect(names(x), names(y))[1L]
|
||||
if (is.na(by)) {
|
||||
stop_("no common column found for left_join()")
|
||||
}
|
||||
join_message(by)
|
||||
} else if (!is.null(names(by))) {
|
||||
by <- unname(c(names(by), by))
|
||||
}
|
||||
if (length(by) == 1) {
|
||||
by <- rep(by, 2)
|
||||
}
|
||||
requires_suffix <- any(colnames(x) %in% colnames(y))
|
||||
if (requires_suffix == TRUE) {
|
||||
int_x <- colnames(x) %in% colnames(y) & colnames(x) != by[1]
|
||||
int_y <- colnames(y) %in% colnames(x) & colnames(y) != by[2]
|
||||
|
||||
colnames(x)[int_x] <- paste0(colnames(x)[int_x], suffix[1L])
|
||||
colnames(y)[int_y] <- paste0(colnames(y)[int_y], suffix[2L])
|
||||
}
|
||||
merged <- cbind(x,
|
||||
y[match(x[, by[1], drop = TRUE],
|
||||
y[, by[2], drop = TRUE]),
|
||||
colnames(y)[!colnames(y) %in% colnames(x) & !colnames(y) == by[2]],
|
||||
drop = FALSE])
|
||||
|
||||
rownames(merged) <- NULL
|
||||
merged
|
||||
}
|
||||
filter_join_worker <- function(x, y, by = NULL, type = c("anti", "semi")) {
|
||||
type <- match.arg(type, choices = c("anti", "semi"), several.ok = FALSE)
|
||||
if (is.null(by)) {
|
||||
|
@ -92,9 +123,10 @@ check_dataset_integrity <- function() {
|
|||
"synonyms", "oral_ddd", "oral_units",
|
||||
"iv_ddd", "iv_units", "loinc") %in% colnames(antibiotics),
|
||||
na.rm = TRUE)
|
||||
}, error = function(e)
|
||||
stop_('please use the command \'library("AMR")\' before using this function, to load the required reference data.', call = FALSE)
|
||||
)
|
||||
}, error = function(e) {
|
||||
# package not yet loaded
|
||||
require("AMR")
|
||||
})
|
||||
invisible(TRUE)
|
||||
}
|
||||
|
||||
|
|
|
@ -248,9 +248,9 @@ inner_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
|||
join_worker(x = x, y = y, by = by, suffix = suffix, sort = FALSE)
|
||||
}
|
||||
|
||||
left_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
||||
join_worker(x = x, y = y, by = by, suffix = suffix, all.x = TRUE)
|
||||
}
|
||||
# left_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
||||
# join_worker(x = x, y = y, by = by, suffix = suffix, all.x = TRUE)
|
||||
# }
|
||||
|
||||
right_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
||||
join_worker(x = x, y = y, by = by, suffix = suffix, all.y = TRUE)
|
||||
|
|
19
R/ab.R
19
R/ab.R
|
@ -25,6 +25,7 @@
|
|||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param x character vector to determine to antibiotic ID
|
||||
#' @param flag_multiple_results logical to indicate whether a note should be printed to the console that probably more than one antibiotic code or name can be retrieved from a single input value.
|
||||
#' @param info logical to indicate whether a progress bar should be printed
|
||||
#' @param ... arguments passed on to internal functions
|
||||
#' @rdname as.ab
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
|
@ -75,7 +76,7 @@
|
|||
#' # they use as.ab() internally:
|
||||
#' ab_name("J01FA01") # "Erythromycin"
|
||||
#' ab_name("eryt") # "Erythromycin"
|
||||
as.ab <- function(x, flag_multiple_results = TRUE, ...) {
|
||||
as.ab <- function(x, flag_multiple_results = TRUE, info = TRUE, ...) {
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
|
@ -131,7 +132,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, ...) {
|
|||
}
|
||||
|
||||
if (initial_search == TRUE) {
|
||||
progress <- progress_estimated(n = length(x), n_min = 25) # start if n >= 25
|
||||
progress <- progress_estimated(n = length(x), n_min = ifelse(isTRUE(info), 25, length(x) + 1)) # start if n >= 25
|
||||
on.exit(close(progress))
|
||||
}
|
||||
|
||||
|
@ -158,6 +159,13 @@ as.ab <- function(x, flag_multiple_results = TRUE, ...) {
|
|||
from_text <- character(0)
|
||||
}
|
||||
|
||||
# exact name
|
||||
found <- antibiotics[which(toupper(antibiotics$name) == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact AB code
|
||||
found <- antibiotics[which(antibiotics$ab == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
|
@ -179,13 +187,6 @@ as.ab <- function(x, flag_multiple_results = TRUE, ...) {
|
|||
next
|
||||
}
|
||||
|
||||
# exact name
|
||||
found <- antibiotics[which(toupper(antibiotics$name) == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact LOINC code
|
||||
loinc_found <- unlist(lapply(antibiotics$loinc,
|
||||
function(s) x[i] %in% s))
|
||||
|
|
25
R/data.R
25
R/data.R
|
@ -70,7 +70,7 @@
|
|||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <http://ec.europa.eu/health/documents/community-register/html/atc.htm>
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [microorganisms]
|
||||
#' @seealso [microorganisms], [intrinsic_resistant]
|
||||
"antibiotics"
|
||||
|
||||
#' @rdname antibiotics
|
||||
|
@ -119,7 +119,7 @@
|
|||
#'
|
||||
#' Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, <https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date> and <https://lpsn.dsmz.de> (check included version with [catalogue_of_life_version()]).
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [as.mo()], [mo_property()], [microorganisms.codes]
|
||||
#' @seealso [as.mo()], [mo_property()], [microorganisms.codes], [intrinsic_resistant]
|
||||
"microorganisms"
|
||||
|
||||
catalogue_of_life <- list(
|
||||
|
@ -235,4 +235,25 @@ catalogue_of_life <- list(
|
|||
#' - `uti`\cr A logical value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI)
|
||||
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.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. The file is updated automatically.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [intrinsic_resistant]
|
||||
"rsi_translation"
|
||||
|
||||
#' Data set with bacterial intrinsic resistance
|
||||
#'
|
||||
#' Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations.
|
||||
#' @format A [`data.frame`] with `r format(nrow(intrinsic_resistant), big.mark = ",")` observations and `r ncol(intrinsic_resistant)` variables:
|
||||
#' - `microorganism`\cr Name of the microorganism
|
||||
#' - `antibiotic`\cr Name of the antibiotic drug
|
||||
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.com/msberends/AMR/blob/master/data-raw/intrinsic_resistant.txt>. This file **allows for machine reading EUCAST guidelines about intrinsic resistance**, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
|
||||
#'
|
||||
#' This data set is based on 'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes', version `r EUCAST_VERSION_EXPERT_RULES`.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' if (require("dplyr")) {
|
||||
#' intrinsic_resistant %>%
|
||||
#' filter(antibiotic == "Vancomycin", microorganism %like% "Enterococcus") %>%
|
||||
#' pull(microorganism)
|
||||
#' # [1] "Enterococcus casseliflavus" "Enterococcus gallinarum"
|
||||
#' }
|
||||
#' @seealso [intrinsic_resistant]
|
||||
"intrinsic_resistant"
|
||||
|
|
|
@ -668,7 +668,13 @@ eucast_rules <- function(x,
|
|||
|
||||
# Official EUCAST rules ---------------------------------------------------
|
||||
eucast_notification_shown <- FALSE
|
||||
eucast_rules_df <- eucast_rules_file # internal data file
|
||||
if (!is.null(list(...)$eucast_rules_df)) {
|
||||
# this allows: eucast_rules(x, eucast_rules_df = AMR:::eucast_rules_file %>% filter(is.na(have_these_values)))
|
||||
eucast_rules_df <- list(...)$eucast_rules_df
|
||||
} else {
|
||||
# otherwise internal data file, created in data-raw/internals.R
|
||||
eucast_rules_df <- eucast_rules_file
|
||||
}
|
||||
for (i in seq_len(nrow(eucast_rules_df))) {
|
||||
|
||||
rule_previous <- eucast_rules_df[max(1, i - 1), "reference.rule"]
|
||||
|
|
|
@ -141,7 +141,7 @@ get_column_abx <- function(x,
|
|||
x <- x[, x_columns, drop = FALSE] # without drop = TRUE, x will become a vector when x_columns is length 1
|
||||
|
||||
df_trans <- data.frame(colnames = colnames(x),
|
||||
abcode = suppressWarnings(as.ab(colnames(x))))
|
||||
abcode = suppressWarnings(as.ab(colnames(x), info = FALSE)))
|
||||
df_trans <- df_trans[!is.na(df_trans$abcode), ]
|
||||
x <- as.character(df_trans$colnames)
|
||||
names(x) <- df_trans$abcode
|
||||
|
@ -150,7 +150,7 @@ get_column_abx <- function(x,
|
|||
# such as get_column_abx(example_isolates %>% rename(thisone = AMX), amox = "thisone")
|
||||
dots <- list(...)
|
||||
if (length(dots) > 0) {
|
||||
newnames <- suppressWarnings(as.ab(names(dots)))
|
||||
newnames <- suppressWarnings(as.ab(names(dots), info = FALSE))
|
||||
if (any(is.na(newnames))) {
|
||||
warning("Invalid antibiotic reference(s): ", toString(names(dots)[is.na(newnames)]),
|
||||
call. = FALSE, immediate. = TRUE)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#' @rdname lifecycle
|
||||
#' @description Functions in this `AMR` package are categorised using [the lifecycle circle of the Tidyverse as found on www.tidyverse.org/lifecycle](https://www.Tidyverse.org/lifecycle).
|
||||
#'
|
||||
#' \if{html}{\figure{lifecycle_Tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr}
|
||||
#' \if{html}{\figure{lifecycle_tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr}
|
||||
#' This page contains a section for every lifecycle (with text borrowed from the aforementioned Tidyverse website), so they can be used in the manual pages of the functions.
|
||||
#' @section Experimental lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_experimental.svg}{options: style=margin-bottom:5px} \cr}
|
||||
|
|
16
R/mo.R
16
R/mo.R
|
@ -375,22 +375,20 @@ exec_as.mo <- function(x,
|
|||
x <- data.frame(fullname_lower = tolower(x), stringsAsFactors = FALSE) %>%
|
||||
left_join_MO_lookup(by = "fullname_lower") %>%
|
||||
pull(property)
|
||||
# x <- reference_data_to_use[data.table(fullname_lower = tolower(x)),
|
||||
# on = "fullname_lower",
|
||||
# ..property][[1]]
|
||||
|
||||
} else if (all(x %in% reference_data_to_use$fullname)) {
|
||||
# we need special treatment for very prevalent full names, they are likely!
|
||||
# e.g. as.mo("Staphylococcus aureus")
|
||||
x <- data.frame(fullname = x, stringsAsFactors = FALSE) %>%
|
||||
left_join_MO_lookup(by = "fullname") %>%
|
||||
pull(property)
|
||||
|
||||
} else if (all(toupper(x) %in% microorganisms.codes$code)) {
|
||||
# commonly used MO codes
|
||||
x <- data.frame(code = toupper(x), stringsAsFactors = FALSE) %>%
|
||||
left_join(microorganisms.codes, by = "code") %>%
|
||||
left_join_MO_lookup(by = "mo") %>%
|
||||
pull(property)
|
||||
# y <- as.data.table(microorganisms.codes)[data.table(code = toupper(x)),
|
||||
# on = "code", ]
|
||||
#
|
||||
# x <- reference_data_to_use[data.table(mo = y[["mo"]]),
|
||||
# on = "mo",
|
||||
# ..property][[1]]
|
||||
|
||||
} else if (!all(x %in% microorganisms[, property])) {
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#'
|
||||
#' The function [proportion_df()] takes any variable from `data` that has an [`rsi`] class (created with [as.rsi()]) and calculates the proportions R, I and S. It also supports grouped variables. The function [rsi_df()] works exactly like [proportion_df()], but adds the number of isolates.
|
||||
#' @section Combination therapy:
|
||||
#' When using more than one variable for `...` (= combination therapy)), use `only_all_tested` to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI:
|
||||
#' When using more than one variable for `...` (= combination therapy), use `only_all_tested` to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI:
|
||||
#'
|
||||
#' ```
|
||||
#' --------------------------------------------------------------------
|
||||
|
|
4
R/zzz.R
4
R/zzz.R
|
@ -30,13 +30,13 @@
|
|||
}
|
||||
|
||||
.onAttach <- function(...) {
|
||||
if (!interactive() || stats::runif(1) > 0.25 || isTRUE(as.logical(Sys.getenv("AMR_silentstart", FALSE)))) {
|
||||
if (!interactive() || stats::runif(1) > 0.1 || isTRUE(as.logical(Sys.getenv("AMR_silentstart", FALSE)))) {
|
||||
return()
|
||||
}
|
||||
packageStartupMessage("Thank you for using the AMR package! ",
|
||||
"If you have a minute, please anonymously fill in this short questionnaire to improve the package and its functionalities:",
|
||||
"\nhttps://msberends.github.io/AMR/survey.html",
|
||||
"\n[ permanently turn this message off with: Sys.setenv(AMR_silentstart = TRUE) ]")
|
||||
"\n[ prevent his notice with suppressPackageStartupMessages(library(AMR)) or use Sys.setenv(AMR_silentstart = TRUE) ]")
|
||||
}
|
||||
|
||||
create_MO_lookup <- function() {
|
||||
|
|
|
@ -81,3 +81,5 @@ write.table(dplyr::mutate_if(antibiotics, ~!is.numeric(.), as.character),
|
|||
"data-raw/antibiotics.txt", sep = "\t", na = "", row.names = FALSE)
|
||||
write.table(dplyr::mutate_all(antivirals, as.character),
|
||||
"data-raw/antivirals.txt", sep = "\t", na = "", row.names = FALSE)
|
||||
write.table(intrinsic_resistant,
|
||||
"data-raw/intrinsic_resistant.txt", sep = "\t", na = "", row.names = FALSE)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,41 @@
|
|||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2020 Berends MS, Luz CF et al. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
library(AMR)
|
||||
int_resis <- data.frame(microorganism = microorganisms$mo, stringsAsFactors = FALSE)
|
||||
for (i in seq_len(nrow(antibiotics))) {
|
||||
int_resis$new <- as.rsi("S")
|
||||
colnames(int_resis)[ncol(int_resis)] <- antibiotics$name[i]
|
||||
}
|
||||
|
||||
int_resis <- eucast_rules(int_resis,
|
||||
eucast_rules_df = subset(AMR:::eucast_rules_file, is.na(have_these_values)))
|
||||
|
||||
int_resis <- int_resis[, sapply(int_resis, function(x) any(!is.rsi(x) | x == "R"))] %>%
|
||||
tidyr::pivot_longer(-microorganism) %>%
|
||||
filter(value == "R") %>%
|
||||
select(microorganism, antibiotic = name)
|
||||
|
||||
int_resis$microorganism <- mo_name(int_resis$microorganism, language = NULL)
|
||||
|
||||
intrinsic_resistant <- as.data.frame(int_resis, stringsAsFactors = FALSE)
|
||||
usethis::use_data(intrinsic_resistant, internal = FALSE, overwrite = TRUE, version = 2)
|
||||
rm(intrinsic_resistant)
|
Binary file not shown.
|
@ -81,7 +81,7 @@
|
|||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.github.io/AMR/index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9001</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9002</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9001</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9002</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9001</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9002</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -186,7 +186,7 @@
|
|||
<h1 data-toc-skip>How to conduct AMR analysis</h1>
|
||||
<h4 class="author">Matthijs S. Berends</h4>
|
||||
|
||||
<h4 class="date">10 August 2020</h4>
|
||||
<h4 class="date">14 August 2020</h4>
|
||||
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/AMR.Rmd"><code>vignettes/AMR.Rmd</code></a></small>
|
||||
<div class="hidden name"><code>AMR.Rmd</code></div>
|
||||
|
@ -195,7 +195,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 10 August 2020.</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 14 August 2020.</p>
|
||||
<div id="introduction" class="section level1">
|
||||
<h1 class="hasAnchor">
|
||||
<a href="#introduction" class="anchor"></a>Introduction</h1>
|
||||
|
@ -226,21 +226,21 @@
|
|||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2020-08-10</td>
|
||||
<td align="center">2020-08-14</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">2020-08-10</td>
|
||||
<td align="center">2020-08-14</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">2020-08-10</td>
|
||||
<td align="center">2020-08-14</td>
|
||||
<td align="center">efgh</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
|
@ -354,70 +354,70 @@
|
|||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2014-08-12</td>
|
||||
<td align="center">M9</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">2010-03-16</td>
|
||||
<td align="center">X9</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Staphylococcus aureus</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>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2013-03-13</td>
|
||||
<td align="center">W1</td>
|
||||
<td align="center">2013-10-27</td>
|
||||
<td align="center">G3</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Escherichia 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">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2015-12-02</td>
|
||||
<td align="center">L5</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">Staphylococcus aureus</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>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2017-09-11</td>
|
||||
<td align="center">O7</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Streptococcus 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">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2014-06-03</td>
|
||||
<td align="center">K4</td>
|
||||
<td align="center">2014-12-09</td>
|
||||
<td align="center">F7</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">Streptococcus pneumoniae</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">I</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2010-07-19</td>
|
||||
<td align="center">W4</td>
|
||||
<td align="center">2014-06-08</td>
|
||||
<td align="center">S9</td>
|
||||
<td align="center">Hospital B</td>
|
||||
<td align="center">Klebsiella pneumoniae</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">F</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2015-01-01</td>
|
||||
<td align="center">N10</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">Streptococcus 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">F</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2015-11-12</td>
|
||||
<td align="center">H6</td>
|
||||
<td align="center">Hospital B</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">S</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">M</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -452,16 +452,16 @@ Longest: 1</p>
|
|||
<tr class="odd">
|
||||
<td align="left">1</td>
|
||||
<td align="left">M</td>
|
||||
<td align="right">10,386</td>
|
||||
<td align="right">51.93%</td>
|
||||
<td align="right">10,386</td>
|
||||
<td align="right">51.93%</td>
|
||||
<td align="right">10,276</td>
|
||||
<td align="right">51.38%</td>
|
||||
<td align="right">10,276</td>
|
||||
<td align="right">51.38%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">2</td>
|
||||
<td align="left">F</td>
|
||||
<td align="right">9,614</td>
|
||||
<td align="right">48.07%</td>
|
||||
<td align="right">9,724</td>
|
||||
<td align="right">48.62%</td>
|
||||
<td align="right">20,000</td>
|
||||
<td align="right">100.00%</td>
|
||||
</tr>
|
||||
|
@ -511,7 +511,7 @@ Longest: 1</p>
|
|||
<span class="co"># NOTE: Using column `date` as input for `col_date`.</span>
|
||||
<span class="co"># NOTE: Using column `patient_id` as input for `col_patient_id`.</span>
|
||||
</pre></div>
|
||||
<p>So only 28.5% 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>
|
||||
<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>
|
||||
<div class="sourceCode" id="cb16"><pre class="downlit">
|
||||
<span class="kw">data_1st</span> <span class="op"><-</span> <span class="kw">data</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="kw">first</span> <span class="op">==</span> <span class="fl">TRUE</span>)
|
||||
|
@ -525,7 +525,7 @@ Longest: 1</p>
|
|||
<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 A7, 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 N8, sorted on date:</p>
|
||||
<table class="table">
|
||||
<thead><tr class="header">
|
||||
<th align="center">isolate</th>
|
||||
|
@ -541,10 +541,10 @@ Longest: 1</p>
|
|||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-03</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-05-17</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</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>
|
||||
|
@ -552,10 +552,10 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-02-04</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-07-03</td>
|
||||
<td align="center">N8</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>
|
||||
|
@ -563,52 +563,52 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-05</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-07-31</td>
|
||||
<td align="center">N8</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">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-06-15</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-09-13</td>
|
||||
<td align="center">N8</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">5</td>
|
||||
<td align="center">2010-08-28</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-09-15</td>
|
||||
<td align="center">N8</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">R</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-09-03</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-16</td>
|
||||
<td align="center">N8</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">7</td>
|
||||
<td align="center">2010-11-14</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-17</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
|
@ -618,30 +618,30 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2011-02-14</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-24</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</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">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2011-03-06</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-12-27</td>
|
||||
<td align="center">N8</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">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-03-09</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2011-02-25</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
|
@ -651,14 +651,13 @@ Longest: 1</p>
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>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>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="cb18"><pre class="downlit">
|
||||
<span class="kw">data</span> <span class="op"><-</span> <span class="kw">data</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(keyab = <span class="fu"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(<span class="kw">.</span>)) <span class="op">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(first_weighted = <span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span>(<span class="kw">.</span>))
|
||||
<span class="co"># NOTE: Using column `bacteria` as input for `col_mo`.</span>
|
||||
<span class="co"># NOTE: more than one result was found for item 1: amoxicillin/clavulanic acid, azidocillin</span>
|
||||
<span class="co"># NOTE: Using column `bacteria` as input for `col_mo`.</span>
|
||||
<span class="co"># NOTE: Using column `date` as input for `col_date`.</span>
|
||||
<span class="co"># NOTE: Using column `patient_id` as input for `col_patient_id`.</span>
|
||||
|
@ -680,10 +679,10 @@ Longest: 1</p>
|
|||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">1</td>
|
||||
<td align="center">2010-02-03</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-05-17</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</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>
|
||||
|
@ -692,10 +691,10 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2</td>
|
||||
<td align="center">2010-02-04</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-07-03</td>
|
||||
<td align="center">N8</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>
|
||||
|
@ -704,56 +703,56 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">3</td>
|
||||
<td align="center">2010-04-05</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-07-31</td>
|
||||
<td align="center">N8</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">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">4</td>
|
||||
<td align="center">2010-06-15</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-09-13</td>
|
||||
<td align="center">N8</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">FALSE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">5</td>
|
||||
<td align="center">2010-08-28</td>
|
||||
<td align="center">A7</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">5</td>
|
||||
<td align="center">2010-09-15</td>
|
||||
<td align="center">N8</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">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">6</td>
|
||||
<td align="center">2010-09-03</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-16</td>
|
||||
<td align="center">N8</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>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">7</td>
|
||||
<td align="center">2010-11-14</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-17</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
|
@ -764,49 +763,49 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">8</td>
|
||||
<td align="center">2011-02-14</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-10-24</td>
|
||||
<td align="center">N8</td>
|
||||
<td align="center">B_ESCHR_COLI</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">TRUE</td>
|
||||
<td align="center">FALSE</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">9</td>
|
||||
<td align="center">2011-03-06</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2010-12-27</td>
|
||||
<td align="center">N8</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">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-03-09</td>
|
||||
<td align="center">A7</td>
|
||||
<td align="center">2011-02-25</td>
|
||||
<td align="center">N8</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">FALSE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Instead of 2, now 9 isolates are flagged. In total, 79.0% of all isolates are marked ‘first weighted’ - 50.5% 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 1, now 9 isolates are flagged. In total, 78.0% of all isolates are marked ‘first weighted’ - 49.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>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="cb19"><pre class="downlit">
|
||||
<span class="kw">data_1st</span> <span class="op"><-</span> <span class="kw">data</span> <span class="op">%>%</span>
|
||||
<span class="fu"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()
|
||||
</pre></div>
|
||||
<p>So we end up with 15,794 isolates for analysis.</p>
|
||||
<p>So we end up with 15,607 isolates for analysis.</p>
|
||||
<p>We can remove unneeded columns:</p>
|
||||
<div class="sourceCode" id="cb20"><pre class="downlit">
|
||||
<span class="kw">data_1st</span> <span class="op"><-</span> <span class="kw">data_1st</span> <span class="op">%>%</span>
|
||||
|
@ -852,15 +851,15 @@ Longest: 1</p>
|
|||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="left">1</td>
|
||||
<td align="center">2014-08-12</td>
|
||||
<td align="center">M9</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">2010-03-16</td>
|
||||
<td align="center">X9</td>
|
||||
<td align="center">Hospital B</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">M</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Staphylococcus</td>
|
||||
<td align="center">aureus</td>
|
||||
|
@ -868,27 +867,11 @@ Longest: 1</p>
|
|||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">2</td>
|
||||
<td align="center">2013-03-13</td>
|
||||
<td align="center">W1</td>
|
||||
<td align="center">2013-10-27</td>
|
||||
<td align="center">G3</td>
|
||||
<td align="center">Hospital A</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">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 align="left">3</td>
|
||||
<td align="center">2015-12-02</td>
|
||||
<td align="center">L5</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">R</td>
|
||||
<td align="center">S</td>
|
||||
|
@ -898,11 +881,43 @@ Longest: 1</p>
|
|||
<td align="center">aureus</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="left">3</td>
|
||||
<td align="center">2014-12-09</td>
|
||||
<td align="center">F7</td>
|
||||
<td align="center">Hospital C</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">M</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 align="left">4</td>
|
||||
<td align="center">2017-09-11</td>
|
||||
<td align="center">O7</td>
|
||||
<td align="center">2014-06-08</td>
|
||||
<td align="center">S9</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">S</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 align="left">5</td>
|
||||
<td align="center">2015-01-01</td>
|
||||
<td align="center">N10</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">R</td>
|
||||
<td align="center">R</td>
|
||||
|
@ -914,36 +929,20 @@ Longest: 1</p>
|
|||
<td align="center">pneumoniae</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="left">5</td>
|
||||
<td align="center">2014-06-03</td>
|
||||
<td align="center">K4</td>
|
||||
<td align="center">Hospital C</td>
|
||||
<td align="center">B_STRPT_PNMN</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</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 align="left">7</td>
|
||||
<td align="center">2011-02-14</td>
|
||||
<td align="center">B9</td>
|
||||
<td align="center">Hospital A</td>
|
||||
<td align="center">B_ESCHR_COLI</td>
|
||||
<td align="center">2014-08-04</td>
|
||||
<td align="center">O9</td>
|
||||
<td align="center">Hospital D</td>
|
||||
<td align="center">B_STPHY_AURS</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">M</td>
|
||||
<td align="center">Gram-negative</td>
|
||||
<td align="center">Escherichia</td>
|
||||
<td align="center">coli</td>
|
||||
<td align="center">F</td>
|
||||
<td align="center">Gram-positive</td>
|
||||
<td align="center">Staphylococcus</td>
|
||||
<td align="center">aureus</td>
|
||||
<td align="center">TRUE</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -969,8 +968,8 @@ Longest: 1</p>
|
|||
</pre></div>
|
||||
<p><strong>Frequency table</strong></p>
|
||||
<p>Class: character<br>
|
||||
Length: 15,794<br>
|
||||
Available: 15,794 (100%, NA: 0 = 0%)<br>
|
||||
Length: 15,607<br>
|
||||
Available: 15,607 (100%, NA: 0 = 0%)<br>
|
||||
Unique: 4</p>
|
||||
<p>Shortest: 16<br>
|
||||
Longest: 24</p>
|
||||
|
@ -987,33 +986,33 @@ Longest: 24</p>
|
|||
<tr class="odd">
|
||||
<td align="left">1</td>
|
||||
<td align="left">Escherichia coli</td>
|
||||
<td align="right">7,828</td>
|
||||
<td align="right">49.56%</td>
|
||||
<td align="right">7,828</td>
|
||||
<td align="right">49.56%</td>
|
||||
<td align="right">7,836</td>
|
||||
<td align="right">50.21%</td>
|
||||
<td align="right">7,836</td>
|
||||
<td align="right">50.21%</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="left">2</td>
|
||||
<td align="left">Staphylococcus aureus</td>
|
||||
<td align="right">3,925</td>
|
||||
<td align="right">24.85%</td>
|
||||
<td align="right">11,753</td>
|
||||
<td align="right">74.41%</td>
|
||||
<td align="right">3,899</td>
|
||||
<td align="right">24.98%</td>
|
||||
<td align="right">11,735</td>
|
||||
<td align="right">75.19%</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="left">3</td>
|
||||
<td align="left">Streptococcus pneumoniae</td>
|
||||
<td align="right">2,399</td>
|
||||
<td align="right">15.19%</td>
|
||||
<td align="right">14,152</td>
|
||||
<td align="right">89.60%</td>
|
||||
<td align="right">2,337</td>
|
||||
<td align="right">14.97%</td>
|
||||
<td align="right">14,072</td>
|
||||
<td align="right">90.16%</td>
|
||||
</tr>
|
||||
<tr class="even" |