-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToy.R
More file actions
executable file
·20 lines (14 loc) · 855 Bytes
/
Toy.R
File metadata and controls
executable file
·20 lines (14 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(splatter)
library(scater)
params <- newSplatParams()
params <- setParams(params, update = list(nGenes = 5000))
params <- setParams(params, update = list(batchCells = c(4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000)))
params <- setParams(params, update = list(batch.facLoc = 0.5))
params <- setParams(params, update = list(batch.facScale = 2.0))
params <- setParams(params, update = list(group.prob = c(0.2, 0.2, 0.2, 0.2, 0.2)))
sim <- splatSimulate(params, verbose = FALSE, method = "groups")
sim <- normalize(sim)
# plotPCA(sim, colour_by = "Group")
write.table(x = counts(sim), file = "./data/toy/toy.csv", sep = ",")
write.table(x = sim@colData@listData[["Batch"]], file = "./data/toy/toy_batch.csv", sep = ',')
write.table(x = sim@colData@listData[["Group"]], file = "./data/toy/toy_celltype.csv", sep = ',')