mirror of
https://github.com/msberends/AMR.git
synced 2024-12-26 07:26:13 +01:00
(v0.7.1.9100) bug_drug speed, MIC levels
This commit is contained in:
parent
683d226fd3
commit
c8f6b97847
@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 0.7.1.9098
|
Version: 0.7.1.9100
|
||||||
Date: 2019-10-07
|
Date: 2019-10-08
|
||||||
Title: Antimicrobial Resistance Analysis
|
Title: Antimicrobial Resistance Analysis
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person(role = c("aut", "cre"),
|
person(role = c("aut", "cre"),
|
||||||
|
5
NEWS.md
5
NEWS.md
@ -1,5 +1,5 @@
|
|||||||
# AMR 0.7.1.9098
|
# AMR 0.7.1.9100
|
||||||
<small>Last updated: 07-Oct-2019</small>
|
<small>Last updated: 08-Oct-2019</small>
|
||||||
|
|
||||||
### 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`:
|
* 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`:
|
||||||
@ -121,6 +121,7 @@
|
|||||||
* Fix for `key_antibiotics()` on foreign systems
|
* Fix for `key_antibiotics()` on foreign systems
|
||||||
* Added 80 new LIS codes for microorganisms
|
* Added 80 new LIS codes for microorganisms
|
||||||
* Relabeled the factor levels of `mdr_tb()`
|
* Relabeled the factor levels of `mdr_tb()`
|
||||||
|
* Added more MIC factor levels (`as.mic()`)
|
||||||
|
|
||||||
#### Other
|
#### Other
|
||||||
* Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors
|
* Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors
|
||||||
|
@ -186,7 +186,7 @@ ab_validate <- function(x, property, ...) {
|
|||||||
# so the 'call.' can be set to FALSE
|
# so the 'call.' can be set to FALSE
|
||||||
tryCatch(x[1L] %in% AMR::antibiotics[1, property],
|
tryCatch(x[1L] %in% AMR::antibiotics[1, property],
|
||||||
error = function(e) stop(e$message, call. = FALSE))
|
error = function(e) stop(e$message, call. = FALSE))
|
||||||
|
x_bak <- x
|
||||||
if (!all(x %in% AMR::antibiotics[, property])) {
|
if (!all(x %in% AMR::antibiotics[, property])) {
|
||||||
x <- data.frame(ab = AMR::as.ab(x, ...), stringsAsFactors = FALSE) %>%
|
x <- data.frame(ab = AMR::as.ab(x, ...), stringsAsFactors = FALSE) %>%
|
||||||
left_join(AMR::antibiotics, by = "ab") %>%
|
left_join(AMR::antibiotics, by = "ab") %>%
|
||||||
@ -199,6 +199,8 @@ ab_validate <- function(x, property, ...) {
|
|||||||
} else if (property %like% "ddd") {
|
} else if (property %like% "ddd") {
|
||||||
return(as.double(x))
|
return(as.double(x))
|
||||||
} else {
|
} else {
|
||||||
|
# return "(input)" for NAs
|
||||||
|
x[is.na(x) & !is.na(x_bak)] <- paste0("(", x_bak[is.na(x) & !is.na(x_bak)], ")")
|
||||||
return(x)
|
return(x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#' The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}.
|
#' The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}.
|
||||||
#' @export
|
#' @export
|
||||||
#' @rdname bug_drug_combinations
|
#' @rdname bug_drug_combinations
|
||||||
|
#' @return The function \code{bug_drug_combinations} returns a \code{data.frame} with columns "mo", "ab", "S", "I", "R" and "total".
|
||||||
#' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
#' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
||||||
#' @inheritSection AMR Read more on our website!
|
#' @inheritSection AMR Read more on our website!
|
||||||
#' @examples
|
#' @examples
|
||||||
@ -58,7 +59,6 @@
|
|||||||
#' }
|
#' }
|
||||||
bug_drug_combinations <- function(x,
|
bug_drug_combinations <- function(x,
|
||||||
col_mo = NULL,
|
col_mo = NULL,
|
||||||
minimum = 30,
|
|
||||||
FUN = mo_shortname,
|
FUN = mo_shortname,
|
||||||
...) {
|
...) {
|
||||||
if (!is.data.frame(x)) {
|
if (!is.data.frame(x)) {
|
||||||
@ -77,16 +77,16 @@ bug_drug_combinations <- function(x,
|
|||||||
x <- x %>%
|
x <- x %>%
|
||||||
as.data.frame(stringsAsFactors = FALSE) %>%
|
as.data.frame(stringsAsFactors = FALSE) %>%
|
||||||
mutate(mo = x %>% pull(col_mo) %>% FUN(...)) %>%
|
mutate(mo = x %>% pull(col_mo) %>% FUN(...)) %>%
|
||||||
filter(mo %in% (freq(mo) %>%
|
|
||||||
filter(count >= minimum) %>%
|
|
||||||
pull(item))) %>%
|
|
||||||
group_by(mo) %>%
|
group_by(mo) %>%
|
||||||
AMR::rsi_df(translate_ab = FALSE, combine_SI = FALSE) %>%
|
select_if(is.rsi) %>%
|
||||||
select(-value) %>%
|
gather("ab", "value", -mo) %>%
|
||||||
spread(interpretation, isolates) %>%
|
group_by(mo, ab) %>%
|
||||||
|
summarise(S = sum(value == "S", na.rm = TRUE),
|
||||||
|
I = sum(value == "I", na.rm = TRUE),
|
||||||
|
R = sum(value == "R", na.rm = TRUE)) %>%
|
||||||
|
ungroup() %>%
|
||||||
mutate(total = S + I + R) %>%
|
mutate(total = S + I + R) %>%
|
||||||
filter(total >= minimum) %>%
|
as.data.frame(stringsAsFactors = FALSE)
|
||||||
rename(ab = antibiotic)
|
|
||||||
|
|
||||||
structure(.Data = x, class = c("bug_drug_combinations", class(x)))
|
structure(.Data = x, class = c("bug_drug_combinations", class(x)))
|
||||||
}
|
}
|
||||||
@ -107,6 +107,8 @@ format.bug_drug_combinations <- function(x,
|
|||||||
decimal.mark = getOption("OutDec"),
|
decimal.mark = getOption("OutDec"),
|
||||||
big.mark = ifelse(decimal.mark == ",", ".", ","),
|
big.mark = ifelse(decimal.mark == ",", ".", ","),
|
||||||
...) {
|
...) {
|
||||||
|
x <- x %>% filter(total >= minimum)
|
||||||
|
|
||||||
if (remove_intrinsic_resistant == TRUE) {
|
if (remove_intrinsic_resistant == TRUE) {
|
||||||
x <- x %>% filter(R != total)
|
x <- x %>% filter(R != total)
|
||||||
}
|
}
|
||||||
@ -133,7 +135,6 @@ format.bug_drug_combinations <- function(x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
y <- x %>%
|
y <- x %>%
|
||||||
filter(total >= minimum) %>%
|
|
||||||
mutate(ab = as.ab(ab),
|
mutate(ab = as.ab(ab),
|
||||||
ab_txt = give_ab_name(ab = ab, format = translate_ab, language = language)) %>%
|
ab_txt = give_ab_name(ab = ab, format = translate_ab, language = language)) %>%
|
||||||
group_by(ab, ab_txt, mo) %>%
|
group_by(ab, ab_txt, mo) %>%
|
||||||
|
@ -429,7 +429,7 @@ eucast_rules <- function(x,
|
|||||||
x_original <<- x_original %>% mutate_at(vars(cols), ~factor(x = as.character(.), levels = c(to, levels(.))))
|
x_original <<- x_original %>% mutate_at(vars(cols), ~factor(x = as.character(.), levels = c(to, levels(.))))
|
||||||
x <<- x %>% mutate_at(vars(cols), ~factor(x = as.character(.), levels = c(to, levels(.))))
|
x <<- x %>% mutate_at(vars(cols), ~factor(x = as.character(.), levels = c(to, levels(.))))
|
||||||
x_original[rows, cols] <<- to
|
x_original[rows, cols] <<- to
|
||||||
warning('Value "', to, '" added to the factor levels of column(s) `', paste(cols, collapse = '`, `'), '` because this value was not an existing factor level.\nA better way is to use as.rsi() on beforehand on antibiotic columns to guarantee the right structure.', call. = FALSE)
|
warning('Value "', to, '" added to the factor levels of column(s) `', paste(cols, collapse = '`, `'), '` because this value was not an existing factor level.\nA better way is to use as.rsi() on beforehand on antimicrobial columns to guarantee the right structure.', call. = FALSE)
|
||||||
txt_warning()
|
txt_warning()
|
||||||
warned <<- FALSE
|
warned <<- FALSE
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,7 +130,7 @@ get_column_abx <- function(x,
|
|||||||
# and that have no more than 50% invalid values
|
# and that have no more than 50% invalid values
|
||||||
vectr_antibiotics <- unique(toupper(unlist(AMR::antibiotics[,c("ab", "atc", "name", "abbreviations", "synonyms")])))
|
vectr_antibiotics <- unique(toupper(unlist(AMR::antibiotics[,c("ab", "atc", "name", "abbreviations", "synonyms")])))
|
||||||
vectr_antibiotics <- vectr_antibiotics[!is.na(vectr_antibiotics) & nchar(vectr_antibiotics) >= 3]
|
vectr_antibiotics <- vectr_antibiotics[!is.na(vectr_antibiotics) & nchar(vectr_antibiotics) >= 3]
|
||||||
x_columns <- sapply(colnames(x), function(col = x, df = x_bak) {
|
x_columns <- sapply(colnames(x), function(col, df = x_bak) {
|
||||||
if (toupper(col) %in% vectr_antibiotics |
|
if (toupper(col) %in% vectr_antibiotics |
|
||||||
is.rsi(as.data.frame(df)[, col]) |
|
is.rsi(as.data.frame(df)[, col]) |
|
||||||
is.rsi.eligible(as.data.frame(df)[, col], threshold = 0.5)) {
|
is.rsi.eligible(as.data.frame(df)[, col], threshold = 0.5)) {
|
||||||
@ -139,8 +139,8 @@ get_column_abx <- function(x,
|
|||||||
return(NA_character_)
|
return(NA_character_)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
x_coluxmns <- x_columns[!is.na(x_columns)]
|
x_columns <- x_columns[!is.na(x_columns)]
|
||||||
x <- x[,x_columns[!is.na(x_columns)]]
|
x <- x[, x_columns, drop = FALSE] # without drop = TRUE, x will become a vector when x_columns is length 1
|
||||||
|
|
||||||
df_trans <- data.frame(colnames = colnames(x),
|
df_trans <- data.frame(colnames = colnames(x),
|
||||||
abcode = suppressWarnings(as.ab(colnames(x))))
|
abcode = suppressWarnings(as.ab(colnames(x))))
|
||||||
|
34
R/mic.R
34
R/mic.R
@ -68,6 +68,9 @@ as.mic <- function(x, na.rm = FALSE) {
|
|||||||
x <- gsub(',', '.', x, fixed = TRUE)
|
x <- gsub(',', '.', x, fixed = TRUE)
|
||||||
# remove space between operator and number ("<= 0.002" -> "<=0.002")
|
# remove space between operator and number ("<= 0.002" -> "<=0.002")
|
||||||
x <- gsub('(<|=|>) +', '\\1', x)
|
x <- gsub('(<|=|>) +', '\\1', x)
|
||||||
|
# transform => to >= and =< to <=
|
||||||
|
x <- gsub('=>', '>=', x, fixed = TRUE)
|
||||||
|
x <- gsub('=<', '<=', x, fixed = TRUE)
|
||||||
# starting dots must start with 0
|
# starting dots must start with 0
|
||||||
x <- gsub('^[.]+', '0.', x)
|
x <- gsub('^[.]+', '0.', x)
|
||||||
# <=0.2560.512 should be 0.512
|
# <=0.2560.512 should be 0.512
|
||||||
@ -76,13 +79,19 @@ as.mic <- function(x, na.rm = FALSE) {
|
|||||||
x <- gsub('[.]+0$', '', x)
|
x <- gsub('[.]+0$', '', x)
|
||||||
# remove all after last digit
|
# remove all after last digit
|
||||||
x <- gsub('[^0-9]+$', '', x)
|
x <- gsub('[^0-9]+$', '', x)
|
||||||
|
# keep only one zero before dot
|
||||||
|
x <- gsub("0+[.]", "0.", x)
|
||||||
|
# starting 00 is probably 0.0 if there's no dot yet
|
||||||
|
x[!x %like% "[.]"] <- gsub("^00", "0.0", x[!x %like% "[.]"])
|
||||||
# remove last zeroes
|
# remove last zeroes
|
||||||
x <- gsub('([.].?)0+$', '\\1', x)
|
x <- gsub('([.].?)0+$', '\\1', x)
|
||||||
x <- gsub('(.*[.])0+$', '\\10', x)
|
x <- gsub('(.*[.])0+$', '\\10', x)
|
||||||
# remove ending .0 again
|
# remove ending .0 again
|
||||||
x <- gsub('[.]+0$', '', x)
|
x[x %like% "[.]"] <- gsub('0+$', '', x[x %like% "[.]"])
|
||||||
# force to be character
|
# force to be character
|
||||||
x <- as.character(x)
|
x <- as.character(x)
|
||||||
|
# trim it
|
||||||
|
x <- trimws(x)
|
||||||
|
|
||||||
## previously unempty values now empty - should return a warning later on
|
## previously unempty values now empty - should return a warning later on
|
||||||
x[x.bak != "" & x == ""] <- "invalid"
|
x[x.bak != "" & x == ""] <- "invalid"
|
||||||
@ -92,15 +101,25 @@ as.mic <- function(x, na.rm = FALSE) {
|
|||||||
"<0.002", "<=0.002", "0.002", ">=0.002", ">0.002",
|
"<0.002", "<=0.002", "0.002", ">=0.002", ">0.002",
|
||||||
"<0.003", "<=0.003", "0.003", ">=0.003", ">0.003",
|
"<0.003", "<=0.003", "0.003", ">=0.003", ">0.003",
|
||||||
"<0.004", "<=0.004", "0.004", ">=0.004", ">0.004",
|
"<0.004", "<=0.004", "0.004", ">=0.004", ">0.004",
|
||||||
|
"<0.005", "<=0.005", "0.005", ">=0.005", ">0.005",
|
||||||
"<0.006", "<=0.006", "0.006", ">=0.006", ">0.006",
|
"<0.006", "<=0.006", "0.006", ">=0.006", ">0.006",
|
||||||
|
"<0.007", "<=0.007", "0.007", ">=0.007", ">0.007",
|
||||||
"<0.008", "<=0.008", "0.008", ">=0.008", ">0.008",
|
"<0.008", "<=0.008", "0.008", ">=0.008", ">0.008",
|
||||||
|
"<0.009", "<=0.009", "0.009", ">=0.009", ">0.009",
|
||||||
|
"<0.01", "<=0.01", "0.01", ">=0.01", ">0.01",
|
||||||
"<0.012", "<=0.012", "0.012", ">=0.012", ">0.012",
|
"<0.012", "<=0.012", "0.012", ">=0.012", ">0.012",
|
||||||
"<0.0125", "<=0.0125", "0.0125", ">=0.0125", ">0.0125",
|
"<0.0125", "<=0.0125", "0.0125", ">=0.0125", ">0.0125",
|
||||||
"<0.016", "<=0.016", "0.016", ">=0.016", ">0.016",
|
"<0.016", "<=0.016", "0.016", ">=0.016", ">0.016",
|
||||||
|
"<0.019", "<=0.019", "0.019", ">=0.019", ">0.019",
|
||||||
|
"<0.02", "<=0.02", "0.02", ">=0.02", ">0.02",
|
||||||
"<0.023", "<=0.023", "0.023", ">=0.023", ">0.023",
|
"<0.023", "<=0.023", "0.023", ">=0.023", ">0.023",
|
||||||
"<0.025", "<=0.025", "0.025", ">=0.025", ">0.025",
|
"<0.025", "<=0.025", "0.025", ">=0.025", ">0.025",
|
||||||
|
"<0.028", "<=0.028", "0.028", ">=0.028", ">0.028",
|
||||||
"<0.03", "<=0.03", "0.03", ">=0.03", ">0.03",
|
"<0.03", "<=0.03", "0.03", ">=0.03", ">0.03",
|
||||||
|
"<0.031", "<=0.031", "0.031", ">=0.031", ">0.031",
|
||||||
"<0.032", "<=0.032", "0.032", ">=0.032", ">0.032",
|
"<0.032", "<=0.032", "0.032", ">=0.032", ">0.032",
|
||||||
|
"<0.038", "<=0.038", "0.038", ">=0.038", ">0.038",
|
||||||
|
"<0.04", "<=0.04", "0.04", ">=0.04", ">0.04",
|
||||||
"<0.047", "<=0.047", "0.047", ">=0.047", ">0.047",
|
"<0.047", "<=0.047", "0.047", ">=0.047", ">0.047",
|
||||||
"<0.05", "<=0.05", "0.05", ">=0.05", ">0.05",
|
"<0.05", "<=0.05", "0.05", ">=0.05", ">0.05",
|
||||||
"<0.054", "<=0.054", "0.054", ">=0.054", ">0.054",
|
"<0.054", "<=0.054", "0.054", ">=0.054", ">0.054",
|
||||||
@ -108,25 +127,38 @@ as.mic <- function(x, na.rm = FALSE) {
|
|||||||
"<0.0625", "<=0.0625", "0.0625", ">=0.0625", ">0.0625",
|
"<0.0625", "<=0.0625", "0.0625", ">=0.0625", ">0.0625",
|
||||||
"<0.063", "<=0.063", "0.063", ">=0.063", ">0.063",
|
"<0.063", "<=0.063", "0.063", ">=0.063", ">0.063",
|
||||||
"<0.064", "<=0.064", "0.064", ">=0.064", ">0.064",
|
"<0.064", "<=0.064", "0.064", ">=0.064", ">0.064",
|
||||||
|
"<0.075", "<=0.075", "0.075", ">=0.075", ">0.075",
|
||||||
|
"<0.08", "<=0.08", "0.08", ">=0.08", ">0.08",
|
||||||
"<0.09", "<=0.09", "0.09", ">=0.09", ">0.09",
|
"<0.09", "<=0.09", "0.09", ">=0.09", ">0.09",
|
||||||
"<0.094", "<=0.094", "0.094", ">=0.094", ">0.094",
|
"<0.094", "<=0.094", "0.094", ">=0.094", ">0.094",
|
||||||
|
"<0.095", "<=0.095", "0.095", ">=0.095", ">0.095",
|
||||||
|
"<0.1", "<=0.1", "0.1", ">=0.1", ">0.1",
|
||||||
"<0.12", "<=0.12", "0.12", ">=0.12", ">0.12",
|
"<0.12", "<=0.12", "0.12", ">=0.12", ">0.12",
|
||||||
"<0.125", "<=0.125", "0.125", ">=0.125", ">0.125",
|
"<0.125", "<=0.125", "0.125", ">=0.125", ">0.125",
|
||||||
"<0.128", "<=0.128", "0.128", ">=0.128", ">0.128",
|
"<0.128", "<=0.128", "0.128", ">=0.128", ">0.128",
|
||||||
|
"<0.15", "<=0.15", "0.15", ">=0.15", ">0.15",
|
||||||
"<0.16", "<=0.16", "0.16", ">=0.16", ">0.16",
|
"<0.16", "<=0.16", "0.16", ">=0.16", ">0.16",
|
||||||
|
"<0.17", "<=0.17", "0.17", ">=0.17", ">0.17",
|
||||||
|
"<0.18", "<=0.18", "0.18", ">=0.18", ">0.18",
|
||||||
"<0.19", "<=0.19", "0.19", ">=0.19", ">0.19",
|
"<0.19", "<=0.19", "0.19", ">=0.19", ">0.19",
|
||||||
|
"<0.2", "<=0.2", "0.2", ">=0.2", ">0.2",
|
||||||
"<0.23", "<=0.23", "0.23", ">=0.23", ">0.23",
|
"<0.23", "<=0.23", "0.23", ">=0.23", ">0.23",
|
||||||
"<0.25", "<=0.25", "0.25", ">=0.25", ">0.25",
|
"<0.25", "<=0.25", "0.25", ">=0.25", ">0.25",
|
||||||
"<0.256", "<=0.256", "0.256", ">=0.256", ">0.256",
|
"<0.256", "<=0.256", "0.256", ">=0.256", ">0.256",
|
||||||
"<0.28", "<=0.28", "0.28", ">=0.28", ">0.28",
|
"<0.28", "<=0.28", "0.28", ">=0.28", ">0.28",
|
||||||
"<0.3", "<=0.3", "0.3", ">=0.3", ">0.3",
|
"<0.3", "<=0.3", "0.3", ">=0.3", ">0.3",
|
||||||
"<0.32", "<=0.32", "0.32", ">=0.32", ">0.32",
|
"<0.32", "<=0.32", "0.32", ">=0.32", ">0.32",
|
||||||
|
"<0.35", "<=0.35", "0.35", ">=0.35", ">0.35",
|
||||||
"<0.36", "<=0.36", "0.36", ">=0.36", ">0.36",
|
"<0.36", "<=0.36", "0.36", ">=0.36", ">0.36",
|
||||||
"<0.38", "<=0.38", "0.38", ">=0.38", ">0.38",
|
"<0.38", "<=0.38", "0.38", ">=0.38", ">0.38",
|
||||||
|
"<0.47", "<=0.47", "0.47", ">=0.47", ">0.47",
|
||||||
"<0.5", "<=0.5", "0.5", ">=0.5", ">0.5",
|
"<0.5", "<=0.5", "0.5", ">=0.5", ">0.5",
|
||||||
"<0.512", "<=0.512", "0.512", ">=0.512", ">0.512",
|
"<0.512", "<=0.512", "0.512", ">=0.512", ">0.512",
|
||||||
"<0.64", "<=0.64", "0.64", ">=0.64", ">0.64",
|
"<0.64", "<=0.64", "0.64", ">=0.64", ">0.64",
|
||||||
|
"<0.73", "<=0.73", "0.73", ">=0.73", ">0.73",
|
||||||
"<0.75", "<=0.75", "0.75", ">=0.75", ">0.75",
|
"<0.75", "<=0.75", "0.75", ">=0.75", ">0.75",
|
||||||
|
"<0.8", "<=0.8", "0.8", ">=0.8", ">0.8",
|
||||||
|
"<0.94", "<=0.94", "0.94", ">=0.94", ">0.94",
|
||||||
"<1", "<=1", "1", ">=1", ">1",
|
"<1", "<=1", "1", ">=1", ">1",
|
||||||
"<1.5", "<=1.5", "1.5", ">=1.5", ">1.5",
|
"<1.5", "<=1.5", "1.5", ">=1.5", ">1.5",
|
||||||
"<2", "<=2", "2", ">=2", ">2",
|
"<2", "<=2", "2", ">=2", ">2",
|
||||||
|
44
R/mo.R
44
R/mo.R
@ -412,13 +412,13 @@ exec_as.mo <- function(x,
|
|||||||
y <- reference_data_to_use[prevalence == 1][data.table(mo = x), on = "mo", ..property][[1]]
|
y <- reference_data_to_use[prevalence == 1][data.table(mo = x), on = "mo", ..property][[1]]
|
||||||
if (any(is.na(y))) {
|
if (any(is.na(y))) {
|
||||||
y[is.na(y)] <- reference_data_to_use[prevalence == 2][data.table(mo = x[is.na(y)]),
|
y[is.na(y)] <- reference_data_to_use[prevalence == 2][data.table(mo = x[is.na(y)]),
|
||||||
on = "mo",
|
on = "mo",
|
||||||
..property][[1]]
|
..property][[1]]
|
||||||
}
|
}
|
||||||
if (any(is.na(y))) {
|
if (any(is.na(y))) {
|
||||||
y[is.na(y)] <- reference_data_to_use[prevalence == 3][data.table(mo = x[is.na(y)]),
|
y[is.na(y)] <- reference_data_to_use[prevalence == 3][data.table(mo = x[is.na(y)]),
|
||||||
on = "mo",
|
on = "mo",
|
||||||
..property][[1]]
|
..property][[1]]
|
||||||
}
|
}
|
||||||
x <- y
|
x <- y
|
||||||
|
|
||||||
@ -441,13 +441,13 @@ exec_as.mo <- function(x,
|
|||||||
y <- reference_data_to_use[prevalence == 1][data.table(fullname_lower = tolower(x)), on = "fullname_lower", ..property][[1]]
|
y <- reference_data_to_use[prevalence == 1][data.table(fullname_lower = tolower(x)), on = "fullname_lower", ..property][[1]]
|
||||||
if (any(is.na(y))) {
|
if (any(is.na(y))) {
|
||||||
y[is.na(y)] <- reference_data_to_use[prevalence == 2][data.table(fullname_lower = tolower(x[is.na(y)])),
|
y[is.na(y)] <- reference_data_to_use[prevalence == 2][data.table(fullname_lower = tolower(x[is.na(y)])),
|
||||||
on = "fullname_lower",
|
on = "fullname_lower",
|
||||||
..property][[1]]
|
..property][[1]]
|
||||||
}
|
}
|
||||||
if (any(is.na(y))) {
|
if (any(is.na(y))) {
|
||||||
y[is.na(y)] <- reference_data_to_use[prevalence == 3][data.table(fullname_lower = tolower(x[is.na(y)])),
|
y[is.na(y)] <- reference_data_to_use[prevalence == 3][data.table(fullname_lower = tolower(x[is.na(y)])),
|
||||||
on = "fullname_lower",
|
on = "fullname_lower",
|
||||||
..property][[1]]
|
..property][[1]]
|
||||||
}
|
}
|
||||||
x <- y
|
x <- y
|
||||||
|
|
||||||
@ -1067,9 +1067,9 @@ exec_as.mo <- function(x,
|
|||||||
ref_old = found[1, ref],
|
ref_old = found[1, ref],
|
||||||
ref_new = microorganismsDT[col_id == found[1, col_id_new], ref],
|
ref_new = microorganismsDT[col_id == found[1, col_id_new], ref],
|
||||||
mo = microorganismsDT[col_id == found[1, col_id_new], mo])
|
mo = microorganismsDT[col_id == found[1, col_id_new], mo])
|
||||||
if (initial_search == TRUE) {
|
# if (initial_search == TRUE) {
|
||||||
set_mo_history(a.x_backup, get_mo_code(x[i], property), 0, force = force_mo_history, disable = disable_mo_history)
|
# set_mo_history(a.x_backup, get_mo_code(x[i], property), 0, force = force_mo_history, disable = disable_mo_history)
|
||||||
}
|
# }
|
||||||
return(x[i])
|
return(x[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1099,7 +1099,7 @@ exec_as.mo <- function(x,
|
|||||||
message("Running '", d.x_withspaces_start_end, "' and '", e.x_withspaces_start_only, "'")
|
message("Running '", d.x_withspaces_start_end, "' and '", e.x_withspaces_start_only, "'")
|
||||||
}
|
}
|
||||||
found <- data.old_to_check[fullname_lower %like_case% d.x_withspaces_start_end
|
found <- data.old_to_check[fullname_lower %like_case% d.x_withspaces_start_end
|
||||||
| fullname_lower %like_case% e.x_withspaces_start_only]
|
| fullname_lower %like_case% e.x_withspaces_start_only]
|
||||||
if (NROW(found) > 0 & nchar(g.x_backup_without_spp) >= 6) {
|
if (NROW(found) > 0 & nchar(g.x_backup_without_spp) >= 6) {
|
||||||
if (property == "ref") {
|
if (property == "ref") {
|
||||||
# when property is "ref" (which is the case in mo_ref, mo_authors and mo_year), return the old value, so:
|
# when property is "ref" (which is the case in mo_ref, mo_authors and mo_year), return the old value, so:
|
||||||
@ -1119,9 +1119,9 @@ exec_as.mo <- function(x,
|
|||||||
format_uncertainty_as_df(uncertainty_level = now_checks_for_uncertainty_level,
|
format_uncertainty_as_df(uncertainty_level = now_checks_for_uncertainty_level,
|
||||||
input = a.x_backup,
|
input = a.x_backup,
|
||||||
result_mo = microorganismsDT[col_id == found[1, col_id_new], mo]))
|
result_mo = microorganismsDT[col_id == found[1, col_id_new], mo]))
|
||||||
if (initial_search == TRUE) {
|
# if (initial_search == TRUE) {
|
||||||
set_mo_history(a.x_backup, get_mo_code(x, property), 1, force = force_mo_history, disable = disable_mo_history)
|
# set_mo_history(a.x_backup, get_mo_code(x, property), 1, force = force_mo_history, disable = disable_mo_history)
|
||||||
}
|
# }
|
||||||
return(x)
|
return(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1520,7 +1520,7 @@ exec_as.mo <- function(x,
|
|||||||
# THEN TRY PREVALENT IN HUMAN INFECTIONS ----
|
# THEN TRY PREVALENT IN HUMAN INFECTIONS ----
|
||||||
x[i] <- check_per_prevalence(data_to_check = reference_data_to_use[prevalence == 2],
|
x[i] <- check_per_prevalence(data_to_check = reference_data_to_use[prevalence == 2],
|
||||||
data.old_to_check = microorganisms.oldDT[prevalence %in% c(2, 3)], # run all other old MOs the second time,
|
data.old_to_check = microorganisms.oldDT[prevalence %in% c(2, 3)], # run all other old MOs the second time,
|
||||||
# otherwise e.g. mo_ref("Chlamydia psittaci") doesn't work correctly
|
# otherwise e.g. mo_ref("Chlamydia psittaci") doesn't work correctly
|
||||||
a.x_backup = x_backup[i],
|
a.x_backup = x_backup[i],
|
||||||
b.x_trimmed = x_trimmed[i],
|
b.x_trimmed = x_trimmed[i],
|
||||||
c.x_trimmed_without_group = x_trimmed_without_group[i],
|
c.x_trimmed_without_group = x_trimmed_without_group[i],
|
||||||
@ -1931,12 +1931,12 @@ print.mo_renamed <- function(x, ...) {
|
|||||||
}
|
}
|
||||||
for (i in 1:nrow(x)) {
|
for (i in 1:nrow(x)) {
|
||||||
message(blue(paste0("NOTE: ",
|
message(blue(paste0("NOTE: ",
|
||||||
italic(x$old_name[i]), ifelse(x$old_ref[i] %in% c("", NA), "",
|
italic(x$old_name[i]), ifelse(x$old_ref[i] %in% c("", NA), "",
|
||||||
paste0(" (", gsub("et al.", italic("et al."), x$old_ref[i]), ")")),
|
paste0(" (", gsub("et al.", italic("et al."), x$old_ref[i]), ")")),
|
||||||
" was renamed ",
|
" was renamed ",
|
||||||
italic(x$new_name[i]), ifelse(x$new_ref[i] %in% c("", NA), "",
|
italic(x$new_name[i]), ifelse(x$new_ref[i] %in% c("", NA), "",
|
||||||
paste0(" (", gsub("et al.", italic("et al."), x$new_ref[i]), ")")),
|
paste0(" (", gsub("et al.", italic("et al."), x$new_ref[i]), ")")),
|
||||||
" [", x$mo[i], "]")))
|
" [", x$mo[i], "]")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +279,7 @@ antibiotics <- abx2 %>%
|
|||||||
antibiotics[which(antibiotics$ab == "DOX"), "abbreviations"][[1]] <- list(c("dox", "doxy"))
|
antibiotics[which(antibiotics$ab == "DOX"), "abbreviations"][[1]] <- list(c("dox", "doxy"))
|
||||||
antibiotics[which(antibiotics$ab == "FLC"), "abbreviations"][[1]] <- list(c("clox"))
|
antibiotics[which(antibiotics$ab == "FLC"), "abbreviations"][[1]] <- list(c("clox"))
|
||||||
antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]], "CFC")) # cefaclor old WHONET4 code
|
antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]], "CFC")) # cefaclor old WHONET4 code
|
||||||
|
antibiotics[which(antibiotics$ab == "AMX"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "AMX"), "synonyms"][[1]], "Amoxy")))
|
||||||
# 'Polymixin B' (POL) and 'Polymyxin B' (PLB) both exist, so:
|
# 'Polymixin B' (POL) and 'Polymyxin B' (PLB) both exist, so:
|
||||||
antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]], "POL", "Polymixin", "Polymixin B"))
|
antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]], "POL", "Polymixin", "Polymixin B"))
|
||||||
antibiotics <- filter(antibiotics, ab != "POL")
|
antibiotics <- filter(antibiotics, ab != "POL")
|
||||||
@ -303,6 +304,10 @@ antibiotics[which(antibiotics$ab == "CPC"), "abbreviations"][[1]] <- list(c("xpm
|
|||||||
antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]], "xpm"))
|
antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]], "xpm"))
|
||||||
antibiotics[which(antibiotics$ab == "CTC"), "abbreviations"][[1]] <- list(c("xctl"))
|
antibiotics[which(antibiotics$ab == "CTC"), "abbreviations"][[1]] <- list(c("xctl"))
|
||||||
antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]], "xct"))
|
antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]], "xct"))
|
||||||
|
# High level Gentamcin and Streptomycin
|
||||||
|
antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]] <- list(c("gehl"))
|
||||||
|
antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]] <- list(c("sthl"))
|
||||||
|
|
||||||
|
|
||||||
antibiotics <- antibiotics %>% arrange(name)
|
antibiotics <- antibiotics %>% arrange(name)
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
|
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -231,11 +231,11 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="amr-0-7-1-9098" class="section level1">
|
<div id="amr-0-7-1-9100" class="section level1">
|
||||||
<h1 class="page-header">
|
<h1 class="page-header">
|
||||||
<a href="#amr-0-7-1-9098" class="anchor"></a>AMR 0.7.1.9098<small> Unreleased </small>
|
<a href="#amr-0-7-1-9100" class="anchor"></a>AMR 0.7.1.9100<small> Unreleased </small>
|
||||||
</h1>
|
</h1>
|
||||||
<p><small>Last updated: 07-Oct-2019</small></p>
|
<p><small>Last updated: 08-Oct-2019</small></p>
|
||||||
<div id="breaking" class="section level3">
|
<div id="breaking" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#breaking" class="anchor"></a>Breaking</h3>
|
<a href="#breaking" class="anchor"></a>Breaking</h3>
|
||||||
@ -370,6 +370,7 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
|
|||||||
<li>Added 80 new LIS codes for microorganisms</li>
|
<li>Added 80 new LIS codes for microorganisms</li>
|
||||||
<li>Relabeled the factor levels of <code><a href="../reference/mdro.html">mdr_tb()</a></code>
|
<li>Relabeled the factor levels of <code><a href="../reference/mdro.html">mdr_tb()</a></code>
|
||||||
</li>
|
</li>
|
||||||
|
<li>Added more MIC factor levels (<code><a href="../reference/as.mic.html">as.mic()</a></code>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="other" class="section level4">
|
<div id="other" class="section level4">
|
||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
@ -1289,7 +1290,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
|||||||
<div id="tocnav">
|
<div id="tocnav">
|
||||||
<h2>Contents</h2>
|
<h2>Contents</h2>
|
||||||
<ul class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-stacked">
|
||||||
<li><a href="#amr-0-7-1-9098">0.7.1.9098</a></li>
|
<li><a href="#amr-0-7-1-9100">0.7.1.9100</a></li>
|
||||||
<li><a href="#amr-0-7-1">0.7.1</a></li>
|
<li><a href="#amr-0-7-1">0.7.1</a></li>
|
||||||
<li><a href="#amr-0-7-0">0.7.0</a></li>
|
<li><a href="#amr-0-7-0">0.7.0</a></li>
|
||||||
<li><a href="#amr-0-6-1">0.6.1</a></li>
|
<li><a href="#amr-0-6-1">0.6.1</a></li>
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9089</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -237,8 +237,7 @@
|
|||||||
<p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code>format</code> on the result to prettify it to a publicable/printable format, see Examples.</p>
|
<p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code>format</code> on the result to prettify it to a publicable/printable format, see Examples.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre class="usage"><span class='fu'>bug_drug_combinations</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
|
<pre class="usage"><span class='fu'>bug_drug_combinations</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>FUN</span> <span class='kw'>=</span> <span class='no'>mo_shortname</span>, <span class='no'>...</span>)
|
||||||
<span class='kw'>FUN</span> <span class='kw'>=</span> <span class='no'>mo_shortname</span>, <span class='no'>...</span>)
|
|
||||||
|
|
||||||
<span class='co'># S3 method for bug_drug_combinations</span>
|
<span class='co'># S3 method for bug_drug_combinations</span>
|
||||||
<span class='fu'><a href='https://rdrr.io/r/base/format.html'>format</a></span>(<span class='no'>x</span>,
|
<span class='fu'><a href='https://rdrr.io/r/base/format.html'>format</a></span>(<span class='no'>x</span>,
|
||||||
@ -259,10 +258,6 @@
|
|||||||
<th>col_mo</th>
|
<th>col_mo</th>
|
||||||
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td>
|
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th>minimum</th>
|
|
||||||
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>FUN</th>
|
<th>FUN</th>
|
||||||
<td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname</a></code></p></td>
|
<td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname</a></code></p></td>
|
||||||
@ -279,6 +274,10 @@
|
|||||||
<th>language</th>
|
<th>language</th>
|
||||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>minimum</th>
|
||||||
|
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>combine_SI</th>
|
<th>combine_SI</th>
|
||||||
<td><p>a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter <code>combine_IR</code>, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is <code>TRUE</code>.</p></td>
|
<td><p>a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter <code>combine_IR</code>, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is <code>TRUE</code>.</p></td>
|
||||||
@ -311,6 +310,9 @@
|
|||||||
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
|
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
|
||||||
|
|
||||||
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
|
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
|
||||||
|
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||||
|
|
||||||
|
<p>The function <code>bug_drug_combinations</code> returns a <code>data.frame</code> with columns "mo", "ab", "S", "I", "R" and "total".</p>
|
||||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||||
|
|
||||||
<p>The function <code>format</code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p>
|
<p>The function <code>format</code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p>
|
||||||
@ -342,6 +344,7 @@
|
|||||||
<ul class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-stacked">
|
||||||
<li><a href="#arguments">Arguments</a></li>
|
<li><a href="#arguments">Arguments</a></li>
|
||||||
<li><a href="#source">Source</a></li>
|
<li><a href="#source">Source</a></li>
|
||||||
|
<li><a href="#value">Value</a></li>
|
||||||
<li><a href="#details">Details</a></li>
|
<li><a href="#details">Details</a></li>
|
||||||
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
|
||||||
<li><a href="#examples">Examples</a></li>
|
<li><a href="#examples">Examples</a></li>
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9096</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9098</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9097</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9100</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
\strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
\strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
||||||
}
|
}
|
||||||
\usage{
|
\usage{
|
||||||
bug_drug_combinations(x, col_mo = NULL, minimum = 30,
|
bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
|
||||||
FUN = mo_shortname, ...)
|
|
||||||
|
|
||||||
\method{format}{bug_drug_combinations}(x,
|
\method{format}{bug_drug_combinations}(x,
|
||||||
translate_ab = "name (ab, atc)", language = get_locale(),
|
translate_ab = "name (ab, atc)", language = get_locale(),
|
||||||
@ -23,8 +22,6 @@ bug_drug_combinations(x, col_mo = NULL, minimum = 30,
|
|||||||
|
|
||||||
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.}
|
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.}
|
||||||
|
|
||||||
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
|
||||||
|
|
||||||
\item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link{mo_shortname}}}
|
\item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link{mo_shortname}}}
|
||||||
|
|
||||||
\item{...}{arguments passed on to \code{FUN}}
|
\item{...}{arguments passed on to \code{FUN}}
|
||||||
@ -33,6 +30,8 @@ bug_drug_combinations(x, col_mo = NULL, minimum = 30,
|
|||||||
|
|
||||||
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||||
|
|
||||||
|
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
||||||
|
|
||||||
\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.}
|
\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.}
|
||||||
|
|
||||||
\item{combine_IR}{logical to indicate whether values R and I should be summed}
|
\item{combine_IR}{logical to indicate whether values R and I should be summed}
|
||||||
@ -48,6 +47,9 @@ bug_drug_combinations(x, col_mo = NULL, minimum = 30,
|
|||||||
\code{big.interval} decimals \emph{before} (hence \code{big}) the
|
\code{big.interval} decimals \emph{before} (hence \code{big}) the
|
||||||
decimal point.}
|
decimal point.}
|
||||||
}
|
}
|
||||||
|
\value{
|
||||||
|
The function \code{bug_drug_combinations} returns a \code{data.frame} with columns "mo", "ab", "S", "I", "R" and "total".
|
||||||
|
}
|
||||||
\description{
|
\description{
|
||||||
Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{format} on the result to prettify it to a publicable/printable format, see Examples.
|
Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{format} on the result to prettify it to a publicable/printable format, see Examples.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user