mirror of
https://github.com/msberends/AMR.git
synced 2025-07-11 17:02:00 +02:00
(v2.1.1.9186) replace antibiotics
with antimicrobials
!
This commit is contained in:
@ -27,33 +27,36 @@
|
||||
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
expect_identical(
|
||||
as.mo("Enterobacter asburiae/cloacae"),
|
||||
as.mo("Enterobacter asburiae")
|
||||
)
|
||||
|
||||
suppressMessages(
|
||||
add_custom_microorganisms(
|
||||
data.frame(
|
||||
mo = "ENT_ASB_CLO",
|
||||
genus = "Enterobacter",
|
||||
species = "asburiae/cloacae"
|
||||
test_that("custom mo works", {
|
||||
expect_identical(
|
||||
as.mo("Enterobacter asburiae/cloacae"),
|
||||
as.mo("Enterobacter asburiae")
|
||||
)
|
||||
|
||||
suppressMessages(
|
||||
add_custom_microorganisms(
|
||||
data.frame(
|
||||
mo = "ENT_ASB_CLO",
|
||||
genus = "Enterobacter",
|
||||
species = "asburiae/cloacae"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
expect_identical(as.character(as.mo("ENT_ASB_CLO")), "ENT_ASB_CLO")
|
||||
expect_identical(mo_name("ENT_ASB_CLO"), "Enterobacter asburiae/cloacae")
|
||||
expect_identical(mo_gramstain("ENT_ASB_CLO", language = NULL), "Gram-negative")
|
||||
expect_identical(as.character(as.mo("ENT_ASB_CLO")), "ENT_ASB_CLO")
|
||||
expect_identical(mo_name("ENT_ASB_CLO"), "Enterobacter asburiae/cloacae")
|
||||
expect_identical(mo_gramstain("ENT_ASB_CLO", language = NULL), "Gram-negative")
|
||||
|
||||
if (getRversion() >= "3.3.0") {
|
||||
# until R 3.2, abbreviate() used a completely different algorithm, making these tests unreproducible
|
||||
expect_identical(
|
||||
paste("B", AMR:::abbreviate_mo("Klebsiella"), AMR:::abbreviate_mo("pneumoniae", 4), sep = "_"),
|
||||
as.character(as.mo("Klebsiella pneumoniae"))
|
||||
)
|
||||
expect_identical(
|
||||
paste("B", AMR:::abbreviate_mo("Aerococcus"), AMR:::abbreviate_mo("urinae", 4), sep = "_"),
|
||||
as.character(as.mo("Aerococcus urinae"))
|
||||
)
|
||||
}
|
||||
if (getRversion() >= "3.3.0") {
|
||||
# until R 3.2, abbreviate() used a completely different algorithm, making these tests unreproducible
|
||||
expect_identical(
|
||||
paste("B", AMR:::abbreviate_mo("Klebsiella"), AMR:::abbreviate_mo("pneumoniae", 4), sep = "_"),
|
||||
as.character(as.mo("Klebsiella pneumoniae"))
|
||||
)
|
||||
expect_identical(
|
||||
paste("B", AMR:::abbreviate_mo("Aerococcus"), AMR:::abbreviate_mo("urinae", 4), sep = "_"),
|
||||
as.character(as.mo("Aerococcus urinae"))
|
||||
)
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user