The counts are simulated from a poisson distribution with stats::rpois()
.
Use set.seed()
if you want the results to be reproducible.
make_test_sce(n_cell = 100, n_gene = 100, n_cellType = 4, n_donor = 2)
A
SingleCellExperiment
object with randomly generated counts and colData()
.
## Create an example sce using default values.
set.seed(20240823)
test <- make_test_sce()
## Let's check the number of cells per cell type from each donor
addmargins(table(test$cellType, test$donor))
#>
#> D1 D2 Sum
#> Cell1 9 13 22
#> Cell2 12 12 24
#> Cell3 19 16 35
#> Cell4 8 11 19
#> Sum 48 52 100