mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 14:01:55 +02:00
(v1.5.0.9039) handle first isolates for missing antibiograms
This commit is contained in:
@ -196,6 +196,10 @@ test_that("first isolates work", {
|
||||
expect_equal(sum(first_isolate(test_unknown)),
|
||||
1045)
|
||||
|
||||
# empty rsi results
|
||||
expect_equal(sum(first_isolate(example_isolates, include_untested_rsi = FALSE)),
|
||||
1287)
|
||||
|
||||
# shortcuts
|
||||
expect_identical(filter_first_isolate(example_isolates),
|
||||
subset(example_isolates, first_isolate(example_isolates)))
|
||||
|
@ -95,20 +95,20 @@ test_that("mic2rsi works", {
|
||||
mo = "B_STRPT_PNMN",
|
||||
ab = "AMP",
|
||||
guideline = "EUCAST 2020")),
|
||||
c("S", "S", "I", "I", "R"), info = pkg_env$strange)
|
||||
c("S", "S", "I", "I", "R"))
|
||||
# S. pneumoniae/amoxicillin in CLSI 2019: 2-8 ug/ml (R is 8 and > 8)
|
||||
expect_equal(as.character(
|
||||
as.rsi(x = as.mic(c(1, 2, 4, 8, 16)),
|
||||
mo = "B_STRPT_PNMN",
|
||||
ab = "AMX",
|
||||
guideline = "CLSI 2019")),
|
||||
c("S", "S", "I", "R", "R"), info = pkg_env$strange)
|
||||
c("S", "S", "I", "R", "R"))
|
||||
|
||||
# cutoffs at MIC = 8
|
||||
expect_equal(as.rsi(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020"),
|
||||
as.rsi("S"), info = pkg_env$strange)
|
||||
as.rsi("S"))
|
||||
expect_equal(as.rsi(as.mic(32), "E. coli", "ampicillin", guideline = "EUCAST 2020"),
|
||||
as.rsi("R"), info = pkg_env$strange)
|
||||
as.rsi("R"))
|
||||
|
||||
expect_true(suppressWarnings(example_isolates %>%
|
||||
mutate(amox_mic = as.mic(2)) %>%
|
||||
|
Reference in New Issue
Block a user