diff --git a/DESCRIPTION b/DESCRIPTION index 6dd34bb6..d9a94b3d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.8.0.9032 -Date: 2019-11-15 +Version: 0.8.0.9033 +Date: 2019-11-18 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 7a5ce649..e8825b6b 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.8.0.9032 -Last updated: 15-Nov-2019 +# AMR 0.8.0.9033 +## Last updated: 18-Nov-2019 ### Breaking * Adopted Adeolu *et al.* (2016), [PMID 27620848](https://www.ncbi.nlm.nih.gov/pubmed/27620848) for the `microorganisms` data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like *Morganellaceae* and *Yersiniaceae*). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with `mdro()` will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family. @@ -25,6 +25,7 @@ * Support for a new MDRO guideline: Magiorakos AP, Srinivasan A *et al.* "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012). * This is now the new default guideline for the `mdro()` function * The new Verbose mode (`mdro(...., verbose = TRUE)`) returns an informative data set where the reason for MDRO determination is given for every isolate, and an list of the resistant antimicrobial agents +* Data set `antivirals`, containing all entries from the ATC J05 group with their DDDs for oral and parenteral treatment ### Changes * Improvements to algorithm in `as.mo()`: @@ -48,13 +49,14 @@ * When running `as.rsi()` over a data set, it will now print the guideline that will be used if it is not specified by the user * Improvements for `eucast_rules()`: * Fix where *Stenotrophomonas maltophilia* would always become ceftazidime R (following EUCAST v3.1) - * Fix where *Leuconostoc* and *Pediococcus* would not always become glyopeptides R + * Fix where *Leuconostoc* and *Pediococcus* would not always become glycopeptides R * non-EUCAST rules in `eucast_rules()` are now applied first and not as last anymore. This is to improve the dependency on certain antibiotics for the official EUCAST rules. Please see `?eucast_rules`. * Fix for interpreting MIC values with `as.rsi()` where the input is `NA` * Added "imi" and "imp" as allowed abbreviation for Imipenem (IPM) * Fix for automatically determining columns with antibiotic results in `mdro()` and `eucast_rules()` * Added ATC codes for ceftaroline, ceftobiprole and faropenem and fixed two typos in the `antibiotics` data set * More robust way of determining valid MIC values +* Small changed to the `example_isolates` data set to better reflect reality ### Other * Change dependency on `clean` to `cleaner`, as this package was renamed accordingly upon CRAN request diff --git a/R/data.R b/R/data.R index 4244bc6a..f1fbb0a7 100755 --- a/R/data.R +++ b/R/data.R @@ -34,7 +34,7 @@ #' \item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)} #' \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} #' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} -#' \item{\code{oral_units}}{Units of \code{ddd_units}} +#' \item{\code{oral_units}}{Units of \code{oral_ddd}} #' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} #' \item{\code{iv_units}}{Units of \code{iv_ddd}} #' } @@ -48,9 +48,28 @@ #' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} #' @inheritSection WHOCC WHOCC #' @inheritSection AMR Read more on our website! -#' @seealso \code{\link{microorganisms}} +#' @seealso \code{\link{antivirals}} \code{\link{microorganisms}} "antibiotics" +#' Data set with ~100 antivirals +#' +#' A data set containing all antivirals, according to the ATC code group 'J05' (Antivirals for systemic use). +#' @format A \code{\link{data.frame}} with 102 observations and 7 variables: +#' \describe{ +#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC} +#' \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} +#' \item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC} +#' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} +#' \item{\code{oral_units}}{Units of \code{oral_ddd}} +#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} +#' \item{\code{iv_units}}{Units of \code{iv_ddd}} +#' } +#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/} +#' @inheritSection WHOCC WHOCC +#' @inheritSection AMR Read more on our website! +#' @seealso \code{\link{antibiotics}} \code{\link{microorganisms}} +"antivirals" + #' Data set with ~70,000 microorganisms #' #' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}. @@ -126,9 +145,9 @@ catalogue_of_life <- list( #' @seealso \code{\link{as.mo}} \code{\link{microorganisms}} "microorganisms.codes" -#' Data set with 2,000 blood culture isolates +#' Data set with 2,000 example isolates #' -#' An anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found 4 different hospitals in the Netherlands, between 2001 and 2017. This \code{data.frame} can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. +#' A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. #' @format A \code{\link{data.frame}} with 2,000 observations and 49 variables: #' \describe{ #' \item{\code{date}}{date of receipt at the laboratory} @@ -138,7 +157,7 @@ catalogue_of_life <- list( #' \item{\code{ward_outpatient}}{logical to determine if ward is an outpatient clinic} #' \item{\code{age}}{age of the patient} #' \item{\code{gender}}{gender of the patient} -#' \item{\code{patient_id}}{ID of the patient, first 10 characters of an SHA hash containing irretrievable information} +#' \item{\code{patient_id}}{ID of the patient} #' \item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}} #' \item{\code{PEN:RIF}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{ab_name}}} #' } @@ -183,17 +202,17 @@ catalogue_of_life <- list( #' Data set for RSI interpretation #' #' Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link{as.rsi}} to transform MICs or disks measurements to RSI values. -#' @format A \code{\link{data.frame}} with 11,559 observations and 9 variables: +#' @format A \code{\link{data.frame}} with 13,975 observations and 9 variables: #' \describe{ #' \item{\code{guideline}}{Name of the guideline} +#' \item{\code{method}}{Either "MIC" or "DISK"} +#' \item{\code{site}}{Body site, e.g. "Oral" or "Respiratory"} #' \item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}} #' \item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}} #' \item{\code{ref_tbl}}{Info about where the guideline rule can be found} -#' \item{\code{S_mic}}{Lowest MIC value that leads to "S"} -#' \item{\code{R_mic}}{Highest MIC value that leads to "R"} -#' \item{\code{dose_disk}}{Dose of the used disk diffusion method} -#' \item{\code{S_disk}}{Lowest number of millimeters that leads to "S"} -#' \item{\code{R_disk}}{Highest number of millimeters that leads to "R"} +#' \item{\code{disk_dose}}{Dose of the used disk diffusion method} +#' \item{\code{breakpoint_S}}{Lowest MIC value or highest number of millimeters that leads to "S"} +#' \item{\code{breakpoint_R}}{Highest MIC value or lowest number of millimeters that leads to "R"} #' } #' @inheritSection AMR Read more on our website! "rsi_translation" diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 8d6d4915..6f10cae5 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -163,6 +163,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' } #' @inheritSection AMR Read more on our website! #' @examples +#' \donttest{ #' a <- data.frame(mo = c("Staphylococcus aureus", #' "Enterococcus faecalis", #' "Escherichia coli", @@ -198,7 +199,6 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' # 5 Pseudomonas aeruginosa R R - - R R R #' #' -#' \donttest{ #' # do not apply EUCAST rules, but rather get a data.frame #' # with 18 rows, containing all details about the transformations: #' c <- eucast_rules(a, verbose = TRUE) diff --git a/R/mdro.R b/R/mdro.R index f9c47449..7a923c1a 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -54,29 +54,24 @@ #' @rdname mdro #' @aliases MDR XDR PDR BRMO 3MRGN 4MRGN #' @importFrom dplyr %>% filter_at vars all_vars pull mutate_at -#' @importFrom crayon blue bold italic +#' @importFrom crayon blue bold italic red #' @importFrom cleaner percentage #' @export #' @inheritSection AMR Read more on our website! #' @source #' Please see Details for the list of publications used for this function. #' @examples +#' \donttest{ #' library(dplyr) #' #' example_isolates %>% #' mdro() %>% #' freq() #' -#' \donttest{ #' example_isolates %>% #' mutate(EUCAST = eucast_exceptional_phenotypes(.), #' 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, @@ -155,7 +150,7 @@ mdro <- function(x, guideline$name <- "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." guideline$author <- "Magiorakos AP, Srinivasan A, Carey RB, ..., Vatopoulos A, Weber JT, Monnet DL" guideline$version <- "N/A" - guideline$source <- "Magiorakos et al. (2012) Clinical Microbiology and Infection 18:3. DOI: 10.1111/j.1469-0691.2011.03570.x" + guideline$source <- "Clinical Microbiology and Infection 18:3, 2012. DOI: 10.1111/j.1469-0691.2011.03570.x" } else if (guideline$code == "eucast") { guideline$name <- "EUCAST Expert Rules, \"Intrinsic Resistance and Exceptional Phenotypes Tables\"" @@ -174,7 +169,7 @@ mdro <- function(x, guideline$name <- "Cross-border comparison of the Dutch and German guidelines on multidrug-resistant Gram-negative microorganisms" guideline$author <- "M\u00fcller J, Voss A, K\u00f6ck R, ..., Kern WV, Wendt C, Friedrich AW" 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" + guideline$source <- "Antimicrobial Resistance and Infection Control 4:7, 2015. DOI: 10.1186/s13756-015-0047-6" } else if (guideline$code == "brmo") { guideline$name <- "WIP-Richtlijn Bijzonder Resistente Micro-organismen (BRMO)" @@ -422,9 +417,9 @@ mdro <- function(x, if (info == TRUE) { if (combine_SI == TRUE) { - cat("\nOnly results with 'R' are considered as resistance. Use `combine_SI = FALSE` to also consider 'I' as resistance.\n") + cat(red("\nOnly results with 'R' are considered as resistance. Use `combine_SI = FALSE` to also consider 'I' as resistance.\n")) } else { - cat("\nResults with 'R' or 'I' are considered as resistance. Use `combine_SI = TRUE` to only consider 'R' as resistance.\n") + cat(red("\nResults with 'R' or 'I' are considered as resistance. Use `combine_SI = TRUE` to only consider 'R' as resistance.\n")) } cat("\nDetermining multidrug-resistant organisms (MDRO), according to:\n", bold("Guideline: "), italic(guideline$name), "\n", diff --git a/R/mo.R b/R/mo.R index 3f44bd27..6e5eb645 100755 --- a/R/mo.R +++ b/R/mo.R @@ -572,22 +572,21 @@ exec_as.mo <- function(x, # add start en stop regex x <- paste0("^", x, "$") - x_withspaces_start_only <- paste0("^", x_withspaces) x_withspaces_end_only <- paste0(x_withspaces, "$") x_withspaces_start_end <- paste0("^", x_withspaces, "$") if (isTRUE(debug)) { - cat(paste0(blue('x'), ' "', x, '"\n')) - cat(paste0(blue('x_species'), ' "', x_species, '"\n')) - cat(paste0(blue('x_withspaces_start_only'), ' "', x_withspaces_start_only, '"\n')) - cat(paste0(blue('x_withspaces_end_only'), ' "', x_withspaces_end_only, '"\n')) - cat(paste0(blue('x_withspaces_start_end'), ' "', x_withspaces_start_end, '"\n')) - cat(paste0(blue('x_backup'), ' "', x_backup, '"\n')) - cat(paste0(blue('x_backup_without_spp'), ' "', x_backup_without_spp, '"\n')) - cat(paste0(blue('x_trimmed'), ' "', x_trimmed, '"\n')) - cat(paste0(blue('x_trimmed_species'), ' "', x_trimmed_species, '"\n')) - cat(paste0(blue('x_trimmed_without_group'), ' "', x_trimmed_without_group, '"\n')) + cat(paste0(blue("x"), ' "', x, '"\n')) + cat(paste0(blue("x_species"), ' "', x_species, '"\n')) + cat(paste0(blue("x_withspaces_start_only"), ' "', x_withspaces_start_only, '"\n')) + cat(paste0(blue("x_withspaces_end_only"), ' "', x_withspaces_end_only, '"\n')) + cat(paste0(blue("x_withspaces_start_end"), ' "', x_withspaces_start_end, '"\n')) + cat(paste0(blue("x_backup"), ' "', x_backup, '"\n')) + cat(paste0(blue("x_backup_without_spp"), ' "', x_backup_without_spp, '"\n')) + cat(paste0(blue("x_trimmed"), ' "', x_trimmed, '"\n')) + cat(paste0(blue("x_trimmed_species"), ' "', x_trimmed_species, '"\n')) + cat(paste0(blue("x_trimmed_without_group"), ' "', x_trimmed_without_group, '"\n')) } progress <- progress_estimated(n = length(x), min_time = 3) @@ -1782,6 +1781,7 @@ pillar_shaft.mo <- function(x, ...) { out[is.na(x)] <- pillar::style_na(" NA") out[x == "UNKNOWN"] <- pillar::style_na(" UNKNOWN") + # make it always fit exactly pillar::new_pillar_shaft_simple(out, align = "left", width = max(nchar(x))) } diff --git a/R/whocc.R b/R/whocc.R index b031d8c5..bddc5ef8 100755 --- a/R/whocc.R +++ b/R/whocc.R @@ -24,7 +24,7 @@ #' All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology. #' @section WHOCC: #' \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -#' This package contains \strong{all ~450 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +#' This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). #' #' These have become the gold standard for international drug utilisation monitoring and research. #' diff --git a/_pkgdown.yml b/_pkgdown.yml index 2e0b6ed2..f74f913b 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -83,6 +83,62 @@ navbar: href: "LICENSE-text.html" reference: + - title: "Cleaning your data" + desc: > + Functions for cleaning and optimising your data, to be able to add + variables later on (like taxonomic properties) or to fix and extend + antibiotic interpretations by applying [EUCAST rules](http://www.eucast.org/expert_rules_and_intrinsic_resistance/). + contents: + - starts_with("as.") + - "`eucast_rules`" + - "`guess_ab_col`" + - "`mo_source`" + - "`read.4D`" + - "`rsi_translation`" + - title: "Enhancing your data" + desc: > + Functions to add new data to your existing data, such as the determination + of first isolates, multi-drug resistant microorganisms (MDRO), getting + properties of microorganisms or antibiotics and determining the age of + patients or divide ages into age groups. + contents: + - "`ab_property`" + - "`age_groups`" + - "`age`" + - "`atc_online_property`" + - "`first_isolate`" + - "`join`" + - "`key_antibiotics`" + - "`mdro`" + - "`mo_property`" + - "`p_symbol`" + - title: "Analysing your data" + desc: > + Functions for conducting AMR analysis, like counting isolates, calculating + resistance or susceptibility, or make plots. + contents: + - "`availability`" + - "`bug_drug_combinations`" + - "`count`" + - "`filter_ab_class`" + - "`g.test`" + - "`ggplot_rsi`" + - "`kurtosis`" + - "`portion`" + - "`resistance_predict`" + - "`skewness`" + - title: "Included data sets" + desc: > + Scientifically reliable references for microorganisms and + antibiotics, and example data sets to use for practise. + contents: + - "`antibiotics`" + - "`antivirals`" + - "`example_isolates`" + - "`microorganisms.codes`" + - "`microorganisms.old`" + - "`microorganisms`" + - "`WHONET`" - title: "Background information" desc: > Some pages about our package and its external sources. Be sure to read our [How To's](./../articles/index.html) @@ -92,61 +148,6 @@ reference: - "`catalogue_of_life`" - "`catalogue_of_life_version`" - "`WHOCC`" - - title: "Cleaning your data" - desc: > - Functions for cleaning and optimising your data, to be able to add - variables later on (like taxonomic properties) or to fix and extend - antibiotic interpretations by applying [EUCAST rules](http://www.eucast.org/expert_rules_and_intrinsic_resistance/). - contents: - - starts_with("as.") - - "`mo_source`" - - "`eucast_rules`" - - "`rsi_translation`" - - "`guess_ab_col`" - - "`read.4D`" - - title: "Adding variables to your data" - desc: > - Functions to add new data to existing data, like the determination - of first isolates, multi-drug resistant microorganisms (MDRO), getting - properties of microorganisms or antibiotics and determining the age of - patients or divide ages into age groups. - contents: - - "`first_isolate`" - - "`mdro`" - - "`key_antibiotics`" - - "`mo_property`" - - "`ab_property`" - - "`age`" - - "`age_groups`" - - "`p_symbol`" - - "`join`" - - "`atc_online_property`" - - title: "Analysing your data" - desc: > - Functions for conducting AMR analysis, like counting isolates, calculating - resistance or susceptibility, or make plots. - contents: - - "`availability`" - - "`bug_drug_combinations`" - - "`count`" - - "`portion`" - - "`filter_ab_class`" - - "`g.test`" - - "`ggplot_rsi`" - - "`kurtosis`" - - "`resistance_predict`" - - "`skewness`" - - title: "Included data sets" - desc: > - References for microorganisms and antibiotics, and even a - genuine data set with isolates from septic patients. - contents: - - "`antibiotics`" - - "`microorganisms`" - - "`example_isolates`" - - "`WHONET`" - - "`microorganisms.codes`" - - "`microorganisms.old`" - title: Other functions desc: > These functions are mostly for internal use, but some of @@ -160,9 +161,10 @@ reference: These functions are extensions of functions in other packages. contents: - "`extended-functions`" + - "`reexports`" - title: functions desc: > - These functions are deprecated, meaning that they still + These functions are deprecated, meaning that they will still work but show a warning with every use and will be removed in a future version. contents: diff --git a/data-raw/reproduction_of_antibiotics.R b/data-raw/reproduction_of_antibiotics.R index 75bd702a..6274fe78 100644 --- a/data-raw/reproduction_of_antibiotics.R +++ b/data-raw/reproduction_of_antibiotics.R @@ -1,3 +1,23 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# # +# 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. # +# # +# This R package was created for academic research and 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.gitlab.io/AMR. # +# ==================================================================== # library(dplyr) diff --git a/data-raw/reproduction_of_antivirals.R b/data-raw/reproduction_of_antivirals.R new file mode 100644 index 00000000..6f781161 --- /dev/null +++ b/data-raw/reproduction_of_antivirals.R @@ -0,0 +1,62 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# # +# 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. # +# # +# This R package was created for academic research and 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.gitlab.io/AMR. # +# ==================================================================== # + +# get all data from the WHOCC website + +get_atc_table <- function(atc_group) { + # give as input J0XXX, like atc_group = "J05AB" + downloaded <- read_html(paste0("https://www.whocc.no/atc_ddd_index/?code=", atc_group, "&showdescription=no")) + table_title <- downloaded %>% html_nodes(paste0('a[href="./?code=', atc_group, '"]')) %>% html_text() + table_content <- downloaded %>% + html_nodes("table") %>% + html_table(header = TRUE) %>% + # returns list, so make data.frame out of it + as.data.frame(stringsAsFactors = FALSE) %>% + # select right columns + select(atc = ATC.code, name = Name, ddd = DDD, unit = U, ddd_type = Adm.R) %>% + # fill empty rows + mutate(atc = ifelse(atc == "", lag(atc), atc), name = ifelse(name == "", lag(name), name)) %>% + pivot_wider(names_from = ddd_type, values_from = c(ddd, unit)) %>% + mutate(atc_group = table_title) + if (!"ddd_O" %in% colnames(table_content)) { + table_content <- table_content %>% mutate(ddd_O = NA_real_, unit_O = NA_character_) + } + if (!"ddd_P" %in% colnames(table_content)) { + table_content <- table_content %>% mutate(ddd_P = NA_real_, unit_P = NA_character_) + } + table_content %>% select(atc, name, atc_group, + oral_ddd = ddd_O, oral_units = unit_O, + iv_ddd = ddd_P, iv_units = unit_P) +} + +# these are the relevant groups for input: https://www.whocc.no/atc_ddd_index/?code=J05A (J05 only contains J05A) +atc_groups <- c("J05AA", "J05AB", "J05AC", "J05AD", "J05AE", "J05AF", "J05AG", "J05AH", "J05AP", "J05AR", "J05AX") + +# get the first +antivirals <- get_atc_table(atc_groups[1]) +# bind all others to it +for (i in 2:length(atc_groups)) { + antivirals <- rbind(antivirals, get_atc_table(atc_groups[i])) +} + +# arrange on name, untibble it and save +antivirals <- antivirals %>% arrange(name) %>% as.data.frame(stringsAsFactors = FALSE) +usethis::use_data(antivirals, overwrite = TRUE) diff --git a/data/antivirals.rda b/data/antivirals.rda new file mode 100644 index 00000000..8217fe01 Binary files /dev/null and b/data/antivirals.rda differ diff --git a/data/example_isolates.rda b/data/example_isolates.rda index 15c315bc..04b026c0 100644 Binary files a/data/example_isolates.rda and b/data/example_isolates.rda differ diff --git a/docs/404.html b/docs/404.html index f98b3192..ae0ed72b 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 ab0c5143..1f557fd1 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 412273a1..9e658236 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 15 November 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 18 November 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 %>%
@@ -422,8 +422,8 @@
# Other rules by this AMR package
# Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)
# Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)
-# Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (3,022 values changed)
-# Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (151 values changed)
+# Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,986 values changed)
+# Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (176 values changed)
# Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)
# Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)
# Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)
@@ -448,14 +448,14 @@
# Pasteurella multocida (no changes)
# Staphylococcus (no changes)
# Streptococcus groups A, B, C, G (no changes)
-# Streptococcus pneumoniae (1,071 values changed)
+# Streptococcus pneumoniae (1,015 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,282 values changed)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1,284 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,783 values changed)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2,796 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)
@@ -463,15 +463,15 @@
# Table 13: Interpretive rules for quinolones (no changes)
#
# --------------------------------------------------------------------------
-# EUCAST rules affected 6,586 out of 20,000 rows, making a total of 8,309 edits
+# EUCAST rules affected 6,569 out of 20,000 rows, making a total of 8,257 edits
# => added 0 test results
#
-# => changed 8,309 test results
-# - 129 test results changed from S to I
-# - 4,834 test results changed from S to R
-# - 1,222 test results changed from I to S
-# - 324 test results changed from I to R
-# - 1,800 test results changed from R to S
+# => changed 8,257 test results
+# - 123 test results changed from S to I
+# - 4,779 test results changed from S to R
+# - 1,134 test results changed from I to S
+# - 369 test results changed from I to R
+# - 1,852 test results changed from R to S
# --------------------------------------------------------------------------
#
# 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 I9, 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 X7, sorted on date:
isolate | @@ -526,19 +526,19 @@|||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-08 | -I9 | +2010-03-18 | +X7 | B_ESCHR_COLI | S | S | -R | +S | S | TRUE | ||||||||
2 | -2010-03-05 | -I9 | +2010-04-28 | +X7 | B_ESCHR_COLI | S | S | @@ -548,30 +548,30 @@||||||||||||
3 | -2010-05-14 | -I9 | +2010-06-26 | +X7 | B_ESCHR_COLI | -S | -S | -S | R | +S | +S | +S | FALSE | ||||||
4 | -2010-12-10 | -I9 | +2010-08-06 | +X7 | B_ESCHR_COLI | -R | S | -R | +S | +S | S | FALSE | |||||||
5 | -2010-12-17 | -I9 | +2010-08-31 | +X7 | B_ESCHR_COLI | S | S | @@ -581,19 +581,19 @@||||||||||||
6 | -2011-04-18 | -I9 | +2010-10-15 | +X7 | B_ESCHR_COLI | +R | S | S | S | -S | -TRUE | +FALSE | |||||||
7 | -2011-04-25 | -I9 | +2010-11-19 | +X7 | B_ESCHR_COLI | R | S | @@ -603,8 +603,8 @@||||||||||||
8 | -2011-06-06 | -I9 | +2011-01-20 | +X7 | B_ESCHR_COLI | S | S | @@ -614,23 +614,23 @@||||||||||||
9 | -2011-07-14 | -I9 | +2011-04-10 | +X7 | B_ESCHR_COLI | S | S | S | S | -FALSE | +TRUE | ||||||||
10 | -2011-07-31 | -I9 | +2011-04-12 | +X7 | B_ESCHR_COLI | S | S | -R | +S | S | FALSE |
isolate | @@ -664,80 +664,68 @@||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-08 | -I9 | +2010-03-18 | +X7 | B_ESCHR_COLI | S | S | -R | +S | S | TRUE | TRUE | ||
2 | -2010-03-05 | -I9 | +2010-04-28 | +X7 | B_ESCHR_COLI | S | S | S | S | FALSE | -TRUE | +FALSE | ||
3 | -2010-05-14 | -I9 | +2010-06-26 | +X7 | B_ESCHR_COLI | -S | -S | -S | R | +S | +S | +S | FALSE | TRUE |
4 | -2010-12-10 | -I9 | +2010-08-06 | +X7 | B_ESCHR_COLI | -R | S | -R | +S | +S | S | FALSE | TRUE | |
5 | -2010-12-17 | -I9 | +2010-08-31 | +X7 | B_ESCHR_COLI | S | S | S | S | FALSE | -TRUE | +FALSE | ||
6 | -2011-04-18 | -I9 | -B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -TRUE | -|||||
7 | -2011-04-25 | -I9 | +2010-10-15 | +X7 | B_ESCHR_COLI | R | S | @@ -746,10 +734,22 @@FALSE | TRUE | |||||
7 | +2010-11-19 | +X7 | +B_ESCHR_COLI | +R | +S | +S | +S | +FALSE | +FALSE | +|||||
8 | -2011-06-06 | -I9 | +2011-01-20 | +X7 | B_ESCHR_COLI | S | S | @@ -760,35 +760,35 @@|||||||
9 | -2011-07-14 | -I9 | +2011-04-10 | +X7 | B_ESCHR_COLI | S | S | S | S | -FALSE | -FALSE | +TRUE | +TRUE | |
10 | -2011-07-31 | -I9 | +2011-04-12 | +X7 | B_ESCHR_COLI | S | S | -R | +S | S | FALSE | -TRUE | +FALSE |
Instead of 2, now 9 isolates are flagged. In total, 75.3% of all isolates are marked ‘first weighted’ - 46.8% 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 6 isolates are flagged. In total, 75.4% 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.
As with filter_first_isolate()
, there’s a shortcut for this new algorithm too:
So we end up with 15,051 isolates for analysis.
+So we end up with 15,085 isolates for analysis.
We can remove unneeded columns:
@@ -813,13 +813,29 @@Frequency table
Class: character
-Length: 15,051 (of which NA: 0 = 0%)
+Length: 15,085 (of which NA: 0 = 0%)
Unique: 4
Shortest: 16
Longest: 24
The functions resistance()
and susceptibility()
can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions proportion_S()
, proportion_SI()
, proportion_I()
, proportion_IR()
and proportion_R()
can be used to determine the proportion of a specific antimicrobial outcome.
As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R()
, equal to resistance()
) and susceptibility as the proportion of S and I (proportion_SI()
, equal to susceptibility()
). 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) %>%
@@ -995,19 +995,19 @@ Longest: 24
Hospital A
-0.4651671
+0.4666964
Hospital B
-0.4687618
+0.4711845
Hospital C
-0.4569626
+0.4627451
Hospital D
-0.4668462
+0.4704102
The next example uses the included example_isolates
, which is an anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found in septic patients in 4 different hospitals in the Netherlands, between 2001 and 2017. This data.frame
can be used to practice AMR analysis.
The next example uses the example_isolates
data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis.
We will compare the resistance to fosfomycin (column FOS
) in hospital A and D. The input for the fisher.test()
can be retrieved with a transformation like this:
# use package 'tidyr' to pivot data;
# it gets installed with this 'AMR' package
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 1c0a9842..157e8a6b 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 8c3a0329..81c7a283 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 a3a91508..6191bf74 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 d929dd38..39b50936 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/EUCAST.html b/docs/articles/EUCAST.html
index 26ddcd76..cfdb6474 100644
--- a/docs/articles/EUCAST.html
+++ b/docs/articles/EUCAST.html
@@ -41,7 +41,7 @@
EUCAST.Rmd
MDR.Rmd
With the function mdro()
, you can determine multi-drug resistant organisms (MDRO).
With the function mdro()
, you can determine which micro-organisms are multi-drug resistant organisms (MDRO).
The mdro()
takes a data set as input, such as a regular data.frame
. It automatically determines the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command ?mdro
.
The mdro()
function takes a data set as input, such as a regular data.frame
. It tries to automatically determine the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command ?mdro
.
For WHONET data (and most other data), all settings are automatically set correctly.
The mdro()
function always returns an ordered factor
. For example, the output of the default guideline by Magiorakos et al. returns a factor
with levels ‘Negative’, ‘MDR’, ‘XDR’ or ‘PDR’ in that order. If we test that guideline on the included example_isolates
data set, we get:
The mdro()
function always returns an ordered factor
. For example, the output of the default guideline by Magiorakos et al. returns a factor
with levels ‘Negative’, ‘MDR’, ‘XDR’ or ‘PDR’ in that order.
The next example uses the example_isolates
data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis. If we test the MDR/XDR/PDR guideline on this data set, we get:
example_isolates %>%
mdro() %>%
@@ -306,14 +307,14 @@ Unique: 2
The data set now looks like this:
head(my_TB_data)
# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1 S R S R I R
-# 2 I S R I R R
-# 3 S R S S S R
-# 4 R S S S R S
-# 5 S S S S I R
-# 6 I S R I S S
+# 1 S R S S S S
+# 2 S S S S R S
+# 3 S R R S S R
+# 4 S R S S I S
+# 5 R S S I R S
+# 6 R R S S R R
# kanamycin
-# 1 S
+# 1 R
# 2 R
# 3 R
# 4 S
@@ -335,7 +336,7 @@ Unique: 2
# Author: WHO (World Health Organization)
# Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/
#
-# => Found 4320 MDROs out of 5000 tested isolates (86.4%)
+# => Found 4341 MDROs out of 5000 tested isolates (86.8%)
Create a frequency table of the results:
Frequency table
@@ -356,40 +357,40 @@ Unique: 5SPSS.Rmd
WHONET.Rmd
benchmarks.Rmd
In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.
To achieve this speed, the as.mo
function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of Methanosarcina semesiae (B_MTHNSR_SEMS
), a bug probably never found before in humans:
That takes 14.3 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like Methanosarcina semesiae) are almost fast - these are the most probable input from most data sets.
+# 1627.00 10 +# 1628.00 10 +# 2395.00 10 +# 2535.00 10 +# 69.48 10 +That takes 13.8 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like Methanosarcina semesiae) are almost fast - these are the most probable input from most data sets.
In the figure below, we compare Escherichia coli (which is very common) with Prevotella brevis (which is moderately common) and with Methanosarcina semesiae (which is uncommon):
In reality, the as.mo()
functions learns from its own output to speed up determinations for next times. In above figure, this effect was disabled to show the difference with the boxplot below - when you would use as.mo()
yourself:
So transforming 500,000 values (!!) of 50 unique values only takes 0.67 seconds (671 ms). You only lose time on your unique input values.
+# mo_name(x) 642 674 702 687 713 843 10 +So transforming 500,000 values (!!) of 50 unique values only takes 0.69 seconds (686 ms). You only lose time on your unique input values.
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0009 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:
run_it <- microbenchmark(A = mo_species("aureus"),
B = mo_genus("Staphylococcus"),
@@ -326,14 +326,14 @@
print(run_it, unit = "ms", signif = 3)
# Unit: milliseconds
# expr min lq mean median uq max neval
-# A 0.509 0.530 0.681 0.565 0.661 1.630 10
-# B 0.518 0.526 0.598 0.553 0.564 0.875 10
-# C 0.848 0.882 1.100 0.990 1.180 1.920 10
-# D 0.566 0.592 0.734 0.714 0.765 1.120 10
-# E 0.486 0.522 0.555 0.542 0.551 0.681 10
-# F 0.466 0.493 0.598 0.553 0.586 1.110 10
-# G 0.462 0.498 0.598 0.525 0.671 0.921 10
-# H 0.480 0.489 0.566 0.508 0.628 0.756 10
Of course, when running mo_phylum("Firmicutes")
the function has zero knowledge about the actual microorganism, namely S. aureus. But since the result would be "Firmicutes"
too, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.
Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.
diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png index b1ec4b1d..a0ab03d1 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png index 3bc10897..8189a9e9 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png index e85fcf12..07b95fbd 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 309c4158..130e31fb 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 3ad919fe..95212fe6 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -41,7 +41,7 @@ @@ -187,7 +187,7 @@resistance_predict.Rmd
AMR
(for R)?AMR
is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 60 countries (source: CRAN logs, 2019).
After installing this package, R knows ~70,000 microorganisms (distinct microbial species) and ~450 antibiotics by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
+AMR
is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 70 countries (source: CRAN logs, 2019).
After installing this package, R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs 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 and is free software (see Copyright).
Used to SPSS? Read our tutorial on how to import data from SPSS, SAS or Stata.
This package contains all ~450 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission.
+This package contains all ~550 antibiotic, antimycotic and antiviral drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission.
NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
Read more about the data from WHOCC in our manual.
mdro()
(abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.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), 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.microorganisms
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.antibiotics
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. The function ab_atc()
will return the ATC code of an antibiotic as defined by the WHO. Use functions like ab_name()
, ab_group()
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.antibiotics
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.example_isolates
data set. This data set contains:
-example_isolates
data set. This data set contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis.WHONET
data set. This data set only contains fake data, but with the exact same structure as files exported by WHONET. Read more about WHONET on its tutorial page.Last updated: 15-Nov-2019
+mdro(...., verbose = TRUE)
) returns an informative data set where the reason for MDRO determination is given for every isolate, and an list of the resistant antimicrobial agentsData set antivirals
, containing all entries from the ATC J05 group with their DDDs for oral and parenteral treatment
eucast_rules()
:
eucast_rules()
are now applied first and not as last anymore. This is to improve the dependency on certain antibiotics for the official EUCAST rules. Please see ?eucast_rules
.antibiotics
data setexample_isolates
data set to better reflect realityas.mo(..., allow_uncertain = 3)
Contents
-This package contains all ~450 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index 4cb5788b..7ab33ea1 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 0832b935..79bfa8b1 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/age.html b/docs/reference/age.html index 7b1cfb42..9ea06299 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 6996c161..77b2a19f 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 81cfbee0..4724a72b 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -85,7 +85,7 @@ @@ -253,7 +253,7 @@abbr
List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)
synonyms
Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
oral_ddd
Defined Daily Dose (DDD), oral treatment
oral_units
Units of ddd_units
oral_units
Units of oral_ddd
iv_ddd
Defined Daily Dose (DDD), parenteral treatment
iv_units
Units of iv_ddd
-This package contains all ~450 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
@@ -283,7 +283,7 @@ This package contains all ~450 antimicrobial drugs and their AnOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
antivirals
microorganisms
-This package contains all ~450 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index 90ffcee0..61fa87ea 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 0826fd1a..88811896 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index ee6f6662..bb52836f 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 00f1d8ed..52caf178 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index ccf87195..730425d6 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/availability.html b/docs/reference/availability.html index a251ca19..6d1646cc 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index c55ecfc4..274b406a 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index 6bd0d959..08e5ff57 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index eea29753..77ceae90 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/count.html b/docs/reference/count.html index e43891c4..e342195e 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -86,7 +86,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 5372f500..09701e32 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied @@ -394,7 +394,8 @@ To improve the interpretation of the antibiogram before EUCAST rules are appliedOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
a <- data.frame(mo = c("Staphylococcus aureus", +# \donttest{ +a <- data.frame(mo = c("Staphylococcus aureus", "Enterococcus faecalis", "Escherichia coli", "Klebsiella pneumoniae", @@ -429,7 +430,6 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied # 5 Pseudomonas aeruginosa R R - - R R R -# \donttest{ # do not apply EUCAST rules, but rather get a data.frame # with 18 rows, containing all details about the transformations: c <- eucast_rules(a, verbose = TRUE) diff --git a/docs/reference/example_isolates.html b/docs/reference/example_isolates.html index 14bb5108..c213ba64 100644 --- a/docs/reference/example_isolates.html +++ b/docs/reference/example_isolates.html @@ -6,7 +6,7 @@ -Data set with 2,000 blood culture isolates — example_isolates • AMR (for R) +Data set with 2,000 example isolates — example_isolates • AMR (for R) @@ -50,8 +50,8 @@ - - + + @@ -85,7 +85,7 @@ @@ -228,13 +228,13 @@diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 84235158..565ce03f 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index 2e2ee242..b3f4246e 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index 36b1a078..fb78880d 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index 2045ded8..ed78a93a 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/index.html b/docs/reference/index.html index db35b2b9..1c0fe3da 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -84,7 +84,7 @@ @@ -239,38 +239,6 @@ -diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index f3c0e4e0..25359ca9 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -85,7 +85,7 @@-Data set with 2,000 blood culture isolates
+Data set with 2,000 example isolates
example_isolates.Rd
-An anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found 4 different hospitals in the Netherlands, between 2001 and 2017. This
+data.frame
can be used to practice AMR analysis. For examples, please read the tutorial on our website.A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read the tutorial on our website.
example_isolates
@@ -250,7 +250,7 @@ward_outpatient
logical to determine if ward is an outpatient clinic
age
age of the patient
gender
- gender of the patient
patient_id
+ ID of the patient, first 10 characters of an SHA hash containing irretrievable information
patient_id
ID of the patient
mo
ID of microorganism created with
as.mo
, see alsomicroorganisms
PEN:RIF
diff --git a/docs/reference/extended-functions.html b/docs/reference/extended-functions.html index 279bf6e8..ec19c987 100644 --- a/docs/reference/extended-functions.html +++ b/docs/reference/extended-functions.html @@ -85,7 +85,7 @@ 40 different antibiotics with class
rsi
(seeas.rsi
); these column names occur inantibiotics
data set and can be translated withab_name
- -- -Background information
-Some pages about our package and its external sources. Be sure to read our How To’s for more information about how to work with functions in this package.
-- - - - -- The
AMR
Package- - - - -- The Catalogue of Life
- - - - -- Version info of included Catalogue of Life
- - -- - -- WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
Cleaning your data
@@ -309,80 +277,50 @@Class 'rsi'
- - - -- Use predefined reference data set
- EUCAST rules
- - - -- Data set for RSI interpretation
- Guess antibiotic column
+ + + ++ Use predefined reference data set
+ + Read data from 4D database
+ + + + +Data set for RSI interpretation
- Adding variables to your data
-Functions to add new data to existing data, like the determination of first isolates, multi-drug resistant microorganisms (MDRO), getting properties of microorganisms or antibiotics and determining the age of patients or divide ages into age groups.
+Enhancing your data
+Functions to add new data to your existing data, such as the determination of first isolates, multi-drug resistant microorganisms (MDRO), getting properties of microorganisms or antibiotics and determining the age of patients or divide ages into age groups.
- - --
first_isolate()
filter_first_isolate()
filter_first_weighted_isolate()
- Determine first (weighted) isolates
- - - --
mdro()
brmo()
mrgn()
mdr_tb()
mdr_cmi2012()
eucast_exceptional_phenotypes()
- Determine multidrug-resistant organisms (MDRO)
- - - - -- Key antibiotics for first weighted isolates
- - - --
mo_name()
mo_fullname()
mo_shortname()
mo_subspecies()
mo_species()
mo_genus()
mo_family()
mo_order()
mo_class()
mo_phylum()
mo_kingdom()
mo_type()
mo_gramstain()
mo_ref()
mo_authors()
mo_year()
mo_rank()
mo_taxonomy()
mo_synonyms()
mo_info()
mo_url()
mo_property()
- Property of a microorganism
-
ab_name()
ab_atc()
ab_cid()
ab_synonyms()
ab_tradenames()
ab_group()
ab_atc_group1()
ab_atc_group2()
ab_ddd()
ab_info()
ab_property()
Property of an antibiotic
- - - -- Age in years of individuals
- @@ -390,9 +328,21 @@ - + -+ Symbol of a p value
+ Age in years of individuals
+ + + + ++ Get ATC properties from WHOCC website
+ + + ++
first_isolate()
filter_first_isolate()
filter_first_weighted_isolate()
Determine first (weighted) isolates
@@ -402,9 +352,27 @@ - + -+ Get ATC properties from WHOCC website
+ Key antibiotics for first weighted isolates
+ + + ++
mdro()
brmo()
mrgn()
mdr_tb()
mdr_cmi2012()
eucast_exceptional_phenotypes()
+ Determine multidrug-resistant organisms (MDRO)
+ + + ++
mo_name()
mo_fullname()
mo_shortname()
mo_subspecies()
mo_species()
mo_genus()
mo_family()
mo_order()
mo_class()
mo_phylum()
mo_kingdom()
mo_type()
mo_gramstain()
mo_ref()
mo_authors()
mo_year()
mo_rank()
mo_taxonomy()
mo_synonyms()
mo_info()
mo_url()
mo_property()
+ Property of a microorganism
+ + + + +Symbol of a p value
@@ -433,12 +401,6 @@ Count isolates
- - --
resistance()
susceptibility()
proportion_R()
proportion_IR()
proportion_I()
proportion_SI()
proportion_S()
proportion_df()
rsi_df()
- Calculate microbial resistance
- @@ -463,6 +425,12 @@
filter_ab_class()
filter_aminoglycosides()
filter_carbapenems()
filter_cephalosporins()
filter_1st_cephalosporins()
filter_2nd_cephalosporins()
filter_3rd_cephalosporins()
filter_4th_cephalosporins()
filter_5th_cephalosporins()
filter_fluoroquinolones()
filter_glycopeptides()
filter_macrolides()
filter_tetracyclines()
Kurtosis of the sample
+ + ++
resistance()
susceptibility()
proportion_R()
proportion_IR()
proportion_I()
proportion_SI()
proportion_S()
proportion_df()
rsi_df()
+ Calculate microbial resistance
+ @@ -478,7 +446,7 @@
resistance_predict()
rsi_predict()
plot(<resistance_predict>)
ggplot_rsi_predict()
Included data sets
-References for microorganisms and antibiotics, and even a genuine data set with isolates from septic patients.
+Scientifically reliable references for microorganisms and antibiotics, and example data sets to use for practise.
@@ -490,21 +458,15 @@ - + -+ Data set with ~70,000 microorganisms
Data set with ~100 antivirals
- - Data set with 2,000 blood culture isolates
- - - - -+ Data set with 500 isolates - WHONET example
Data set with 2,000 example isolates
@@ -517,6 +479,50 @@ + Data set with previously accepted taxonomic names
+ + + + ++ Data set with ~70,000 microorganisms
+ + + ++ + ++ Data set with 500 isolates - WHONET example
+ ++ +Background information
+Some pages about our package and its external sources. Be sure to read our How To’s for more information about how to work with functions in this package.
++ + + + ++ The
AMR
Package+ + + + ++ The Catalogue of Life
+ + + + ++ Version info of included Catalogue of Life
+ + + + +WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
@@ -551,12 +557,18 @@
scale_type.mo()
scale_type.ab()
+ Extended functions
+ + + + +Objects exported from other packages
functions
-These functions are deprecated, meaning that they still work but show a warning with every use and will be removed in a future version.
+These functions are deprecated, meaning that they will still work but show a warning with every use and will be removed in a future version.
@@ -573,11 +585,11 @@ diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index ba5f9e2d..f79575ea 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 8aeb49e9..29b19287 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/like.html b/docs/reference/like.html index 6111c680..f9aefc61 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 36f0ddb0..1a449711 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -85,7 +85,7 @@ @@ -419,22 +419,17 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
Examples
-library(dplyr) +# \donttest{ +library(dplyr) example_isolates %>% mdro() %>% freq() -# \donttest{ example_isolates %>% mutate(EUCAST = eucast_exceptional_phenotypes(.), BRMO = brmo(.), MRGN = mrgn(.)) - -example_isolates %>% - rename(PIP = TZP) %>% # no piperacillin, so take piperacillin/tazobactam - mrgn() %>% # check German guideline - freq() # check frequencies # }diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index c9199617..c0692755 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 8484316a..cea10cb0 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index c8f4e454..62ccf34b 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index f35068a4..161ded70 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -86,7 +86,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p diff --git a/docs/reference/p_symbol.html b/docs/reference/p_symbol.html index b4f99832..36779c4d 100644 --- a/docs/reference/p_symbol.html +++ b/docs/reference/p_symbol.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index 356d678f..9e2d044b 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -86,7 +86,7 @@ resistance() should be used to calculate resistance, susceptibility() should be diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index 6bb71a21..84db8e42 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index c4947971..f3a5db5e 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -90,7 +90,7 @@ below to see their documentation. diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 0d1cc210..37ca3826 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index d061e360..2f74af5e 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -85,7 +85,7 @@ @@ -242,16 +242,16 @@Format
-A
data.frame
with 11,559 observations and 9 variables:+
A
data.frame
with 13,975 observations and 9 variables:
guideline
- +
Name of the guideline
method
- +
Either "MIC" or "DISK"
site
Body site, e.g. "Oral" or "Respiratory"
mo
Microbial ID, see
as.mo
ab
Antibiotic ID, see
as.ab
ref_tbl
- -
Info about where the guideline rule can be found
S_mic
- -
Lowest MIC value that leads to "S"
R_mic
- -
Highest MIC value that leads to "R"
dose_disk
- -
Dose of the used disk diffusion method
S_disk
- -
Lowest number of millimeters that leads to "S"
R_disk
- +
Highest number of millimeters that leads to "R"
disk_dose
- +
Dose of the used disk diffusion method
breakpoint_S
- +
Lowest MIC value or highest number of millimeters that leads to "S"
breakpoint_R
Highest MIC value or lowest number of millimeters that leads to "R"
Read more on our website!
diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 09fbc614..a5841cb6 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -86,7 +86,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr diff --git a/docs/reference/translate.html b/docs/reference/translate.html index e1c442e9..8c7d326d 100644 --- a/docs/reference/translate.html +++ b/docs/reference/translate.html @@ -85,7 +85,7 @@ diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 092414d3..131eb24d 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -27,6 +27,9 @@+ https://msberends.gitlab.io/AMR/reference/antibiotics.html + https://msberends.gitlab.io/AMR/reference/antivirals.html +diff --git a/git_premaster.sh b/git_premaster.sh index f53c316d..190194a5 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -37,7 +37,7 @@ sed -i -- "s/^Version: .*/Version: ${new_version}/" DESCRIPTION # update 1st line of NEWS.md sed -i -- "1s/.*/# AMR ${new_version}/" NEWS.md # add date to 2nd line of NEWS.md -sed -i -- "2s/.*/\Last updated: $(date '+%d-%b-%Y')\<\/small\>/" NEWS.md +sed -i -- "2s/.*/## \Last updated: $(date '+%d-%b-%Y')\<\/small\>/" NEWS.md rm *-- || true echo "• First 3 lines of DESCRIPTION:" head -3 DESCRIPTION diff --git a/index.md b/index.md index 3965e0e7..c153a5ce 100644 --- a/index.md +++ b/index.md @@ -10,9 +10,9 @@ ### 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. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 60 countries (source: [CRAN logs, 2019](https://cran-logs.rstudio.com)). +`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. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 70 countries (source: [CRAN logs, 2019](https://cran-logs.rstudio.com)). -After installing this package, R knows [**~70,000 microorganisms**](./reference/microorganisms.html) (distinct microbial species) and [**~450 antibiotics**](./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. +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)). @@ -109,7 +109,7 @@ Read more about which data from the Catalogue of Life [in our manual](./referenc #### Antimicrobial reference data -This package contains **all ~450 antimicrobial drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the [Pharmaceuticals Community Register of the European Commission](http://ec.europa.eu/health/documents/community-register/html/atc.htm). +This package contains **all ~550 antibiotic, antimycotic and antiviral drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the [Pharmaceuticals Community Register of the European Commission](http://ec.europa.eu/health/documents/community-register/html/atc.htm). **NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.** @@ -137,9 +137,9 @@ The `AMR` package basically does four important things: * Use `eucast_rules()` to apply [EUCAST expert rules to isolates](http://www.eucast.org/expert_rules_and_intrinsic_resistance/) (not the translation from MIC to RSI values, use `as.rsi()` for that). * 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()` (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported. + * 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. The function `ab_atc()` will return the ATC code of an antibiotic as defined by the WHO. Use functions like `ab_name()`, `ab_group()` and `ab_tradenames()` to look up values. The `ab_*` functions use `as.ab()` internally so they support the same intelligent rules to guess the most probable result. For example, `ab_name("Fluclox")`, `ab_name("Floxapen")` and `ab_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data. + * The [data set `antibiotics`](./reference/antibiotics.html) contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, 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. @@ -151,10 +151,7 @@ The `AMR` package basically does four important things: * Aside from this website with many tutorials, the package itself contains extensive help pages with many examples for all functions. * The package also contains example data sets: - * The [`example_isolates` data set](./reference/example_isolates.html). This data set contains: - * 2,000 blood culture isolates from anonymised septic patients between 2001 and 2017 in the Northern Netherlands - * Results of 40 antibiotics (each antibiotic in its own column) with a total ~40,000 antimicrobial results - * Real and genuine data + * The [`example_isolates` data set](./reference/example_isolates.html). This data set contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis. * The [`WHONET` data set](./reference/WHONET.html). This data set only contains fake data, but with the exact same structure as files exported by WHONET. Read more about WHONET [on its tutorial page](./articles/WHONET.html). ### Copyright diff --git a/man/WHOCC.Rd b/man/WHOCC.Rd index ef6aa3dc..c99c8ec1 100644 --- a/man/WHOCC.Rd +++ b/man/WHOCC.Rd @@ -9,7 +9,7 @@ All antimicrobial drugs and their official names, ATC codes, ATC groups and defi \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~450 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd index 8b1e37ea..e694bf2c 100644 --- a/man/antibiotics.Rd +++ b/man/antibiotics.Rd @@ -16,7 +16,7 @@ \item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)} \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} - \item{\code{oral_units}}{Units of \code{ddd_units}} + \item{\code{oral_units}}{Units of \code{oral_ddd}} \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} \item{\code{iv_units}}{Units of \code{iv_ddd}} }} @@ -41,7 +41,7 @@ Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and co \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~450 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. @@ -56,6 +56,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{microorganisms}} +\code{\link{antivirals}} \code{\link{microorganisms}} } \keyword{datasets} diff --git a/man/antivirals.Rd b/man/antivirals.Rd new file mode 100644 index 00000000..a3306fd8 --- /dev/null +++ b/man/antivirals.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{antivirals} +\alias{antivirals} +\title{Data set with ~100 antivirals} +\format{A \code{\link{data.frame}} with 102 observations and 7 variables: +\describe{ + \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC} + \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} + \item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC} + \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} + \item{\code{oral_units}}{Units of \code{oral_ddd}} + \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} + \item{\code{iv_units}}{Units of \code{iv_ddd}} +}} +\source{ +World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/} +} +\usage{ +antivirals +} +\description{ +A data set containing all antivirals, according to the ATC code group 'J05' (Antivirals for systemic use). +} +\section{WHOCC}{ + +\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. + +\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} +} + +\section{Read more on our website!}{ + +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. +} + +\seealso{ +\code{\link{antibiotics}} \code{\link{microorganisms}} +} +\keyword{datasets} diff --git a/man/as.ab.Rd b/man/as.ab.Rd index 745b185c..bfdf2c8a 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -37,7 +37,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~450 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 24b6e799..764eed66 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -158,6 +158,7 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \examples{ +\donttest{ a <- data.frame(mo = c("Staphylococcus aureus", "Enterococcus faecalis", "Escherichia coli", @@ -193,7 +194,6 @@ b # 5 Pseudomonas aeruginosa R R - - R R R -\donttest{ # do not apply EUCAST rules, but rather get a data.frame # with 18 rows, containing all details about the transformations: c <- eucast_rules(a, verbose = TRUE) diff --git a/man/example_isolates.Rd b/man/example_isolates.Rd index 456de6cf..e94b7182 100644 --- a/man/example_isolates.Rd +++ b/man/example_isolates.Rd @@ -3,7 +3,7 @@ \docType{data} \name{example_isolates} \alias{example_isolates} -\title{Data set with 2,000 blood culture isolates} +\title{Data set with 2,000 example isolates} \format{A \code{\link{data.frame}} with 2,000 observations and 49 variables: \describe{ \item{\code{date}}{date of receipt at the laboratory} @@ -13,7 +13,7 @@ \item{\code{ward_outpatient}}{logical to determine if ward is an outpatient clinic} \item{\code{age}}{age of the patient} \item{\code{gender}}{gender of the patient} - \item{\code{patient_id}}{ID of the patient, first 10 characters of an SHA hash containing irretrievable information} + \item{\code{patient_id}}{ID of the patient} \item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}} \item{\code{PEN:RIF}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{ab_name}}} }} @@ -21,7 +21,7 @@ example_isolates } \description{ -An anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found 4 different hospitals in the Netherlands, between 2001 and 2017. This \code{data.frame} can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. +A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. } \section{Read more on our website!}{ diff --git a/man/mdro.Rd b/man/mdro.Rd index 976875dc..56558457 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -184,21 +184,16 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \examples{ +\donttest{ library(dplyr) example_isolates \%>\% mdro() \%>\% freq() -\donttest{ example_isolates \%>\% mutate(EUCAST = eucast_exceptional_phenotypes(.), BRMO = brmo(.), MRGN = mrgn(.)) - -example_isolates \%>\% - rename(PIP = TZP) \%>\% # no piperacillin, so take piperacillin/tazobactam - mrgn() \%>\% # check German guideline - freq() # check frequencies } } diff --git a/man/rsi_translation.Rd b/man/rsi_translation.Rd index 0f97422d..2c558b74 100644 --- a/man/rsi_translation.Rd +++ b/man/rsi_translation.Rd @@ -4,17 +4,17 @@ \name{rsi_translation} \alias{rsi_translation} \title{Data set for RSI interpretation} -\format{A \code{\link{data.frame}} with 11,559 observations and 9 variables: +\format{A \code{\link{data.frame}} with 13,975 observations and 9 variables: \describe{ \item{\code{guideline}}{Name of the guideline} + \item{\code{method}}{Either "MIC" or "DISK"} + \item{\code{site}}{Body site, e.g. "Oral" or "Respiratory"} \item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}} \item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}} \item{\code{ref_tbl}}{Info about where the guideline rule can be found} - \item{\code{S_mic}}{Lowest MIC value that leads to "S"} - \item{\code{R_mic}}{Highest MIC value that leads to "R"} - \item{\code{dose_disk}}{Dose of the used disk diffusion method} - \item{\code{S_disk}}{Lowest number of millimeters that leads to "S"} - \item{\code{R_disk}}{Highest number of millimeters that leads to "R"} + \item{\code{disk_dose}}{Dose of the used disk diffusion method} + \item{\code{breakpoint_S}}{Lowest MIC value or highest number of millimeters that leads to "S"} + \item{\code{breakpoint_R}}{Highest MIC value or lowest number of millimeters that leads to "R"} }} \usage{ rsi_translation diff --git a/pkgdown/extra.css b/pkgdown/extra.css index c40042cc..2c97a9df 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -139,6 +139,11 @@ help { font-size: 1.5em; } +/* Beautify manually added 'Last updated' text of NEWS */ +div[id^=last-updated] h2 { + padding-top: 10px; +} + .version.label { display: none; } diff --git a/tests/testthat/test-first_isolate.R b/tests/testthat/test-first_isolate.R index 1829e6ad..4e136d33 100755 --- a/tests/testthat/test-first_isolate.R +++ b/tests/testthat/test-first_isolate.R @@ -99,7 +99,7 @@ test_that("first isolates work", { info = TRUE, icu_exclude = TRUE), na.rm = TRUE), - 1163) + 906) # set 1500 random observations to be of specimen type 'Urine' random_rows <- sample(x = 1:2000, size = 1500, replace = FALSE) diff --git a/vignettes/AMR.Rmd b/vignettes/AMR.Rmd index 74083d5d..774a5eb5 100755 --- a/vignettes/AMR.Rmd +++ b/vignettes/AMR.Rmd @@ -459,7 +459,7 @@ data_1st %>% ## Independence test -The next example uses the included `example_isolates`, which is an anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found in septic patients in 4 different hospitals in the Netherlands, between 2001 and 2017. This `data.frame` can be used to practice AMR analysis. +The next example uses the `example_isolates` data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis. We will compare the resistance to fosfomycin (column `FOS`) in hospital A and D. The input for the `fisher.test()` can be retrieved with a transformation like this: diff --git a/vignettes/MDR.Rmd b/vignettes/MDR.Rmd index aa57f0d2..58b75122 100644 --- a/vignettes/MDR.Rmd +++ b/vignettes/MDR.Rmd @@ -21,11 +21,11 @@ knitr::opts_chunk$set( library(AMR) ``` -With the function `mdro()`, you can determine multi-drug resistant organisms (MDRO). +With the function `mdro()`, you can determine which micro-organisms are multi-drug resistant organisms (MDRO). #### Type of input -The `mdro()` takes a data set as input, such as a regular `data.frame`. It automatically determines the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command `?mdro`. +The `mdro()` function takes a data set as input, such as a regular `data.frame`. It tries to automatically determine the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command `?mdro`. For WHONET data (and most other data), all settings are automatically set correctly. @@ -51,7 +51,9 @@ The function support multiple guidelines. You can select a guideline with the `g #### Examples -The `mdro()` function always returns an ordered `factor`. For example, the output of the default guideline by Magiorakos *et al.* returns a `factor` with levels 'Negative', 'MDR', 'XDR' or 'PDR' in that order. If we test that guideline on the included `example_isolates` data set, we get: +The `mdro()` function always returns an ordered `factor`. For example, the output of the default guideline by Magiorakos *et al.* returns a `factor` with levels 'Negative', 'MDR', 'XDR' or 'PDR' in that order. + +The next example uses the `example_isolates` data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR analysis. If we test the MDR/XDR/PDR guideline on this data set, we get: ```{r, message = FALSE} library(dplyr) # to support pipes: %>% @@ -62,7 +64,7 @@ example_isolates %>% freq() # show frequency table of the result ``` ```{r, echo = FALSE, results = 'asis', message = FALSE, warning = FALSE} -library(dplyr) # to support pipes: %>% +library(dplyr) example_isolates %>% mdro(info = FALSE) %>% freq() # show frequency table of the result https://msberends.gitlab.io/AMR/reference/as.ab.html