mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 01:30:54 +01:00
(v3.1.0.9013) Add species groups and complexes to the intrinsic_resistant data set for every antimicrobial to which all their species are intrinsically resistant (fixes #338)
This commit is contained in:
1 parent
aab0fcc479
commit
7f3c75ece7
14 files changed
+104
-4
No files matched your search
@@ -547,6 +547,25 @@ test_that("intrinsic_resistant: synonyms have exactly the resistances of their c
|
||||
expect_true(length(absent) == 0, info = paste("Current names missing while their synonym is listed:", describe_mo(absent)))
|
||||
})
|
||||
|
||||
test_that("intrinsic_resistant: species groups have the resistances shared by all their species", {
|
||||
skip_on_cran()
|
||||
ir_keys <- paste(intrinsic_resistant$mo, intrinsic_resistant$ab)
|
||||
groups <- microorganisms.groups[which(microorganisms$rank[match(microorganisms.groups$mo, microorganisms$mo)] == "species"), , drop = FALSE]
|
||||
groups_species <- split(as.character(groups$mo), as.character(groups$mo_group))
|
||||
missing <- unlist(Map(function(group, species) {
|
||||
abx <- unique(as.character(intrinsic_resistant$ab[intrinsic_resistant$mo %in% species]))
|
||||
abx <- abx[vapply(abx, function(ab) all(paste(species, ab) %in% ir_keys), logical(1))]
|
||||
if (length(abx) == 0) {
|
||||
return(NULL)
|
||||
}
|
||||
abx <- abx[!paste(group, abx) %in% ir_keys]
|
||||
if (length(abx) > 0) paste0(group, " (", paste(abx, collapse = ", "), ")")
|
||||
}, names(groups_species), groups_species), use.names = FALSE)
|
||||
expect_true(length(missing) == 0, info = paste("Species groups missing resistances shared by all their species:", paste(missing, collapse = "; ")))
|
||||
# Enterobacter cloacae complex (#338)
|
||||
expect_true(all(mo_is_intrinsic_resistant(rep("B_ENTRBC_CLOC-C", 2), ab = c("AMX", "AMC"))))
|
||||
})
|
||||
|
||||
test_that("interpretive rules name organisms that exist", {
|
||||
skip_on_cran()
|
||||
r <- AMR:::INTERPRETIVE_RULES_DF
|
||||
|
||||
Reference in new issue
Block a user