Skip to content

Commit

Permalink
make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisorwa committed Aug 26, 2024
1 parent 78131c1 commit 8353600
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions R/as_noise_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ as_noise_params <- function(data, antigen_isos = NULL) {
if (!all(
is.element(antigen_isos, noise_data$antigen_iso)
)) {

missing_antigen <- setdiff(antigen_isos,
unique(noise_data$antigen_iso))
cli::cli_abort(
class = "missing_antigen",
message = c(
"x" = "Can't convert {.envvar noise_data} to {.cls noise_params}.",
"i" = ""
"x" = "Can't convert {.var data} to {.cls noise_params}.",
"i" = "The antigen type{?s} {missing_antigen} {?is/are} missing in {.var data}"
)
)
}
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-as_noise_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ test_that("`as_noise_params()` produces error when wrong antigen_iso is provided

expect_error(object = "https://osf.io/download//hqy4v/" %>% # noise data
readr::read_rds() %>%
as_noise_params(antigen_iso = "HlyE_IgB"))
as_noise_params(antigen_iso = "HlyE_IgB"),
class = 'missing_antigen')
})

0 comments on commit 8353600

Please sign in to comment.