-
Luke Zappia authored
* master: (183 commits) Run checks Add batch effects to vignette Update splatEstimate to set batchCells Add batch effects to splatSimulate Update SplatParams Bump version number Update citation Fix error handling when fitting means Fix comparison plots Bioconductor 3.5 release bump x.y.z versions to odd y after creation of 3_5 branch Creating branch for BioC 3.5 release bump x.y.z versions to even y prior to creation of 3_5 branch Update NEWS and DESCRIPTION Version 0.99.15 Remove dropout.present estimation Add limits to zeros plots Adjust default splat DE fac params Add BPPARAM to scDDSimulate Add summariseDiff function ... From: Luke Zappia <lazappi@users.noreply.github.com> git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/splatter@131029 bc3139a8-67e5-0310-9ffc-ced21a209358
Luke Zappia authored* master: (183 commits) Run checks Add batch effects to vignette Update splatEstimate to set batchCells Add batch effects to splatSimulate Update SplatParams Bump version number Update citation Fix error handling when fitting means Fix comparison plots Bioconductor 3.5 release bump x.y.z versions to odd y after creation of 3_5 branch Creating branch for BioC 3.5 release bump x.y.z versions to even y prior to creation of 3_5 branch Update NEWS and DESCRIPTION Version 0.99.15 Remove dropout.present estimation Add limits to zeros plots Adjust default splat DE fac params Add BPPARAM to scDDSimulate Add summariseDiff function ... From: Luke Zappia <lazappi@users.noreply.github.com> git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/splatter@131029 bc3139a8-67e5-0310-9ffc-ced21a209358
test-SplatParams.R 1.32 KiB
context("SplatParams")
test_that("nBatches checks work", {
params <- newSplatParams()
expect_error(setParam(params, "nCells", 1),
"nCells cannot be set directly, set batchCells instead")
expect_error(setParam(params, "nBatches", 1),
"nBatches cannot be set directly, set batchCells instead")
})
test_that("nGroups checks work", {
params <- newSplatParams()
expect_error(setParam(params, "nGroups", 1),
"nGroups cannot be set directly, set group.prob instead")
})
test_that("path.from checks work", {
params <- newSplatParams()
params <- setParams(params, group.prob = c(0.5, 0.5))
params <- setParamUnchecked(params, "path.from", c(0, 1))
expect_silent(validObject(params))
params <- setParamUnchecked(params, "path.from", c(0, 3))
expect_error(validObject(params),
paste('invalid class "SplatParams" object: path.from:',
"All elements must be <= 2"))
params <- setParamUnchecked(params, "path.from", c(1, 0))
expect_error(validObject(params), "path cannot begin at itself")
params <- newSplatParams()
params <- setParams(params, group.prob = c(0.3, 0.3, 0.4))
params <- setParamUnchecked(params, "path.from", c(2, 1, 1))
expect_error(validObject(params), "origin must be specified in path.from")
})