simulateDataset | R Documentation |
Simulate an unrealistic spatial omics dataset.
simulateDataset(n_cells = 300, n_genes = 30, n_rings = 3, rate = 10)
n_cells |
An integer scalar specifying the approximate number of cells. |
n_genes |
An integer scalar specifying the number of genes. |
n_rings |
An integer scalar specifying the number of spatial rings. |
rate |
A numeric scalar specifying the Poisson rate parameter for simulating counts. |
This function generates an unrealistic spatial omics dataset based on a
user-specified number of cells and genes. The number of clusters is defined
by n_rings
, while counts follow a Poisson distribution with a
user-specified rate rate
. The simulation is set up such that the
number of cells in each cluster is uniformly distributed; as such, the final
number of cells is approximately equal to the user-specified number of cells.
A SpatialExperiment object.
set.seed(2023)
rings <- simulateDataset(n_cells = 5e3, n_genes = 50, n_rings = 8)
rings
table(rings$cluster)
df <- cbind.data.frame(
SummarizedExperiment::colData(rings),
SpatialExperiment::spatialCoords(rings))
library(ggplot2)
ggplot(df, aes(x=x, y=y, col=cluster)) + geom_point() + theme_classic()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.