diff --git a/DESCRIPTION b/DESCRIPTION index 76521423..d9500f25 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.7.1.9095 -Date: 2019-10-06 +Version: 0.7.1.9096 +Date: 2019-10-07 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index ca2829b0..fbec4890 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.7.1.9095 -Last updated: 06-Oct-2019 +# AMR 0.7.1.9096 +Last updated: 07-Oct-2019 ### Breaking * Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`: @@ -23,6 +23,7 @@ ``` This is important, because a value like `"testvalue"` could never be understood by e.g. `mo_name()`, although the class would suggest a valid microbial code. * Function `freq()` has moved to a new package, [`clean`](https://github.com/msberends/clean) ([CRAN link](https://cran.r-project.org/package=clean)), since creating frequency tables actually does not fit the scope of this package. The `freq()` function still works, since it is re-exported from the `clean` package (which will be installed automatically upon updating this `AMR` package). +* Renamed data set `septic_patients` to `example_isolates` ### New * Function `bug_drug_combinations()` to quickly get a `data.frame` with the antimicrobial resistance of any bug-drug combination in a data set. The columns with microorganism codes is guessed automatically and its input is transformed with `mo_shortname()` at default: @@ -94,8 +95,8 @@ * Added support for unknown yeasts and fungi * Changed most microorganism IDs to improve readability. For example, the old code `B_ENTRC_FAE` could have been both *E. faecalis* and *E. faecium*. Its new code is `B_ENTRC_FCLS` and *E. faecium* has become `B_ENTRC_FACM`. Also, the Latin character æ (ae) is now preserved at the start of each genus and species abbreviation. For example, the old code for *Aerococcus urinae* was `B_ARCCC_NAE`. This is now `B_AERCC_URIN`. **IMPORTANT:** Old microorganism IDs are still supported, but support will be dropped in a future version. Use `as.mo()` on your old codes to transform them to the new format. Using functions from the `mo_*` family (like `mo_name()` and `mo_gramstain()`) on old codes, will throw a warning. -* More intelligent guessing for `as.ab()` which also led to bidirectional language support -* Renamed data set `septic_patients` to `example_isolates` +* More intelligent guessing for `as.ab()`, including bidirectional language support +* Added support for the German national guideline (3MRGN/4MRGN) in the `mdro()` function, to determine multi-drug resistant organisms * Function `eucast_rules()`: * Fixed a bug for *Yersinia pseudotuberculosis* * Added more informative errors and warnings diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 5f51bcf8..ce75cdb1 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -41,7 +41,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' @section Antibiotics: #' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. #' -#' The following antibiotics are used for the functions \code{\link{eucast_rules}} and \code{\link{mdro}}. These are shown below in the format '\strong{antimicrobial ID}: name (\emph{ATC code})', sorted by name: +#' The following antibiotics are used for the functions \code{\link{eucast_rules}} and \code{\link{mdro}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: #' #' \strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), #' \strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), diff --git a/R/mdro.R b/R/mdro.R index d7d47303..a38d78cd 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -28,18 +28,20 @@ #' @inheritParams eucast_rules #' @param verbose print additional info: missing antibiotic columns per parameter #' @inheritSection eucast_rules Antibiotics -#' @details Currently supported guidelines are: +#' @details Currently supported guidelines are (case-insensitive): #' \itemize{ -#' \item{\code{guideline = "EUCAST"}: EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link})} -#' \item{\code{guideline = "TB"}: World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link})} -#' \item{\code{guideline = "MRGN"}: (work in progress)} -#' \item{\code{guideline = "BRMO"}: Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (\href{https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH}{link})} +#' \item{\code{guideline = "EUCAST"}: The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link})} +#' \item{\code{guideline = "TB"}: The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link})} +#' \item{\code{guideline = "MRGN"}: The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6} +#' \item{\code{guideline = "BRMO"}: The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (\href{https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH}{link})} #' } #' #' Please suggest your own (country-specific) guidelines by letting us know: \url{https://gitlab.com/msberends/AMR/issues/new}. -#' @return For TB (\code{mdr_tb()}): Ordered factor with levels \code{Negative < Mono-resistance < Poly-resistance < Multidrug resistance < Extensive drug resistance}. -#' -#' For everything else: Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests. +#' @return \itemize{ +#' \item{TB guideline - function \code{mdr_tb()} or \code{mdro(..., guideline = "TB")}:\cr Ordered factor with levels \code{Negative < Mono-resistant < Poly-resistant < Multi-drug-resistant < Extensive drug-resistant}} +#' \item{German guideline - function \code{mrgn()} or \code{mdro(..., guideline = "MRGN")}:\cr Ordered factor with levels \code{Negative < 3MRGN < 4MRGN}} +#' \item{Everything else:\cr Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests} +#' } #' @rdname mdro #' @importFrom dplyr %>% #' @importFrom crayon red blue bold @@ -56,7 +58,13 @@ #' #' example_isolates %>% #' mutate(EUCAST = mdro(.), -#' BRMO = brmo(.)) +#' BRMO = brmo(.), +#' MRGN = mrgn(.)) +#' +#' example_isolates %>% +#' rename(PIP = TZP) # no piperacillin, so take piperacillin/tazobactam +#' mrgn() %>% # check German guideline +#' freq() # check frequencies mdro <- function(x, guideline = NULL, col_mo = NULL, @@ -120,10 +128,10 @@ mdro <- function(x, # support per country: } else if (guideline$code == "mrgn") { - guideline$name <- "Germany" - guideline$name <- "" - guideline$version <- "" - guideline$source <- "" + guideline$name <- "Cross-border comparison of the Dutch and German guidelines on multidrug-resistant Gram-negative microorganisms" + guideline$author <- "J. M\u00fcller, A. Voss, R. K\u00f6ck, ..., W.V. Kern, C. Wendt, A.W. Friedrich" + guideline$version <- "N/A" + guideline$source <- "M\u00fcller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6" } else if (guideline$code == "brmo") { guideline$name <- "WIP-Richtlijn Bijzonder Resistente Micro-organismen (BRMO)" guideline$author <- "RIVM (Rijksinstituut voor de Volksgezondheid)" @@ -153,6 +161,15 @@ mdro <- function(x, "RIB", "RFP"), verbose = verbose, ...) + } else if (guideline$code == "mrgn") { + cols_ab <- get_column_abx(x = x, + soft_dependencies = c("PIP", + "CTX", + "CAZ", + "IPM", + "MEM", + "CIP"), + verbose = verbose, ...) } else { cols_ab <- get_column_abx(x = x, verbose = verbose, ...) } @@ -269,7 +286,9 @@ mdro <- function(x, # join to microorganisms data set left_join_microorganisms(by = col_mo) %>% # add unconfirmed to where genus is available - mutate(MDRO = ifelse(!is.na(genus), 1, NA_integer_)) + mutate(MDRO = ifelse(!is.na(genus), 1, NA_integer_)) %>% + # transform to data.frame so subsetting is possible with x[y, z] (might not be the case with tibble/data.table/...) + as.data.frame(stringsAsFactors = FALSE) if (guideline$code == "eucast") { # EUCAST ------------------------------------------------------------------ @@ -302,7 +321,7 @@ mdro <- function(x, "any") # Table 6 trans_tbl(3, - which(x$fullname %like% "^Staphylococcus (aureus|epidermidis|coagulase negatief|hominis|haemolyticus|intermedius|pseudointermedius)"), + which(x$fullname %like% "^(Coagulase-negative|Staphylococcus (aureus|epidermidis|hominis|haemolyticus|intermedius|pseudointermedius))"), c(VAN, TEC, DAP, LNZ, QDA, TGC), "any") trans_tbl(3, @@ -314,7 +333,7 @@ mdro <- function(x, c(carbapenems, VAN, TEC, DAP, LNZ, QDA, TGC, RIF), "any") trans_tbl(3, # Sr. groups A/B/C/G - which(x$fullname %like% "^Streptococcus (pyogenes|agalactiae|equisimilis|equi|zooepidemicus|dysgalactiae|anginosus)"), + which(x$fullname %like% "^Streptococcus (group (A|B|C|G)|pyogenes|agalactiae|equisimilis|equi|zooepidemicus|dysgalactiae|anginosus)"), c(PEN, cephalosporins, VAN, TEC, DAP, LNZ, QDA, TGC), "any") trans_tbl(3, @@ -338,7 +357,51 @@ mdro <- function(x, if (guideline$code == "mrgn") { # Germany ----------------------------------------------------------------- - stop("We are still working on German guidelines in this beta version.", call. = FALSE) + CTX_or_CAZ <- CTX %or% CAZ + IPM_or_MEM <- IPM %or% MEM + x$missing <- NA_character_ + if (is.na(PIP)) PIP <- "missing" + if (is.na(CTX_or_CAZ)) CTX_or_CAZ <- "missing" + if (is.na(IPM_or_MEM)) IPM_or_MEM <- "missing" + if (is.na(IPM)) IPM <- "missing" + if (is.na(MEM)) MEM <- "missing" + if (is.na(CIP)) CIP <- "missing" + + # Table 1 + x[which((x$family == "Enterobacteriaceae" | + x$fullname %like% "^Acinetobacter baumannii") & + x[, PIP] == "R" & + x[, CTX_or_CAZ] == "R" & + x[, IPM_or_MEM] == "S" & + x[, CIP] == "R"), + "MDRO"] <- 2 # 2 = 3MRGN + + x[which((x$family == "Enterobacteriaceae" | + x$fullname %like% "^Acinetobacter baumannii") & + x[, PIP] == "R" & + x[, CTX_or_CAZ] == "R" & + x[, IPM_or_MEM] == "R" & + x[, CIP] == "R"), + "MDRO"] <- 3 # 3 = 4MRGN, overwrites 3MRGN if applicable + + x[which((x$family == "Enterobacteriaceae" | + x$fullname %like% "^Acinetobacter baumannii") & + x[, IPM] == "R" | x[, MEM] == "R"), + "MDRO"] <- 3 # 3 = 4MRGN, always when imipenem or meropenem is R + + x[which(x$fullname %like% "^Pseudomonas aeruginosa" & + (x[, PIP] == "S") + + (x[, CTX_or_CAZ] == "S") + + (x[, IPM_or_MEM] == "S") + + (x[, CIP] == "S") == 1), + "MDRO"] <- 2 # 2 = 3MRGN, if only 1 group is S + + x[which((x$fullname %like% "^Pseudomonas aeruginosa") & + x[, PIP] == "R" & + x[, CTX_or_CAZ] == "R" & + x[, IPM_or_MEM] == "R" & + x[, CIP] == "R"), + "MDRO"] <- 3 # 3 = 4MRGN } if (guideline$code == "brmo") { @@ -486,6 +549,11 @@ mdro <- function(x, levels = 1:5, labels = c("Negative", "Mono-resistant", "Poly-resistant", "Multi-drug-resistant", "Extensive drug-resistant"), ordered = TRUE) + } else if (guideline$code == "mrgn") { + factor(x = x$MDRO, + levels = 1:3, + labels = c("Negative", "3MRGN", "4MRGN"), + ordered = TRUE) } else { factor(x = x$MDRO, levels = 1:3, diff --git a/docs/404.html b/docs/404.html index f5434742..425de77f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index cada0e5d..0f44aaa4 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index d502016e..cb697ca1 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -41,7 +41,7 @@ @@ -187,7 +187,7 @@AMR.Rmd
Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 30 September 2019.
+Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 07 October 2019.
So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values M
and F
. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.
The data is already quite clean, but we still need to transform some variables. The bacteria
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 mutate()
function of the dplyr
package makes this really easy:
data <- data %>%
@@ -438,14 +438,14 @@
# Pasteurella multocida (no changes)
# Staphylococcus (no changes)
# Streptococcus groups A, B, C, G (no changes)
-# Streptococcus pneumoniae (1,448 values changed)
+# Streptococcus pneumoniae (1,466 values changed)
# Viridans group streptococci (no changes)
#
# EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-# Table 01: Intrinsic resistance in Enterobacteriaceae (1,335 values changed)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1,304 values changed)
# Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)
# Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)
-# Table 04: Intrinsic resistance in Gram-positive bacteria (2,751 values changed)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2,787 values changed)
# Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)
# Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)
# Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)
@@ -453,24 +453,24 @@
# Table 13: Interpretive rules for quinolones (no changes)
#
# Other rules
-# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,259 values changed)
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (125 values changed)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,243 values changed)
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (114 values changed)
# Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)
# Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)
# Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)
# Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)
#
# --------------------------------------------------------------------------
-# EUCAST rules affected 6,609 out of 20,000 rows, making a total of 7,918 edits
+# EUCAST rules affected 6,571 out of 20,000 rows, making a total of 7,914 edits
# => added 0 test results
#
-# => changed 7,918 test results
-# - 101 test results changed from S to I
-# - 4,771 test results changed from S to R
-# - 1,065 test results changed from I to S
-# - 321 test results changed from I to R
-# - 1,636 test results changed from R to S
-# - 24 test results changed from R to I
+# => changed 7,914 test results
+# - 104 test results changed from S to I
+# - 4,762 test results changed from S to R
+# - 1,059 test results changed from I to S
+# - 331 test results changed from I to R
+# - 1,638 test results changed from R to S
+# - 20 test results changed from R to I
# --------------------------------------------------------------------------
#
# Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.
So only 28.4% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 28.5% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
For future use, the above two syntaxes can be shortened with the filter_first_isolate()
function:
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 K5, sorted on date:
+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 E8, sorted on date:
isolate | @@ -525,8 +525,8 @@||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-04-28 | -K5 | +2010-01-14 | +E8 | B_ESCHR_COLI | S | S | @@ -536,8 +536,8 @@|||||
2 | -2010-06-18 | -K5 | +2010-03-24 | +E8 | B_ESCHR_COLI | S | S | @@ -547,10 +547,10 @@|||||
3 | -2010-10-15 | -K5 | +2010-05-23 | +E8 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -558,8 +558,8 @@||
4 | -2010-12-16 | -K5 | +2010-08-30 | +E8 | B_ESCHR_COLI | S | S | @@ -569,30 +569,19 @@|||||
5 | -2011-01-17 | -K5 | +2010-09-04 | +E8 | B_ESCHR_COLI | -S | -S | +R | +R | S | S | FALSE |
6 | -2011-06-30 | -K5 | -B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -||||
7 | -2011-08-11 | -K5 | +2010-09-14 | +E8 | B_ESCHR_COLI | R | S | @@ -600,42 +589,53 @@S | FALSE | |||
7 | +2010-10-02 | +E8 | +B_ESCHR_COLI | +S | +S | +R | +S | +FALSE | +||||
8 | -2011-10-18 | -K5 | +2011-01-01 | +E8 | B_ESCHR_COLI | -R | -R | +S | +S | S | S | FALSE |
9 | -2012-04-24 | -K5 | +2011-02-10 | +E8 | B_ESCHR_COLI | -I | S | S | -R | -FALSE | -||
10 | -2012-10-30 | -K5 | -B_ESCHR_COLI | -R | -S | S | S | TRUE | ||||
10 | +2011-03-11 | +E8 | +B_ESCHR_COLI | +S | +S | +S | +S | +FALSE | +
Only 3 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 key_antibiotics()
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.
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 key_antibiotics()
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.
If a column exists with a name like ‘key(…)ab’ the first_isolate()
function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:
data <- data %>%
mutate(keyab = key_antibiotics(.)) %>%
@@ -646,7 +646,7 @@
# NOTE: Using column `patient_id` as input for `col_patient_id`.
# NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.
# [Criterion] Inclusion based on key antibiotics, ignoring I.
-# => Found 15,102 first weighted isolates (75.5% of total)
isolate | @@ -663,8 +663,8 @@||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-04-28 | -K5 | +2010-01-14 | +E8 | B_ESCHR_COLI | S | S | @@ -675,8 +675,8 @@|||||||
2 | -2010-06-18 | -K5 | +2010-03-24 | +E8 | B_ESCHR_COLI | S | S | @@ -687,8 +687,44 @@|||||||
3 | -2010-10-15 | -K5 | +2010-05-23 | +E8 | +B_ESCHR_COLI | +S | +S | +S | +S | +FALSE | +FALSE | +|||
4 | +2010-08-30 | +E8 | +B_ESCHR_COLI | +S | +S | +S | +S | +FALSE | +FALSE | +|||||
5 | +2010-09-04 | +E8 | +B_ESCHR_COLI | +R | +R | +S | +S | +FALSE | +TRUE | +|||||
6 | +2010-09-14 | +E8 | B_ESCHR_COLI | R | S | @@ -697,61 +733,25 @@FALSE | TRUE | |||||||
4 | -2010-12-16 | -K5 | -B_ESCHR_COLI | -S | -S | -S | -S | -FALSE | -TRUE | -|||||
5 | -2011-01-17 | -K5 | -B_ESCHR_COLI | -S | -S | -S | -S | -FALSE | -FALSE | -|||||
6 | -2011-06-30 | -K5 | -B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -TRUE | -|||||
7 | -2011-08-11 | -K5 | +2010-10-02 | +E8 | B_ESCHR_COLI | +S | +S | R | S | -S | -S | FALSE | TRUE | |
8 | -2011-10-18 | -K5 | +2011-01-01 | +E8 | B_ESCHR_COLI | -R | -R | +S | +S | S | S | FALSE | @@ -759,35 +759,35 @@||
9 | -2012-04-24 | -K5 | +2011-02-10 | +E8 | B_ESCHR_COLI | -I | S | S | -R | -FALSE | +S | +S | +TRUE | TRUE |
10 | -2012-10-30 | -K5 | +2011-03-11 | +E8 | B_ESCHR_COLI | -R | S | S | S | -TRUE | -TRUE | +S | +FALSE | +FALSE |
Instead of 3, now 9 isolates are flagged. In total, 75.5% of all isolates are marked ‘first weighted’ - 47.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
+Instead of 2, now 7 isolates are flagged. In total, 75.4% of all isolates are marked ‘first weighted’ - 47.0% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
As with filter_first_isolate()
, there’s a shortcut for this new algorithm too:
So we end up with 15,102 isolates for analysis.
+So we end up with 15,087 isolates for analysis.
We can remove unneeded columns:
@@ -813,25 +813,89 @@Time for the analysis!
@@ -926,7 +926,7 @@Frequency table
Class: character
-Length: 15,102 (of which NA: 0 = 0%)
+Length: 15,087 (of which NA: 0 = 0%)
Unique: 4
Shortest: 16
Longest: 24
The functions portion_S()
, portion_SI()
, portion_I()
, portion_IR()
and portion_R()
can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (portion_R()
) and susceptibility as the portion of S and I (portion_SI()
). These functions can be used on their own:
Or can be used in conjuction with group_by()
and summarise()
, both from the dplyr
package:
data_1st %>%
group_by(hospital) %>%
@@ -993,19 +993,19 @@ Longest: 24
Hospital A
-0.4653354
+0.4725537
Hospital B
-0.4673178
+0.4704871
Hospital C
-0.4720576
+0.4684529
Hospital D
-0.4613045
+0.4749061
@@ -1023,23 +1023,23 @@ Longest: 24
Hospital A
-0.4653354
-4457
+0.4725537
+4609
Hospital B
-0.4673178
-5324
+0.4704871
+5235
Hospital C
-0.4720576
-2362
+0.4684529
+2314
Hospital D
-0.4613045
-2959
+0.4749061
+2929
@@ -1059,27 +1059,27 @@ Longest: 24
Escherichia
-0.9226512
-0.8964633
-0.9943305
+0.9202644
+0.8950351
+0.9919050
Klebsiella
-0.8281445
-0.8953923
-0.9856787
+0.8166773
+0.9019733
+0.9847231
Staphylococcus
-0.9236723
-0.9196691
-0.9954630
+0.9247283
+0.9196926
+0.9939041
Streptococcus
-0.6253738
+0.6194766
0.0000000
-0.6253738
+0.6194766
diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png
index 1140c870..7797d727 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png
index 1a157cce..a0813f87 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png
index 6039720d..66384219 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png
index 32d3dbdb..1b63c680 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 1ef2919f..0c630127 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -84,7 +84,7 @@
Last updated: 06-Oct-2019
+Last updated: 07-Oct-2019
#> Warning message:
#> invalid microorganism code, NA generated
"testvalue"
could never be understood by e.g. mo_name()
, although the class would suggest a valid microbial code.
-Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).Renamed data set septic_patients
to example_isolates
also_single_tested
w
B_ENTRC_FAE
could have been both E. faecalis and E. faecium. Its new code is B_ENTRC_FCLS
and E. faecium has become B_ENTRC_FACM
. Also, the Latin character æ (ae) is now preserved at the start of each genus and species abbreviation. For example, the old code for Aerococcus urinae was B_ARCCC_NAE
. This is now B_AERCC_URIN
. IMPORTANT: Old microorganism IDs are still supported, but support will be dropped in a future version. Use as.mo()
on your old codes to transform them to the new format. Using functions from the mo_*
family (like mo_name()
and mo_gramstain()
) on old codes, will throw a warning.as.ab()
which also led to bidirectional language supportseptic_patients
to example_isolates
-as.ab()
, including bidirectional language supportmdro()
function, to determine multi-drug resistant organismseucast_rules()
:
as.mo(..., allow_uncertain = 3)
Contents