1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 22:41:52 +02:00

(v1.3.0.9002) intrinsic_resistant data set

This commit is contained in:
2020-08-14 13:36:10 +02:00
parent 7d16bec21f
commit 08d62bb5d5
111 changed files with 50487 additions and 525 deletions

16
R/mo.R
View File

@ -375,22 +375,20 @@ exec_as.mo <- function(x,
x <- data.frame(fullname_lower = tolower(x), stringsAsFactors = FALSE) %>%
left_join_MO_lookup(by = "fullname_lower") %>%
pull(property)
# x <- reference_data_to_use[data.table(fullname_lower = tolower(x)),
# on = "fullname_lower",
# ..property][[1]]
} else if (all(x %in% reference_data_to_use$fullname)) {
# we need special treatment for very prevalent full names, they are likely!
# e.g. as.mo("Staphylococcus aureus")
x <- data.frame(fullname = x, stringsAsFactors = FALSE) %>%
left_join_MO_lookup(by = "fullname") %>%
pull(property)
} else if (all(toupper(x) %in% microorganisms.codes$code)) {
# commonly used MO codes
x <- data.frame(code = toupper(x), stringsAsFactors = FALSE) %>%
left_join(microorganisms.codes, by = "code") %>%
left_join_MO_lookup(by = "mo") %>%
pull(property)
# y <- as.data.table(microorganisms.codes)[data.table(code = toupper(x)),
# on = "code", ]
#
# x <- reference_data_to_use[data.table(mo = y[["mo"]]),
# on = "mo",
# ..property][[1]]
} else if (!all(x %in% microorganisms[, property])) {