datasets.toy_spide

datasets.toy_spide()

A small synthetic spatial data set for spiDE examples (R toySpiDE).

A seeded toy data set of 20 genes across 2,400 cells from 16 patients (eight Responders, eight Non-responders; one sample of 150 cells each) with three cell types (A, B, C) laid out on a 500 x 500 field. Cell type B is concentrated in the right of the field, and a neighbourhood-dependent signal is planted: gene G1 is up-regulated in the index cell type A, in Responders, in proportion to the local density of the niche cell type B.

Returns

Name Type Description
anndata.AnnData Cells x genes counts in X and layers["counts"], obs columns sample_id, condition, x, y, cell_type, Age, cell_id, Area, nCount and obsm["spatial"]. It is R’s own object (generated by data-raw/make_toySpiDE.R with .toySPE(n_samples = 16, n_per = 150, n_genes = 20, seed = 7)), not a simulate_toy draw. Text columns are plain strings.

See Also

simulate_toy : Simulate a data set of any size with the same planted effect.

Examples

from spidepy.datasets import toy_spide
adata = toy_spide()
adata.shape
(2400, 20)
sorted(adata.obs["cell_type"].unique())
['A', 'B', 'C']
adata.obs["sample_id"].nunique()
16