Skip to content
Snippets Groups Projects
Commit d2f73c1b authored by Luke Zappia's avatar Luke Zappia
Browse files

Add dropout.type tests

parent d09b2635
No related branches found
No related tags found
No related merge requests found
......@@ -31,3 +31,13 @@ test_that("path.from checks work", {
pp <- setParamUnchecked(pp, "path.from", c(2, 1, 1))
expect_error(validObject(pp), "origin must be specified in path.from")
})
test_that("dropout.type checks work", {
expect_error(setParam(params, "dropout.type", "cell"),
"dropout.type cannot be set to 'cell'")
pp <- setParams(params, dropout.mid = rep(1, 100),
dropout.shape = rep(1, 100))
expect_silent(setParam(pp, "dropout.type", "cell"))
expect_error(setParam(params, "dropout.type", "a"),
"dropout.type must be one of: ")
})
context("Splatter simulations")
context("Splat simulations")
test.params <- newSplatParams(nGenes = 100, batchCells = c(5, 5),
group.prob = c(0.5, 0.5), lib.scale = 0)
test_that("splatSimulate output is valid", {
expect_true(validObject(splatSimulate(test.params, method = "single",
dropout.present = TRUE)))
expect_true(validObject(splatSimulate(test.params, method = "single")))
expect_true(validObject(splatSimulate(test.params, method = "groups")))
expect_true(validObject(splatSimulate(test.params, method = "paths",
path.from = c(0, 1))))
......@@ -23,3 +22,10 @@ test_that("infinite bcv.df is detected", {
expect_warning(splatSimulate(test.params, bcv.df = Inf),
"'bcv.df' is infinite. This parameter will be ignored.")
})
test_that("dropout.type checks work", {
pp <- setParams(test.params, dropout.type = "experiment")
expect_true(validObject(splatSimulate(pp, method = "single")))
pp <- setParams(pp, dropout.mid = 1:2)
expect_error(splatSimulate(pp), "aren't length 1")
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment