1
0
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:
2019-04-05 18:47:39 +02:00
parent 56d4b4719f
commit fbc9191b13
115 changed files with 1340 additions and 2174 deletions

View File

@ -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"),