1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 01:22:25 +02:00

Fixes for Salmonella

This commit is contained in:
2022-12-17 14:31:33 +01:00
parent 5f3a7694aa
commit 23fe427cbc
42 changed files with 375 additions and 445 deletions

View File

@ -127,8 +127,8 @@ expect_identical(as.character(as.mo(" ")), NA_character_)
expect_warning(as.mo("ab"))
expect_equal(
suppressWarnings(as.character(as.mo(c("Qq species", "", "CRSM", "K. pneu rhino", "esco")))),
c("UNKNOWN", NA_character_, "B_STNTR_MLTP", "B_KLBSL_PNMN_RHNS", "B_ESCHR_COLI")
suppressWarnings(as.character(as.mo(c("Qq species", "", "MRSA", "K. pneu rhino", "esco")))),
c("UNKNOWN", NA_character_, "B_STPHY_AURS", "B_KLBSL_PNMN_RHNS", "B_ESCHR_COLI")
)
# check for Becker classification

View File

@ -68,6 +68,7 @@ current_grampos_classes <- c(
"Erysipelotrichia",
"Ktedonobacteria",
"Limnochordia",
"Limnocylindria",
"Mollicutes",
"Negativicutes",
"Nitriliruptoria",
@ -122,9 +123,9 @@ for (l in AMR:::LANGUAGES_SUPPORTED[-1]) {
# test languages
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
dutch <- suppressWarnings(mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]")], language = "nl", keep_synonyms = TRUE)) # should be transformable to English again
dutch <- suppressWarnings(mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")], language = "nl", keep_synonyms = TRUE)) # should be transformable to English again
expect_identical(suppressWarnings(mo_name(dutch, language = NULL, keep_synonyms = TRUE)),
microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]")]) # gigantic test - will run ALL names
microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")]) # gigantic test - will run ALL names
# manual property function
expect_error(mo_property("Escherichia coli", property = c("genus", "fullname")))