mirror of
https://github.com/msberends/AMR.git
synced 2025-07-12 05:42:18 +02:00
new EUCAST rules algorithm
This commit is contained in:
@ -16,13 +16,22 @@
|
||||
# This R package was created for academic research and was publicly #
|
||||
# released in the hope that it will be useful, but it comes WITHOUT #
|
||||
# ANY WARRANTY OR LIABILITY. #
|
||||
# Visit our website for more info: https://msberends.gitab.io/AMR. #
|
||||
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
context("eucast_rules.R")
|
||||
|
||||
test_that("EUCAST rules work", {
|
||||
|
||||
# thoroughly check input table
|
||||
expect_true(file.exists(EUCAST_RULES_FILE_LOCATION))
|
||||
eucast_input_file <- eucast_rules_file()
|
||||
expect_equal(colnames(eucast_input_file),
|
||||
c("if_mo_property", "like_is_one_of", "this_value",
|
||||
"and_these_antibiotics", "have_these_values",
|
||||
"then_change_these_antibiotics", "to_value",
|
||||
"reference.rule", "reference.rule_group"))
|
||||
|
||||
expect_error(suppressWarnings(eucast_rules(septic_patients, col_mo = "Non-existing")))
|
||||
|
||||
expect_identical(colnames(septic_patients),
|
||||
@ -40,7 +49,6 @@ test_that("EUCAST rules work", {
|
||||
stringsAsFactors = FALSE)
|
||||
expect_identical(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b)
|
||||
expect_identical(suppressWarnings(eucast_rules(a, "mo", info = TRUE)), b)
|
||||
expect_identical(suppressWarnings(interpretive_reading(a, "mo", info = TRUE)), b)
|
||||
|
||||
a <- data.frame(mo = c("Staphylococcus aureus",
|
||||
"Streptococcus group A"),
|
||||
|
Reference in New Issue
Block a user