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

Add lunSimulate tests and run checks

parent d04a0d15
No related branches found
No related tags found
No related merge requests found
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 0.6.13
Version: 0.6.14
Date: 2016-10-14
Author: Luke Zappia
Authors@R: as.person(c(
......
......@@ -8,7 +8,7 @@
#' @return New Params object.
#' @examples
#' params <- newSimpleParams()
#' params <- newSimpleParams(nGenes = 200, ncells = 10)
#' params <- newSimpleParams(nGenes = 200, nCells = 10)
#'
#' @name newParams
NULL
......
......@@ -58,9 +58,9 @@ lunSimulate <- function(params = newLunParams(), verbose = TRUE, ...) {
mean.rate <- getParam(params, "mean.rate")
count.disp <- getParam(params, "count.disp")
de.nGenes <- getParam(params, "de.nGenes")
de.upProp <- getParams(params, "de.upProp")
de.upFC <- getParams(params, "de.upFC")
de.downFC <- getParams(params, "de.downFC")
de.upProp <- getParam(params, "de.upProp")
de.upFC <- getParam(params, "de.upFC")
de.downFC <- getParam(params, "de.downFC")
if (verbose) {message("Simulating means...")}
gene.means <- rgamma(nGenes, shape = mean.shape, rate = mean.rate)
......@@ -80,8 +80,8 @@ lunSimulate <- function(params = newLunParams(), verbose = TRUE, ...) {
cell.facs.group <- 2 ^ rnorm(groupCells[idx], sd = 0.5)
cell.facs[[idx]] <- cell.facs.group
chosen <- nGenes.de[idx] * (idx - 1) + seq_len(nGenes.de[idx])
is.up <- seq_len(nGenes.de[idx] * de.upProp[idx])
chosen <- de.nGenes[idx] * (idx - 1) + seq_len(de.nGenes[idx])
is.up <- seq_len(de.nGenes[idx] * de.upProp[idx])
de.up <- chosen[is.up]
de.down <- chosen[-is.up]
......
......@@ -25,7 +25,7 @@ Params subtypes.
}
\examples{
params <- newSimpleParams()
params <- newSimpleParams(nGenes = 200, ncells = 10)
params <- newSimpleParams(nGenes = 200, nCells = 10)
}
context("Lun simulation")
test_that("Lun simulation output is valid", {
expect_true(validObject(lunSimulate()))
expect_true(validObject(lunSimulate(groupCells = c(10, 10))))
})
\ No newline at end of file
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