Skip to content
Snippets Groups Projects
Commit eb6819eb authored by Jeffrey Pullin's avatar Jeffrey Pullin
Browse files

Add initial draft of simulation code

parent 329fa571
No related branches found
No related tags found
No related merge requests found
# Need to use real data to estimate parameters.
# de.prob = 0.1 is the default.
params <- newSplatParams(group.prob = rep(0.2, 5))
sim <- splatSimulate(params, method = "groups")
sim
extract_de_inds <- function(sce) {
stopifnot(is(sce, "SingleCellExperiment"))
n_groups <- length(unique(colData(sce)$Group))
col_names <- paste0("DEFacGroup", 1:n_groups)
data <- rowData(sce)[, col_names]
out <- lapply(data, function(x) which(x != 1))
names(out) <- paste0("group_", 1:n_groups)
out
}
out <- extract_de_inds(sim)
str(out)
clusters <- quickCluster(sim)
sim <- computeSumFactors(sim, clusters = clusters)
sim <- logNormCounts(sim)
scran_markers <- findMarkers(sim)
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