diff --git a/.github/workflows/codecovr.yaml b/.github/workflows/codecovr.yaml index d6552648..aee14073 100644 --- a/.github/workflows/codecovr.yaml +++ b/.github/workflows/codecovr.yaml @@ -63,5 +63,5 @@ jobs: shell: Rscript {0} - name: Test coverage - run: covr::codecov(line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/resistance_predict.R", "R/aa_helper_pm_functions.R", "R/zzz.R"), quiet = FALSE) + run: covr::codecov(line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R"), quiet = FALSE) shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 320a78ed..a472cb25 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.3.0.9034 +Version: 1.3.0.9035 Date: 2020-09-29 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index bce8ff8e..92eff153 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -193,12 +193,6 @@ export(n_rsi) export(p_symbol) export(pca) export(penicillins) -export(portion_I) -export(portion_IR) -export(portion_R) -export(portion_S) -export(portion_SI) -export(portion_df) export(proportion_I) export(proportion_IR) export(proportion_R) diff --git a/NEWS.md b/NEWS.md index 62306a9e..b9d8f2be 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,13 @@ -# AMR 1.3.0.9034 +# AMR 1.3.0.9035 ## Last updated: 29 September 2020 Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly! +### Breaking +* Removed functions `portion_R()`, `portion_S()` and `portion_I()` that were deprecated since version 0.9.0 (November 2019) and were replaced with `proportion_R()`, `proportion_S()` and `proportion_I()`. + ### New -* Support for 'EUCAST Expert Rules' / 'EUCAST Intrinsic Resistance and Unusual Phenotypes' version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the `eucast_rules()` function can now correct for more than 180 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The `eucast_rules()` function consequently gained the parameters `version_breakpoints` (at the moment defaults to v10.0, 2020) and `version_expertrules` (at the moment defaults to v3.2, 2020). The `example_isolates` data set now also reflects the change from v3.1 to v3.2. +* Support for 'EUCAST Expert Rules' / 'EUCAST Intrinsic Resistance and Unusual Phenotypes' version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the `eucast_rules()` function can now correct for more than 180 different antibiotics and the `mdro()` function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The `eucast_rules()` function consequently gained the parameters `version_breakpoints` (at the moment defaults to v10.0, 2020) and `version_expertrules` (at the moment defaults to v3.2, 2020). The `example_isolates` data set now also reflects the change from v3.1 to v3.2. The `mdro()` function now accepts `guideline == "EUCAST3.1"` and `guideline == "EUCAST3.2"`. * A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html * Data set `intrinsic_resistant`. This data set contains all bug-drug combinations where the 'bug' is intrinsic resistant to the 'drug' according to the latest EUCAST insights. It contains just two columns: `microorganism` and `antibiotic`. diff --git a/R/ab_class_selectors.R b/R/ab_class_selectors.R index 1a950358..18230306 100644 --- a/R/ab_class_selectors.R +++ b/R/ab_class_selectors.R @@ -33,8 +33,7 @@ #' @inheritSection AMR Reference data publicly available #' @inheritSection AMR Read more on our website! #' @examples -#' \dontrun{ -#' library(dplyr) +#' if (require("dplyr")) { #' #' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem): #' example_isolates %>% @@ -57,9 +56,9 @@ #' format() #' #' -#' data.frame(irrelevant = "value", +#' data.frame(some_column = "some_value", #' J01CA01 = "S") %>% # ATC code of ampicillin -#' select(penicillins()) # the 'J01CA01' column will be selected +#' select(penicillins()) # only the 'J01CA01' column will be selected #' #' } ab_class <- function(ab_class) { diff --git a/R/age.R b/R/age.R index 9ec75281..aa905fa6 100755 --- a/R/age.R +++ b/R/age.R @@ -127,7 +127,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) { #' # same: #' age_groups(ages, c(1, 2, 4, 6, 13, 17)) #' -#' \dontrun{ +#' \donttest{ #' # resistance of ciprofloxacine per age group #' library(dplyr) #' example_isolates %>% diff --git a/R/atc_online.R b/R/atc_online.R index 52e59520..e80f5446 100644 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -60,17 +60,14 @@ #' @inheritSection AMR Read more on our website! #' @source #' @examples -#' \dontrun{ +#' \donttest{ #' # oral DDD (Defined Daily Dose) of amoxicillin #' atc_online_property("J01CA04", "DDD", "O") +#' #' # parenteral DDD (Defined Daily Dose) of amoxicillin #' atc_online_property("J01CA04", "DDD", "P") #' #' atc_online_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin -#' # [1] "ANTIINFECTIVES FOR SYSTEMIC USE" -#' # [2] "ANTIBACTERIALS FOR SYSTEMIC USE" -#' # [3] "BETA-LACTAM ANTIBACTERIALS, PENICILLINS" -#' # [4] "Penicillins with extended spectrum" #' } atc_online_property <- function(atc_code, property, diff --git a/R/availability.R b/R/availability.R index 2baed04b..46d14616 100644 --- a/R/availability.R +++ b/R/availability.R @@ -32,18 +32,11 @@ #' @examples #' availability(example_isolates) #' -#' \dontrun{ -#' library(dplyr) -#' example_isolates %>% availability() -#' -#' example_isolates %>% -#' select_if(is.rsi) %>% -#' availability() -#' -#' example_isolates %>% -#' filter(mo == as.mo("E. coli")) %>% -#' select_if(is.rsi) %>% -#' availability() +#' if (require("dplyr")) { +#' example_isolates %>% +#' filter(mo == as.mo("E. coli")) %>% +#' select_if(is.rsi) %>% +#' availability() #' } availability <- function(tbl, width = NULL) { stop_ifnot(is.data.frame(tbl), "`tbl` must be a data.frame") diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index 72faa7ef..3f0e9cde 100644 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -26,7 +26,7 @@ #' @inheritParams eucast_rules #' @param combine_IR logical to indicate whether values R and I should be summed #' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column -#' @param remove_intrinsic_resistant logical to indicate that rows with 100% resistance for all tested antimicrobials must be removed from the table +#' @param remove_intrinsic_resistant logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table #' @param FUN the function to call on the `mo` column to transform the microorganism IDs, defaults to [mo_shortname()] #' @param translate_ab a character of length 1 containing column names of the [antibiotics] data set #' @param ... arguments passed on to `FUN` @@ -45,13 +45,13 @@ #' format(x, translate_ab = "name (atc)") #' #' # Use FUN to change to transformation of microorganism codes -#' x <- bug_drug_combinations(example_isolates, -#' FUN = mo_gramstain) +#' bug_drug_combinations(example_isolates, +#' FUN = mo_gramstain) #' -#' x <- bug_drug_combinations(example_isolates, -#' FUN = function(x) ifelse(x == as.mo("E. coli"), -#' "E. coli", -#' "Others")) +#' bug_drug_combinations(example_isolates, +#' FUN = function(x) ifelse(x == as.mo("E. coli"), +#' "E. coli", +#' "Others")) #' } bug_drug_combinations <- function(x, col_mo = NULL, @@ -183,13 +183,12 @@ format.bug_drug_combinations <- function(x, y <- y %pm>% pm_left_join(mo_group, by = "ab") } - y <<- y y <- y %pm>% pm_distinct(ab, .keep_all = TRUE) %pm>% pm_select(-mo, -txt) %pm>% # replace tidyr::pivot_wider() until here remove_NAs() - + select_ab_vars <- function(.data) { .data[, c("ab_group", "ab_txt", colnames(.data)[!colnames(.data) %in% c("ab_group", "ab_txt", "ab")])] } @@ -205,12 +204,19 @@ format.bug_drug_combinations <- function(x, y <- y %pm>% pm_select(-ab_group) %pm>% pm_rename("Drug" = ab_txt) - colnames(y)[1] <- translate_AMR(colnames(y)[1], language = get_locale(), only_unknown = FALSE) + colnames(y)[1] <- translate_AMR(colnames(y)[1], language, only_unknown = FALSE) } else { y <- y %pm>% pm_rename("Group" = ab_group, "Drug" = ab_txt) - colnames(y)[1:2] <- translate_AMR(colnames(y)[1:2], language = get_locale(), only_unknown = FALSE) + } + + if (!is.null(language)) { + colnames(y) <- translate_AMR(colnames(y), language, only_unknown = FALSE) + } + + if (remove_intrinsic_resistant == TRUE) { + y <- y[, !sapply(y, function(col) all(col %like% "100", na.rm = TRUE) & !any(is.na(col))), drop = FALSE] } rownames(y) <- NULL diff --git a/R/deprecated.R b/R/deprecated.R index d169a00e..62812c78 100755 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -24,46 +24,6 @@ #' These functions are so-called '[Deprecated]'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). #' @inheritSection lifecycle Retired lifecycle #' @inheritSection AMR Read more on our website! -#' @export #' @keywords internal #' @name AMR-deprecated -#' @export -portion_R <- function(...) { - .Deprecated("resistance()", package = "AMR") - proportion_R(...) -} - -#' @rdname AMR-deprecated -#' @export -portion_IR <- function(...) { - .Deprecated("proportion_IR()", package = "AMR") - proportion_IR(...) -} - -#' @rdname AMR-deprecated -#' @export -portion_I <- function(...) { - .Deprecated("proportion_I()", package = "AMR") - proportion_I(...) -} - -#' @rdname AMR-deprecated -#' @export -portion_SI <- function(...) { - .Deprecated("susceptibility()", package = "AMR") - proportion_SI(...) -} - -#' @rdname AMR-deprecated -#' @export -portion_S <- function(...) { - .Deprecated("proportion_S()", package = "AMR") - proportion_S(...) -} - -#' @rdname AMR-deprecated -#' @export -portion_df <- function(...) { - .Deprecated("proportion_df()", package = "AMR") - proportion_df(...) -} +# @export diff --git a/R/disk.R b/R/disk.R index 007fac85..8267144e 100644 --- a/R/disk.R +++ b/R/disk.R @@ -33,7 +33,7 @@ #' @seealso [as.rsi()] #' @inheritSection AMR Read more on our website! #' @examples -#' \dontrun{ +#' \donttest{ #' # transform existing disk zones to the `disk` class #' library(dplyr) #' df <- data.frame(microorganism = "E. coli", @@ -41,8 +41,9 @@ #' CIP = 14, #' GEN = 18, #' TOB = 16) -#' df <- df %>% mutate_at(vars(AMP:TOB), as.disk) -#' df +#' df[, 2:5] <- lapply(df[, 2:5], as.disk) +#' # same with dplyr: +#' # df %>% mutate(across(AMP:TOB, as.disk)) #' #' # interpret disk values, see ?as.rsi #' as.rsi(x = as.disk(18), diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 280ff1bc..0b326400 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -67,23 +67,18 @@ EUCAST_VERSION_EXPERT_RULES <- list("3.1" = list(version_txt = "v3.1", #' #' The following antibiotics are used for the functions [eucast_rules()] and [mdro()]. These are shown below in the format 'name (`antimicrobial ID`, [ATC code](https://www.whocc.no/atc/structure_and_principles/))', sorted alphabetically: #' -#' `r create_ab_documentation(c("AMC", "AMK", "AMP", "AMX", "ATM", "AVO", "AZL", "AZM", "BAM", "BPR", "CAC", "CAP", "CAT", "CAZ", "CCV", "CDR", "CDZ", "CEC", "CED", "CEI", "CEP", "CFM", "CFM1", "CFP", "CFR", "CFS", "CHL", "CID", "CIP", "CLI", "CLR", "CMX", "CMZ", "CND", "COL", "CPD", "CPM", "CPO", "CPR", "CPT", "CRB", "CRD", "CRN", "CRO", "CSL", "CTB", "CTF", "CTL", "CTT", "CTX", "CTZ", "CXM", "CYC", "CZD", "CZO", "CZX", "DAL", "DAP", "DIR", "DIT", "DIZ", "DKB", "DOR", "DOX", "ENX", "EPC", "ERY", "ETH", "ETP", "FEP", "FLC", "FLE", "FLR1", "FOS", "FOX", "FOX1", "FUS", "GAT", "GEH", "GEM", "GEN", "GRX", "HAP", "HET", "INH", "IPM", "ISE", "JOS", "KAN", "LEX", "LIN", "LNZ", "LOM", "LOR", "LTM", "LVX", "MAN", "MCM", "MEC", "MEM", "MEV", "MEZ", "MFX", "MID", "MNO", "MTM", "NAL", "NEO", "NET", "NIT", "NOR", "NOV", "NVA", "OFX", "OLE", "ORI", "OXA", "PAZ", "PEF", "PEN", "PHN", "PIP", "PLB", "PME", "PRI", "PRL", "PRU", "PVM", "PZA", "QDA", "RAM", "RFL", "RFP", "RIB", "RID", "RIF", "ROK", "RST", "RXT", "SAM", "SBC", "SDI", "SDM", "SIS", "SLF", "SLF1", "SLF10", "SLF11", "SLF12", "SLF13", "SLF2", "SLF3", "SLF4", "SLF5", "SLF6", "SLF7", "SLF8", "SLF9", "SLT1", "SLT2", "SLT3", "SLT4", "SLT5", "SMX", "SPI", "SPX", "STH", "STR", "STR1", "SUD", "SUT", "SXT", "SZO", "TAL", "TCC", "TCM", "TCY", "TEC", "TEM", "TGC", "THA", "TIC", "TLT", "TLV", "TMP", "TMX", "TOB", "TRL", "TVA", "TZD", "TZP", "VAN"))` +#' `r create_ab_documentation(c("AMC", "AMK", "AMP", "AMX", "ATM", "AVO", "AZL", "AZM", "BAM", "BPR", "CAC", "CAP", "CAT", "CAZ", "CCV", "CDR", "CDZ", "CEC", "CED", "CEI", "CEP", "CFM", "CFM1", "CFP", "CFR", "CFS", "CHL", "CID", "CIP", "CLI", "CLR", "CMX", "CMZ", "CND", "COL", "CPD", "CPM", "CPO", "CPR", "CPT", "CRB", "CRD", "CRN", "CRO", "CSL", "CTB", "CTF", "CTL", "CTT", "CTX", "CTZ", "CXM", "CYC", "CZD", "CZO", "CZX", "DAL", "DAP", "DIR", "DIT", "DIZ", "DKB", "DOR", "DOX", "ENX", "EPC", "ERV", "ERY", "ETH", "ETP", "FDX", "FEP", "FLC", "FLE", "FLR1", "FOS", "FOX", "FOX1", "FUS", "GAT", "GEH", "GEM", "GEN", "GRX", "HAP", "HET", "INH", "IPM", "ISE", "JOS", "KAN", "LEX", "LIN", "LNZ", "LOM", "LOR", "LTM", "LVX", "MAN", "MCM", "MEC", "MEM", "MEV", "MEZ", "MFX", "MID", "MNO", "MTM", "MTR", "NAL", "NEO", "NET", "NIT", "NOR", "NOV", "NVA", "OFX", "OLE", "OMC", "ORI", "OXA", "PAZ", "PEF", "PEN", "PHN", "PIP", "PLB", "PME", "PRI", "PRL", "PRU", "PVM", "PZA", "QDA", "RAM", "RFL", "RFP", "RIB", "RID", "RIF", "ROK", "RST", "RXT", "SAM", "SBC", "SDI", "SDM", "SIS", "SLF", "SLF1", "SLF10", "SLF11", "SLF12", "SLF13", "SLF2", "SLF3", "SLF4", "SLF5", "SLF6", "SLF7", "SLF8", "SLF9", "SLT1", "SLT2", "SLT3", "SLT4", "SLT5", "SMX", "SPI", "SPT", "SPX", "STH", "STR", "STR1", "SUD", "SUT", "SXT", "SZO", "TAL", "TCC", "TCM", "TCY", "TEC", "TEM", "TGC", "THA", "TIC", "TLT", "TLV", "TMP", "TMX", "TOB", "TRL", "TVA", "TZD", "TZP", "VAN"))` #' @aliases EUCAST #' @rdname eucast_rules #' @export #' @return The input of `x`, possibly with edited values of antibiotics. Or, if `verbose = TRUE`, a [data.frame] with all original and new values of the affected bug-drug combinations. #' @source -#' - EUCAST Expert Rules. Version 2.0, 2012. \cr -#' Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility testing.** *Clin Microbiol Infect.* 2013;19(2):141-60. \cr -#' -#' - EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr -#' -#' - EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. \cr -#' -#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr -#' -#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. \cr -#' +#' - EUCAST Expert Rules. Version 2.0, 2012.\cr +#' Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility testing.** *Clin Microbiol Infect.* 2013;19(2):141-60. [(link)](https://doi.org/10.1111/j.1469-0691.2011.03703.x) +#' - EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf) +#' - EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf) +#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx) +#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx) #' @inheritSection AMR Reference data publicly available #' @inheritSection AMR Read more on our website! #' @examples diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 3770960b..18adbdcc 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -33,40 +33,43 @@ #' @seealso [antibiotic_class_selectors()] for the `select()` equivalent. #' @export #' @examples -#' \dontrun{ -#' library(dplyr) -#' -#' # filter on isolates that have any result for any aminoglycoside -#' example_isolates %>% filter_ab_class("aminoglycoside") -#' example_isolates %>% filter_aminoglycosides() -#' -#' # this is essentially the same as (but without determination of column names): -#' example_isolates %>% -#' filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")), -#' .vars_predicate = any_vars(. %in% c("S", "I", "R"))) -#' -#' -#' # filter on isolates that show resistance to ANY aminoglycoside -#' example_isolates %>% filter_aminoglycosides("R", "any") -#' -#' # filter on isolates that show resistance to ALL aminoglycosides -#' example_isolates %>% filter_aminoglycosides("R", "all") -#' -#' # filter on isolates that show resistance to -#' # any aminoglycoside and any fluoroquinolone -#' example_isolates %>% -#' filter_aminoglycosides("R") %>% -#' filter_fluoroquinolones("R") -#' -#' # filter on isolates that show resistance to -#' # all aminoglycosides and all fluoroquinolones -#' example_isolates %>% -#' filter_aminoglycosides("R", "all") %>% -#' filter_fluoroquinolones("R", "all") +#' filter_aminoglycosides(example_isolates) #' -#' # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: -#' example_isolates %>% filter_carbapenems("R", "all") -#' example_isolates %>% filter(across(carbapenems(), ~. == "R")) +#' \donttest{ +#' if (require("dplyr")) { +#' +#' # filter on isolates that have any result for any aminoglycoside +#' example_isolates %>% filter_aminoglycosides() +#' example_isolates %>% filter_ab_class("aminoglycoside") +#' +#' # this is essentially the same as (but without determination of column names): +#' example_isolates %>% +#' filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")), +#' .vars_predicate = any_vars(. %in% c("S", "I", "R"))) +#' +#' +#' # filter on isolates that show resistance to ANY aminoglycoside +#' example_isolates %>% filter_aminoglycosides("R", "any") +#' +#' # filter on isolates that show resistance to ALL aminoglycosides +#' example_isolates %>% filter_aminoglycosides("R", "all") +#' +#' # filter on isolates that show resistance to +#' # any aminoglycoside and any fluoroquinolone +#' example_isolates %>% +#' filter_aminoglycosides("R") %>% +#' filter_fluoroquinolones("R") +#' +#' # filter on isolates that show resistance to +#' # all aminoglycosides and all fluoroquinolones +#' example_isolates %>% +#' filter_aminoglycosides("R", "all") %>% +#' filter_fluoroquinolones("R", "all") +#' +#' # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: +#' example_isolates %>% filter_carbapenems("R", "all") +#' example_isolates %>% filter(across(carbapenems(), ~. == "R")) +#' } #' } filter_ab_class <- function(x, ab_class, diff --git a/R/first_isolate.R b/R/first_isolate.R index ae1ff596..cae8b509 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -46,18 +46,19 @@ #' #' All isolates with a microbial ID of `NA` will be excluded as first isolate. #' -#' The functions [filter_first_isolate()] and [filter_first_weighted_isolate()] are helper functions to quickly filter on first isolates. The function [filter_first_isolate()] is essentially equal to one of: +#' The functions [filter_first_isolate()] and [filter_first_weighted_isolate()] are helper functions to quickly filter on first isolates. The function [filter_first_isolate()] is essentially equal to either: #' ``` -#' x %>% filter(first_isolate(., ...)) +#' x[first_isolate(x, ...), ] +#' x %>% filter(first_isolate(x, ...)) #' ``` #' The function [filter_first_weighted_isolate()] is essentially equal to: #' ``` -#' x %>% -#' mutate(keyab = key_antibiotics(.)) %>% -#' mutate(only_weighted_firsts = first_isolate(x, -#' col_keyantibiotics = "keyab", ...)) %>% -#' filter(only_weighted_firsts == TRUE) %>% -#' select(-only_weighted_firsts, -keyab) +#' x %>% +#' mutate(keyab = key_antibiotics(.)) %>% +#' mutate(only_weighted_firsts = first_isolate(x, +#' col_keyantibiotics = "keyab", ...)) %>% +#' filter(only_weighted_firsts == TRUE) %>% +#' select(-only_weighted_firsts, -keyab) #' ``` #' @section Key antibiotics: #' There are two ways to determine whether isolates can be included as first *weighted* isolates which will give generally the same results: @@ -80,50 +81,41 @@ #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. -#' -#' \dontrun{ -#' library(dplyr) -#' # Filter on first isolates: -#' example_isolates %>% -#' mutate(first_isolate = first_isolate(.)) %>% -#' filter(first_isolate == TRUE) #' -#' # Now let's see if first isolates matter: -#' A <- example_isolates %>% -#' group_by(hospital_id) %>% -#' summarise(count = n_rsi(GEN), # gentamicin availability -#' resistance = resistance(GEN)) # gentamicin resistance -#' -#' B <- example_isolates %>% -#' filter_first_weighted_isolate() %>% # the 1st isolate filter -#' group_by(hospital_id) %>% -#' summarise(count = n_rsi(GEN), # gentamicin availability -#' resistance = resistance(GEN)) # gentamicin resistance -#' -#' # Have a look at A and B. -#' # B is more reliable because every isolate is counted only once. -#' # Gentamicin resistance in hospital D appears to be 3.7% higher than -#' # when you (erroneously) would have used all isolates for analysis. -#' -#' -#' ## OTHER EXAMPLES: +#' # basic filtering on first isolates +#' example_isolates[first_isolate(example_isolates), ] #' -#' # Short-hand versions: -#' example_isolates %>% -#' filter_first_isolate() +#' \donttest{ +#' if (require("dplyr")) { +#' # Filter on first isolates: +#' example_isolates %>% +#' mutate(first_isolate = first_isolate(.)) %>% +#' filter(first_isolate == TRUE) +#' +#' # Short-hand versions: +#' example_isolates %>% +#' filter_first_isolate() +#' +#' example_isolates %>% +#' filter_first_weighted_isolate() #' -#' example_isolates %>% -#' filter_first_weighted_isolate() -#' -#' -#' # set key antibiotics to a new variable -#' x$keyab <- key_antibiotics(x) -#' -#' x$first_isolate <- first_isolate(x) -#' -#' x$first_isolate_weighed <- first_isolate(x, col_keyantibiotics = 'keyab') -#' -#' x$first_blood_isolate <- first_isolate(x, specimen_group = "Blood") +#' # Now let's see if first isolates matter: +#' A <- example_isolates %>% +#' group_by(hospital_id) %>% +#' summarise(count = n_rsi(GEN), # gentamicin availability +#' resistance = resistance(GEN)) # gentamicin resistance +#' +#' B <- example_isolates %>% +#' filter_first_weighted_isolate() %>% # the 1st isolate filter +#' group_by(hospital_id) %>% +#' summarise(count = n_rsi(GEN), # gentamicin availability +#' resistance = resistance(GEN)) # gentamicin resistance +#' +#' # Have a look at A and B. +#' # B is more reliable because every isolate is counted only once. +#' # Gentamicin resistance in hospital D appears to be 3.7% higher than +#' # when you (erroneously) would have used all isolates for analysis. +#' } #' } first_isolate <- function(x, col_date = NULL, diff --git a/R/ggplot_pca.R b/R/ggplot_pca.R index e81f18e8..ad4a6f82 100755 --- a/R/ggplot_pca.R +++ b/R/ggplot_pca.R @@ -60,8 +60,7 @@ #' # See ?example_isolates. #' #' # See ?pca for more info about Principal Component Analysis (PCA). -#' \dontrun{ -#' library(dplyr) +#' if (require("dplyr")) { #' pca_model <- example_isolates %>% #' filter(mo_genus(mo) == "Staphylococcus") %>% #' group_by(species = mo_shortname(mo)) %>% diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 044c23c9..b43a5169 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -102,14 +102,14 @@ #' #' } #' -#' \dontrun{ +#' \donttest{ #' #' # resistance of ciprofloxacine per age group #' example_isolates %>% #' mutate(first_isolate = first_isolate(.)) %>% #' filter(first_isolate == TRUE, #' mo == as.mo("E. coli")) %>% -#' # `age_group` is also a function of this package: +#' # `age_groups` is also a function of this AMR package: #' group_by(age_group = age_groups(age)) %>% #' select(age_group, #' CIP) %>% @@ -118,7 +118,8 @@ #' # for colourblind mode, use divergent colours from the viridis package: #' example_isolates %>% #' select(AMX, NIT, FOS, TMP, CIP) %>% -#' ggplot_rsi() + scale_fill_viridis_d() +#' ggplot_rsi() + +#' scale_fill_viridis_d() #' # a shorter version which also adjusts data label colours: #' example_isolates %>% #' select(AMX, NIT, FOS, TMP, CIP) %>% diff --git a/R/join_microorganisms.R b/R/join_microorganisms.R index e5b85bdd..6af73977 100755 --- a/R/join_microorganisms.R +++ b/R/join_microorganisms.R @@ -39,19 +39,22 @@ #' left_join_microorganisms(as.mo("K. pneumoniae")) #' left_join_microorganisms("B_KLBSL_PNE") #' -#' \dontrun{ -#' library(dplyr) -#' example_isolates %>% left_join_microorganisms() -#' -#' df <- data.frame(date = seq(from = as.Date("2018-01-01"), -#' to = as.Date("2018-01-07"), -#' by = 1), -#' bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", -#' "E. coli", "E. coli", "E. coli")), -#' stringsAsFactors = FALSE) -#' colnames(df) -#' df_joined <- left_join_microorganisms(df, "bacteria") -#' colnames(df_joined) +#' \donttest{ +#' if (require("dplyr")) { +#' example_isolates %>% +#' left_join_microorganisms() %>% +#' colnames() +#' +#' df <- data.frame(date = seq(from = as.Date("2018-01-01"), +#' to = as.Date("2018-01-07"), +#' by = 1), +#' bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", +#' "E. coli", "E. coli", "E. coli")), +#' stringsAsFactors = FALSE) +#' colnames(df) +#' df_joined <- left_join_microorganisms(df, "bacteria") +#' colnames(df_joined) +#' } #' } inner_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) { check_dataset_integrity() diff --git a/R/key_antibiotics.R b/R/key_antibiotics.R index 22d08f6c..41aecd1c 100755 --- a/R/key_antibiotics.R +++ b/R/key_antibiotics.R @@ -72,33 +72,35 @@ #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. -#' -#' \dontrun{ -#' library(dplyr) -#' # set key antibiotics to a new variable -#' my_patients <- example_isolates %>% -#' mutate(keyab = key_antibiotics(.)) %>% -#' mutate( -#' # now calculate first isolates -#' first_regular = first_isolate(., col_keyantibiotics = FALSE), -#' # and first WEIGHTED isolates -#' first_weighted = first_isolate(., col_keyantibiotics = "keyab") -#' ) -#' -#' # Check the difference, in this data set it results in 7% more isolates: -#' sum(my_patients$first_regular, na.rm = TRUE) -#' sum(my_patients$first_weighted, na.rm = TRUE) -#' } -#' +#' #' # output of the `key_antibiotics` function could be like this: #' strainA <- "SSSRR.S.R..S" #' strainB <- "SSSIRSSSRSSS" #' +#' # can those strings can be compared with: #' key_antibiotics_equal(strainA, strainB) #' # TRUE, because I is ignored (as well as missing values) #' #' key_antibiotics_equal(strainA, strainB, ignore_I = FALSE) #' # FALSE, because I is not ignored and so the 4th value differs +#' +#' \donttest{ +#' if (require("dplyr")) { +#' # set key antibiotics to a new variable +#' my_patients <- example_isolates %>% +#' mutate(keyab = key_antibiotics(.)) %>% +#' mutate( +#' # now calculate first isolates +#' first_regular = first_isolate(., col_keyantibiotics = FALSE), +#' # and first WEIGHTED isolates +#' first_weighted = first_isolate(., col_keyantibiotics = "keyab") +#' ) +#' +#' # Check the difference, in this data set it results in 7% more isolates: +#' sum(my_patients$first_regular, na.rm = TRUE) +#' sum(my_patients$first_weighted, na.rm = TRUE) +#' } +#' } key_antibiotics <- function(x, col_mo = NULL, universal_1 = guess_ab_col(x, "amoxicillin"), diff --git a/R/like.R b/R/like.R index fd52ec78..c557fb59 100755 --- a/R/like.R +++ b/R/like.R @@ -57,10 +57,11 @@ #' #> TRUE TRUE TRUE #' #' # get isolates whose name start with 'Ent' or 'ent' -#' \dontrun{ -#' library(dplyr) -#' example_isolates %>% -#' filter(mo_name(mo) %like% "^ent") +#' \donttest{ +#' if (require("dplyr")) { +#' example_isolates %>% +#' filter(mo_name(mo) %like% "^ent") +#' } #' } like <- function(x, pattern, ignore.case = TRUE) { # set to fixed if no regex found diff --git a/R/mdro.R b/R/mdro.R index a390e03f..d342c2fe 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -27,7 +27,7 @@ #' @param info a logical to indicate whether progress should be printed to the console #' @inheritParams eucast_rules #' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate. -#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I. +#' @param combine_SI a [logical] to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I. #' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not. #' @inheritSection eucast_rules Antibiotics #' @details @@ -37,8 +37,10 @@ #' #' - `guideline = "CMI2012"`\cr #' 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) ([link](https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext)) -#' - `guideline = "EUCAST"`\cr -#' The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" ([link](http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf)) +#' - `guideline = "EUCAST3.2"` (or simply `guideline = "EUCAST"`)\cr +#' The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" ([link](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf)) +#' - `guideline = "EUCAST3.1"`\cr +#' The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" ([link](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf)) #' - `guideline = "TB"`\cr #' The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" ([link](https://www.who.int/tb/publications/pmdt_companionhandbook/en/)) #' - `guideline = "MRGN"`\cr @@ -48,7 +50,7 @@ #' #' Please suggest your own (country-specific) guidelines by letting us know: . #' -#' **Note:** Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu *et al.* in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this [mdro()] function makes sure that results from before 2016 and after 2016 are identical. +#' **Note:** Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named *order* Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu *et al.* in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this [mdro()] function makes sure that results from before 2016 and after 2016 are identical. #' @inheritSection as.rsi Interpretation of R and S/I #' @return #' - CMI 2012 paper - function [mdr_cmi2012()] or [mdro()]:\cr @@ -66,18 +68,19 @@ #' @source #' Please see *Details* for the list of publications used for this function. #' @examples -#' \dontrun{ -#' library(dplyr) -#' library(cleaner) +#' mdro(example_isolates, guideline = "EUCAST") #' -#' example_isolates %>% -#' mdro() %>% -#' freq() +#' \donttest{ +#' if (require("dplyr")) { +#' example_isolates %>% +#' mdro() %>% +#' table() #' -#' example_isolates %>% -#' mutate(EUCAST = eucast_exceptional_phenotypes(.), -#' BRMO = brmo(.), -#' MRGN = mrgn(.)) +#' example_isolates %>% +#' mutate(EUCAST = eucast_exceptional_phenotypes(.), +#' BRMO = brmo(.), +#' MRGN = mrgn(.)) +#' } #' } mdro <- function(x, guideline = "CMI2012", @@ -90,12 +93,12 @@ mdro <- function(x, check_dataset_integrity() - if (verbose == TRUE & interactive()) { + if (interactive() & verbose == TRUE & info == TRUE) { txt <- paste0("WARNING: In Verbose mode, the mdro() function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.", "\n\nThis may overwrite your existing data if you use e.g.:", "\ndata <- mdro(data, verbose = TRUE)\n\nDo you want to continue?") - if ("rstudioapi" %in% rownames(utils::installed.packages())) { - showQuestion <- import_fn("showQuestion", "rstudioapi") + showQuestion <- import_fn("showQuestion", "rstudioapi", error_on_fail = FALSE) + if (!is.null(showQuestion)) { q_continue <- showQuestion("Using verbose = TRUE with mdro()", txt) } else { q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt) @@ -124,19 +127,25 @@ mdro <- function(x, } stop_ifnot(length(guideline) == 1, "`guideline` must be of length 1") + guideline.bak <- guideline + guideline <- tolower(gsub("[^a-zA-Z0-9.]+", "", guideline)) if (is.null(guideline)) { # default to the paper by Magiorakos et al. (2012) guideline <- "cmi2012" } - if (tolower(guideline) == "nl") { - guideline <- "BRMO" + if (guideline == "eucast") { + # turn into latest EUCAST guideline + guideline <- "eucast3.2" } - if (tolower(guideline) == "de") { - guideline <- "MRGN" + if (guideline == "nl") { + guideline <- "brmo" } - stop_ifnot(tolower(guideline) %in% c("brmo", "mrgn", "eucast", "tb", "cmi2012"), - "invalid guideline: ", guideline) - guideline <- list(code = tolower(guideline)) + if (guideline == "de") { + guideline <- "mrgn" + } + stop_ifnot(guideline %in% c("brmo", "mrgn", "eucast3.1", "eucast3.2", "tb", "cmi2012"), + "invalid guideline: ", guideline.bak) + guideline <- list(code = guideline) # try to find columns based on type # -- mo @@ -158,16 +167,22 @@ mdro <- function(x, guideline$version <- "N/A" guideline$source <- "Clinical Microbiology and Infection 18:3, 2012. DOI: 10.1111/j.1469-0691.2011.03570.x" - } else if (guideline$code == "eucast") { + } else if (guideline$code == "eucast3.2") { + guideline$name <- "EUCAST Expert Rules, \"Intrinsic Resistance and Unusual Phenotypes\"" + guideline$author <- "EUCAST (European Committee on Antimicrobial Susceptibility Testing)" + guideline$version <- "3.2, 2020" + guideline$source <- "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" + + } else if (guideline$code == "eucast3.1") { guideline$name <- "EUCAST Expert Rules, \"Intrinsic Resistance and Exceptional Phenotypes Tables\"" guideline$author <- "EUCAST (European Committee on Antimicrobial Susceptibility Testing)" - guideline$version <- "3.1" - guideline$source <- "http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" + guideline$version <- "3.1, 2016" + guideline$source <- "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" } else if (guideline$code == "tb") { guideline$name <- "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" guideline$author <- "WHO (World Health Organization)" - guideline$version <- "WHO/HTM/TB/2014.11" + guideline$version <- "WHO/HTM/TB/2014.11, 2014" guideline$source <- "https://www.who.int/tb/publications/pmdt_companionhandbook/en/" # support per country: @@ -306,6 +321,33 @@ mdro <- function(x, verbose = verbose, info = info, ...) + } else if (guideline$code == "eucast3.2") { + cols_ab <- get_column_abx(x = x, + soft_dependencies = c("AMP", + "AMX", + "CIP", + "DAL", + "DAP", + "ERV", + "FDX", + "GEN", + "LNZ", + "MEM", + "MTR", + "OMC", + "ORI", + "PEN", + "QDA", + "RIF", + "TEC", + "TGC", + "TLV", + "TOB", + "TZD", + "VAN"), + info = info, + verbose = verbose, + ...) } else if (guideline$code == "tb") { cols_ab <- get_column_abx(x = x, soft_dependencies = c("CAP", @@ -344,41 +386,88 @@ mdro <- function(x, ATM <- cols_ab["ATM"] AZL <- cols_ab["AZL"] AZM <- cols_ab["AZM"] + BPR <- cols_ab["BPR"] + CAC <- cols_ab["CAC"] + CAT <- cols_ab["CAT"] CAZ <- cols_ab["CAZ"] + CCV <- cols_ab["CCV"] + CDR <- cols_ab["CDR"] + CDZ <- cols_ab["CDZ"] + CEC <- cols_ab["CEC"] CED <- cols_ab["CED"] + CEI <- cols_ab["CEI"] + CEP <- cols_ab["CEP"] + CFM <- cols_ab["CFM"] + CFM1 <- cols_ab["CFM1"] + CFP <- cols_ab["CFP"] + CFR <- cols_ab["CFR"] + CFS <- cols_ab["CFS"] CHL <- cols_ab["CHL"] + CID <- cols_ab["CID"] CIP <- cols_ab["CIP"] CLI <- cols_ab["CLI"] CLR <- cols_ab["CLR"] + CMX <- cols_ab["CMX"] + CMZ <- cols_ab["CMZ"] + CND <- cols_ab["CND"] COL <- cols_ab["COL"] + CPD <- cols_ab["CPD"] + CPM <- cols_ab["CPM"] + CPO <- cols_ab["CPO"] + CPR <- cols_ab["CPR"] CPT <- cols_ab["CPT"] + CRD <- cols_ab["CRD"] CRO <- cols_ab["CRO"] + CSL <- cols_ab["CSL"] + CTB <- cols_ab["CTB"] + CTF <- cols_ab["CTF"] + CTL <- cols_ab["CTL"] CTT <- cols_ab["CTT"] CTX <- cols_ab["CTX"] + CTZ <- cols_ab["CTZ"] CXM <- cols_ab["CXM"] + CZD <- cols_ab["CZD"] CZO <- cols_ab["CZO"] + CZX <- cols_ab["CZX"] + DAL <- cols_ab["DAL"] DAP <- cols_ab["DAP"] + DIT <- cols_ab["DIT"] + DIZ <- cols_ab["DIZ"] DOR <- cols_ab["DOR"] DOX <- cols_ab["DOX"] + ENX <- cols_ab["ENX"] + ERV <- cols_ab["ERV"] ERY <- cols_ab["ERY"] ETP <- cols_ab["ETP"] + FDX <- cols_ab["FDX"] FEP <- cols_ab["FEP"] FLC <- cols_ab["FLC"] + FLE <- cols_ab["FLE"] FOS <- cols_ab["FOS"] FOX <- cols_ab["FOX"] FUS <- cols_ab["FUS"] + GAT <- cols_ab["GAT"] GEH <- cols_ab["GEH"] + GEM <- cols_ab["GEM"] GEN <- cols_ab["GEN"] + GRX <- cols_ab["GRX"] + HAP <- cols_ab["HAP"] IPM <- cols_ab["IPM"] KAN <- cols_ab["KAN"] + LEX <- cols_ab["LEX"] LIN <- cols_ab["LIN"] LNZ <- cols_ab["LNZ"] + LOM <- cols_ab["LOM"] + LOR <- cols_ab["LOR"] + LTM <- cols_ab["LTM"] LVX <- cols_ab["LVX"] + MAN <- cols_ab["MAN"] MEM <- cols_ab["MEM"] + MEV <- cols_ab["MEV"] MEZ <- cols_ab["MEZ"] - MTR <- cols_ab["MTR"] MFX <- cols_ab["MFX"] MNO <- cols_ab["MNO"] + MTR <- cols_ab["MTR"] NAL <- cols_ab["NAL"] NEO <- cols_ab["NEO"] NET <- cols_ab["NET"] @@ -386,17 +475,25 @@ mdro <- function(x, NOR <- cols_ab["NOR"] NOV <- cols_ab["NOV"] OFX <- cols_ab["OFX"] + OMC <- cols_ab["OMC"] + ORI <- cols_ab["ORI"] OXA <- cols_ab["OXA"] + PAZ <- cols_ab["PAZ"] + PEF <- cols_ab["PEF"] PEN <- cols_ab["PEN"] PIP <- cols_ab["PIP"] PLB <- cols_ab["PLB"] PRI <- cols_ab["PRI"] + PRU <- cols_ab["PRU"] QDA <- cols_ab["QDA"] + RFL <- cols_ab["RFL"] RID <- cols_ab["RID"] RIF <- cols_ab["RIF"] RXT <- cols_ab["RXT"] SAM <- cols_ab["SAM"] SIS <- cols_ab["SIS"] + SPT <- cols_ab["SPT"] + SPX <- cols_ab["SPX"] STH <- cols_ab["STH"] SXT <- cols_ab["SXT"] TCC <- cols_ab["TCC"] @@ -406,7 +503,10 @@ mdro <- function(x, TIC <- cols_ab["TIC"] TLV <- cols_ab["TLV"] TMP <- cols_ab["TMP"] + TMX <- cols_ab["TMX"] TOB <- cols_ab["TOB"] + TVA <- cols_ab["TVA"] + TZD <- cols_ab["TZD"] TZP <- cols_ab["TZP"] VAN <- cols_ab["VAN"] # additional for TB @@ -453,10 +553,12 @@ mdro <- function(x, # antibiotic classes aminoglycosides <- c(TOB, GEN) - cephalosporins <- c(FEP, CTX, FOX, CED, CAZ, CRO, CXM, CZO) - cephalosporins_3rd <- c(CTX, CRO, CAZ) - carbapenems <- c(ETP, IPM, MEM) - fluoroquinolones <- c(OFX, CIP, LVX, MFX) + cephalosporins <- c(CDZ, CAC, CEC, CFR, RID, MAN, CTZ, CZD, CZO, CDR, DIT, FEP, CAT, CFM, CMX, CMZ, DIZ, CID, CFP, CSL, CND, CTX, CTT, CTF, FOX, CPM, CPO, CPD, CPR, CRD, CFS, CPT, CAZ, CCV, CTL, CTB, CZX, BPR, CFM1, CEI, CRO, CXM, LEX, CEP, HAP, CED, LTM, LOR) + cephalosporins_1st <- c(CAC, CFR, RID, CTZ, CZD, CZO, CRD, CTL, LEX, CEP, HAP, CED) + cephalosporins_2nd <- c(CEC, MAN, CMZ, CID, CND, CTT, CTF, FOX, CPR, CXM, LOR) + cephalosporins_3rd <- c(CDZ, CDR, DIT, CAT, CFM, CMX, DIZ, CFP, CSL, CTX, CPM, CPD, CFS, CAZ, CCV, CTB, CZX, CRO, LTM) + carbapenems <- c(DOR, ETP, IPM, MEM, MEV) + fluoroquinolones <- c(CIP, ENX, FLE, GAT, GEM, GRX, LVX, LOM, MFX, NOR, OFX, PAZ, PEF, PRU, RFL, SPX, TMX, TVA) # helper function for editing the table trans_tbl <- function(to, rows, cols, any_all) { @@ -749,33 +851,33 @@ mdro <- function(x, } - if (guideline$code == "eucast") { - # EUCAST ------------------------------------------------------------------ + if (guideline$code == "eucast3.1") { + # EUCAST 3.1 -------------------------------------------------------------- # Table 5 trans_tbl(3, which(x$order == "Enterobacterales" - | x$fullname %like% "^Pseudomonas aeruginosa" + | (x$genus == "Pseudomonas" & x$species == "aeruginosa") | x$genus == "Acinetobacter"), COL, "all") trans_tbl(3, - which(x$fullname %like% "^Salmonella Typhi"), + which(x$genus == "Salmonella" & x$species == "Typhi"), c(carbapenems, fluoroquinolones), "any") trans_tbl(3, - which(x$fullname %like% "^Haemophilus influenzae"), + which(x$genus == "Haemophilus" & x$species == "influenzae"), c(cephalosporins_3rd, carbapenems, fluoroquinolones), "any") trans_tbl(3, - which(x$fullname %like% "^Moraxella catarrhalis"), + which(x$genus == "Moraxella" & x$species == "catarrhalis"), c(cephalosporins_3rd, fluoroquinolones), "any") trans_tbl(3, - which(x$fullname %like% "^Neisseria meningitidis"), + which(x$genus == "Neisseria" & x$species == "meningitidis"), c(cephalosporins_3rd, fluoroquinolones), "any") trans_tbl(3, - which(x$fullname %like% "^Neisseria gonorrhoeae"), + which(x$genus == "Neisseria" & x$species == "gonorrhoeae"), AZM, "any") # Table 6 @@ -788,7 +890,7 @@ mdro <- function(x, c(VAN, TEC, DAP, LNZ, QDA, TGC), "any") trans_tbl(3, - which(x$fullname %like% "^Streptococcus pneumoniae"), + which(x$genus == "Streptococcus" & x$species == "pneumoniae"), c(carbapenems, VAN, TEC, DAP, LNZ, QDA, TGC, RIF), "any") trans_tbl(3, # Sr. groups A/B/C/G @@ -800,7 +902,7 @@ mdro <- function(x, c(DAP, LNZ, TGC, TEC), "any") trans_tbl(3, - which(x$fullname %like% "^Enterococcus faecalis"), + which(x$genus == "Enterococcus" & x$species == "faecalis"), c(AMP, AMX), "any") # Table 7 @@ -809,11 +911,84 @@ mdro <- function(x, MTR, "any") trans_tbl(3, - which(x$fullname %like% "^Clostridium difficile"), + which(x$genus == "Clostridium" & x$species == "difficile"), c(MTR, VAN), "any") } + if (guideline$code == "eucast3.2") { + # EUCAST 3.2 -------------------------------------------------------------- + # Table 6 + trans_tbl(3, + which((x$order == "Enterobacterales" & + !x$family == "Morganellaceae" & + !(x$genus == "Serratia" & x$species == "marcescens")) + | (x$genus == "Pseudomonas" & x$species == "aeruginosa") + | x$genus == "Acinetobacter"), + COL, + "all") + trans_tbl(3, + which(x$genus == "Salmonella" & x$species == "Typhi"), + c(carbapenems), + "any") + trans_tbl(3, + which(x$genus == "Haemophilus" & x$species == "influenzae"), + c(cephalosporins_3rd, carbapenems, fluoroquinolones), + "any") + trans_tbl(3, + which(x$genus == "Moraxella" & x$species == "catarrhalis"), + c(cephalosporins_3rd, fluoroquinolones), + "any") + trans_tbl(3, + which(x$genus == "Neisseria" & x$species == "meningitidis"), + c(cephalosporins_3rd, fluoroquinolones), + "any") + trans_tbl(3, + which(x$genus == "Neisseria" & x$species == "gonorrhoeae"), + SPT, + "any") + # Table 7 + trans_tbl(3, + which(x$genus == "Staphylococcus" & x$species == "aureus"), + c(VAN, TEC, TLV, DAL, ORI, DAP, LNZ, TZD, QDA, TGC, ERV, OMC), + "any") + trans_tbl(3, + which(x$mo %in% MO_CONS), # coagulase-negative Staphylococcus + c( VAN, TLV, DAL, ORI, DAP, LNZ, TZD, QDA, TGC, ERV, OMC), + "any") + trans_tbl(3, + which(x$genus == "Corynebacterium"), + c(VAN, TEC, TLV, DAL, ORI, DAP, LNZ, TZD, QDA, TGC), + "any") + trans_tbl(3, + which(x$genus == "Streptococcus" & x$species == "pneumoniae"), + c(carbapenems, VAN, TEC, TLV, DAL, ORI, DAP, LNZ, TZD, QDA, TGC, ERV, OMC, RIF), + "any") + streps <- MO_lookup[which(MO_lookup$genus == "Streptococcus"), "mo", drop = TRUE] + streps_ABCG <- streps[as.mo(streps, Lancefield = TRUE) %in% c("B_STRPT_GRPA", "B_STRPT_GRPB", "B_STRPT_GRPC", "B_STRPT_GRPG")] + trans_tbl(3, # Sr. groups A/B/C/G + which(x$mo %in% streps_ABCG), + c(PEN, cephalosporins, VAN, TEC, TLV, DAL, ORI, DAP, LNZ, TZD, QDA, TGC, ERV, OMC), + "any") + trans_tbl(3, + which(x$genus == "Enterococcus"), + c(DAP, LNZ, TGC, ERV, OMC, TEC), + "any") + trans_tbl(3, + which(x$genus == "Enterococcus" & x$species == "faecalis"), + c(AMP, AMX), + "any") + # Table 8 + trans_tbl(3, + which(x$genus == "Bacteroides"), + MTR, + "any") + trans_tbl(3, + which(x$genus == "Clostridium" & x$species == "difficile"), + c(MTR, VAN, FDX), + "any") + } + if (guideline$code == "mrgn") { # Germany ----------------------------------------------------------------- CTX_or_CAZ <- CTX %or% CAZ @@ -828,7 +1003,7 @@ mdro <- function(x, # Table 1 x[which((x$order == "Enterobacterales" | # following in fact the old Enterobacteriaceae classification - x$fullname %like% "^Acinetobacter baumannii") & + (x$genus == "Acinetobacter" & x$species == "baumannii")) & x[, PIP] == "R" & x[, CTX_or_CAZ] == "R" & x[, IPM_or_MEM] == "S" & @@ -836,7 +1011,7 @@ mdro <- function(x, "MDRO"] <- 2 # 2 = 3MRGN x[which((x$order == "Enterobacterales" | # following in fact the old Enterobacteriaceae classification - x$fullname %like% "^Acinetobacter baumannii") & + (x$genus == "Acinetobacter" & x$species == "baumannii")) & x[, PIP] == "R" & x[, CTX_or_CAZ] == "R" & x[, IPM_or_MEM] == "R" & @@ -844,18 +1019,18 @@ mdro <- function(x, "MDRO"] <- 3 # 3 = 4MRGN, overwrites 3MRGN if applicable x[which((x$order == "Enterobacterales" | # following in fact the old Enterobacteriaceae classification - x$fullname %like% "^Acinetobacter baumannii") & + (x$genus == "Acinetobacter" & x$species == "baumannii")) & x[, IPM] == "R" | x[, MEM] == "R"), "MDRO"] <- 3 # 3 = 4MRGN, always when imipenem or meropenem is R - x[which(x$fullname %like% "^Pseudomonas aeruginosa" & + x[which(x$genus == "Pseudomonas" & x$species == "aeruginosa" & (x[, PIP] == "S") + (x[, CTX_or_CAZ] == "S") + (x[, IPM_or_MEM] == "S") + (x[, CIP] == "S") == 1), "MDRO"] <- 2 # 2 = 3MRGN, if only 1 group is S - x[which((x$fullname %like% "^Pseudomonas aeruginosa") & + x[which((x$genus == "Pseudomonas" & x$species == "aeruginosa") & x[, PIP] == "R" & x[, CTX_or_CAZ] == "R" & x[, IPM_or_MEM] == "R" & @@ -903,7 +1078,7 @@ mdro <- function(x, "all") trans_tbl(3, - which(x$fullname %like% "^Stenotrophomonas maltophilia"), + which(x$genus == "Stenotrophomonas" & x$species == "maltophilia"), SXT, "all") @@ -922,20 +1097,20 @@ mdro <- function(x, x$psae <- 0 } x[which( - x$fullname %like% "Pseudomonas aeruginosa" + x$genus == "Pseudomonas" & x$species == "aeruginosa" & x$psae >= 3), "MDRO"] <- 3 # Table 3 trans_tbl(3, - which(x$fullname %like% "Streptococcus pneumoniae"), + which(x$genus == "Streptococcus" & x$species == "pneumoniae"), PEN, "all") trans_tbl(3, - which(x$fullname %like% "Streptococcus pneumoniae"), + which(x$genus == "Streptococcus" & x$species == "pneumoniae"), VAN, "all") trans_tbl(3, - which(x$fullname %like% "Enterococcus faecium"), + which(x$genus == "Enterococcus" & x$species == "faecium"), c(PEN, VAN), "all") } @@ -1086,7 +1261,6 @@ mdr_cmi2012 <- function(x, guideline = "CMI2012", ...) { mdro(x = x, guideline = "CMI2012", ...) } - #' @rdname mdro #' @export eucast_exceptional_phenotypes <- function(x, guideline = "EUCAST", ...) { diff --git a/R/mo.R b/R/mo.R index cda2f305..9892369a 100755 --- a/R/mo.R +++ b/R/mo.R @@ -93,14 +93,7 @@ #' #' ## Microbial prevalence of pathogens in humans #' -#' The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the `prevalence` columns in the [microorganisms] and [microorganisms.old] data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. -#' -#' Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is *Enterococcus*, *Staphylococcus* or *Streptococcus*. This group consequently contains all common Gram-negative bacteria, such as *Klebsiella*, *Pseudomonas* and *Legionella*. -#' -#' Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is *Aspergillus*, *Bacteroides*, *Candida*, *Capnocytophaga*, *Chryseobacterium*, *Cryptococcus*, *Elisabethkingia*, *Flavobacterium*, *Fusobacterium*, *Giardia*, *Leptotrichia*, *Mycoplasma*, *Prevotella*, *Rhodotorula*, *Treponema*, *Trichophyton* or *Ureaplasma*. This group consequently contains all less common and rare human pathogens. -#' -#' Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans. -#' +#' The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the `prevalence` columns in the [microorganisms] and [microorganisms.old] data sets. The grouping into human pathogenic prevalence is explained in the section *Matching score for microorganisms* below. #' @inheritSection mo_matching_score Matching score for microorganisms #' @inheritSection catalogue_of_life Catalogue of Life # (source as a section here, so it can be inherited by other man pages:) @@ -152,25 +145,6 @@ #' # All mo_* functions use as.mo() internally too (see ?mo_property): #' mo_genus("E. coli") # returns "Escherichia" #' mo_gramstain("E. coli") # returns "Gram negative" -#' -#' } -#' \dontrun{ -#' df$mo <- as.mo(df$microorganism_name) -#' -#' # the select function of the Tidyverse is also supported: -#' library(dplyr) -#' df$mo <- df %>% -#' select(microorganism_name) %>% -#' as.mo() -#' -#' # and can even contain 2 columns, which is convenient -#' # for genus/species combinations: -#' df$mo <- df %>% -#' select(genus, species) %>% -#' as.mo() -#' # although this works easier and does the same: -#' df <- df %>% -#' mutate(mo = as.mo(paste(genus, species))) #' } as.mo <- function(x, Becker = FALSE, @@ -1439,45 +1413,26 @@ exec_as.mo <- function(x, # Becker ---- if (Becker == TRUE | Becker == "all") { - # See Source. It's this figure: - # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4187637/figure/F3/ - MOs_staph <- MO_lookup[which(MO_lookup$genus == "Staphylococcus"), ] - CoNS <- MOs_staph[which(MOs_staph$species %in% c("arlettae", "auricularis", "capitis", - "caprae", "carnosus", "chromogenes", "cohnii", "condimenti", - "devriesei", "epidermidis", "equorum", "felis", - "fleurettii", "gallinarum", "haemolyticus", - "hominis", "jettensis", "kloosii", "lentus", - "lugdunensis", "massiliensis", "microti", - "muscae", "nepalensis", "pasteuri", "petrasii", - "pettenkoferi", "piscifermentans", "rostri", - "saccharolyticus", "saprophyticus", "sciuri", - "stepanovicii", "simulans", "succinus", - "vitulinus", "warneri", "xylosus") - | (MOs_staph$species == "schleiferi" & MOs_staph$subspecies %in% c("schleiferi", ""))), - property] - CoPS <- MOs_staph[which(MOs_staph$species %in% c("simiae", "agnetis", - "delphini", "lutrae", - "hyicus", "intermedius", - "pseudintermedius", "pseudointermedius", - "schweitzeri", "argenteus") - | (MOs_staph$species == "schleiferi" & MOs_staph$subspecies == "coagulans")), - property] - # warn when species found that are not in Becker (2014, PMID 25278577) and Becker (2019, PMID 30872103) post_Becker <- c("argensis", "caeli", "cornubiensis", "edaphicus") - if (any(x %in% MOs_staph[which(MOs_staph$species %in% post_Becker), property])) { + if (any(x %in% MO_lookup[which(MO_lookup$species %in% post_Becker), property])) { warning("Becker ", font_italic("et al."), " (2014, 2019) does not contain these species named after their publication: ", font_italic(paste("S.", - sort(mo_species(unique(x[x %in% MOs_staph[which(MOs_staph$species %in% post_Becker), property]]))), + sort(mo_species(unique(x[x %in% MO_lookup[which(MO_lookup$species %in% post_Becker), property]]))), collapse = ", ")), ".", call. = FALSE, immediate. = TRUE) } + # 'MO_CONS' and 'MO_COPS' are vectors created in R/zzz.R + CoNS <- MO_lookup[which(MO_lookup$mo %in% MO_CONS), property, drop = TRUE] x[x %in% CoNS] <- lookup(mo == "B_STPHY_CONS", uncertainty = -1) + + CoPS <- MO_lookup[which(MO_lookup$mo %in% MO_COPS), property, drop = TRUE] x[x %in% CoPS] <- lookup(mo == "B_STPHY_COPS", uncertainty = -1) + if (Becker == "all") { x[x %in% lookup(fullname %like_case% "^Staphylococcus aureus", n = Inf)] <- lookup(mo == "B_STPHY_COPS", uncertainty = -1) } diff --git a/R/mo_matching_score.R b/R/mo_matching_score.R index a4fd1f83..386d88f7 100755 --- a/R/mo_matching_score.R +++ b/R/mo_matching_score.R @@ -32,21 +32,22 @@ #' where: #' #' * \eqn{x} is the user input; -#' * \eqn{n} is a taxonomic name (genus, species and subspecies) as found in [`microorganisms$fullname`][microorganisms]; -#' * \eqn{l_{n}}{l_n} is the length of \eqn{n}; -#' * \eqn{\operatorname{lev}}{lev} is the [Levenshtein distance function](https://en.wikipedia.org/wiki/Levenshtein_distance); -#' * \eqn{p_{n}}{p_n} is the human pathogenic prevalence of \eqn{n}, categorised into group \eqn{1}, \eqn{2} and \eqn{3} (see *Details* in `?as.mo`), meaning that \eqn{p = \{1, 2 , 3\}}{p = {1, 2, 3}}; -#' * \eqn{k_{n}}{k_n} is the kingdom index of \eqn{n}, set as follows: Bacteria = \eqn{1}, Fungi = \eqn{2}, Protozoa = \eqn{3}, Archaea = \eqn{4}, and all others = \eqn{5}, meaning that \eqn{k = \{1, 2 , 3, 4, 5\}}{k = {1, 2, 3, 4, 5}}. +#' * \eqn{n} is a taxonomic name (genus, species, and subspecies); +#' * \eqn{l_n}{l_n} is the length of \eqn{n}; +#' * lev is the [Levenshtein distance function](https://en.wikipedia.org/wiki/Levenshtein_distance), which counts any insertion, deletion and substitution as 1 that is needed to change \eqn{x} into \eqn{n}; +#' * \eqn{p_n}{p_n} is the human pathogenic prevalence group of \eqn{n}, as described below; +#' * \eqn{k_n}{p_n} is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5. #' -#' This means that the user input `x = "E. coli"` gets for *Escherichia coli* a matching score of `r percentage(mo_matching_score("E. coli", "Escherichia coli"), 1)` and for *Entamoeba coli* a matching score of `r percentage(mo_matching_score("E. coli", "Entamoeba coli"), 1)`. +#' The grouping into human pathogenic prevalence (\eqn{p}) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. **Group 1** (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is *Enterococcus*, *Staphylococcus* or *Streptococcus*. This group consequently contains all common Gram-negative bacteria, such as *Pseudomonas* and *Legionella* and all species within the order Enterobacterales. **Group 2** consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is *Absidia*, *Acremonium*, *Actinotignum*, *Alternaria*, *Anaerosalibacter*, *Apophysomyces*, *Arachnia*, *Aspergillus*, *Aureobacterium*, *Aureobasidium*, *Bacteroides*, *Basidiobolus*, *Beauveria*, *Blastocystis*, *Branhamella*, *Calymmatobacterium*, *Candida*, *Capnocytophaga*, *Catabacter*, *Chaetomium*, *Chryseobacterium*, *Chryseomonas*, *Chrysonilia*, *Cladophialophora*, *Cladosporium*, *Conidiobolus*, *Cryptococcus*, *Curvularia*, *Exophiala*, *Exserohilum*, *Flavobacterium*, *Fonsecaea*, *Fusarium*, *Fusobacterium*, *Hendersonula*, *Hypomyces*, *Koserella*, *Lelliottia*, *Leptosphaeria*, *Leptotrichia*, *Malassezia*, *Malbranchea*, *Mortierella*, *Mucor*, *Mycocentrospora*, *Mycoplasma*, *Nectria*, *Ochroconis*, *Oidiodendron*, *Phoma*, *Piedraia*, *Pithomyces*, *Pityrosporum*, *Prevotella*,\\*Pseudallescheria*, *Rhizomucor*, *Rhizopus*, *Rhodotorula*, *Scolecobasidium*, *Scopulariopsis*, *Scytalidium*,*Sporobolomyces*, *Stachybotrys*, *Stomatococcus*, *Treponema*, *Trichoderma*, *Trichophyton*, *Trichosporon*, *Tritirachium* or *Ureaplasma*. **Group 3** consists of all other microorganisms. #' -#' All matches are sorted descending on their matching score and for all user input values, the top match will be returned. +#' All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., `"E. coli"` will return the microbial ID of *Escherichia coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Escherichia coli"), 3)`}, a highly prevalent microorganism found in humans) and not *Entamoeba coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Entamoeba coli"), 3)`}, a less prevalent microorganism in humans), although the latter would alphabetically come first. #' @export #' @examples #' as.mo("E. coli") #' mo_uncertainties() #' -#' mo_matching_score("E. coli", "Escherichia coli") +#' mo_matching_score(x = "E. coli", +#' n = c("Escherichia coli", "Entamoeba coli")) mo_matching_score <- function(x, n) { # n is always a taxonomically valid full name levenshtein <- double(length = length(x)) diff --git a/R/p_symbol.R b/R/p_symbol.R index be4054d7..7c7d51bc 100755 --- a/R/p_symbol.R +++ b/R/p_symbol.R @@ -25,6 +25,7 @@ #' @inheritSection lifecycle Questioning lifecycle #' @param p p value #' @param emptychar text to show when `p > 0.1` +#' @details **NOTE**: this function will be moved to the `cleaner` package when a new version is being published on CRAN. #' @return Text #' @inheritSection AMR Read more on our website! #' @export diff --git a/R/pca.R b/R/pca.R index 79ad9453..9d319e3f 100755 --- a/R/pca.R +++ b/R/pca.R @@ -36,22 +36,24 @@ #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. #' -#' \dontrun{ -#' # calculate the resistance per group first -#' library(dplyr) -#' resistance_data <- example_isolates %>% -#' group_by(order = mo_order(mo), # group on anything, like order -#' genus = mo_genus(mo)) %>% # and genus as we do here -#' summarise_if(is.rsi, resistance) # then get resistance of all drugs -#' -#' # now conduct PCA for certain antimicrobial agents -#' pca_result <- resistance_data %>% -#' pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) -#' -#' pca_result -#' summary(pca_result) -#' biplot(pca_result) -#' ggplot_pca(pca_result) # a new and convenient plot function +#' \donttest{ +#' +#' if (require("dplyr")) { +#' # calculate the resistance per group first +#' resistance_data <- example_isolates %>% +#' group_by(order = mo_order(mo), # group on anything, like order +#' genus = mo_genus(mo)) %>% # and genus as we do here +#' summarise_if(is.rsi, resistance) # then get resistance of all drugs +#' +#' # now conduct PCA for certain antimicrobial agents +#' pca_result <- resistance_data %>% +#' pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) +#' +#' pca_result +#' summary(pca_result) +#' biplot(pca_result) +#' ggplot_pca(pca_result) # a new and convenient plot function +#' } #' } pca <- function(x, ..., diff --git a/R/proportion.R b/R/proportion.R index b794013d..b13947f7 100755 --- a/R/proportion.R +++ b/R/proportion.R @@ -157,15 +157,6 @@ #' group_by(hospital_id) %>% #' proportion_df(translate = FALSE) #' } -#' -#' \dontrun{ -#' # calculate current empiric combination therapy of Helicobacter gastritis: -#' my_table %>% -#' filter(first_isolate == TRUE, -#' genus == "Helicobacter") %>% -#' summarise(p = susceptibility(AMX, MTR), # amoxicillin with metronidazole -#' n = count_all(AMX, MTR)) -#' } resistance <- function(..., minimum = 30, as_percent = FALSE, diff --git a/R/resistance_predict.R b/R/resistance_predict.R index 3607f76d..ea0a76cc 100755 --- a/R/resistance_predict.R +++ b/R/resistance_predict.R @@ -84,10 +84,8 @@ #' } #' #' # create nice plots with ggplot2 yourself -#' \dontrun{ -#' library(dplyr) -#' library(ggplot2) -#' +#' if (require("dplyr") & require("ggplot2")) { +#' #' data <- example_isolates %>% #' filter(mo == as.mo("E. coli")) %>% #' resistance_predict(col_ab = "AMX", diff --git a/R/rsi.R b/R/rsi.R index 5f8cfb64..8ac2bea2 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -106,34 +106,6 @@ #' NIT = as.mic(32)) #' as.rsi(df) #' -#' \dontrun{ -#' -#' # the dplyr way -#' library(dplyr) -#' df %>% mutate_if(is.mic, as.rsi) -#' df %>% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) -#' df %>% mutate(across(where(is.mic), as.rsi)) -#' df %>% mutate_at(vars(AMP:TOB), as.rsi) -#' df %>% mutate(across(AMP:TOB), as.rsi) -#' -#' df %>% -#' mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") -#' -#' # to include information about urinary tract infections (UTI) -#' data.frame(mo = "E. coli", -#' NIT = c("<= 2", 32), -#' from_the_bladder = c(TRUE, FALSE)) %>% -#' as.rsi(uti = "from_the_bladder") -#' -#' data.frame(mo = "E. coli", -#' NIT = c("<= 2", 32), -#' specimen = c("urine", "blood")) %>% -#' as.rsi() # automatically determines urine isolates -#' -#' df %>% -#' mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) -#' } -#' #' # for single values #' as.rsi(x = as.mic(2), #' mo = as.mo("S. pneumoniae"), @@ -145,6 +117,32 @@ #' ab = "ampicillin", # and `ab` with as.ab() #' guideline = "EUCAST") #' +#' \donttest{ +#' # the dplyr way +#' if (require("dplyr")) { +#' df %>% mutate_if(is.mic, as.rsi) +#' df %>% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) +#' df %>% mutate(across(where(is.mic), as.rsi)) +#' df %>% mutate_at(vars(AMP:TOB), as.rsi) +#' df %>% mutate(across(AMP:TOB), as.rsi) +#' +#' df %>% +#' mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") +#' +#' # to include information about urinary tract infections (UTI) +#' data.frame(mo = "E. coli", +#' NIT = c("<= 2", 32), +#' from_the_bladder = c(TRUE, FALSE)) %>% +#' as.rsi(uti = "from_the_bladder") +#' +#' data.frame(mo = "E. coli", +#' NIT = c("<= 2", 32), +#' specimen = c("urine", "blood")) %>% +#' as.rsi() # automatically determines urine isolates +#' +#' df %>% +#' mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) +#' } #' #' # For CLEANING existing R/SI values ------------------------------------ #' @@ -156,25 +154,22 @@ #' plot(rsi_data) # for percentages #' barplot(rsi_data) # for frequencies #' -#' \dontrun{ -#' library(dplyr) -#' example_isolates %>% -#' mutate_at(vars(PEN:RIF), as.rsi) -#' # same: -#' example_isolates %>% -#' as.rsi(PEN:RIF) -#' -#' # fastest way to transform all columns with already valid AMR results to class `rsi`: -#' example_isolates %>% -#' mutate_if(is.rsi.eligible, as.rsi) -#' -#' # note: from dplyr 1.0.0 on, this will be: -#' # example_isolates %>% -#' # mutate(across(is.rsi.eligible, as.rsi)) -#' -#' # default threshold of `is.rsi.eligible` is 5%. -#' is.rsi.eligible(WHONET$`First name`) # fails, >80% is invalid -#' is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds +#' # the dplyr way +#' if (require("dplyr")) { +#' example_isolates %>% +#' mutate_at(vars(PEN:RIF), as.rsi) +#' # same: +#' example_isolates %>% +#' as.rsi(PEN:RIF) +#' +#' # fastest way to transform all columns with already valid AMR results to class `rsi`: +#' example_isolates %>% +#' mutate_if(is.rsi.eligible, as.rsi) +#' +#' # note: from dplyr 1.0.0 on, this will be: +#' # example_isolates %>% +#' # mutate(across(is.rsi.eligible, as.rsi)) +#' } #' } as.rsi <- function(x, ...) { UseMethod("as.rsi") @@ -430,13 +425,6 @@ as.rsi.data.frame <- function(x, conserve_capped_values = FALSE, add_intrinsic_resistance = FALSE) { - # try to find columns based on type - # -- mo - if (is.null(col_mo)) { - col_mo <- search_type_in_df(x = x, type = "mo") - stop_if(is.null(col_mo), "`col_mo` must be set") - } - # -- UTIs col_uti <- uti if (is.null(col_uti)) { @@ -517,6 +505,14 @@ as.rsi.data.frame <- function(x, types[types == "" & sapply(x[, ab_cols], all_valid_disks)] <- "disk" types[types == "" & !sapply(x[, ab_cols], is.rsi)] <- "rsi" + if (any(types %in% c("mic", "disk"), na.rm = TRUE)) { + # now we need an mo column - try to find columns based on type + if (is.null(col_mo)) { + col_mo <- search_type_in_df(x = x, type = "mo") + stop_if(is.null(col_mo), "`col_mo` must be set") + } + } + for (i in seq_len(length(ab_cols))) { if (types[i] == "mic") { x[, ab_cols[i]] <- as.rsi.mic(x = x %pm>% pm_pull(ab_cols[i]), diff --git a/R/rsi_calc.R b/R/rsi_calc.R index 0e49b9ee..f53eb9d0 100755 --- a/R/rsi_calc.R +++ b/R/rsi_calc.R @@ -188,9 +188,9 @@ rsi_calc_df <- function(type, # "proportion", "count" or "both" translate_ab <- get_translate_ab(translate_ab) # select only groups and antibiotics - if (pm_has_groups(data)) { + if (inherits(data, "grouped_df")) { data_has_groups <- TRUE - groups <- setdiff(names(pm_get_group_details(data)), ".rows") + groups <- setdiff(names(attributes(data)$groups), ".rows") data <- data[, c(groups, colnames(data)[sapply(data, is.rsi)]), drop = FALSE] } else { data_has_groups <- FALSE diff --git a/R/sysdata.rda b/R/sysdata.rda index 7422746d..00d266a6 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/R/zzz.R b/R/zzz.R index d9816272..702b4bfc 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -35,9 +35,18 @@ assign(x = "LANGUAGES_SUPPORTED", value = sort(c("en", unique(translations_file$lang))), envir = asNamespace("AMR")) + + assign(x = "MO_CONS", + value = create_species_cons_cops("CoNS"), + envir = asNamespace("AMR")) + + assign(x = "MO_COPS", + value = create_species_cons_cops("CoPS"), + envir = asNamespace("AMR")) - # support for tibble headers (type_sum) and tibble columns content (pillar_shaft) without the need to depend on other packages - # this was suggested by the developers of the vctrs package: + # Support for tibble headers (type_sum) and tibble columns content (pillar_shaft) + # without the need to depend on other packages. This was suggested by the + # developers of the vctrs package: # https://github.com/r-lib/vctrs/blob/05968ce8e669f73213e3e894b5f4424af4f46316/R/register-s3.R s3_register("pillar::pillar_shaft", "ab") s3_register("tibble::type_sum", "ab") @@ -49,10 +58,10 @@ s3_register("tibble::type_sum", "mic") s3_register("pillar::pillar_shaft", "disk") s3_register("tibble::type_sum", "disk") - # support for frequency tables from the cleaner package + # Support for frequency tables from the cleaner package s3_register("cleaner::freq", "mo") s3_register("cleaner::freq", "rsi") - # support from skim from the skimr package + # Support from skim() from the skimr package s3_register("skimr::get_skimmers", "mo") s3_register("skimr::get_skimmers", "rsi") s3_register("skimr::get_skimmers", "mic") @@ -60,6 +69,7 @@ } .onAttach <- function(...) { + # show notice in 10% of cases in interactive session if (!interactive() || stats::runif(1) > 0.1 || isTRUE(as.logical(getOption("AMR_silentstart", FALSE)))) { return() } @@ -69,6 +79,39 @@ "\n[ prevent his notice with suppressPackageStartupMessages(library(AMR)) or use options(AMR_silentstart = TRUE) ]") } +create_species_cons_cops <- function(type = c("CoNS", "CoPS")) { + # Determination of which staphylococcal species are CoNS/CoPS according to Becker et al.: + # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4187637/figure/F3/ + # returns class + MO_staph <- AMR::microorganisms + MO_staph <- MO_staph[which(MO_staph$genus == "Staphylococcus"), , drop = FALSE] + if (type == "CoNS") { + MO_staph[which(MO_staph$species %in% c("coagulase-negative", + "arlettae", "auricularis", "capitis", + "caprae", "carnosus", "chromogenes", "cohnii", "condimenti", + "devriesei", "epidermidis", "equorum", "felis", + "fleurettii", "gallinarum", "haemolyticus", + "hominis", "jettensis", "kloosii", "lentus", + "lugdunensis", "massiliensis", "microti", + "muscae", "nepalensis", "pasteuri", "petrasii", + "pettenkoferi", "piscifermentans", "rostri", + "saccharolyticus", "saprophyticus", "sciuri", + "stepanovicii", "simulans", "succinus", + "vitulinus", "warneri", "xylosus") + | (MO_staph$species == "schleiferi" & MO_staph$subspecies %in% c("schleiferi", ""))), + "mo", drop = TRUE] + } else if (type == "CoPS") { + MO_staph[which(MO_staph$species %in% c("coagulase-positive", + "simiae", "agnetis", + "delphini", "lutrae", + "hyicus", "intermedius", + "pseudintermedius", "pseudointermedius", + "schweitzeri", "argenteus") + | (MO_staph$species == "schleiferi" & MO_staph$subspecies == "coagulans")), + "mo", drop = TRUE] + } +} + create_AB_lookup <- function() { AB_lookup <- AMR::antibiotics AB_lookup$generalised_name <- generalise_antibiotic_name(AB_lookup$name) diff --git a/_pkgdown.yml b/_pkgdown.yml index a306d0d8..38ec2a4d 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -184,13 +184,13 @@ reference: - "`skewness`" - "`p_symbol`" - - title: "Other: deprecated functions" - desc: > - 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: - - "`AMR-deprecated`" + # - title: "Other: deprecated functions" + # desc: > + # 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: + # - "`AMR-deprecated`" authors: Matthijs S. Berends: diff --git a/data-raw/translations.tsv b/data-raw/translations.tsv index 192357cb..f5130755 100644 --- a/data-raw/translations.tsv +++ b/data-raw/translations.tsv @@ -57,8 +57,8 @@ nl ([([ ]*?)group \\1groep FALSE FALSE nl ([([ ]*?)Group \\1Groep FALSE FALSE nl antibiotic antibioticum FALSE FALSE nl Antibiotic Antibioticum FALSE FALSE -nl Drug Middel FALSE FALSE -nl drug middel FALSE FALSE +nl Drug Middel FALSE FALSE +nl drug middel FALSE FALSE nl no .*growth geen .*groei FALSE TRUE nl no|not geen|niet FALSE TRUE diff --git a/docs/404.html b/docs/404.html index 8edbb951..005f4f69 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 80114b85..f360f8ad 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/docs/articles/index.html b/docs/articles/index.html index 066d66e5..cf275702 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/docs/authors.html b/docs/authors.html index cdc5eabf..f390818f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/docs/index.html b/docs/index.html index 15efb8a7..0479145a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/docs/news/index.html b/docs/news/index.html index 12937ab7..f987f0d4 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 @@ -236,20 +236,27 @@ Source: NEWS.md -
-

-AMR 1.3.0.9034 Unreleased +
+

+AMR 1.3.0.9035 Unreleased

Last updated: 29 September 2020

Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly!

+
+

+Breaking

+ +

New

    -
  • Support for ‘EUCAST Expert Rules’ / ‘EUCAST Intrinsic Resistance and Unusual Phenotypes’ version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the eucast_rules() function can now correct for more than 180 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The eucast_rules() function consequently gained the parameters version_breakpoints (at the moment defaults to v10.0, 2020) and version_expertrules (at the moment defaults to v3.2, 2020). The example_isolates data set now also reflects the change from v3.1 to v3.2.

  • +
  • Support for ‘EUCAST Expert Rules’ / ‘EUCAST Intrinsic Resistance and Unusual Phenotypes’ version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the eucast_rules() function can now correct for more than 180 different antibiotics and the mdro() function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The eucast_rules() function consequently gained the parameters version_breakpoints (at the moment defaults to v10.0, 2020) and version_expertrules (at the moment defaults to v3.2, 2020). The example_isolates data set now also reflects the change from v3.1 to v3.2. The mdro() function now accepts guideline == "EUCAST3.1" and guideline == "EUCAST3.2".

  • A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html

  • Data set intrinsic_resistant. This data set contains all bug-drug combinations where the ‘bug’ is intrinsic resistant to the ‘drug’ according to the latest EUCAST insights. It contains just two columns: microorganism and antibiotic.

    @@ -430,9 +437,9 @@

    AMR 1.2.0 2020-05-28

    -
    +

    -Breaking

    +Breaking

  • Removed code dependency on all other R packages, making this package fully independent of the development process of others. This is a major code change, but will probably not be noticeable by most users.

    @@ -640,9 +647,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/

    AMR 0.9.0 2019-11-29

    -
    +

    -Breaking

    +Breaking
    • Adopted Adeolu et al. (2016), PMID 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.
        @@ -748,9 +755,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/

        AMR 0.8.0 2019-10-15

        -
        +

        -Breaking

        +Breaking
        • Determination of first isolates now excludes all ‘unknown’ microorganisms at default, i.e. microbial code "UNKNOWN". They can be included with the new parameter include_unknown:

          @@ -889,7 +896,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
        • The antibiotics data set is now sorted by name and all cephalosporins now have their generation between brackets
        • Speed improvement for guess_ab_col() which is now 30 times faster for antibiotic abbreviations
        • Improved filter_ab_class() to be more reliable and to support 5th generation cephalosporins
        • -
        • Function availability() now uses portion_R() instead of portion_IR(), to comply with EUCAST insights
        • +
        • Function availability() now uses portion_R() instead of portion_IR(), to comply with EUCAST insights
        • Functions age() and age_groups() now have a na.rm parameter to remove empty values
        • Renamed function p.symbol() to p_symbol() (the former is now deprecated and will be removed in a future version)
        • Using negative values for x in age_groups() will now introduce NAs and not return an error anymore
        • @@ -919,7 +926,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ New
          • -

            Function rsi_df() to transform a data.frame to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df() and portion_df() to immediately show resistance percentages and number of available isolates:

            +

            Function rsi_df() to transform a data.frame to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df() and portion_df() to immediately show resistance percentages and number of available isolates:

             septic_patients %>%
               select(AMX, CIP) %>%
            @@ -964,7 +971,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
             

            Changed

              -
            • Column names of output count_df() and portion_df() are now lowercase
            • +
            • Column names of output count_df() and portion_df() are now lowercase
            • Fixed bug in translation of microorganism names
            • Fixed bug in determining taxonomic kingdoms
            • Algorithm improvements for as.ab() and as.mo() to understand even more severely misspelled input
            • @@ -1041,7 +1048,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
            • Improved intelligence of looking up antibiotic columns in a data set using guess_ab_col()
            • Added ~5,000 more old taxonomic names to the microorganisms.old data set, which leads to better results finding when using the as.mo() function
            • -
            • This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df() and count_df() this means that their new parameter combine_SI is TRUE at default. Our plotting function ggplot_rsi() also reflects this change since it uses count_df() internally.
            • +
            • This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df() and count_df() this means that their new parameter combine_SI is TRUE at default. Our plotting function ggplot_rsi() also reflects this change since it uses count_df() internally.
            • The age() function gained a new parameter exact to determine ages with decimals
            • Removed deprecated functions guess_mo(), guess_atc(), EUCAST_rules(), interpretive_reading(), rsi()
            • @@ -1595,9 +1602,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ # which is the same as: septic_patients %>% count_IR(amox, cipr) -septic_patients %>% portion_S(amcl) -septic_patients %>% portion_S(amcl, gent) -septic_patients %>% portion_S(amcl, gent, pita) +septic_patients %>% portion_S(amcl) +septic_patients %>% portion_S(amcl, gent) +septic_patients %>% portion_S(amcl, gent, pita)
          • Edited ggplot_rsi and geom_rsi so they can cope with count_df. The new fun parameter has value portion_df at default, but can be set to count_df.

          • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index e89ab12a..6a490e84 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 2.7.3 pkgdown: 1.5.1.9000 pkgdown_sha: eae56f08694abebf93cdfc0dd8e9ede06d8c815f articles: [] -last_built: 2020-09-29T08:40Z +last_built: 2020-09-29T21:35Z urls: reference: https://msberends.github.io/AMR/reference article: https://msberends.github.io/AMR/articles diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index e6cff4b7..cf328689 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9026 + 1.3.0.9035
        @@ -315,7 +315,7 @@ The lifecycle of this function is stable# same: age_groups(ages, c(1, 2, 4, 6, 13, 17)) -if (FALSE) { +# \donttest{ # resistance of ciprofloxacine per age group library(dplyr) example_isolates %>% @@ -324,7 +324,7 @@ The lifecycle of this function is stablegroup_by(age_group = age_groups(age)) %>% select(age_group, CIP) %>% ggplot_rsi(x = "age_group", minimum = 0) -} +# }
        @@ -298,8 +298,7 @@

        filter_ab_class() for the filter() equivalent.

        Examples

        -
        if (FALSE) {
        -  library(dplyr)
        +    
        if (require("dplyr")) {
         
           # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
           example_isolates %>% 
        @@ -322,11 +321,12 @@
             format()
             
             
        -  data.frame(irrelevant = "value",
        +  data.frame(some_column = "some_value",
                      J01CA01 = "S") %>%   # ATC code of ampicillin
        -    select(penicillins())         # the 'J01CA01' column will be selected
        +    select(penicillins())         # only the 'J01CA01' column will be selected
         
        -}
        +} +
    @@ -282,7 +282,7 @@ The lifecycle of this function is stable

    as.rsi()

    Examples

    -
    if (FALSE) {
    +    
    # \donttest{
     # transform existing disk zones to the `disk` class
     library(dplyr)
     df <- data.frame(microorganism = "E. coli",
    @@ -290,8 +290,9 @@ The lifecycle of this function is stable14,
                      GEN = 18,
                      TOB = 16)
    -df <- df %>% mutate_at(vars(AMP:TOB), as.disk)
    -df
    +df[, 2:5] <- lapply(df[, 2:5], as.disk)
    +# same with dplyr:
    +# df %>% mutate(across(AMP:TOB, as.disk))
     
     # interpret disk values, see ?as.rsi
     as.rsi(x = as.disk(18),
    @@ -300,7 +301,7 @@ The lifecycle of this function is stable"EUCAST")
            
     as.rsi(df)
    -}
    +# }
     
@@ -361,10 +361,7 @@

Microbial prevalence of pathogens in humans

-

The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the prevalence columns in the microorganisms and microorganisms.old data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.

-

Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Klebsiella, Pseudomonas and Legionella.

-

Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Aspergillus, Bacteroides, Candida, Capnocytophaga, Chryseobacterium, Cryptococcus, Elisabethkingia, Flavobacterium, Fusobacterium, Giardia, Leptotrichia, Mycoplasma, Prevotella, Rhodotorula, Treponema, Trichophyton or Ureaplasma. This group consequently contains all less common and rare human pathogens.

-

Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans.

+

The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the prevalence columns in the microorganisms and microorganisms.old data sets. The grouping into human pathogenic prevalence is explained in the section Matching score for microorganisms below.

Source

@@ -392,15 +389,15 @@ The lifecycle of this function is stable$$m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \operatorname{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}$$

where:

  • \(x\) is the user input;

  • -
  • \(n\) is a taxonomic name (genus, species and subspecies) as found in microorganisms$fullname;

  • -
  • \(l_{n}\) is the length of \(n\);

  • -
  • \(\operatorname{lev}\) is the Levenshtein distance function;

  • -
  • \(p_{n}\) is the human pathogenic prevalence of \(n\), categorised into group \(1\), \(2\) and \(3\) (see Details in ?as.mo), meaning that \(p = \{1, 2 , 3\}\);

  • -
  • \(k_{n}\) is the kingdom index of \(n\), set as follows: Bacteria = \(1\), Fungi = \(2\), Protozoa = \(3\), Archaea = \(4\), and all others = \(5\), meaning that \(k = \{1, 2 , 3, 4, 5\}\).

  • +
  • \(n\) is a taxonomic name (genus, species, and subspecies);

  • +
  • \(l_n\) is the length of \(n\);

  • +
  • lev is the Levenshtein distance function, which counts any insertion, deletion and substitution as 1 that is needed to change \(x\) into \(n\);

  • +
  • \(p_n\) is the human pathogenic prevalence group of \(n\), as described below;

  • +
  • \(k_n\) is the taxonomic kingdom of \(n\), set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.

-

This means that the user input x = "E. coli" gets for Escherichia coli a matching score of 68.8% and for Entamoeba coli a matching score of 7.9%.

-

All matches are sorted descending on their matching score and for all user input values, the top match will be returned.

+

The grouping into human pathogenic prevalence (\(p\)) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Pseudomonas and Legionella and all species within the order Enterobacterales. Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Absidia, Acremonium, Actinotignum, Alternaria, Anaerosalibacter, Apophysomyces, Arachnia, Aspergillus, Aureobacterium, Aureobasidium, Bacteroides, Basidiobolus, Beauveria, Blastocystis, Branhamella, Calymmatobacterium, Candida, Capnocytophaga, Catabacter, Chaetomium, Chryseobacterium, Chryseomonas, Chrysonilia, Cladophialophora, Cladosporium, Conidiobolus, Cryptococcus, Curvularia, Exophiala, Exserohilum, Flavobacterium, Fonsecaea, Fusarium, Fusobacterium, Hendersonula, Hypomyces, Koserella, Lelliottia, Leptosphaeria, Leptotrichia, Malassezia, Malbranchea, Mortierella, Mucor, Mycocentrospora, Mycoplasma, Nectria, Ochroconis, Oidiodendron, Phoma, Piedraia, Pithomyces, Pityrosporum, Prevotella,\Pseudallescheria, Rhizomucor, Rhizopus, Rhodotorula, Scolecobasidium, Scopulariopsis, Scytalidium,Sporobolomyces, Stachybotrys, Stomatococcus, Treponema, Trichoderma, Trichophyton, Trichosporon, Tritirachium or Ureaplasma. Group 3 consists of all other microorganisms.

+

All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., "E. coli" will return the microbial ID of Escherichia coli (\(m = 0.688\), a highly prevalent microorganism found in humans) and not Entamoeba coli (\(m = 0.079\), a less prevalent microorganism in humans), although the latter would alphabetically come first.

Catalogue of Life

@@ -459,26 +456,7 @@ This package contains the complete taxonomic tree of almost all microorganisms ( # All mo_* functions use as.mo() internally too (see ?mo_property): mo_genus("E. coli") # returns "Escherichia" mo_gramstain("E. coli") # returns "Gram negative" - # } -if (FALSE) { -df$mo <- as.mo(df$microorganism_name) - -# the select function of the Tidyverse is also supported: -library(dplyr) -df$mo <- df %>% - select(microorganism_name) %>% - as.mo() - -# and can even contain 2 columns, which is convenient -# for genus/species combinations: -df$mo <- df %>% - select(genus, species) %>% - as.mo() -# although this works easier and does the same: -df <- df %>% - mutate(mo = as.mo(paste(genus, species))) -} @@ -424,34 +424,6 @@ The lifecycle of this function is stableas.mic(32)) as.rsi(df) -if (FALSE) { - -# the dplyr way -library(dplyr) -df %>% mutate_if(is.mic, as.rsi) -df %>% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) -df %>% mutate(across(where(is.mic), as.rsi)) -df %>% mutate_at(vars(AMP:TOB), as.rsi) -df %>% mutate(across(AMP:TOB), as.rsi) - -df %>% - mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") - -# to include information about urinary tract infections (UTI) -data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - from_the_bladder = c(TRUE, FALSE)) %>% - as.rsi(uti = "from_the_bladder") - -data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - specimen = c("urine", "blood")) %>% - as.rsi() # automatically determines urine isolates - -df %>% - mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) -} - # for single values as.rsi(x = as.mic(2), mo = as.mo("S. pneumoniae"), @@ -463,6 +435,32 @@ The lifecycle of this function is stable"ampicillin", # and `ab` with as.ab() guideline = "EUCAST") +# \donttest{ +# the dplyr way +if (require("dplyr")) { + df %>% mutate_if(is.mic, as.rsi) + df %>% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) + df %>% mutate(across(where(is.mic), as.rsi)) + df %>% mutate_at(vars(AMP:TOB), as.rsi) + df %>% mutate(across(AMP:TOB), as.rsi) + + df %>% + mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") + + # to include information about urinary tract infections (UTI) + data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + from_the_bladder = c(TRUE, FALSE)) %>% + as.rsi(uti = "from_the_bladder") + + data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + specimen = c("urine", "blood")) %>% + as.rsi() # automatically determines urine isolates + + df %>% + mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) +} # For CLEANING existing R/SI values ------------------------------------ @@ -473,26 +471,23 @@ The lifecycle of this function is stableplot(rsi_data) # for percentages barplot(rsi_data) # for frequencies -if (FALSE) { -library(dplyr) -example_isolates %>% - mutate_at(vars(PEN:RIF), as.rsi) -# same: -example_isolates %>% - as.rsi(PEN:RIF) - -# fastest way to transform all columns with already valid AMR results to class `rsi`: -example_isolates %>% - mutate_if(is.rsi.eligible, as.rsi) - -# note: from dplyr 1.0.0 on, this will be: -# example_isolates %>% -# mutate(across(is.rsi.eligible, as.rsi)) - -# default threshold of `is.rsi.eligible` is 5%. -is.rsi.eligible(WHONET$`First name`) # fails, >80% is invalid -is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds +# the dplyr way +if (require("dplyr")) { + example_isolates %>% + mutate_at(vars(PEN:RIF), as.rsi) + # same: + example_isolates %>% + as.rsi(PEN:RIF) + + # fastest way to transform all columns with already valid AMR results to class `rsi`: + example_isolates %>% + mutate_if(is.rsi.eligible, as.rsi) + + # note: from dplyr 1.0.0 on, this will be: + # example_isolates %>% + # mutate(across(is.rsi.eligible, as.rsi)) } +# } @@ -327,18 +327,15 @@ The lifecycle of this function is stableOn our website https://msberends.github.io/AMR you can find a comprehensive 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. As we would like to better understand the backgrounds and needs of our users, please participate in our survey!

Examples

-
if (FALSE) {
+    
# \donttest{
 # oral DDD (Defined Daily Dose) of amoxicillin
 atc_online_property("J01CA04", "DDD", "O")
+
 # parenteral DDD (Defined Daily Dose) of amoxicillin
 atc_online_property("J01CA04", "DDD", "P")
 
 atc_online_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin
-# [1] "ANTIINFECTIVES FOR SYSTEMIC USE"
-# [2] "ANTIBACTERIALS FOR SYSTEMIC USE"
-# [3] "BETA-LACTAM ANTIBACTERIALS, PENICILLINS"
-# [4] "Penicillins with extended spectrum"
-}
+# }
 
@@ -279,18 +279,11 @@ The lifecycle of this function is stableExamples
availability(example_isolates)
 
-if (FALSE) {
-library(dplyr)
-example_isolates %>% availability()
-
-example_isolates %>%
-  select_if(is.rsi) %>%
-  availability()
-
-example_isolates %>%
-  filter(mo == as.mo("E. coli")) %>%
-  select_if(is.rsi) %>%
-  availability()
+if (require("dplyr")) {
+  example_isolates %>%
+    filter(mo == as.mo("E. coli")) %>%
+    select_if(is.rsi) %>%
+    availability()
 }
 
diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index 15258182..26dc1565 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9028 + 1.3.0.9035 @@ -304,7 +304,7 @@ remove_intrinsic_resistant -

logical to indicate that rows with 100% resistance for all tested antimicrobials must be removed from the table

+

logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table

decimal.mark @@ -348,13 +348,13 @@ The lifecycle of this function is stableformat(x, translate_ab = "name (atc)") # Use FUN to change to transformation of microorganism codes -x <- bug_drug_combinations(example_isolates, - FUN = mo_gramstain) +bug_drug_combinations(example_isolates, + FUN = mo_gramstain) -x <- bug_drug_combinations(example_isolates, - FUN = function(x) ifelse(x == as.mo("E. coli"), - "E. coli", - "Others")) +bug_drug_combinations(example_isolates, + FUN = function(x) ifelse(x == as.mo("E. coli"), + "E. coli", + "Others")) # }
diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index b18abc3f..b6a0a8ca 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 1.3.0.9034 + 1.3.0.9035 @@ -296,17 +296,12 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied

Value

@@ -333,7 +328,7 @@ Leclercq et al. EUCAST expert rules in antimicrobial susceptibility test

To define antibiotics column names, leave as it is to determine it automatically with guess_ab_col() or input a text (case-insensitive), or use NULL to skip a column (e.g. TIC = NULL to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.

The following antibiotics are used for the functions eucast_rules() and mdro(). These are shown below in the format 'name (antimicrobial ID, ATC code)', sorted alphabetically:

-

Amikacin (AMK, J01GB06), amoxicillin (AMX, J01CA04), amoxicillin/clavulanic acid (AMC, J01CR02), ampicillin (AMP, J01CA01), ampicillin/sulbactam (SAM, J01CR01), avoparcin (AVO, no ATC code), azithromycin (AZM, J01FA10), azlocillin (AZL, J01CA09), aztreonam (ATM, J01DF01), bacampicillin (BAM, J01CA06), benzylpenicillin (PEN, J01CE01), cadazolid (CDZ, J01DD09), capreomycin (CAP, J04AB30), carbenicillin (CRB, J01CA03), carindacillin (CRN, J01CA05), cefacetrile (CAC, J01DB10), cefaclor (CEC, J01DC04), cefadroxil (CFR, J01DB05), cefaloridine (RID, J01DB02), cefamandole (MAN, J01DC03), cefatrizine (CTZ, J01DB07), cefazedone (CZD, J01DB06), cefazolin (CZO, J01DB04), cefdinir (CDR, J01DD15), cefditoren (DIT, J01DD16), cefepime (FEP, J01DE01), cefetamet (CAT, J01DD10), cefixime (CFM, J01DD08), cefmenoxime (CMX, J01DD05), cefmetazole (CMZ, J01DC09), cefodizime (DIZ, J01DD09), cefonicid (CID, J01DC06), cefoperazone (CFP, J01DD12), cefoperazone/sulbactam (CSL, J01DD62), ceforanide (CND, J01DC11), cefotaxime (CTX, J01DD01), cefotetan (CTT, J01DC05), cefotiam (CTF, J01DC07), cefoxitin (FOX, J01DC01), cefoxitin screening (FOX1, no ATC code), cefpiramide (CPM, J01DD11), cefpirome (CPO, J01DE02), cefpodoxime (CPD, J01DD13), cefprozil (CPR, J01DC10), cefroxadine (CRD, J01DB11), cefsulodin (CFS, J01DD03), ceftaroline (CPT, J01DI02), ceftazidime (CAZ, J01DD02), ceftazidime/clavulanic acid (CCV, J01DD52), ceftezole (CTL, J01DB12), ceftibuten (CTB, J01DD14), ceftizoxime (CZX, J01DD07), ceftobiprole (BPR, J01DI01), ceftobiprole medocaril (CFM1, J01DI01), ceftolozane/enzyme inhibitor (CEI, J01DI54), ceftriaxone (CRO, J01DD04), cefuroxime (CXM, J01DC02), cephalexin (LEX, J01DB01), cephalothin (CEP, J01DB03), cephapirin (HAP, J01DB08), cephradine (CED, J01DB09), chloramphenicol (CHL, J01BA01), ciprofloxacin (CIP, J01MA02), clarithromycin (CLR, J01FA09), clindamycin (CLI, J01FF01), colistin (COL, J01XB01), cycloserine (CYC, J04AB01), dalbavancin (DAL, J01XA04), daptomycin (DAP, J01XX09), dibekacin (DKB, J01GB09), dirithromycin (DIR, J01FA13), doripenem (DOR, J01DH04), doxycycline (DOX, J01AA02), enoxacin (ENX, J01MA04), epicillin (EPC, J01CA07), ertapenem (ETP, J01DH03), erythromycin (ERY, J01FA01), ethambutol (ETH, J04AK02), fleroxacin (FLE, J01MA08), flucloxacillin (FLC, J01CF05), flurithromycin (FLR1, J01FA14), fosfomycin (FOS, J01XX01), fusidic acid (FUS, J01XC01), gatifloxacin (GAT, J01MA16), gemifloxacin (GEM, J01MA15), gentamicin (GEN, J01GB03), gentamicin-high (GEH, no ATC code), grepafloxacin (GRX, J01MA11), hetacillin (HET, J01CA18), imipenem (IPM, J01DH51), isepamicin (ISE, J01GB11), isoniazid (INH, J04AC01), josamycin (JOS, J01FA07), kanamycin (KAN, J01GB04), latamoxef (LTM, J01DD06), levofloxacin (LVX, J01MA12), lincomycin (LIN, J01FF02), linezolid (LNZ, J01XX08), lomefloxacin (LOM, J01MA07), loracarbef (LOR, J01DC08), mecillinam (Amdinocillin) (MEC, J01CA11), meropenem (MEM, J01DH02), meropenem/vaborbactam (MEV, J01DH52), metampicillin (MTM, J01CA14), mezlocillin (MEZ, J01CA10), midecamycin (MID, J01FA03), minocycline (MNO, J01AA08), miocamycin (MCM, J01FA11), moxifloxacin (MFX, J01MA14), nalidixic acid (NAL, J01MB02), neomycin (NEO, J01GB05), netilmicin (NET, J01GB07), nitrofurantoin (NIT, J01XE01), norfloxacin (NOR, J01MA06), norvancomycin (NVA, no ATC code), novobiocin (NOV, QJ01XX95), ofloxacin (OFX, J01MA01), oleandomycin (OLE, J01FA05), oritavancin (ORI, J01XA05), oxacillin (OXA, J01CF04), pazufloxacin (PAZ, J01MA18), pefloxacin (PEF, J01MA03), phenoxymethylpenicillin (PHN, J01CE02), piperacillin (PIP, J01CA12), piperacillin/tazobactam (TZP, J01CR05), pirlimycin (PRL, no ATC code), pivampicillin (PVM, J01CA02), pivmecillinam (PME, J01CA08), polymyxin B (PLB, J01XB02), pristinamycin (PRI, J01FG01), prulifloxacin (PRU, J01MA17), pyrazinamide (PZA, J04AK01), quinupristin/dalfopristin (QDA, J01FG02), ramoplanin (RAM, no ATC code), ribostamycin (RST, J01GB10), rifabutin (RIB, J04AB04), rifampicin (RIF, J04AB02), rifapentine (RFP, J04AB05), rokitamycin (ROK, J01FA12), roxithromycin (RXT, J01FA06), rufloxacin (RFL, J01MA10), sisomicin (SIS, J01GB08), sparfloxacin (SPX, J01MA09), spiramycin (SPI, J01FA02), streptoduocin (STR, J01GA02), streptomycin (STR1, J01GA01), streptomycin-high (STH, no ATC code), sulbenicillin (SBC, J01CA16), sulfadiazine (SDI, J01EC02), sulfadiazine/trimethoprim (SLT1, J01EE02), sulfadimethoxine (SUD, J01ED01), sulfadimidine (SDM, J01EB03), sulfadimidine/trimethoprim (SLT2, J01EE05), sulfafurazole (SLF, J01EB05), sulfaisodimidine (SLF1, J01EB01), sulfalene (SLF2, J01ED02), sulfamazone (SZO, J01ED09), sulfamerazine (SLF3, J01ED07), sulfamerazine/trimethoprim (SLT3, J01EE07), sulfamethizole (SLF4, J01EB02), sulfamethoxazole (SMX, J01EC01), sulfamethoxypyridazine (SLF5, J01ED05), sulfametomidine (SLF6, J01ED03), sulfametoxydiazine (SLF7, J01ED04), sulfametrole/trimethoprim (SLT4, J01EE03), sulfamoxole (SLF8, J01EC03), sulfamoxole/trimethoprim (SLT5, J01EE04), sulfanilamide (SLF9, J01EB06), sulfaperin (SLF10, J01ED06), sulfaphenazole (SLF11, J01ED08), sulfapyridine (SLF12, J01EB04), sulfathiazole (SUT, J01EB07), sulfathiourea (SLF13, J01EB08), talampicillin (TAL, J01CA15), tedizolid (TZD, J01XX11), teicoplanin (TEC, J01XA02), teicoplanin-macromethod (TCM, no ATC code), telavancin (TLV, J01XA03), telithromycin (TLT, J01FA15), temafloxacin (TMX, J01MA05), temocillin (TEM, J01CA17), tetracycline (TCY, J01AA07), thiacetazone (THA, no ATC code), ticarcillin (TIC, J01CA13), ticarcillin/clavulanic acid (TCC, J01CR03), tigecycline (TGC, J01AA12), tobramycin (TOB, J01GB01), trimethoprim (TMP, J01EA01), trimethoprim/sulfamethoxazole (SXT, J01EE01), troleandomycin (TRL, J01FA08), trovafloxacin (TVA, J01MA13), vancomycin (VAN, J01XA01)

+

Amikacin (AMK, J01GB06), amoxicillin (AMX, J01CA04), amoxicillin/clavulanic acid (AMC, J01CR02), ampicillin (AMP, J01CA01), ampicillin/sulbactam (SAM, J01CR01), avoparcin (AVO, no ATC code), azithromycin (AZM, J01FA10), azlocillin (AZL, J01CA09), aztreonam (ATM, J01DF01), bacampicillin (BAM, J01CA06), benzylpenicillin (PEN, J01CE01), cadazolid (CDZ, J01DD09), capreomycin (CAP, J04AB30), carbenicillin (CRB, J01CA03), carindacillin (CRN, J01CA05), cefacetrile (CAC, J01DB10), cefaclor (CEC, J01DC04), cefadroxil (CFR, J01DB05), cefaloridine (RID, J01DB02), cefamandole (MAN, J01DC03), cefatrizine (CTZ, J01DB07), cefazedone (CZD, J01DB06), cefazolin (CZO, J01DB04), cefdinir (CDR, J01DD15), cefditoren (DIT, J01DD16), cefepime (FEP, J01DE01), cefetamet (CAT, J01DD10), cefixime (CFM, J01DD08), cefmenoxime (CMX, J01DD05), cefmetazole (CMZ, J01DC09), cefodizime (DIZ, J01DD09), cefonicid (CID, J01DC06), cefoperazone (CFP, J01DD12), cefoperazone/sulbactam (CSL, J01DD62), ceforanide (CND, J01DC11), cefotaxime (CTX, J01DD01), cefotetan (CTT, J01DC05), cefotiam (CTF, J01DC07), cefoxitin (FOX, J01DC01), cefoxitin screening (FOX1, no ATC code), cefpiramide (CPM, J01DD11), cefpirome (CPO, J01DE02), cefpodoxime (CPD, J01DD13), cefprozil (CPR, J01DC10), cefroxadine (CRD, J01DB11), cefsulodin (CFS, J01DD03), ceftaroline (CPT, J01DI02), ceftazidime (CAZ, J01DD02), ceftazidime/clavulanic acid (CCV, J01DD52), ceftezole (CTL, J01DB12), ceftibuten (CTB, J01DD14), ceftizoxime (CZX, J01DD07), ceftobiprole (BPR, J01DI01), ceftobiprole medocaril (CFM1, J01DI01), ceftolozane/enzyme inhibitor (CEI, J01DI54), ceftriaxone (CRO, J01DD04), cefuroxime (CXM, J01DC02), cephalexin (LEX, J01DB01), cephalothin (CEP, J01DB03), cephapirin (HAP, J01DB08), cephradine (CED, J01DB09), chloramphenicol (CHL, J01BA01), ciprofloxacin (CIP, J01MA02), clarithromycin (CLR, J01FA09), clindamycin (CLI, J01FF01), colistin (COL, J01XB01), cycloserine (CYC, J04AB01), dalbavancin (DAL, J01XA04), daptomycin (DAP, J01XX09), dibekacin (DKB, J01GB09), dirithromycin (DIR, J01FA13), doripenem (DOR, J01DH04), doxycycline (DOX, J01AA02), enoxacin (ENX, J01MA04), epicillin (EPC, J01CA07), eravacycline (ERV, J01AA13), ertapenem (ETP, J01DH03), erythromycin (ERY, J01FA01), ethambutol (ETH, J04AK02), fidaxomicin (FDX, no ATC code), fleroxacin (FLE, J01MA08), flucloxacillin (FLC, J01CF05), flurithromycin (FLR1, J01FA14), fosfomycin (FOS, J01XX01), fusidic acid (FUS, J01XC01), gatifloxacin (GAT, J01MA16), gemifloxacin (GEM, J01MA15), gentamicin (GEN, J01GB03), gentamicin-high (GEH, no ATC code), grepafloxacin (GRX, J01MA11), hetacillin (HET, J01CA18), imipenem (IPM, J01DH51), isepamicin (ISE, J01GB11), isoniazid (INH, J04AC01), josamycin (JOS, J01FA07), kanamycin (KAN, J01GB04), latamoxef (LTM, J01DD06), levofloxacin (LVX, J01MA12), lincomycin (LIN, J01FF02), linezolid (LNZ, J01XX08), lomefloxacin (LOM, J01MA07), loracarbef (LOR, J01DC08), mecillinam (Amdinocillin) (MEC, J01CA11), meropenem (MEM, J01DH02), meropenem/vaborbactam (MEV, J01DH52), metampicillin (MTM, J01CA14), metronidazole (MTR, J01XD01), mezlocillin (MEZ, J01CA10), midecamycin (MID, J01FA03), minocycline (MNO, J01AA08), miocamycin (MCM, J01FA11), moxifloxacin (MFX, J01MA14), nalidixic acid (NAL, J01MB02), neomycin (NEO, J01GB05), netilmicin (NET, J01GB07), nitrofurantoin (NIT, J01XE01), norfloxacin (NOR, J01MA06), norvancomycin (NVA, no ATC code), novobiocin (NOV, QJ01XX95), ofloxacin (OFX, J01MA01), oleandomycin (OLE, J01FA05), omadacycline (OMC, no ATC code), oritavancin (ORI, J01XA05), oxacillin (OXA, J01CF04), pazufloxacin (PAZ, J01MA18), pefloxacin (PEF, J01MA03), phenoxymethylpenicillin (PHN, J01CE02), piperacillin (PIP, J01CA12), piperacillin/tazobactam (TZP, J01CR05), pirlimycin (PRL, no ATC code), pivampicillin (PVM, J01CA02), pivmecillinam (PME, J01CA08), polymyxin B (PLB, J01XB02), pristinamycin (PRI, J01FG01), prulifloxacin (PRU, J01MA17), pyrazinamide (PZA, J04AK01), quinupristin/dalfopristin (QDA, J01FG02), ramoplanin (RAM, no ATC code), ribostamycin (RST, J01GB10), rifabutin (RIB, J04AB04), rifampicin (RIF, J04AB02), rifapentine (RFP, J04AB05), rokitamycin (ROK, J01FA12), roxithromycin (RXT, J01FA06), rufloxacin (RFL, J01MA10), sisomicin (SIS, J01GB08), sparfloxacin (SPX, J01MA09), spectinomycin (SPT, J01XX04), spiramycin (SPI, J01FA02), streptoduocin (STR, J01GA02), streptomycin (STR1, J01GA01), streptomycin-high (STH, no ATC code), sulbenicillin (SBC, J01CA16), sulfadiazine (SDI, J01EC02), sulfadiazine/trimethoprim (SLT1, J01EE02), sulfadimethoxine (SUD, J01ED01), sulfadimidine (SDM, J01EB03), sulfadimidine/trimethoprim (SLT2, J01EE05), sulfafurazole (SLF, J01EB05), sulfaisodimidine (SLF1, J01EB01), sulfalene (SLF2, J01ED02), sulfamazone (SZO, J01ED09), sulfamerazine (SLF3, J01ED07), sulfamerazine/trimethoprim (SLT3, J01EE07), sulfamethizole (SLF4, J01EB02), sulfamethoxazole (SMX, J01EC01), sulfamethoxypyridazine (SLF5, J01ED05), sulfametomidine (SLF6, J01ED03), sulfametoxydiazine (SLF7, J01ED04), sulfametrole/trimethoprim (SLT4, J01EE03), sulfamoxole (SLF8, J01EC03), sulfamoxole/trimethoprim (SLT5, J01EE04), sulfanilamide (SLF9, J01EB06), sulfaperin (SLF10, J01ED06), sulfaphenazole (SLF11, J01ED08), sulfapyridine (SLF12, J01EB04), sulfathiazole (SUT, J01EB07), sulfathiourea (SLF13, J01EB08), talampicillin (TAL, J01CA15), tedizolid (TZD, J01XX11), teicoplanin (TEC, J01XA02), teicoplanin-macromethod (TCM, no ATC code), telavancin (TLV, J01XA03), telithromycin (TLT, J01FA15), temafloxacin (TMX, J01MA05), temocillin (TEM, J01CA17), tetracycline (TCY, J01AA07), thiacetazone (THA, no ATC code), ticarcillin (TIC, J01CA13), ticarcillin/clavulanic acid (TCC, J01CR03), tigecycline (TGC, J01AA12), tobramycin (TOB, J01GB01), trimethoprim (TMP, J01EA01), trimethoprim/sulfamethoxazole (SXT, J01EE01), troleandomycin (TRL, J01FA08), trovafloxacin (TVA, J01MA13), vancomycin (VAN, J01XA01)

Stable lifecycle

diff --git a/docs/reference/figures/mo_matching_score.png b/docs/reference/figures/mo_matching_score.png new file mode 100644 index 00000000..cd9b3501 Binary files /dev/null and b/docs/reference/figures/mo_matching_score.png differ diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index ec2710e9..d42156fc 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -50,7 +50,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9015 + 1.3.0.9035 @@ -310,41 +310,45 @@ The lifecycle of this function is stable

antibiotic_class_selectors() for the select() equivalent.

Examples

-
if (FALSE) {
-library(dplyr)
+    
filter_aminoglycosides(example_isolates)
 
-# filter on isolates that have any result for any aminoglycoside
-example_isolates %>% filter_ab_class("aminoglycoside")
-example_isolates %>% filter_aminoglycosides()
+# \donttest{
+if (require("dplyr")) {
 
-# this is essentially the same as (but without determination of column names):
-example_isolates %>%
-  filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
-            .vars_predicate = any_vars(. %in% c("S", "I", "R")))
+  # filter on isolates that have any result for any aminoglycoside
+  example_isolates %>% filter_aminoglycosides()
+  example_isolates %>% filter_ab_class("aminoglycoside")
+
+  # this is essentially the same as (but without determination of column names):
+  example_isolates %>%
+    filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
+              .vars_predicate = any_vars(. %in% c("S", "I", "R")))
 
 
-# filter on isolates that show resistance to ANY aminoglycoside
-example_isolates %>% filter_aminoglycosides("R", "any")
-
-# filter on isolates that show resistance to ALL aminoglycosides
-example_isolates %>% filter_aminoglycosides("R", "all")
-
-# filter on isolates that show resistance to
-# any aminoglycoside and any fluoroquinolone
-example_isolates %>%
-  filter_aminoglycosides("R") %>%
-  filter_fluoroquinolones("R")
-
-# filter on isolates that show resistance to
-# all aminoglycosides and all fluoroquinolones
-example_isolates %>%
-  filter_aminoglycosides("R", "all") %>%
-  filter_fluoroquinolones("R", "all")
-
-# with dplyr 1.0.0 and higher (that adds 'across()'), this is equal:
-example_isolates %>% filter_carbapenems("R", "all")
-example_isolates %>% filter(across(carbapenems(), ~. == "R"))
-}
+ # filter on isolates that show resistance to ANY aminoglycoside + example_isolates %>% filter_aminoglycosides("R", "any") + + # filter on isolates that show resistance to ALL aminoglycosides + example_isolates %>% filter_aminoglycosides("R", "all") + + # filter on isolates that show resistance to + # any aminoglycoside and any fluoroquinolone + example_isolates %>% + filter_aminoglycosides("R") %>% + filter_fluoroquinolones("R") + + # filter on isolates that show resistance to + # all aminoglycosides and all fluoroquinolones + example_isolates %>% + filter_aminoglycosides("R", "all") %>% + filter_fluoroquinolones("R", "all") + + # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: + example_isolates %>% filter_carbapenems("R", "all") + example_isolates %>% filter(across(carbapenems(), ~. == "R")) +} +# } +
@@ -369,15 +369,16 @@

WHY THIS IS SO IMPORTANT
To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode (ref). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all S. aureus isolates would be overestimated, because you included this MRSA more than once. It would be selection bias.

All isolates with a microbial ID of NA will be excluded as first isolate.

-

The functions filter_first_isolate() and filter_first_weighted_isolate() are helper functions to quickly filter on first isolates. The function filter_first_isolate() is essentially equal to one of:

 x %>% filter(first_isolate(., ...))
+

The functions filter_first_isolate() and filter_first_weighted_isolate() are helper functions to quickly filter on first isolates. The function filter_first_isolate() is essentially equal to either:

  x[first_isolate(x, ...), ]
+  x %>% filter(first_isolate(x, ...))
 
-

The function filter_first_weighted_isolate() is essentially equal to:

 x %>%
-   mutate(keyab = key_antibiotics(.)) %>%
-   mutate(only_weighted_firsts = first_isolate(x,
-                                               col_keyantibiotics = "keyab", ...)) %>%
-   filter(only_weighted_firsts == TRUE) %>%
-   select(-only_weighted_firsts, -keyab)
+

The function filter_first_weighted_isolate() is essentially equal to:

  x %>%
+    mutate(keyab = key_antibiotics(.)) %>%
+    mutate(only_weighted_firsts = first_isolate(x,
+                                                col_keyantibiotics = "keyab", ...)) %>%
+    filter(only_weighted_firsts == TRUE) %>%
+    select(-only_weighted_firsts, -keyab)
 

Key antibiotics

@@ -411,50 +412,41 @@ The lifecycle of this function is stable# `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. -if (FALSE) { -library(dplyr) -# Filter on first isolates: -example_isolates %>% - mutate(first_isolate = first_isolate(.)) %>% - filter(first_isolate == TRUE) +# basic filtering on first isolates +example_isolates[first_isolate(example_isolates), ] -# Now let's see if first isolates matter: -A <- example_isolates %>% - group_by(hospital_id) %>% - summarise(count = n_rsi(GEN), # gentamicin availability - resistance = resistance(GEN)) # gentamicin resistance - -B <- example_isolates %>% - filter_first_weighted_isolate() %>% # the 1st isolate filter - group_by(hospital_id) %>% - summarise(count = n_rsi(GEN), # gentamicin availability - resistance = resistance(GEN)) # gentamicin resistance - -# Have a look at A and B. -# B is more reliable because every isolate is counted only once. -# Gentamicin resistance in hospital D appears to be 3.7% higher than -# when you (erroneously) would have used all isolates for analysis. - - -## OTHER EXAMPLES: - -# Short-hand versions: -example_isolates %>% - filter_first_isolate() +# \donttest{ +if (require("dplyr")) { + # Filter on first isolates: + example_isolates %>% + mutate(first_isolate = first_isolate(.)) %>% + filter(first_isolate == TRUE) + + # Short-hand versions: + example_isolates %>% + filter_first_isolate() + + example_isolates %>% + filter_first_weighted_isolate() -example_isolates %>% - filter_first_weighted_isolate() - - -# set key antibiotics to a new variable -x$keyab <- key_antibiotics(x) - -x$first_isolate <- first_isolate(x) - -x$first_isolate_weighed <- first_isolate(x, col_keyantibiotics = 'keyab') - -x$first_blood_isolate <- first_isolate(x, specimen_group = "Blood") + # Now let's see if first isolates matter: + A <- example_isolates %>% + group_by(hospital_id) %>% + summarise(count = n_rsi(GEN), # gentamicin availability + resistance = resistance(GEN)) # gentamicin resistance + + B <- example_isolates %>% + filter_first_weighted_isolate() %>% # the 1st isolate filter + group_by(hospital_id) %>% + summarise(count = n_rsi(GEN), # gentamicin availability + resistance = resistance(GEN)) # gentamicin resistance + + # Have a look at A and B. + # B is more reliable because every isolate is counted only once. + # Gentamicin resistance in hospital D appears to be 3.7% higher than + # when you (erroneously) would have used all isolates for analysis. } +# }
@@ -395,8 +395,7 @@ The lifecycle of this function is maturing< # See ?example_isolates. # See ?pca for more info about Principal Component Analysis (PCA). -if (FALSE) { - library(dplyr) +if (require("dplyr")) { pca_model <- example_isolates %>% filter(mo_genus(mo) == "Staphylococcus") %>% group_by(species = mo_shortname(mo)) %>% @@ -414,7 +413,8 @@ The lifecycle of this function is maturing< scale_colour_viridis_d() + labs(title = "Title here") } -}
+} + @@ -467,14 +467,14 @@ The lifecycle of this function is maturing< } -if (FALSE) { +# \donttest{ # resistance of ciprofloxacine per age group example_isolates %>% mutate(first_isolate = first_isolate(.)) %>% filter(first_isolate == TRUE, mo == as.mo("E. coli")) %>% - # `age_group` is also a function of this package: + # `age_groups` is also a function of this AMR package: group_by(age_group = age_groups(age)) %>% select(age_group, CIP) %>% @@ -483,7 +483,8 @@ The lifecycle of this function is maturing< # for colourblind mode, use divergent colours from the viridis package: example_isolates %>% select(AMX, NIT, FOS, TMP, CIP) %>% - ggplot_rsi() + scale_fill_viridis_d() + ggplot_rsi() + + scale_fill_viridis_d() # a shorter version which also adjusts data label colours: example_isolates %>% select(AMX, NIT, FOS, TMP, CIP) %>% @@ -500,7 +501,7 @@ The lifecycle of this function is maturing< title = "AMR of Anti-UTI Drugs Per Hospital", x.title = "Hospital", datalabels = FALSE) -} +# } @@ -634,25 +634,6 @@

Symbol of a p-value

- - - -

Other: deprecated functions

-

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.

- - - - - - - - - - -

portion_R() portion_IR() portion_I() portion_SI() portion_S() portion_df()

- -

Deprecated functions

- diff --git a/docs/reference/join.html b/docs/reference/join.html index 1589915a..182bd3ac 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9032 + 1.3.0.9035 @@ -296,20 +296,23 @@ The lifecycle of this function is stableleft_join_microorganisms(as.mo("K. pneumoniae")) left_join_microorganisms("B_KLBSL_PNE") -if (FALSE) { -library(dplyr) -example_isolates %>% left_join_microorganisms() - -df <- data.frame(date = seq(from = as.Date("2018-01-01"), - to = as.Date("2018-01-07"), - by = 1), - bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", - "E. coli", "E. coli", "E. coli")), - stringsAsFactors = FALSE) -colnames(df) -df_joined <- left_join_microorganisms(df, "bacteria") -colnames(df_joined) +# \donttest{ +if (require("dplyr")) { + example_isolates %>% + left_join_microorganisms() %>% + colnames() + + df <- data.frame(date = seq(from = as.Date("2018-01-01"), + to = as.Date("2018-01-07"), + by = 1), + bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", + "E. coli", "E. coli", "E. coli")), + stringsAsFactors = FALSE) + colnames(df) + df_joined <- left_join_microorganisms(df, "bacteria") + colnames(df_joined) } +# } @@ -395,32 +395,35 @@ The lifecycle of this function is stable# `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. -if (FALSE) { -library(dplyr) -# set key antibiotics to a new variable -my_patients <- example_isolates %>% - mutate(keyab = key_antibiotics(.)) %>% - mutate( - # now calculate first isolates - first_regular = first_isolate(., col_keyantibiotics = FALSE), - # and first WEIGHTED isolates - first_weighted = first_isolate(., col_keyantibiotics = "keyab") - ) - -# Check the difference, in this data set it results in 7% more isolates: -sum(my_patients$first_regular, na.rm = TRUE) -sum(my_patients$first_weighted, na.rm = TRUE) -} - # output of the `key_antibiotics` function could be like this: strainA <- "SSSRR.S.R..S" strainB <- "SSSIRSSSRSSS" +# can those strings can be compared with: key_antibiotics_equal(strainA, strainB) # TRUE, because I is ignored (as well as missing values) key_antibiotics_equal(strainA, strainB, ignore_I = FALSE) -# FALSE, because I is not ignored and so the 4th value differs +# FALSE, because I is not ignored and so the 4th value differs + +# \donttest{ +if (require("dplyr")) { + # set key antibiotics to a new variable + my_patients <- example_isolates %>% + mutate(keyab = key_antibiotics(.)) %>% + mutate( + # now calculate first isolates + first_regular = first_isolate(., col_keyantibiotics = FALSE), + # and first WEIGHTED isolates + first_weighted = first_isolate(., col_keyantibiotics = "keyab") + ) + + # Check the difference, in this data set it results in 7% more isolates: + sum(my_patients$first_regular, na.rm = TRUE) + sum(my_patients$first_weighted, na.rm = TRUE) +} +# } + @@ -313,11 +313,12 @@ The lifecycle of this function is stable#> TRUE TRUE TRUE # get isolates whose name start with 'Ent' or 'ent' -if (FALSE) { -library(dplyr) -example_isolates %>% - filter(mo_name(mo) %like% "^ent") +# \donttest{ +if (require("dplyr")) { + example_isolates %>% + filter(mo_name(mo) %like% "^ent") } +# } @@ -288,7 +288,7 @@ combine_SI -

a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the mdro() function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using combine_SI = FALSE, resistance is considered when isolates are R or I.

+

a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the mdro() function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using combine_SI = FALSE, resistance is considered when isolates are R or I.

verbose @@ -323,8 +323,10 @@ Ordered factor with levels Currently supported guidelines are (case-insensitive):

  • guideline = "CMI2012"
    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) (link)

  • -
  • guideline = "EUCAST"
    -The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)

  • +
  • guideline = "EUCAST3.2" (or simply guideline = "EUCAST")
    +The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" (link)

  • +
  • guideline = "EUCAST3.1"
    +The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)

  • guideline = "TB"
    The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (link)

  • guideline = "MRGN"
    @@ -334,7 +336,7 @@ The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WI

Please suggest your own (country-specific) guidelines by letting us know: https://github.com/msberends/AMR/issues/new.

-

Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro() function makes sure that results from before 2016 and after 2016 are identical.

+

Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro() function makes sure that results from before 2016 and after 2016 are identical.

Maturing lifecycle

@@ -347,7 +349,7 @@ The lifecycle of this function is maturing<

To define antibiotics column names, leave as it is to determine it automatically with guess_ab_col() or input a text (case-insensitive), or use NULL to skip a column (e.g. TIC = NULL to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.

The following antibiotics are used for the functions eucast_rules() and mdro(). These are shown below in the format 'name (antimicrobial ID, ATC code)', sorted alphabetically:

-

Amikacin (AMK, J01GB06), amoxicillin (AMX, J01CA04), amoxicillin/clavulanic acid (AMC, J01CR02), ampicillin (AMP, J01CA01), ampicillin/sulbactam (SAM, J01CR01), avoparcin (AVO, no ATC code), azithromycin (AZM, J01FA10), azlocillin (AZL, J01CA09), aztreonam (ATM, J01DF01), bacampicillin (BAM, J01CA06), benzylpenicillin (PEN, J01CE01), cadazolid (CDZ, J01DD09), capreomycin (CAP, J04AB30), carbenicillin (CRB, J01CA03), carindacillin (CRN, J01CA05), cefacetrile (CAC, J01DB10), cefaclor (CEC, J01DC04), cefadroxil (CFR, J01DB05), cefaloridine (RID, J01DB02), cefamandole (MAN, J01DC03), cefatrizine (CTZ, J01DB07), cefazedone (CZD, J01DB06), cefazolin (CZO, J01DB04), cefdinir (CDR, J01DD15), cefditoren (DIT, J01DD16), cefepime (FEP, J01DE01), cefetamet (CAT, J01DD10), cefixime (CFM, J01DD08), cefmenoxime (CMX, J01DD05), cefmetazole (CMZ, J01DC09), cefodizime (DIZ, J01DD09), cefonicid (CID, J01DC06), cefoperazone (CFP, J01DD12), cefoperazone/sulbactam (CSL, J01DD62), ceforanide (CND, J01DC11), cefotaxime (CTX, J01DD01), cefotetan (CTT, J01DC05), cefotiam (CTF, J01DC07), cefoxitin (FOX, J01DC01), cefoxitin screening (FOX1, no ATC code), cefpiramide (CPM, J01DD11), cefpirome (CPO, J01DE02), cefpodoxime (CPD, J01DD13), cefprozil (CPR, J01DC10), cefroxadine (CRD, J01DB11), cefsulodin (CFS, J01DD03), ceftaroline (CPT, J01DI02), ceftazidime (CAZ, J01DD02), ceftazidime/clavulanic acid (CCV, J01DD52), ceftezole (CTL, J01DB12), ceftibuten (CTB, J01DD14), ceftizoxime (CZX, J01DD07), ceftobiprole (BPR, J01DI01), ceftobiprole medocaril (CFM1, J01DI01), ceftolozane/enzyme inhibitor (CEI, J01DI54), ceftriaxone (CRO, J01DD04), cefuroxime (CXM, J01DC02), cephalexin (LEX, J01DB01), cephalothin (CEP, J01DB03), cephapirin (HAP, J01DB08), cephradine (CED, J01DB09), chloramphenicol (CHL, J01BA01), ciprofloxacin (CIP, J01MA02), clarithromycin (CLR, J01FA09), clindamycin (CLI, J01FF01), colistin (COL, J01XB01), cycloserine (CYC, J04AB01), dalbavancin (DAL, J01XA04), daptomycin (DAP, J01XX09), dibekacin (DKB, J01GB09), dirithromycin (DIR, J01FA13), doripenem (DOR, J01DH04), doxycycline (DOX, J01AA02), enoxacin (ENX, J01MA04), epicillin (EPC, J01CA07), ertapenem (ETP, J01DH03), erythromycin (ERY, J01FA01), ethambutol (ETH, J04AK02), fleroxacin (FLE, J01MA08), flucloxacillin (FLC, J01CF05), flurithromycin (FLR1, J01FA14), fosfomycin (FOS, J01XX01), fusidic acid (FUS, J01XC01), gatifloxacin (GAT, J01MA16), gemifloxacin (GEM, J01MA15), gentamicin (GEN, J01GB03), gentamicin-high (GEH, no ATC code), grepafloxacin (GRX, J01MA11), hetacillin (HET, J01CA18), imipenem (IPM, J01DH51), isepamicin (ISE, J01GB11), isoniazid (INH, J04AC01), josamycin (JOS, J01FA07), kanamycin (KAN, J01GB04), latamoxef (LTM, J01DD06), levofloxacin (LVX, J01MA12), lincomycin (LIN, J01FF02), linezolid (LNZ, J01XX08), lomefloxacin (LOM, J01MA07), loracarbef (LOR, J01DC08), mecillinam (Amdinocillin) (MEC, J01CA11), meropenem (MEM, J01DH02), meropenem/vaborbactam (MEV, J01DH52), metampicillin (MTM, J01CA14), mezlocillin (MEZ, J01CA10), midecamycin (MID, J01FA03), minocycline (MNO, J01AA08), miocamycin (MCM, J01FA11), moxifloxacin (MFX, J01MA14), nalidixic acid (NAL, J01MB02), neomycin (NEO, J01GB05), netilmicin (NET, J01GB07), nitrofurantoin (NIT, J01XE01), norfloxacin (NOR, J01MA06), norvancomycin (NVA, no ATC code), novobiocin (NOV, QJ01XX95), ofloxacin (OFX, J01MA01), oleandomycin (OLE, J01FA05), oritavancin (ORI, J01XA05), oxacillin (OXA, J01CF04), pazufloxacin (PAZ, J01MA18), pefloxacin (PEF, J01MA03), phenoxymethylpenicillin (PHN, J01CE02), piperacillin (PIP, J01CA12), piperacillin/tazobactam (TZP, J01CR05), pirlimycin (PRL, no ATC code), pivampicillin (PVM, J01CA02), pivmecillinam (PME, J01CA08), polymyxin B (PLB, J01XB02), pristinamycin (PRI, J01FG01), prulifloxacin (PRU, J01MA17), pyrazinamide (PZA, J04AK01), quinupristin/dalfopristin (QDA, J01FG02), ramoplanin (RAM, no ATC code), ribostamycin (RST, J01GB10), rifabutin (RIB, J04AB04), rifampicin (RIF, J04AB02), rifapentine (RFP, J04AB05), rokitamycin (ROK, J01FA12), roxithromycin (RXT, J01FA06), rufloxacin (RFL, J01MA10), sisomicin (SIS, J01GB08), sparfloxacin (SPX, J01MA09), spiramycin (SPI, J01FA02), streptoduocin (STR, J01GA02), streptomycin (STR1, J01GA01), streptomycin-high (STH, no ATC code), sulbenicillin (SBC, J01CA16), sulfadiazine (SDI, J01EC02), sulfadiazine/trimethoprim (SLT1, J01EE02), sulfadimethoxine (SUD, J01ED01), sulfadimidine (SDM, J01EB03), sulfadimidine/trimethoprim (SLT2, J01EE05), sulfafurazole (SLF, J01EB05), sulfaisodimidine (SLF1, J01EB01), sulfalene (SLF2, J01ED02), sulfamazone (SZO, J01ED09), sulfamerazine (SLF3, J01ED07), sulfamerazine/trimethoprim (SLT3, J01EE07), sulfamethizole (SLF4, J01EB02), sulfamethoxazole (SMX, J01EC01), sulfamethoxypyridazine (SLF5, J01ED05), sulfametomidine (SLF6, J01ED03), sulfametoxydiazine (SLF7, J01ED04), sulfametrole/trimethoprim (SLT4, J01EE03), sulfamoxole (SLF8, J01EC03), sulfamoxole/trimethoprim (SLT5, J01EE04), sulfanilamide (SLF9, J01EB06), sulfaperin (SLF10, J01ED06), sulfaphenazole (SLF11, J01ED08), sulfapyridine (SLF12, J01EB04), sulfathiazole (SUT, J01EB07), sulfathiourea (SLF13, J01EB08), talampicillin (TAL, J01CA15), tedizolid (TZD, J01XX11), teicoplanin (TEC, J01XA02), teicoplanin-macromethod (TCM, no ATC code), telavancin (TLV, J01XA03), telithromycin (TLT, J01FA15), temafloxacin (TMX, J01MA05), temocillin (TEM, J01CA17), tetracycline (TCY, J01AA07), thiacetazone (THA, no ATC code), ticarcillin (TIC, J01CA13), ticarcillin/clavulanic acid (TCC, J01CR03), tigecycline (TGC, J01AA12), tobramycin (TOB, J01GB01), trimethoprim (TMP, J01EA01), trimethoprim/sulfamethoxazole (SXT, J01EE01), troleandomycin (TRL, J01FA08), trovafloxacin (TVA, J01MA13), vancomycin (VAN, J01XA01)

+

Amikacin (AMK, J01GB06), amoxicillin (AMX, J01CA04), amoxicillin/clavulanic acid (AMC, J01CR02), ampicillin (AMP, J01CA01), ampicillin/sulbactam (SAM, J01CR01), avoparcin (AVO, no ATC code), azithromycin (AZM, J01FA10), azlocillin (AZL, J01CA09), aztreonam (ATM, J01DF01), bacampicillin (BAM, J01CA06), benzylpenicillin (PEN, J01CE01), cadazolid (CDZ, J01DD09), capreomycin (CAP, J04AB30), carbenicillin (CRB, J01CA03), carindacillin (CRN, J01CA05), cefacetrile (CAC, J01DB10), cefaclor (CEC, J01DC04), cefadroxil (CFR, J01DB05), cefaloridine (RID, J01DB02), cefamandole (MAN, J01DC03), cefatrizine (CTZ, J01DB07), cefazedone (CZD, J01DB06), cefazolin (CZO, J01DB04), cefdinir (CDR, J01DD15), cefditoren (DIT, J01DD16), cefepime (FEP, J01DE01), cefetamet (CAT, J01DD10), cefixime (CFM, J01DD08), cefmenoxime (CMX, J01DD05), cefmetazole (CMZ, J01DC09), cefodizime (DIZ, J01DD09), cefonicid (CID, J01DC06), cefoperazone (CFP, J01DD12), cefoperazone/sulbactam (CSL, J01DD62), ceforanide (CND, J01DC11), cefotaxime (CTX, J01DD01), cefotetan (CTT, J01DC05), cefotiam (CTF, J01DC07), cefoxitin (FOX, J01DC01), cefoxitin screening (FOX1, no ATC code), cefpiramide (CPM, J01DD11), cefpirome (CPO, J01DE02), cefpodoxime (CPD, J01DD13), cefprozil (CPR, J01DC10), cefroxadine (CRD, J01DB11), cefsulodin (CFS, J01DD03), ceftaroline (CPT, J01DI02), ceftazidime (CAZ, J01DD02), ceftazidime/clavulanic acid (CCV, J01DD52), ceftezole (CTL, J01DB12), ceftibuten (CTB, J01DD14), ceftizoxime (CZX, J01DD07), ceftobiprole (BPR, J01DI01), ceftobiprole medocaril (CFM1, J01DI01), ceftolozane/enzyme inhibitor (CEI, J01DI54), ceftriaxone (CRO, J01DD04), cefuroxime (CXM, J01DC02), cephalexin (LEX, J01DB01), cephalothin (CEP, J01DB03), cephapirin (HAP, J01DB08), cephradine (CED, J01DB09), chloramphenicol (CHL, J01BA01), ciprofloxacin (CIP, J01MA02), clarithromycin (CLR, J01FA09), clindamycin (CLI, J01FF01), colistin (COL, J01XB01), cycloserine (CYC, J04AB01), dalbavancin (DAL, J01XA04), daptomycin (DAP, J01XX09), dibekacin (DKB, J01GB09), dirithromycin (DIR, J01FA13), doripenem (DOR, J01DH04), doxycycline (DOX, J01AA02), enoxacin (ENX, J01MA04), epicillin (EPC, J01CA07), eravacycline (ERV, J01AA13), ertapenem (ETP, J01DH03), erythromycin (ERY, J01FA01), ethambutol (ETH, J04AK02), fidaxomicin (FDX, no ATC code), fleroxacin (FLE, J01MA08), flucloxacillin (FLC, J01CF05), flurithromycin (FLR1, J01FA14), fosfomycin (FOS, J01XX01), fusidic acid (FUS, J01XC01), gatifloxacin (GAT, J01MA16), gemifloxacin (GEM, J01MA15), gentamicin (GEN, J01GB03), gentamicin-high (GEH, no ATC code), grepafloxacin (GRX, J01MA11), hetacillin (HET, J01CA18), imipenem (IPM, J01DH51), isepamicin (ISE, J01GB11), isoniazid (INH, J04AC01), josamycin (JOS, J01FA07), kanamycin (KAN, J01GB04), latamoxef (LTM, J01DD06), levofloxacin (LVX, J01MA12), lincomycin (LIN, J01FF02), linezolid (LNZ, J01XX08), lomefloxacin (LOM, J01MA07), loracarbef (LOR, J01DC08), mecillinam (Amdinocillin) (MEC, J01CA11), meropenem (MEM, J01DH02), meropenem/vaborbactam (MEV, J01DH52), metampicillin (MTM, J01CA14), metronidazole (MTR, J01XD01), mezlocillin (MEZ, J01CA10), midecamycin (MID, J01FA03), minocycline (MNO, J01AA08), miocamycin (MCM, J01FA11), moxifloxacin (MFX, J01MA14), nalidixic acid (NAL, J01MB02), neomycin (NEO, J01GB05), netilmicin (NET, J01GB07), nitrofurantoin (NIT, J01XE01), norfloxacin (NOR, J01MA06), norvancomycin (NVA, no ATC code), novobiocin (NOV, QJ01XX95), ofloxacin (OFX, J01MA01), oleandomycin (OLE, J01FA05), omadacycline (OMC, no ATC code), oritavancin (ORI, J01XA05), oxacillin (OXA, J01CF04), pazufloxacin (PAZ, J01MA18), pefloxacin (PEF, J01MA03), phenoxymethylpenicillin (PHN, J01CE02), piperacillin (PIP, J01CA12), piperacillin/tazobactam (TZP, J01CR05), pirlimycin (PRL, no ATC code), pivampicillin (PVM, J01CA02), pivmecillinam (PME, J01CA08), polymyxin B (PLB, J01XB02), pristinamycin (PRI, J01FG01), prulifloxacin (PRU, J01MA17), pyrazinamide (PZA, J04AK01), quinupristin/dalfopristin (QDA, J01FG02), ramoplanin (RAM, no ATC code), ribostamycin (RST, J01GB10), rifabutin (RIB, J04AB04), rifampicin (RIF, J04AB02), rifapentine (RFP, J04AB05), rokitamycin (ROK, J01FA12), roxithromycin (RXT, J01FA06), rufloxacin (RFL, J01MA10), sisomicin (SIS, J01GB08), sparfloxacin (SPX, J01MA09), spectinomycin (SPT, J01XX04), spiramycin (SPI, J01FA02), streptoduocin (STR, J01GA02), streptomycin (STR1, J01GA01), streptomycin-high (STH, no ATC code), sulbenicillin (SBC, J01CA16), sulfadiazine (SDI, J01EC02), sulfadiazine/trimethoprim (SLT1, J01EE02), sulfadimethoxine (SUD, J01ED01), sulfadimidine (SDM, J01EB03), sulfadimidine/trimethoprim (SLT2, J01EE05), sulfafurazole (SLF, J01EB05), sulfaisodimidine (SLF1, J01EB01), sulfalene (SLF2, J01ED02), sulfamazone (SZO, J01ED09), sulfamerazine (SLF3, J01ED07), sulfamerazine/trimethoprim (SLT3, J01EE07), sulfamethizole (SLF4, J01EB02), sulfamethoxazole (SMX, J01EC01), sulfamethoxypyridazine (SLF5, J01ED05), sulfametomidine (SLF6, J01ED03), sulfametoxydiazine (SLF7, J01ED04), sulfametrole/trimethoprim (SLT4, J01EE03), sulfamoxole (SLF8, J01EC03), sulfamoxole/trimethoprim (SLT5, J01EE04), sulfanilamide (SLF9, J01EB06), sulfaperin (SLF10, J01ED06), sulfaphenazole (SLF11, J01ED08), sulfapyridine (SLF12, J01EB04), sulfathiazole (SUT, J01EB07), sulfathiourea (SLF13, J01EB08), talampicillin (TAL, J01CA15), tedizolid (TZD, J01XX11), teicoplanin (TEC, J01XA02), teicoplanin-macromethod (TCM, no ATC code), telavancin (TLV, J01XA03), telithromycin (TLT, J01FA15), temafloxacin (TMX, J01MA05), temocillin (TEM, J01CA17), tetracycline (TCY, J01AA07), thiacetazone (THA, no ATC code), ticarcillin (TIC, J01CA13), ticarcillin/clavulanic acid (TCC, J01CR03), tigecycline (TGC, J01AA12), tobramycin (TOB, J01GB01), trimethoprim (TMP, J01EA01), trimethoprim/sulfamethoxazole (SXT, J01EE01), troleandomycin (TRL, J01FA08), trovafloxacin (TVA, J01MA13), vancomycin (VAN, J01XA01)

Interpretation of R and S/I

@@ -369,19 +371,20 @@ A microorganism is categorised as Susceptible, Increased exposure when

On our website https://msberends.github.io/AMR you can find a comprehensive 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. As we would like to better understand the backgrounds and needs of our users, please participate in our survey!

Examples

-
if (FALSE) {
-library(dplyr)
-library(cleaner)
+    
mdro(example_isolates, guideline = "EUCAST")
 
-example_isolates %>%
-  mdro() %>%
-  freq()
+# \donttest{
+if (require("dplyr")) {
+  example_isolates %>%
+    mdro() %>%
+    table()
   
-example_isolates %>%
-  mutate(EUCAST = eucast_exceptional_phenotypes(.),
-         BRMO = brmo(.),
-         MRGN = mrgn(.))
+  example_isolates %>%
+    mutate(EUCAST = eucast_exceptional_phenotypes(.),
+           BRMO = brmo(.),
+           MRGN = mrgn(.))
 }
+# }
 
@@ -265,21 +265,22 @@

$$m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \operatorname{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}$$

where:

  • \(x\) is the user input;

  • -
  • \(n\) is a taxonomic name (genus, species and subspecies) as found in microorganisms$fullname;

  • -
  • \(l_{n}\) is the length of \(n\);

  • -
  • \(\operatorname{lev}\) is the Levenshtein distance function;

  • -
  • \(p_{n}\) is the human pathogenic prevalence of \(n\), categorised into group \(1\), \(2\) and \(3\) (see Details in ?as.mo), meaning that \(p = \{1, 2 , 3\}\);

  • -
  • \(k_{n}\) is the kingdom index of \(n\), set as follows: Bacteria = \(1\), Fungi = \(2\), Protozoa = \(3\), Archaea = \(4\), and all others = \(5\), meaning that \(k = \{1, 2 , 3, 4, 5\}\).

  • +
  • \(n\) is a taxonomic name (genus, species, and subspecies);

  • +
  • \(l_n\) is the length of \(n\);

  • +
  • lev is the Levenshtein distance function, which counts any insertion, deletion and substitution as 1 that is needed to change \(x\) into \(n\);

  • +
  • \(p_n\) is the human pathogenic prevalence group of \(n\), as described below;

  • +
  • \(k_n\) is the taxonomic kingdom of \(n\), set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.

-

This means that the user input x = "E. coli" gets for Escherichia coli a matching score of 68.8% and for Entamoeba coli a matching score of 7.9%.

-

All matches are sorted descending on their matching score and for all user input values, the top match will be returned.

+

The grouping into human pathogenic prevalence (\(p\)) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Pseudomonas and Legionella and all species within the order Enterobacterales. Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Absidia, Acremonium, Actinotignum, Alternaria, Anaerosalibacter, Apophysomyces, Arachnia, Aspergillus, Aureobacterium, Aureobasidium, Bacteroides, Basidiobolus, Beauveria, Blastocystis, Branhamella, Calymmatobacterium, Candida, Capnocytophaga, Catabacter, Chaetomium, Chryseobacterium, Chryseomonas, Chrysonilia, Cladophialophora, Cladosporium, Conidiobolus, Cryptococcus, Curvularia, Exophiala, Exserohilum, Flavobacterium, Fonsecaea, Fusarium, Fusobacterium, Hendersonula, Hypomyces, Koserella, Lelliottia, Leptosphaeria, Leptotrichia, Malassezia, Malbranchea, Mortierella, Mucor, Mycocentrospora, Mycoplasma, Nectria, Ochroconis, Oidiodendron, Phoma, Piedraia, Pithomyces, Pityrosporum, Prevotella,\Pseudallescheria, Rhizomucor, Rhizopus, Rhodotorula, Scolecobasidium, Scopulariopsis, Scytalidium,Sporobolomyces, Stachybotrys, Stomatococcus, Treponema, Trichoderma, Trichophyton, Trichosporon, Tritirachium or Ureaplasma. Group 3 consists of all other microorganisms.

+

All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., "E. coli" will return the microbial ID of Escherichia coli (\(m = 0.688\), a highly prevalent microorganism found in humans) and not Entamoeba coli (\(m = 0.079\), a less prevalent microorganism in humans), although the latter would alphabetically come first.

Examples

as.mo("E. coli")
 mo_uncertainties()
 
-mo_matching_score("E. coli", "Escherichia coli")
+mo_matching_score(x = "E. coli",
+                  n = c("Escherichia coli", "Entamoeba coli"))
 
@@ -354,15 +354,15 @@ The lifecycle of this function is stable$$m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \operatorname{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}$$

where:

  • \(x\) is the user input;

  • -
  • \(n\) is a taxonomic name (genus, species and subspecies) as found in microorganisms$fullname;

  • -
  • \(l_{n}\) is the length of \(n\);

  • -
  • \(\operatorname{lev}\) is the Levenshtein distance function;

  • -
  • \(p_{n}\) is the human pathogenic prevalence of \(n\), categorised into group \(1\), \(2\) and \(3\) (see Details in ?as.mo), meaning that \(p = \{1, 2 , 3\}\);

  • -
  • \(k_{n}\) is the kingdom index of \(n\), set as follows: Bacteria = \(1\), Fungi = \(2\), Protozoa = \(3\), Archaea = \(4\), and all others = \(5\), meaning that \(k = \{1, 2 , 3, 4, 5\}\).

  • +
  • \(n\) is a taxonomic name (genus, species, and subspecies);

  • +
  • \(l_n\) is the length of \(n\);

  • +
  • lev is the Levenshtein distance function, which counts any insertion, deletion and substitution as 1 that is needed to change \(x\) into \(n\);

  • +
  • \(p_n\) is the human pathogenic prevalence group of \(n\), as described below;

  • +
  • \(k_n\) is the taxonomic kingdom of \(n\), set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.

-

This means that the user input x = "E. coli" gets for Escherichia coli a matching score of 68.8% and for Entamoeba coli a matching score of 7.9%.

-

All matches are sorted descending on their matching score and for all user input values, the top match will be returned.

+

The grouping into human pathogenic prevalence (\(p\)) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Pseudomonas and Legionella and all species within the order Enterobacterales. Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Absidia, Acremonium, Actinotignum, Alternaria, Anaerosalibacter, Apophysomyces, Arachnia, Aspergillus, Aureobacterium, Aureobasidium, Bacteroides, Basidiobolus, Beauveria, Blastocystis, Branhamella, Calymmatobacterium, Candida, Capnocytophaga, Catabacter, Chaetomium, Chryseobacterium, Chryseomonas, Chrysonilia, Cladophialophora, Cladosporium, Conidiobolus, Cryptococcus, Curvularia, Exophiala, Exserohilum, Flavobacterium, Fonsecaea, Fusarium, Fusobacterium, Hendersonula, Hypomyces, Koserella, Lelliottia, Leptosphaeria, Leptotrichia, Malassezia, Malbranchea, Mortierella, Mucor, Mycocentrospora, Mycoplasma, Nectria, Ochroconis, Oidiodendron, Phoma, Piedraia, Pithomyces, Pityrosporum, Prevotella,\Pseudallescheria, Rhizomucor, Rhizopus, Rhodotorula, Scolecobasidium, Scopulariopsis, Scytalidium,Sporobolomyces, Stachybotrys, Stomatococcus, Treponema, Trichoderma, Trichophyton, Trichosporon, Tritirachium or Ureaplasma. Group 3 consists of all other microorganisms.

+

All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., "E. coli" will return the microbial ID of Escherichia coli (\(m = 0.688\), a highly prevalent microorganism found in humans) and not Entamoeba coli (\(m = 0.079\), a less prevalent microorganism in humans), although the latter would alphabetically come first.

Catalogue of Life

diff --git a/docs/reference/p_symbol.html b/docs/reference/p_symbol.html index c3c7aa3c..b2c54f53 100644 --- a/docs/reference/p_symbol.html +++ b/docs/reference/p_symbol.html @@ -50,7 +50,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9015 + 1.3.0.9035 @@ -260,6 +260,9 @@

Value

Text

+

Details

+ +

NOTE: this function will be moved to the cleaner package when a new version is being published on CRAN.

Questioning lifecycle

diff --git a/docs/reference/pca.html b/docs/reference/pca.html index 890d5c09..7253ac1c 100644 --- a/docs/reference/pca.html +++ b/docs/reference/pca.html @@ -50,7 +50,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9015 + 1.3.0.9035 @@ -322,23 +322,26 @@ The lifecycle of this function is maturing<
# `example_isolates` is a dataset available in the AMR package.
 # See ?example_isolates.
 
-if (FALSE) {
-# calculate the resistance per group first
-library(dplyr)
-resistance_data <- example_isolates %>% 
-  group_by(order = mo_order(mo),       # group on anything, like order
-           genus = mo_genus(mo)) %>%   #  and genus as we do here
-  summarise_if(is.rsi, resistance)     # then get resistance of all drugs
-  
-# now conduct PCA for certain antimicrobial agents
-pca_result <- resistance_data %>%         
-  pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) 
-  
-pca_result
-summary(pca_result)
-biplot(pca_result)
-ggplot_pca(pca_result) # a new and convenient plot function
-}
+# \donttest{ + +if (require("dplyr")) { + # calculate the resistance per group first + resistance_data <- example_isolates %>% + group_by(order = mo_order(mo), # group on anything, like order + genus = mo_genus(mo)) %>% # and genus as we do here + summarise_if(is.rsi, resistance) # then get resistance of all drugs + + # now conduct PCA for certain antimicrobial agents + pca_result <- resistance_data %>% + pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) + + pca_result + summary(pca_result) + biplot(pca_result) + ggplot_pca(pca_result) # a new and convenient plot function +} +# } +
@@ -464,15 +464,6 @@ A microorganism is categorised as Susceptible, Increased exposure when group_by(hospital_id) %>% proportion_df(translate = FALSE) } - -if (FALSE) { - # calculate current empiric combination therapy of Helicobacter gastritis: - my_table %>% - filter(first_isolate == TRUE, - genus == "Helicobacter") %>% - summarise(p = susceptibility(AMX, MTR), # amoxicillin with metronidazole - n = count_all(AMX, MTR)) -} @@ -418,9 +418,7 @@ A microorganism is categorised as Susceptible, Increased exposure when } # create nice plots with ggplot2 yourself -if (FALSE) { - library(dplyr) - library(ggplot2) +if (require("dplyr") & require("ggplot2")) { data <- example_isolates %>% filter(mo == as.mo("E. coli")) %>% diff --git a/docs/sitemap.xml b/docs/sitemap.xml index e2101955..21f2b38a 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,9 +3,6 @@ https://msberends.github.io/AMR/index.html - - https://msberends.github.io/AMR/reference/AMR-deprecated.html - https://msberends.github.io/AMR/reference/AMR.html diff --git a/docs/survey.html b/docs/survey.html index ba810801..01178fc7 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9034 + 1.3.0.9035 diff --git a/man/AMR-deprecated.Rd b/man/AMR-deprecated.Rd deleted file mode 100644 index 2600e94b..00000000 --- a/man/AMR-deprecated.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/deprecated.R -\name{AMR-deprecated} -\alias{AMR-deprecated} -\alias{portion_R} -\alias{portion_IR} -\alias{portion_I} -\alias{portion_SI} -\alias{portion_S} -\alias{portion_df} -\title{Deprecated functions} -\usage{ -portion_R(...) - -portion_IR(...) - -portion_I(...) - -portion_SI(...) - -portion_S(...) - -portion_df(...) -} -\description{ -These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). -} -\section{Retired lifecycle}{ - -\if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{retired}. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed. -} - -\section{Read more on our website!}{ - -On our website \url{https://msberends.github.io/AMR} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! -} - -\keyword{internal} diff --git a/man/age_groups.Rd b/man/age_groups.Rd index 3eea88e0..7cdad026 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -68,7 +68,7 @@ age_groups(ages, "children") # same: age_groups(ages, c(1, 2, 4, 6, 13, 17)) -\dontrun{ +\donttest{ # resistance of ciprofloxacine per age group library(dplyr) example_isolates \%>\% diff --git a/man/antibiotic_class_selectors.Rd b/man/antibiotic_class_selectors.Rd index 46aca0a4..e4d68902 100644 --- a/man/antibiotic_class_selectors.Rd +++ b/man/antibiotic_class_selectors.Rd @@ -68,8 +68,7 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// } \examples{ -\dontrun{ - library(dplyr) +if (require("dplyr")) { # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem): example_isolates \%>\% @@ -92,9 +91,9 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// format() - data.frame(irrelevant = "value", + data.frame(some_column = "some_value", J01CA01 = "S") \%>\% # ATC code of ampicillin - select(penicillins()) # the 'J01CA01' column will be selected + select(penicillins()) # only the 'J01CA01' column will be selected } } diff --git a/man/as.disk.Rd b/man/as.disk.Rd index 9a4562e5..8f4e25d8 100644 --- a/man/as.disk.Rd +++ b/man/as.disk.Rd @@ -38,7 +38,7 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// } \examples{ -\dontrun{ +\donttest{ # transform existing disk zones to the `disk` class library(dplyr) df <- data.frame(microorganism = "E. coli", @@ -46,8 +46,9 @@ df <- data.frame(microorganism = "E. coli", CIP = 14, GEN = 18, TOB = 16) -df <- df \%>\% mutate_at(vars(AMP:TOB), as.disk) -df +df[, 2:5] <- lapply(df[, 2:5], as.disk) +# same with dplyr: +# df \%>\% mutate(across(AMP:TOB, as.disk)) # interpret disk values, see ?as.rsi as.rsi(x = as.disk(18), diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 6a40d944..626d244d 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -117,13 +117,7 @@ There are three helper functions that can be run after using the \code{\link[=as \subsection{Microbial prevalence of pathogens in humans}{ -The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \link{microorganisms} and \link{microorganisms.old} data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. - -Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Klebsiella}, \emph{Pseudomonas} and \emph{Legionella}. - -Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Aspergillus}, \emph{Bacteroides}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Chryseobacterium}, \emph{Cryptococcus}, \emph{Elisabethkingia}, \emph{Flavobacterium}, \emph{Fusobacterium}, \emph{Giardia}, \emph{Leptotrichia}, \emph{Mycoplasma}, \emph{Prevotella}, \emph{Rhodotorula}, \emph{Treponema}, \emph{Trichophyton} or \emph{Ureaplasma}. This group consequently contains all less common and rare human pathogens. - -Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans. +The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \link{microorganisms} and \link{microorganisms.old} data sets. The grouping into human pathogenic prevalence is explained in the section \emph{Matching score for microorganisms} below. } } \section{Source}{ @@ -153,16 +147,16 @@ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\li where: \itemize{ \item \eqn{x} is the user input; -\item \eqn{n} is a taxonomic name (genus, species and subspecies) as found in \code{\link[=microorganisms]{microorganisms$fullname}}; -\item \eqn{l_{n}}{l_n} is the length of \eqn{n}; -\item \eqn{\operatorname{lev}}{lev} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}; -\item \eqn{p_{n}}{p_n} is the human pathogenic prevalence of \eqn{n}, categorised into group \eqn{1}, \eqn{2} and \eqn{3} (see \emph{Details} in \code{?as.mo}), meaning that \eqn{p = \{1, 2 , 3\}}{p = {1, 2, 3}}; -\item \eqn{k_{n}}{k_n} is the kingdom index of \eqn{n}, set as follows: Bacteria = \eqn{1}, Fungi = \eqn{2}, Protozoa = \eqn{3}, Archaea = \eqn{4}, and all others = \eqn{5}, meaning that \eqn{k = \{1, 2 , 3, 4, 5\}}{k = {1, 2, 3, 4, 5}}. +\item \eqn{n} is a taxonomic name (genus, species, and subspecies); +\item \eqn{l_n}{l_n} is the length of \eqn{n}; +\item lev is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}, which counts any insertion, deletion and substitution as 1 that is needed to change \eqn{x} into \eqn{n}; +\item \eqn{p_n}{p_n} is the human pathogenic prevalence group of \eqn{n}, as described below; +\item \eqn{k_n}{p_n} is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5. } -This means that the user input \code{x = "E. coli"} gets for \emph{Escherichia coli} a matching score of 68.8\% and for \emph{Entamoeba coli} a matching score of 7.9\%. +The grouping into human pathogenic prevalence (\eqn{p}) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. \strong{Group 1} (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacterales. \strong{Group 2} consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Absidia}, \emph{Acremonium}, \emph{Actinotignum}, \emph{Alternaria}, \emph{Anaerosalibacter}, \emph{Apophysomyces}, \emph{Arachnia}, \emph{Aspergillus}, \emph{Aureobacterium}, \emph{Aureobasidium}, \emph{Bacteroides}, \emph{Basidiobolus}, \emph{Beauveria}, \emph{Blastocystis}, \emph{Branhamella}, \emph{Calymmatobacterium}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Catabacter}, \emph{Chaetomium}, \emph{Chryseobacterium}, \emph{Chryseomonas}, \emph{Chrysonilia}, \emph{Cladophialophora}, \emph{Cladosporium}, \emph{Conidiobolus}, \emph{Cryptococcus}, \emph{Curvularia}, \emph{Exophiala}, \emph{Exserohilum}, \emph{Flavobacterium}, \emph{Fonsecaea}, \emph{Fusarium}, \emph{Fusobacterium}, \emph{Hendersonula}, \emph{Hypomyces}, \emph{Koserella}, \emph{Lelliottia}, \emph{Leptosphaeria}, \emph{Leptotrichia}, \emph{Malassezia}, \emph{Malbranchea}, \emph{Mortierella}, \emph{Mucor}, \emph{Mycocentrospora}, \emph{Mycoplasma}, \emph{Nectria}, \emph{Ochroconis}, \emph{Oidiodendron}, \emph{Phoma}, \emph{Piedraia}, \emph{Pithomyces}, \emph{Pityrosporum}, \emph{Prevotella},\\\emph{Pseudallescheria}, \emph{Rhizomucor}, \emph{Rhizopus}, \emph{Rhodotorula}, \emph{Scolecobasidium}, \emph{Scopulariopsis}, \emph{Scytalidium},\emph{Sporobolomyces}, \emph{Stachybotrys}, \emph{Stomatococcus}, \emph{Treponema}, \emph{Trichoderma}, \emph{Trichophyton}, \emph{Trichosporon}, \emph{Tritirachium} or \emph{Ureaplasma}. \strong{Group 3} consists of all other microorganisms. -All matches are sorted descending on their matching score and for all user input values, the top match will be returned. +All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.079}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } \section{Catalogue of Life}{ @@ -219,25 +213,6 @@ as.mo("S. pyogenes", Lancefield = TRUE) # will not remain species: B_STRPT_GRPA # All mo_* functions use as.mo() internally too (see ?mo_property): mo_genus("E. coli") # returns "Escherichia" mo_gramstain("E. coli") # returns "Gram negative" - -} -\dontrun{ -df$mo <- as.mo(df$microorganism_name) - -# the select function of the Tidyverse is also supported: -library(dplyr) -df$mo <- df \%>\% - select(microorganism_name) \%>\% - as.mo() - -# and can even contain 2 columns, which is convenient -# for genus/species combinations: -df$mo <- df \%>\% - select(genus, species) \%>\% - as.mo() -# although this works easier and does the same: -df <- df \%>\% - mutate(mo = as.mo(paste(genus, species))) } } \seealso{ diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index 56b25ff1..7135076e 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -167,34 +167,6 @@ df <- data.frame(microorganism = "E. coli", NIT = as.mic(32)) as.rsi(df) -\dontrun{ - -# the dplyr way -library(dplyr) -df \%>\% mutate_if(is.mic, as.rsi) -df \%>\% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) -df \%>\% mutate(across(where(is.mic), as.rsi)) -df \%>\% mutate_at(vars(AMP:TOB), as.rsi) -df \%>\% mutate(across(AMP:TOB), as.rsi) - -df \%>\% - mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") - -# to include information about urinary tract infections (UTI) -data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - from_the_bladder = c(TRUE, FALSE)) \%>\% - as.rsi(uti = "from_the_bladder") - -data.frame(mo = "E. coli", - NIT = c("<= 2", 32), - specimen = c("urine", "blood")) \%>\% - as.rsi() # automatically determines urine isolates - -df \%>\% - mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) -} - # for single values as.rsi(x = as.mic(2), mo = as.mo("S. pneumoniae"), @@ -206,6 +178,32 @@ as.rsi(x = as.disk(18), ab = "ampicillin", # and `ab` with as.ab() guideline = "EUCAST") +\donttest{ +# the dplyr way +if (require("dplyr")) { + df \%>\% mutate_if(is.mic, as.rsi) + df \%>\% mutate_if(function(x) is.mic(x) | is.disk(x), as.rsi) + df \%>\% mutate(across(where(is.mic), as.rsi)) + df \%>\% mutate_at(vars(AMP:TOB), as.rsi) + df \%>\% mutate(across(AMP:TOB), as.rsi) + + df \%>\% + mutate_at(vars(AMP:TOB), as.rsi, mo = "E. coli") + + # to include information about urinary tract infections (UTI) + data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + from_the_bladder = c(TRUE, FALSE)) \%>\% + as.rsi(uti = "from_the_bladder") + + data.frame(mo = "E. coli", + NIT = c("<= 2", 32), + specimen = c("urine", "blood")) \%>\% + as.rsi() # automatically determines urine isolates + + df \%>\% + mutate_at(vars(AMP:NIT), as.rsi, mo = "E. coli", uti = TRUE) +} # For CLEANING existing R/SI values ------------------------------------ @@ -216,25 +214,22 @@ is.rsi(rsi_data) plot(rsi_data) # for percentages barplot(rsi_data) # for frequencies -\dontrun{ -library(dplyr) -example_isolates \%>\% - mutate_at(vars(PEN:RIF), as.rsi) -# same: -example_isolates \%>\% - as.rsi(PEN:RIF) - -# fastest way to transform all columns with already valid AMR results to class `rsi`: -example_isolates \%>\% - mutate_if(is.rsi.eligible, as.rsi) - -# note: from dplyr 1.0.0 on, this will be: -# example_isolates \%>\% -# mutate(across(is.rsi.eligible, as.rsi)) - -# default threshold of `is.rsi.eligible` is 5\%. -is.rsi.eligible(WHONET$`First name`) # fails, >80\% is invalid -is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds +# the dplyr way +if (require("dplyr")) { + example_isolates \%>\% + mutate_at(vars(PEN:RIF), as.rsi) + # same: + example_isolates \%>\% + as.rsi(PEN:RIF) + + # fastest way to transform all columns with already valid AMR results to class `rsi`: + example_isolates \%>\% + mutate_if(is.rsi.eligible, as.rsi) + + # note: from dplyr 1.0.0 on, this will be: + # example_isolates \%>\% + # mutate(across(is.rsi.eligible, as.rsi)) +} } } \seealso{ diff --git a/man/atc_online.Rd b/man/atc_online.Rd index 707b9d0d..eef0ceae 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -80,16 +80,13 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// } \examples{ -\dontrun{ +\donttest{ # oral DDD (Defined Daily Dose) of amoxicillin atc_online_property("J01CA04", "DDD", "O") + # parenteral DDD (Defined Daily Dose) of amoxicillin atc_online_property("J01CA04", "DDD", "P") atc_online_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin -# [1] "ANTIINFECTIVES FOR SYSTEMIC USE" -# [2] "ANTIBACTERIALS FOR SYSTEMIC USE" -# [3] "BETA-LACTAM ANTIBACTERIALS, PENICILLINS" -# [4] "Penicillins with extended spectrum" } } diff --git a/man/availability.Rd b/man/availability.Rd index 17087d30..397eabe4 100644 --- a/man/availability.Rd +++ b/man/availability.Rd @@ -36,17 +36,10 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// \examples{ availability(example_isolates) -\dontrun{ -library(dplyr) -example_isolates \%>\% availability() - -example_isolates \%>\% - select_if(is.rsi) \%>\% - availability() - -example_isolates \%>\% - filter(mo == as.mo("E. coli")) \%>\% - select_if(is.rsi) \%>\% - availability() +if (require("dplyr")) { + example_isolates \%>\% + filter(mo == as.mo("E. coli")) \%>\% + select_if(is.rsi) \%>\% + availability() } } diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index f9ec49a3..dc9ced88 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -45,7 +45,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) \item{add_ab_group}{logical to indicate where the group of the antimicrobials must be included as a first column} -\item{remove_intrinsic_resistant}{logical to indicate that rows with 100\% resistance for all tested antimicrobials must be removed from the table} +\item{remove_intrinsic_resistant}{logical to indicate that rows and columns with 100\% resistance for all tested antimicrobials must be removed from the table} \item{decimal.mark}{the character to be used to indicate the numeric decimal point.} @@ -83,12 +83,12 @@ x format(x, translate_ab = "name (atc)") # Use FUN to change to transformation of microorganism codes -x <- bug_drug_combinations(example_isolates, - FUN = mo_gramstain) +bug_drug_combinations(example_isolates, + FUN = mo_gramstain) -x <- bug_drug_combinations(example_isolates, - FUN = function(x) ifelse(x == as.mo("E. coli"), - "E. coli", - "Others")) +bug_drug_combinations(example_isolates, + FUN = function(x) ifelse(x == as.mo("E. coli"), + "E. coli", + "Others")) } } diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index abbbfded..b32732a0 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -6,17 +6,12 @@ \title{Apply EUCAST rules} \source{ \itemize{ -\item EUCAST Expert Rules. Version 2.0, 2012. \cr -Leclercq et al. \strong{EUCAST expert rules in antimicrobial susceptibility testing.} \emph{Clin Microbiol Infect.} 2013;19(2):141-60. \cr -\url{https://doi.org/10.1111/j.1469-0691.2011.03703.x} -\item EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr -\url{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} -\item EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. \cr -\url{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf} -\item EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr -\url{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx} -\item EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. \cr -\url{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx} +\item EUCAST Expert Rules. Version 2.0, 2012.\cr +Leclercq et al. \strong{EUCAST expert rules in antimicrobial susceptibility testing.} \emph{Clin Microbiol Infect.} 2013;19(2):141-60. \href{https://doi.org/10.1111/j.1469-0691.2011.03703.x}{(link)} +\item EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{(link)} +\item EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. \href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf}{(link)} +\item EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx}{(link)} +\item EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. \href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx}{(link)} } } \usage{ @@ -80,7 +75,7 @@ To define antibiotics column names, leave as it is to determine it automatically The following antibiotics are used for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: -Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR01&showdescription=no}{J01CR01}), avoparcin (\code{AVO}, no ATC code), azithromycin (\code{AZM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA06&showdescription=no}{J01CA06}), benzylpenicillin (\code{PEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE01&showdescription=no}{J01CE01}), cadazolid (\code{CDZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), capreomycin (\code{CAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB30&showdescription=no}{J04AB30}), carbenicillin (\code{CRB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA05&showdescription=no}{J01CA05}), cefacetrile (\code{CAC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB05&showdescription=no}{J01DB05}), cefaloridine (\code{RID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB02&showdescription=no}{J01DB02}), cefamandole (\code{MAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC03&showdescription=no}{J01DC03}), cefatrizine (\code{CTZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB04&showdescription=no}{J01DB04}), cefdinir (\code{CDR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE01&showdescription=no}{J01DE01}), cefetamet (\code{CAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD10&showdescription=no}{J01DD10}), cefixime (\code{CFM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD01&showdescription=no}{J01DD01}), cefotetan (\code{CTT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC07&showdescription=no}{J01DC07}), cefoxitin (\code{FOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC01&showdescription=no}{J01DC01}), cefoxitin screening (\code{FOX1}, no ATC code), cefpiramide (\code{CPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC10&showdescription=no}{J01DC10}), cefroxadine (\code{CRD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD52&showdescription=no}{J01DD52}), ceftezole (\code{CTL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD14&showdescription=no}{J01DD14}), ceftizoxime (\code{CZX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole (\code{BPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftobiprole medocaril (\code{CFM1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/enzyme inhibitor (\code{CEI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD04&showdescription=no}{J01DD04}), cefuroxime (\code{CXM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC02&showdescription=no}{J01DC02}), cephalexin (\code{LEX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB01&showdescription=no}{J01DB01}), cephalothin (\code{CEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB03&showdescription=no}{J01DB03}), cephapirin (\code{HAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB08&showdescription=no}{J01DB08}), cephradine (\code{CED}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF01&showdescription=no}{J01FF01}), colistin (\code{COL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA04&showdescription=no}{J01XA04}), daptomycin (\code{DAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX09&showdescription=no}{J01XX09}), dibekacin (\code{DKB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB09&showdescription=no}{J01GB09}), dirithromycin (\code{DIR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA04&showdescription=no}{J01MA04}), epicillin (\code{EPC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA01&showdescription=no}{J01FA01}), ethambutol (\code{ETH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK02&showdescription=no}{J04AK02}), fleroxacin (\code{FLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX01&showdescription=no}{J01XX01}), fusidic acid (\code{FUS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XC01&showdescription=no}{J01XC01}), gatifloxacin (\code{GAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB03&showdescription=no}{J01GB03}), gentamicin-high (\code{GEH}, no ATC code), grepafloxacin (\code{GRX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH51&showdescription=no}{J01DH51}), isepamicin (\code{ISE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB11&showdescription=no}{J01GB11}), isoniazid (\code{INH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AC01&showdescription=no}{J04AC01}), josamycin (\code{JOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB04&showdescription=no}{J01GB04}), latamoxef (\code{LTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA12&showdescription=no}{J01MA12}), lincomycin (\code{LIN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC08&showdescription=no}{J01DC08}), mecillinam (Amdinocillin) (\code{MEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA14&showdescription=no}{J01CA14}), mezlocillin (\code{MEZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA10&showdescription=no}{J01CA10}), midecamycin (\code{MID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA14&showdescription=no}{J01MA14}), nalidixic acid (\code{NAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA06&showdescription=no}{J01MA06}), norvancomycin (\code{NVA}, no ATC code), novobiocin (\code{NOV}, \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA05&showdescription=no}{J01FA05}), oritavancin (\code{ORI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF04&showdescription=no}{J01CF04}), pazufloxacin (\code{PAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA03&showdescription=no}{J01MA03}), phenoxymethylpenicillin (\code{PHN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, no ATC code), pivampicillin (\code{PVM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA08&showdescription=no}{J01CA08}), polymyxin B (\code{PLB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB02&showdescription=no}{J01XB02}), pristinamycin (\code{PRI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG01&showdescription=no}{J01FG01}), prulifloxacin (\code{PRU}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA17&showdescription=no}{J01MA17}), pyrazinamide (\code{PZA}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK01&showdescription=no}{J04AK01}), quinupristin/dalfopristin (\code{QDA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG02&showdescription=no}{J01FG02}), ramoplanin (\code{RAM}, no ATC code), ribostamycin (\code{RST}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB10&showdescription=no}{J01GB10}), rifabutin (\code{RIB}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB04&showdescription=no}{J04AB04}), rifampicin (\code{RIF}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB02&showdescription=no}{J04AB02}), rifapentine (\code{RFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB05&showdescription=no}{J04AB05}), rokitamycin (\code{ROK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA10&showdescription=no}{J01MA10}), sisomicin (\code{SIS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB08&showdescription=no}{J01GB08}), sparfloxacin (\code{SPX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA01&showdescription=no}{J01GA01}), streptomycin-high (\code{STH}, no ATC code), sulbenicillin (\code{SBC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB08&showdescription=no}{J01EB08}), talampicillin (\code{TAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA15&showdescription=no}{J01CA15}), tedizolid (\code{TZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA02&showdescription=no}{J01XA02}), teicoplanin-macromethod (\code{TCM}, no ATC code), telavancin (\code{TLV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA07&showdescription=no}{J01AA07}), thiacetazone (\code{THA}, no ATC code), ticarcillin (\code{TIC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA12&showdescription=no}{J01AA12}), tobramycin (\code{TOB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB01&showdescription=no}{J01GB01}), trimethoprim (\code{TMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA13&showdescription=no}{J01MA13}), vancomycin (\code{VAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA01&showdescription=no}{J01XA01}) +Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR01&showdescription=no}{J01CR01}), avoparcin (\code{AVO}, no ATC code), azithromycin (\code{AZM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA06&showdescription=no}{J01CA06}), benzylpenicillin (\code{PEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE01&showdescription=no}{J01CE01}), cadazolid (\code{CDZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), capreomycin (\code{CAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB30&showdescription=no}{J04AB30}), carbenicillin (\code{CRB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA05&showdescription=no}{J01CA05}), cefacetrile (\code{CAC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB05&showdescription=no}{J01DB05}), cefaloridine (\code{RID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB02&showdescription=no}{J01DB02}), cefamandole (\code{MAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC03&showdescription=no}{J01DC03}), cefatrizine (\code{CTZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB04&showdescription=no}{J01DB04}), cefdinir (\code{CDR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE01&showdescription=no}{J01DE01}), cefetamet (\code{CAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD10&showdescription=no}{J01DD10}), cefixime (\code{CFM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD01&showdescription=no}{J01DD01}), cefotetan (\code{CTT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC07&showdescription=no}{J01DC07}), cefoxitin (\code{FOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC01&showdescription=no}{J01DC01}), cefoxitin screening (\code{FOX1}, no ATC code), cefpiramide (\code{CPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC10&showdescription=no}{J01DC10}), cefroxadine (\code{CRD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD52&showdescription=no}{J01DD52}), ceftezole (\code{CTL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD14&showdescription=no}{J01DD14}), ceftizoxime (\code{CZX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole (\code{BPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftobiprole medocaril (\code{CFM1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/enzyme inhibitor (\code{CEI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD04&showdescription=no}{J01DD04}), cefuroxime (\code{CXM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC02&showdescription=no}{J01DC02}), cephalexin (\code{LEX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB01&showdescription=no}{J01DB01}), cephalothin (\code{CEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB03&showdescription=no}{J01DB03}), cephapirin (\code{HAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB08&showdescription=no}{J01DB08}), cephradine (\code{CED}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF01&showdescription=no}{J01FF01}), colistin (\code{COL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA04&showdescription=no}{J01XA04}), daptomycin (\code{DAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX09&showdescription=no}{J01XX09}), dibekacin (\code{DKB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB09&showdescription=no}{J01GB09}), dirithromycin (\code{DIR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA04&showdescription=no}{J01MA04}), epicillin (\code{EPC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA07&showdescription=no}{J01CA07}), eravacycline (\code{ERV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA13&showdescription=no}{J01AA13}), ertapenem (\code{ETP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA01&showdescription=no}{J01FA01}), ethambutol (\code{ETH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK02&showdescription=no}{J04AK02}), fidaxomicin (\code{FDX}, no ATC code), fleroxacin (\code{FLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX01&showdescription=no}{J01XX01}), fusidic acid (\code{FUS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XC01&showdescription=no}{J01XC01}), gatifloxacin (\code{GAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB03&showdescription=no}{J01GB03}), gentamicin-high (\code{GEH}, no ATC code), grepafloxacin (\code{GRX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH51&showdescription=no}{J01DH51}), isepamicin (\code{ISE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB11&showdescription=no}{J01GB11}), isoniazid (\code{INH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AC01&showdescription=no}{J04AC01}), josamycin (\code{JOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB04&showdescription=no}{J01GB04}), latamoxef (\code{LTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA12&showdescription=no}{J01MA12}), lincomycin (\code{LIN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC08&showdescription=no}{J01DC08}), mecillinam (Amdinocillin) (\code{MEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA14&showdescription=no}{J01CA14}), metronidazole (\code{MTR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XD01&showdescription=no}{J01XD01}), mezlocillin (\code{MEZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA10&showdescription=no}{J01CA10}), midecamycin (\code{MID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA14&showdescription=no}{J01MA14}), nalidixic acid (\code{NAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA06&showdescription=no}{J01MA06}), norvancomycin (\code{NVA}, no ATC code), novobiocin (\code{NOV}, \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA05&showdescription=no}{J01FA05}), omadacycline (\code{OMC}, no ATC code), oritavancin (\code{ORI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF04&showdescription=no}{J01CF04}), pazufloxacin (\code{PAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA03&showdescription=no}{J01MA03}), phenoxymethylpenicillin (\code{PHN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, no ATC code), pivampicillin (\code{PVM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA08&showdescription=no}{J01CA08}), polymyxin B (\code{PLB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB02&showdescription=no}{J01XB02}), pristinamycin (\code{PRI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG01&showdescription=no}{J01FG01}), prulifloxacin (\code{PRU}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA17&showdescription=no}{J01MA17}), pyrazinamide (\code{PZA}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK01&showdescription=no}{J04AK01}), quinupristin/dalfopristin (\code{QDA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG02&showdescription=no}{J01FG02}), ramoplanin (\code{RAM}, no ATC code), ribostamycin (\code{RST}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB10&showdescription=no}{J01GB10}), rifabutin (\code{RIB}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB04&showdescription=no}{J04AB04}), rifampicin (\code{RIF}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB02&showdescription=no}{J04AB02}), rifapentine (\code{RFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB05&showdescription=no}{J04AB05}), rokitamycin (\code{ROK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA10&showdescription=no}{J01MA10}), sisomicin (\code{SIS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB08&showdescription=no}{J01GB08}), sparfloxacin (\code{SPX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA09&showdescription=no}{J01MA09}), spectinomycin (\code{SPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX04&showdescription=no}{J01XX04}), spiramycin (\code{SPI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA01&showdescription=no}{J01GA01}), streptomycin-high (\code{STH}, no ATC code), sulbenicillin (\code{SBC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB08&showdescription=no}{J01EB08}), talampicillin (\code{TAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA15&showdescription=no}{J01CA15}), tedizolid (\code{TZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA02&showdescription=no}{J01XA02}), teicoplanin-macromethod (\code{TCM}, no ATC code), telavancin (\code{TLV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA07&showdescription=no}{J01AA07}), thiacetazone (\code{THA}, no ATC code), ticarcillin (\code{TIC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA12&showdescription=no}{J01AA12}), tobramycin (\code{TOB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB01&showdescription=no}{J01GB01}), trimethoprim (\code{TMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA13&showdescription=no}{J01MA13}), vancomycin (\code{VAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA01&showdescription=no}{J01XA01}) } \section{Stable lifecycle}{ diff --git a/man/figures/mo_matching_score.png b/man/figures/mo_matching_score.png new file mode 100644 index 00000000..cd9b3501 Binary files /dev/null and b/man/figures/mo_matching_score.png differ diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd index 51cc0e85..f80035e5 100644 --- a/man/filter_ab_class.Rd +++ b/man/filter_ab_class.Rd @@ -71,40 +71,43 @@ If the unlying code needs breaking changes, they will occur gradually. For examp } \examples{ -\dontrun{ -library(dplyr) +filter_aminoglycosides(example_isolates) -# filter on isolates that have any result for any aminoglycoside -example_isolates \%>\% filter_ab_class("aminoglycoside") -example_isolates \%>\% filter_aminoglycosides() +\donttest{ +if (require("dplyr")) { -# this is essentially the same as (but without determination of column names): -example_isolates \%>\% - filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")), - .vars_predicate = any_vars(. \%in\% c("S", "I", "R"))) + # filter on isolates that have any result for any aminoglycoside + example_isolates \%>\% filter_aminoglycosides() + example_isolates \%>\% filter_ab_class("aminoglycoside") + + # this is essentially the same as (but without determination of column names): + example_isolates \%>\% + filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")), + .vars_predicate = any_vars(. \%in\% c("S", "I", "R"))) -# filter on isolates that show resistance to ANY aminoglycoside -example_isolates \%>\% filter_aminoglycosides("R", "any") - -# filter on isolates that show resistance to ALL aminoglycosides -example_isolates \%>\% filter_aminoglycosides("R", "all") - -# filter on isolates that show resistance to -# any aminoglycoside and any fluoroquinolone -example_isolates \%>\% - filter_aminoglycosides("R") \%>\% - filter_fluoroquinolones("R") - -# filter on isolates that show resistance to -# all aminoglycosides and all fluoroquinolones -example_isolates \%>\% - filter_aminoglycosides("R", "all") \%>\% - filter_fluoroquinolones("R", "all") - -# with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: -example_isolates \%>\% filter_carbapenems("R", "all") -example_isolates \%>\% filter(across(carbapenems(), ~. == "R")) + # filter on isolates that show resistance to ANY aminoglycoside + example_isolates \%>\% filter_aminoglycosides("R", "any") + + # filter on isolates that show resistance to ALL aminoglycosides + example_isolates \%>\% filter_aminoglycosides("R", "all") + + # filter on isolates that show resistance to + # any aminoglycoside and any fluoroquinolone + example_isolates \%>\% + filter_aminoglycosides("R") \%>\% + filter_fluoroquinolones("R") + + # filter on isolates that show resistance to + # all aminoglycosides and all fluoroquinolones + example_isolates \%>\% + filter_aminoglycosides("R", "all") \%>\% + filter_fluoroquinolones("R", "all") + + # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: + example_isolates \%>\% filter_carbapenems("R", "all") + example_isolates \%>\% filter(across(carbapenems(), ~. == "R")) +} } } \seealso{ diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index ffead95d..68dc5418 100755 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -98,15 +98,16 @@ To conduct an analysis of antimicrobial resistance, you should only include the All isolates with a microbial ID of \code{NA} will be excluded as first isolate. -The functions \code{\link[=filter_first_isolate]{filter_first_isolate()}} and \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} are helper functions to quickly filter on first isolates. The function \code{\link[=filter_first_isolate]{filter_first_isolate()}} is essentially equal to one of:\preformatted{ x \%>\% filter(first_isolate(., ...)) +The functions \code{\link[=filter_first_isolate]{filter_first_isolate()}} and \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} are helper functions to quickly filter on first isolates. The function \code{\link[=filter_first_isolate]{filter_first_isolate()}} is essentially equal to either:\preformatted{ x[first_isolate(x, ...), ] + x \%>\% filter(first_isolate(x, ...)) } -The function \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} is essentially equal to:\preformatted{ x \%>\% - mutate(keyab = key_antibiotics(.)) \%>\% - mutate(only_weighted_firsts = first_isolate(x, - col_keyantibiotics = "keyab", ...)) \%>\% - filter(only_weighted_firsts == TRUE) \%>\% - select(-only_weighted_firsts, -keyab) +The function \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} is essentially equal to:\preformatted{ x \%>\% + mutate(keyab = key_antibiotics(.)) \%>\% + mutate(only_weighted_firsts = first_isolate(x, + col_keyantibiotics = "keyab", ...)) \%>\% + filter(only_weighted_firsts == TRUE) \%>\% + select(-only_weighted_firsts, -keyab) } } \section{Key antibiotics}{ @@ -139,49 +140,40 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// # `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. -\dontrun{ -library(dplyr) -# Filter on first isolates: -example_isolates \%>\% - mutate(first_isolate = first_isolate(.)) \%>\% - filter(first_isolate == TRUE) +# basic filtering on first isolates +example_isolates[first_isolate(example_isolates), ] -# Now let's see if first isolates matter: -A <- example_isolates \%>\% - group_by(hospital_id) \%>\% - summarise(count = n_rsi(GEN), # gentamicin availability - resistance = resistance(GEN)) # gentamicin resistance - -B <- example_isolates \%>\% - filter_first_weighted_isolate() \%>\% # the 1st isolate filter - group_by(hospital_id) \%>\% - summarise(count = n_rsi(GEN), # gentamicin availability - resistance = resistance(GEN)) # gentamicin resistance - -# Have a look at A and B. -# B is more reliable because every isolate is counted only once. -# Gentamicin resistance in hospital D appears to be 3.7\% higher than -# when you (erroneously) would have used all isolates for analysis. - - -## OTHER EXAMPLES: - -# Short-hand versions: -example_isolates \%>\% - filter_first_isolate() +\donttest{ +if (require("dplyr")) { + # Filter on first isolates: + example_isolates \%>\% + mutate(first_isolate = first_isolate(.)) \%>\% + filter(first_isolate == TRUE) + + # Short-hand versions: + example_isolates \%>\% + filter_first_isolate() + + example_isolates \%>\% + filter_first_weighted_isolate() -example_isolates \%>\% - filter_first_weighted_isolate() - - -# set key antibiotics to a new variable -x$keyab <- key_antibiotics(x) - -x$first_isolate <- first_isolate(x) - -x$first_isolate_weighed <- first_isolate(x, col_keyantibiotics = 'keyab') - -x$first_blood_isolate <- first_isolate(x, specimen_group = "Blood") + # Now let's see if first isolates matter: + A <- example_isolates \%>\% + group_by(hospital_id) \%>\% + summarise(count = n_rsi(GEN), # gentamicin availability + resistance = resistance(GEN)) # gentamicin resistance + + B <- example_isolates \%>\% + filter_first_weighted_isolate() \%>\% # the 1st isolate filter + group_by(hospital_id) \%>\% + summarise(count = n_rsi(GEN), # gentamicin availability + resistance = resistance(GEN)) # gentamicin resistance + + # Have a look at A and B. + # B is more reliable because every isolate is counted only once. + # Gentamicin resistance in hospital D appears to be 3.7\% higher than + # when you (erroneously) would have used all isolates for analysis. +} } } \seealso{ diff --git a/man/ggplot_pca.Rd b/man/ggplot_pca.Rd index 15f98a40..a822f2c6 100644 --- a/man/ggplot_pca.Rd +++ b/man/ggplot_pca.Rd @@ -118,8 +118,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unly # See ?example_isolates. # See ?pca for more info about Principal Component Analysis (PCA). -\dontrun{ - library(dplyr) +if (require("dplyr")) { pca_model <- example_isolates \%>\% filter(mo_genus(mo) == "Staphylococcus") \%>\% group_by(species = mo_shortname(mo)) \%>\% diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index a6b7a475..2db21aa6 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -193,14 +193,14 @@ if (require("ggplot2") & require("dplyr")) { } -\dontrun{ +\donttest{ # resistance of ciprofloxacine per age group example_isolates \%>\% mutate(first_isolate = first_isolate(.)) \%>\% filter(first_isolate == TRUE, mo == as.mo("E. coli")) \%>\% - # `age_group` is also a function of this package: + # `age_groups` is also a function of this AMR package: group_by(age_group = age_groups(age)) \%>\% select(age_group, CIP) \%>\% @@ -209,7 +209,8 @@ example_isolates \%>\% # for colourblind mode, use divergent colours from the viridis package: example_isolates \%>\% select(AMX, NIT, FOS, TMP, CIP) \%>\% - ggplot_rsi() + scale_fill_viridis_d() + ggplot_rsi() + + scale_fill_viridis_d() # a shorter version which also adjusts data label colours: example_isolates \%>\% select(AMX, NIT, FOS, TMP, CIP) \%>\% diff --git a/man/join.Rd b/man/join.Rd index bea60bda..51d3c45c 100755 --- a/man/join.Rd +++ b/man/join.Rd @@ -57,18 +57,21 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// left_join_microorganisms(as.mo("K. pneumoniae")) left_join_microorganisms("B_KLBSL_PNE") -\dontrun{ -library(dplyr) -example_isolates \%>\% left_join_microorganisms() - -df <- data.frame(date = seq(from = as.Date("2018-01-01"), - to = as.Date("2018-01-07"), - by = 1), - bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", - "E. coli", "E. coli", "E. coli")), - stringsAsFactors = FALSE) -colnames(df) -df_joined <- left_join_microorganisms(df, "bacteria") -colnames(df_joined) +\donttest{ +if (require("dplyr")) { + example_isolates \%>\% + left_join_microorganisms() \%>\% + colnames() + + df <- data.frame(date = seq(from = as.Date("2018-01-01"), + to = as.Date("2018-01-07"), + by = 1), + bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR", + "E. coli", "E. coli", "E. coli")), + stringsAsFactors = FALSE) + colnames(df) + df_joined <- left_join_microorganisms(df, "bacteria") + colnames(df_joined) +} } } diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd index eeafcf9d..e2e1ca5a 100755 --- a/man/key_antibiotics.Rd +++ b/man/key_antibiotics.Rd @@ -136,32 +136,34 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// # `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. -\dontrun{ -library(dplyr) -# set key antibiotics to a new variable -my_patients <- example_isolates \%>\% - mutate(keyab = key_antibiotics(.)) \%>\% - mutate( - # now calculate first isolates - first_regular = first_isolate(., col_keyantibiotics = FALSE), - # and first WEIGHTED isolates - first_weighted = first_isolate(., col_keyantibiotics = "keyab") - ) - -# Check the difference, in this data set it results in 7\% more isolates: -sum(my_patients$first_regular, na.rm = TRUE) -sum(my_patients$first_weighted, na.rm = TRUE) -} - # output of the `key_antibiotics` function could be like this: strainA <- "SSSRR.S.R..S" strainB <- "SSSIRSSSRSSS" +# can those strings can be compared with: key_antibiotics_equal(strainA, strainB) # TRUE, because I is ignored (as well as missing values) key_antibiotics_equal(strainA, strainB, ignore_I = FALSE) # FALSE, because I is not ignored and so the 4th value differs + +\donttest{ +if (require("dplyr")) { + # set key antibiotics to a new variable + my_patients <- example_isolates \%>\% + mutate(keyab = key_antibiotics(.)) \%>\% + mutate( + # now calculate first isolates + first_regular = first_isolate(., col_keyantibiotics = FALSE), + # and first WEIGHTED isolates + first_weighted = first_isolate(., col_keyantibiotics = "keyab") + ) + + # Check the difference, in this data set it results in 7\% more isolates: + sum(my_patients$first_regular, na.rm = TRUE) + sum(my_patients$first_weighted, na.rm = TRUE) +} +} } \seealso{ \code{\link[=first_isolate]{first_isolate()}} diff --git a/man/like.Rd b/man/like.Rd index 30ff857a..a01e311e 100755 --- a/man/like.Rd +++ b/man/like.Rd @@ -68,10 +68,11 @@ a \%like\% b #> TRUE TRUE TRUE # get isolates whose name start with 'Ent' or 'ent' -\dontrun{ -library(dplyr) -example_isolates \%>\% - filter(mo_name(mo) \%like\% "^ent") +\donttest{ +if (require("dplyr")) { + example_isolates \%>\% + filter(mo_name(mo) \%like\% "^ent") +} } } \seealso{ diff --git a/man/mdro.Rd b/man/mdro.Rd index b98245b5..9443b94b 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -50,7 +50,7 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) \item{pct_required_classes}{minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate.} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the \code{\link[=mdro]{mdro()}} function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using \code{combine_SI = FALSE}, resistance is considered when isolates are R or I.} +\item{combine_SI}{a \link{logical} to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the \code{\link[=mdro]{mdro()}} function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using \code{combine_SI = FALSE}, resistance is considered when isolates are R or I.} \item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} @@ -78,8 +78,10 @@ Currently supported guidelines are (case-insensitive): \itemize{ \item \code{guideline = "CMI2012"}\cr Magiorakos AP, Srinivasan A \emph{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) (\href{https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext}{link}) -\item \code{guideline = "EUCAST"}\cr -The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link}) +\item \code{guideline = "EUCAST3.2"} (or simply \code{guideline = "EUCAST"})\cr +The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf}{link}) +\item \code{guideline = "EUCAST3.1"}\cr +The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link}) \item \code{guideline = "TB"}\cr The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link}) \item \code{guideline = "MRGN"}\cr @@ -90,7 +92,7 @@ The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WI Please suggest your own (country-specific) guidelines by letting us know: \url{https://github.com/msberends/AMR/issues/new}. -\strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{\link[=mdro]{mdro()}} function makes sure that results from before 2016 and after 2016 are identical. +\strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named \emph{order} Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{\link[=mdro]{mdro()}} function makes sure that results from before 2016 and after 2016 are identical. } \section{Maturing lifecycle}{ @@ -104,7 +106,7 @@ To define antibiotics column names, leave as it is to determine it automatically The following antibiotics are used for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: -Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR01&showdescription=no}{J01CR01}), avoparcin (\code{AVO}, no ATC code), azithromycin (\code{AZM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA06&showdescription=no}{J01CA06}), benzylpenicillin (\code{PEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE01&showdescription=no}{J01CE01}), cadazolid (\code{CDZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), capreomycin (\code{CAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB30&showdescription=no}{J04AB30}), carbenicillin (\code{CRB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA05&showdescription=no}{J01CA05}), cefacetrile (\code{CAC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB05&showdescription=no}{J01DB05}), cefaloridine (\code{RID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB02&showdescription=no}{J01DB02}), cefamandole (\code{MAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC03&showdescription=no}{J01DC03}), cefatrizine (\code{CTZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB04&showdescription=no}{J01DB04}), cefdinir (\code{CDR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE01&showdescription=no}{J01DE01}), cefetamet (\code{CAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD10&showdescription=no}{J01DD10}), cefixime (\code{CFM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD01&showdescription=no}{J01DD01}), cefotetan (\code{CTT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC07&showdescription=no}{J01DC07}), cefoxitin (\code{FOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC01&showdescription=no}{J01DC01}), cefoxitin screening (\code{FOX1}, no ATC code), cefpiramide (\code{CPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC10&showdescription=no}{J01DC10}), cefroxadine (\code{CRD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD52&showdescription=no}{J01DD52}), ceftezole (\code{CTL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD14&showdescription=no}{J01DD14}), ceftizoxime (\code{CZX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole (\code{BPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftobiprole medocaril (\code{CFM1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/enzyme inhibitor (\code{CEI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD04&showdescription=no}{J01DD04}), cefuroxime (\code{CXM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC02&showdescription=no}{J01DC02}), cephalexin (\code{LEX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB01&showdescription=no}{J01DB01}), cephalothin (\code{CEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB03&showdescription=no}{J01DB03}), cephapirin (\code{HAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB08&showdescription=no}{J01DB08}), cephradine (\code{CED}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF01&showdescription=no}{J01FF01}), colistin (\code{COL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA04&showdescription=no}{J01XA04}), daptomycin (\code{DAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX09&showdescription=no}{J01XX09}), dibekacin (\code{DKB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB09&showdescription=no}{J01GB09}), dirithromycin (\code{DIR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA04&showdescription=no}{J01MA04}), epicillin (\code{EPC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA01&showdescription=no}{J01FA01}), ethambutol (\code{ETH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK02&showdescription=no}{J04AK02}), fleroxacin (\code{FLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX01&showdescription=no}{J01XX01}), fusidic acid (\code{FUS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XC01&showdescription=no}{J01XC01}), gatifloxacin (\code{GAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB03&showdescription=no}{J01GB03}), gentamicin-high (\code{GEH}, no ATC code), grepafloxacin (\code{GRX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH51&showdescription=no}{J01DH51}), isepamicin (\code{ISE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB11&showdescription=no}{J01GB11}), isoniazid (\code{INH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AC01&showdescription=no}{J04AC01}), josamycin (\code{JOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB04&showdescription=no}{J01GB04}), latamoxef (\code{LTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA12&showdescription=no}{J01MA12}), lincomycin (\code{LIN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC08&showdescription=no}{J01DC08}), mecillinam (Amdinocillin) (\code{MEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA14&showdescription=no}{J01CA14}), mezlocillin (\code{MEZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA10&showdescription=no}{J01CA10}), midecamycin (\code{MID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA14&showdescription=no}{J01MA14}), nalidixic acid (\code{NAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA06&showdescription=no}{J01MA06}), norvancomycin (\code{NVA}, no ATC code), novobiocin (\code{NOV}, \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA05&showdescription=no}{J01FA05}), oritavancin (\code{ORI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF04&showdescription=no}{J01CF04}), pazufloxacin (\code{PAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA03&showdescription=no}{J01MA03}), phenoxymethylpenicillin (\code{PHN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, no ATC code), pivampicillin (\code{PVM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA08&showdescription=no}{J01CA08}), polymyxin B (\code{PLB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB02&showdescription=no}{J01XB02}), pristinamycin (\code{PRI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG01&showdescription=no}{J01FG01}), prulifloxacin (\code{PRU}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA17&showdescription=no}{J01MA17}), pyrazinamide (\code{PZA}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK01&showdescription=no}{J04AK01}), quinupristin/dalfopristin (\code{QDA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG02&showdescription=no}{J01FG02}), ramoplanin (\code{RAM}, no ATC code), ribostamycin (\code{RST}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB10&showdescription=no}{J01GB10}), rifabutin (\code{RIB}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB04&showdescription=no}{J04AB04}), rifampicin (\code{RIF}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB02&showdescription=no}{J04AB02}), rifapentine (\code{RFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB05&showdescription=no}{J04AB05}), rokitamycin (\code{ROK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA10&showdescription=no}{J01MA10}), sisomicin (\code{SIS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB08&showdescription=no}{J01GB08}), sparfloxacin (\code{SPX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA01&showdescription=no}{J01GA01}), streptomycin-high (\code{STH}, no ATC code), sulbenicillin (\code{SBC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB08&showdescription=no}{J01EB08}), talampicillin (\code{TAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA15&showdescription=no}{J01CA15}), tedizolid (\code{TZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA02&showdescription=no}{J01XA02}), teicoplanin-macromethod (\code{TCM}, no ATC code), telavancin (\code{TLV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA07&showdescription=no}{J01AA07}), thiacetazone (\code{THA}, no ATC code), ticarcillin (\code{TIC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA12&showdescription=no}{J01AA12}), tobramycin (\code{TOB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB01&showdescription=no}{J01GB01}), trimethoprim (\code{TMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA13&showdescription=no}{J01MA13}), vancomycin (\code{VAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA01&showdescription=no}{J01XA01}) +Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR01&showdescription=no}{J01CR01}), avoparcin (\code{AVO}, no ATC code), azithromycin (\code{AZM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA06&showdescription=no}{J01CA06}), benzylpenicillin (\code{PEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE01&showdescription=no}{J01CE01}), cadazolid (\code{CDZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), capreomycin (\code{CAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB30&showdescription=no}{J04AB30}), carbenicillin (\code{CRB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA05&showdescription=no}{J01CA05}), cefacetrile (\code{CAC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB05&showdescription=no}{J01DB05}), cefaloridine (\code{RID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB02&showdescription=no}{J01DB02}), cefamandole (\code{MAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC03&showdescription=no}{J01DC03}), cefatrizine (\code{CTZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB04&showdescription=no}{J01DB04}), cefdinir (\code{CDR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE01&showdescription=no}{J01DE01}), cefetamet (\code{CAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD10&showdescription=no}{J01DD10}), cefixime (\code{CFM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD01&showdescription=no}{J01DD01}), cefotetan (\code{CTT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC07&showdescription=no}{J01DC07}), cefoxitin (\code{FOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC01&showdescription=no}{J01DC01}), cefoxitin screening (\code{FOX1}, no ATC code), cefpiramide (\code{CPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC10&showdescription=no}{J01DC10}), cefroxadine (\code{CRD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD52&showdescription=no}{J01DD52}), ceftezole (\code{CTL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD14&showdescription=no}{J01DD14}), ceftizoxime (\code{CZX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole (\code{BPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftobiprole medocaril (\code{CFM1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/enzyme inhibitor (\code{CEI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD04&showdescription=no}{J01DD04}), cefuroxime (\code{CXM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC02&showdescription=no}{J01DC02}), cephalexin (\code{LEX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB01&showdescription=no}{J01DB01}), cephalothin (\code{CEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB03&showdescription=no}{J01DB03}), cephapirin (\code{HAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB08&showdescription=no}{J01DB08}), cephradine (\code{CED}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF01&showdescription=no}{J01FF01}), colistin (\code{COL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA04&showdescription=no}{J01XA04}), daptomycin (\code{DAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX09&showdescription=no}{J01XX09}), dibekacin (\code{DKB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB09&showdescription=no}{J01GB09}), dirithromycin (\code{DIR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA04&showdescription=no}{J01MA04}), epicillin (\code{EPC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA07&showdescription=no}{J01CA07}), eravacycline (\code{ERV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA13&showdescription=no}{J01AA13}), ertapenem (\code{ETP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA01&showdescription=no}{J01FA01}), ethambutol (\code{ETH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK02&showdescription=no}{J04AK02}), fidaxomicin (\code{FDX}, no ATC code), fleroxacin (\code{FLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX01&showdescription=no}{J01XX01}), fusidic acid (\code{FUS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XC01&showdescription=no}{J01XC01}), gatifloxacin (\code{GAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB03&showdescription=no}{J01GB03}), gentamicin-high (\code{GEH}, no ATC code), grepafloxacin (\code{GRX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH51&showdescription=no}{J01DH51}), isepamicin (\code{ISE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB11&showdescription=no}{J01GB11}), isoniazid (\code{INH}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AC01&showdescription=no}{J04AC01}), josamycin (\code{JOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB04&showdescription=no}{J01GB04}), latamoxef (\code{LTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA12&showdescription=no}{J01MA12}), lincomycin (\code{LIN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC08&showdescription=no}{J01DC08}), mecillinam (Amdinocillin) (\code{MEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA14&showdescription=no}{J01CA14}), metronidazole (\code{MTR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XD01&showdescription=no}{J01XD01}), mezlocillin (\code{MEZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA10&showdescription=no}{J01CA10}), midecamycin (\code{MID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA14&showdescription=no}{J01MA14}), nalidixic acid (\code{NAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA06&showdescription=no}{J01MA06}), norvancomycin (\code{NVA}, no ATC code), novobiocin (\code{NOV}, \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA05&showdescription=no}{J01FA05}), omadacycline (\code{OMC}, no ATC code), oritavancin (\code{ORI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF04&showdescription=no}{J01CF04}), pazufloxacin (\code{PAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA03&showdescription=no}{J01MA03}), phenoxymethylpenicillin (\code{PHN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, no ATC code), pivampicillin (\code{PVM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA08&showdescription=no}{J01CA08}), polymyxin B (\code{PLB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB02&showdescription=no}{J01XB02}), pristinamycin (\code{PRI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG01&showdescription=no}{J01FG01}), prulifloxacin (\code{PRU}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA17&showdescription=no}{J01MA17}), pyrazinamide (\code{PZA}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AK01&showdescription=no}{J04AK01}), quinupristin/dalfopristin (\code{QDA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG02&showdescription=no}{J01FG02}), ramoplanin (\code{RAM}, no ATC code), ribostamycin (\code{RST}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB10&showdescription=no}{J01GB10}), rifabutin (\code{RIB}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB04&showdescription=no}{J04AB04}), rifampicin (\code{RIF}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB02&showdescription=no}{J04AB02}), rifapentine (\code{RFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB05&showdescription=no}{J04AB05}), rokitamycin (\code{ROK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA10&showdescription=no}{J01MA10}), sisomicin (\code{SIS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB08&showdescription=no}{J01GB08}), sparfloxacin (\code{SPX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA09&showdescription=no}{J01MA09}), spectinomycin (\code{SPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX04&showdescription=no}{J01XX04}), spiramycin (\code{SPI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA01&showdescription=no}{J01GA01}), streptomycin-high (\code{STH}, no ATC code), sulbenicillin (\code{SBC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB08&showdescription=no}{J01EB08}), talampicillin (\code{TAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA15&showdescription=no}{J01CA15}), tedizolid (\code{TZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA02&showdescription=no}{J01XA02}), teicoplanin-macromethod (\code{TCM}, no ATC code), telavancin (\code{TLV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA07&showdescription=no}{J01AA07}), thiacetazone (\code{THA}, no ATC code), ticarcillin (\code{TIC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA12&showdescription=no}{J01AA12}), tobramycin (\code{TOB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB01&showdescription=no}{J01GB01}), trimethoprim (\code{TMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA13&showdescription=no}{J01MA13}), vancomycin (\code{VAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA01&showdescription=no}{J01XA01}) } \section{Interpretation of R and S/I}{ @@ -128,17 +130,18 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https:// } \examples{ -\dontrun{ -library(dplyr) -library(cleaner) +mdro(example_isolates, guideline = "EUCAST") -example_isolates \%>\% - mdro() \%>\% - freq() +\donttest{ +if (require("dplyr")) { + example_isolates \%>\% + mdro() \%>\% + table() -example_isolates \%>\% - mutate(EUCAST = eucast_exceptional_phenotypes(.), - BRMO = brmo(.), - MRGN = mrgn(.)) + example_isolates \%>\% + mutate(EUCAST = eucast_exceptional_phenotypes(.), + BRMO = brmo(.), + MRGN = mrgn(.)) +} } } diff --git a/man/mo_matching_score.Rd b/man/mo_matching_score.Rd index 9a4245d2..7f46159b 100644 --- a/man/mo_matching_score.Rd +++ b/man/mo_matching_score.Rd @@ -23,21 +23,22 @@ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\li where: \itemize{ \item \eqn{x} is the user input; -\item \eqn{n} is a taxonomic name (genus, species and subspecies) as found in \code{\link[=microorganisms]{microorganisms$fullname}}; -\item \eqn{l_{n}}{l_n} is the length of \eqn{n}; -\item \eqn{\operatorname{lev}}{lev} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}; -\item \eqn{p_{n}}{p_n} is the human pathogenic prevalence of \eqn{n}, categorised into group \eqn{1}, \eqn{2} and \eqn{3} (see \emph{Details} in \code{?as.mo}), meaning that \eqn{p = \{1, 2 , 3\}}{p = {1, 2, 3}}; -\item \eqn{k_{n}}{k_n} is the kingdom index of \eqn{n}, set as follows: Bacteria = \eqn{1}, Fungi = \eqn{2}, Protozoa = \eqn{3}, Archaea = \eqn{4}, and all others = \eqn{5}, meaning that \eqn{k = \{1, 2 , 3, 4, 5\}}{k = {1, 2, 3, 4, 5}}. +\item \eqn{n} is a taxonomic name (genus, species, and subspecies); +\item \eqn{l_n}{l_n} is the length of \eqn{n}; +\item lev is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}, which counts any insertion, deletion and substitution as 1 that is needed to change \eqn{x} into \eqn{n}; +\item \eqn{p_n}{p_n} is the human pathogenic prevalence group of \eqn{n}, as described below; +\item \eqn{k_n}{p_n} is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5. } -This means that the user input \code{x = "E. coli"} gets for \emph{Escherichia coli} a matching score of 68.8\% and for \emph{Entamoeba coli} a matching score of 7.9\%. +The grouping into human pathogenic prevalence (\eqn{p}) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. \strong{Group 1} (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacterales. \strong{Group 2} consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Absidia}, \emph{Acremonium}, \emph{Actinotignum}, \emph{Alternaria}, \emph{Anaerosalibacter}, \emph{Apophysomyces}, \emph{Arachnia}, \emph{Aspergillus}, \emph{Aureobacterium}, \emph{Aureobasidium}, \emph{Bacteroides}, \emph{Basidiobolus}, \emph{Beauveria}, \emph{Blastocystis}, \emph{Branhamella}, \emph{Calymmatobacterium}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Catabacter}, \emph{Chaetomium}, \emph{Chryseobacterium}, \emph{Chryseomonas}, \emph{Chrysonilia}, \emph{Cladophialophora}, \emph{Cladosporium}, \emph{Conidiobolus}, \emph{Cryptococcus}, \emph{Curvularia}, \emph{Exophiala}, \emph{Exserohilum}, \emph{Flavobacterium}, \emph{Fonsecaea}, \emph{Fusarium}, \emph{Fusobacterium}, \emph{Hendersonula}, \emph{Hypomyces}, \emph{Koserella}, \emph{Lelliottia}, \emph{Leptosphaeria}, \emph{Leptotrichia}, \emph{Malassezia}, \emph{Malbranchea}, \emph{Mortierella}, \emph{Mucor}, \emph{Mycocentrospora}, \emph{Mycoplasma}, \emph{Nectria}, \emph{Ochroconis}, \emph{Oidiodendron}, \emph{Phoma}, \emph{Piedraia}, \emph{Pithomyces}, \emph{Pityrosporum}, \emph{Prevotella},\\\emph{Pseudallescheria}, \emph{Rhizomucor}, \emph{Rhizopus}, \emph{Rhodotorula}, \emph{Scolecobasidium}, \emph{Scopulariopsis}, \emph{Scytalidium},\emph{Sporobolomyces}, \emph{Stachybotrys}, \emph{Stomatococcus}, \emph{Treponema}, \emph{Trichoderma}, \emph{Trichophyton}, \emph{Trichosporon}, \emph{Tritirachium} or \emph{Ureaplasma}. \strong{Group 3} consists of all other microorganisms. -All matches are sorted descending on their matching score and for all user input values, the top match will be returned. +All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.079}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } \examples{ as.mo("E. coli") mo_uncertainties() -mo_matching_score("E. coli", "Escherichia coli") +mo_matching_score(x = "E. coli", + n = c("Escherichia coli", "Entamoeba coli")) } diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 81a6e5e0..d2588568 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -133,16 +133,16 @@ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\li where: \itemize{ \item \eqn{x} is the user input; -\item \eqn{n} is a taxonomic name (genus, species and subspecies) as found in \code{\link[=microorganisms]{microorganisms$fullname}}; -\item \eqn{l_{n}}{l_n} is the length of \eqn{n}; -\item \eqn{\operatorname{lev}}{lev} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}; -\item \eqn{p_{n}}{p_n} is the human pathogenic prevalence of \eqn{n}, categorised into group \eqn{1}, \eqn{2} and \eqn{3} (see \emph{Details} in \code{?as.mo}), meaning that \eqn{p = \{1, 2 , 3\}}{p = {1, 2, 3}}; -\item \eqn{k_{n}}{k_n} is the kingdom index of \eqn{n}, set as follows: Bacteria = \eqn{1}, Fungi = \eqn{2}, Protozoa = \eqn{3}, Archaea = \eqn{4}, and all others = \eqn{5}, meaning that \eqn{k = \{1, 2 , 3, 4, 5\}}{k = {1, 2, 3, 4, 5}}. +\item \eqn{n} is a taxonomic name (genus, species, and subspecies); +\item \eqn{l_n}{l_n} is the length of \eqn{n}; +\item lev is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance function}, which counts any insertion, deletion and substitution as 1 that is needed to change \eqn{x} into \eqn{n}; +\item \eqn{p_n}{p_n} is the human pathogenic prevalence group of \eqn{n}, as described below; +\item \eqn{k_n}{p_n} is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5. } -This means that the user input \code{x = "E. coli"} gets for \emph{Escherichia coli} a matching score of 68.8\% and for \emph{Entamoeba coli} a matching score of 7.9\%. +The grouping into human pathogenic prevalence (\eqn{p}) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. \strong{Group 1} (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacterales. \strong{Group 2} consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Absidia}, \emph{Acremonium}, \emph{Actinotignum}, \emph{Alternaria}, \emph{Anaerosalibacter}, \emph{Apophysomyces}, \emph{Arachnia}, \emph{Aspergillus}, \emph{Aureobacterium}, \emph{Aureobasidium}, \emph{Bacteroides}, \emph{Basidiobolus}, \emph{Beauveria}, \emph{Blastocystis}, \emph{Branhamella}, \emph{Calymmatobacterium}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Catabacter}, \emph{Chaetomium}, \emph{Chryseobacterium}, \emph{Chryseomonas}, \emph{Chrysonilia}, \emph{Cladophialophora}, \emph{Cladosporium}, \emph{Conidiobolus}, \emph{Cryptococcus}, \emph{Curvularia}, \emph{Exophiala}, \emph{Exserohilum}, \emph{Flavobacterium}, \emph{Fonsecaea}, \emph{Fusarium}, \emph{Fusobacterium}, \emph{Hendersonula}, \emph{Hypomyces}, \emph{Koserella}, \emph{Lelliottia}, \emph{Leptosphaeria}, \emph{Leptotrichia}, \emph{Malassezia}, \emph{Malbranchea}, \emph{Mortierella}, \emph{Mucor}, \emph{Mycocentrospora}, \emph{Mycoplasma}, \emph{Nectria}, \emph{Ochroconis}, \emph{Oidiodendron}, \emph{Phoma}, \emph{Piedraia}, \emph{Pithomyces}, \emph{Pityrosporum}, \emph{Prevotella},\\\emph{Pseudallescheria}, \emph{Rhizomucor}, \emph{Rhizopus}, \emph{Rhodotorula}, \emph{Scolecobasidium}, \emph{Scopulariopsis}, \emph{Scytalidium},\emph{Sporobolomyces}, \emph{Stachybotrys}, \emph{Stomatococcus}, \emph{Treponema}, \emph{Trichoderma}, \emph{Trichophyton}, \emph{Trichosporon}, \emph{Tritirachium} or \emph{Ureaplasma}. \strong{Group 3} consists of all other microorganisms. -All matches are sorted descending on their matching score and for all user input values, the top match will be returned. +All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.079}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } \section{Catalogue of Life}{ diff --git a/man/p_symbol.Rd b/man/p_symbol.Rd index f6da7c36..4162b0f0 100644 --- a/man/p_symbol.Rd +++ b/man/p_symbol.Rd @@ -17,6 +17,9 @@ Text \description{ Return the symbol related to the p-value: 0 '\verb{***}' 0.001 '\verb{**}' 0.01 '\code{*}' 0.05 '\code{.}' 0.1 ' ' 1. Values above \code{p = 1} will return \code{NA}. } +\details{ +\strong{NOTE}: this function will be moved to the \code{cleaner} package when a new version is being published on CRAN. +} \section{Questioning lifecycle}{ \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} diff --git a/man/pca.Rd b/man/pca.Rd index cb83c28e..68aaa8ba 100644 --- a/man/pca.Rd +++ b/man/pca.Rd @@ -69,21 +69,23 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unly # `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. -\dontrun{ -# calculate the resistance per group first -library(dplyr) -resistance_data <- example_isolates \%>\% - group_by(order = mo_order(mo), # group on anything, like order - genus = mo_genus(mo)) \%>\% # and genus as we do here - summarise_if(is.rsi, resistance) # then get resistance of all drugs - -# now conduct PCA for certain antimicrobial agents -pca_result <- resistance_data \%>\% - pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) - -pca_result -summary(pca_result) -biplot(pca_result) -ggplot_pca(pca_result) # a new and convenient plot function +\donttest{ + +if (require("dplyr")) { + # calculate the resistance per group first + resistance_data <- example_isolates \%>\% + group_by(order = mo_order(mo), # group on anything, like order + genus = mo_genus(mo)) \%>\% # and genus as we do here + summarise_if(is.rsi, resistance) # then get resistance of all drugs + + # now conduct PCA for certain antimicrobial agents + pca_result <- resistance_data \%>\% + pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT) + + pca_result + summary(pca_result) + biplot(pca_result) + ggplot_pca(pca_result) # a new and convenient plot function +} } } diff --git a/man/proportion.Rd b/man/proportion.Rd index 7bb61c26..05873510 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -218,15 +218,6 @@ if (require("dplyr")) { group_by(hospital_id) \%>\% proportion_df(translate = FALSE) } - -\dontrun{ - # calculate current empiric combination therapy of Helicobacter gastritis: - my_table \%>\% - filter(first_isolate == TRUE, - genus == "Helicobacter") \%>\% - summarise(p = susceptibility(AMX, MTR), # amoxicillin with metronidazole - n = count_all(AMX, MTR)) -} } \seealso{ \code{\link[=count]{count()}} to count resistant and susceptible isolates. diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd index 651490ae..2db944a6 100644 --- a/man/resistance_predict.Rd +++ b/man/resistance_predict.Rd @@ -150,9 +150,7 @@ if (require("dplyr")) { } # create nice plots with ggplot2 yourself -\dontrun{ - library(dplyr) - library(ggplot2) +if (require("dplyr") & require("ggplot2")) { data <- example_isolates \%>\% filter(mo == as.mo("E. coli")) \%>\% diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R index f2a0dbb0..ebbe184f 100644 --- a/tests/testthat/test-data.R +++ b/tests/testthat/test-data.R @@ -66,6 +66,8 @@ test_that("creation of data sets is valid", { expect_true(all(c("fullname", "fullname_new", "ref", "prevalence", "fullname_lower", "g_species") %in% colnames(olddf))) + expect_s3_class(create_species_cons_cops("CoNS"), "mo") + }) test_that("CoL version info works", { diff --git a/tests/testthat/test-mdro.R b/tests/testthat/test-mdro.R index fb720361..86513eb7 100755 --- a/tests/testthat/test-mdro.R +++ b/tests/testthat/test-mdro.R @@ -31,14 +31,16 @@ test_that("mdro works", { expect_error(mdro(example_isolates, col_mo = "invalid", info = TRUE)) outcome <- suppressWarnings(mdro(example_isolates)) + outcome <- mdro(example_isolates, "eucast3.1", info = TRUE) outcome <- eucast_exceptional_phenotypes(example_isolates, info = TRUE) # check class - expect_equal(outcome %>% class(), c("ordered", "factor")) + expect_equal(class(outcome), c("ordered", "factor")) outcome <- mdro(example_isolates, "nl", info = TRUE) # check class - expect_equal(outcome %>% class(), c("ordered", "factor")) + expect_equal(class(outcome), c("ordered", "factor")) + library(dplyr) # example_isolates should have these finding using Dutch guidelines expect_equal(outcome %>% cleaner::freq() %>% pull(count), c(1969, 25, 6)) # 1969 neg, 25 unconfirmed, 6 pos diff --git a/tests/testthat/test-rsi.R b/tests/testthat/test-rsi.R index 4a3255f5..7a3dd2f1 100644 --- a/tests/testthat/test-rsi.R +++ b/tests/testthat/test-rsi.R @@ -84,18 +84,20 @@ test_that("mic2rsi works", { skip_on_cran() + # S. pneumoniae/ampicillin in EUCAST 2020: 0.5-2 ug/ml (R is only > 2) expect_equal(as.character( - as.rsi(x = as.mic(0.125), - mo = "B_STRPT_PNMN", - ab = "AMX", - guideline = "EUCAST")), - "S") + as.rsi(x = as.mic(c(0.125, 0.5, 1, 2, 4)), + mo = "B_STRPT_PNMN", + ab = "AMP", + guideline = "EUCAST 2020")), + c("S", "S", "I", "I", "R")) + # S. pneumoniae/amoxicillin in CLSI 2019: 2-8 ug/ml (R is 8 and > 8) expect_equal(as.character( - as.rsi(x = as.mic(4), + as.rsi(x = as.mic(c(1, 2, 4, 8, 16)), mo = "B_STRPT_PNMN", ab = "AMX", - guideline = "EUCAST")), - "I") + guideline = "CLSI 2019")), + c("S", "S", "I", "R", "R")) # cutoffs at MIC = 8 expect_equal(as.rsi(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020"),