SimSpace: a comprehensive in-silico spatial omics data simulation framework
Project description
SimSpace
SimSpace is a Python framework for simulating spatial omics data with realistic cellular distributions and tissue organization. Designed for benchmarking spatial analysis methods, SimSpace enables generation of synthetic datasets that preserve spatial autocorrelation, cell-cell interactions, and spatial proximities using a Markov Random Field (MRF) model.
📦 Installation
To install the latest version of SimSpace, we recommend using conda to setup the environment:
git clone https://github.com/TianxiaoNYU/simspace.git
- Create a conda environment for simspace
cd simspace
conda env create -f environment.yml
conda activate simspace
- Install simspace from PyPi
pip install simspace
🧬 Optional: Setting Up the R Environment for Omics Simulation
SimSpace supports external omics profile simulation via R-based tools, including scDesign3, SRTsim, and splatter. These tools are optional but recommended if you want to simulate gene expression profiles in addition to spatial patterns.
To enable this functionality, please install the required R packages manually in your system R environment:
Steps:
- Ensure that R (version 4.4 or compatible) is installed on your system. You can download it from CRAN.
- Open an R session and install the required packages:
if (!require("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("SONGDONGYUAN1994/scDesign3")
devtools::install_github("xzhoulab/SRTsim")
if (!require("devtools", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("splatter"))
Once installed, SimSpace will automatically use these tools when relevant R-based simulations are requested.
📘 Tutorials
To get started with SimSpace, we provide detailed tutorials covering both reference-based and reference-free simulation modes.
- Step-by-step tutorials can be found in
tutorials.md - Executable notebook examples are located in the
examples/directory
These resources walk through how to configure and run simulations as well as visualize outputs.
🚀 Quick Start
Here’s a basic example to simulate a 2D tissue with 3 spatial niches and 8 cell types:
from simspace import util, spatial
# Define simulation parameters
params = util.generate_random_parameters(
n_group=3,
n_state=8,
seed=42)
# Run simulation
sim = util.sim_from_params(
params,
shape=(50, 50), # shape of the simulation grid
custom_neighbor=spatial.generate_offsets(3, 'manhattan'),
seed=42
)
# Visualize
sim.plot()
🙋♀️ About
Developed by Tianxiao Zhao at NYU Grossman School of Medicine. Should you have any questions, please contact Tianxiao Zhao at Tianxiao.Zhao@nyulangone.org
🔗 References
If you use SimSpace in your work, please cite the work on BioRxiv:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simspace-0.2.2.tar.gz.
File metadata
- Download URL: simspace-0.2.2.tar.gz
- Upload date:
- Size: 168.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
120592122616c54c2fd7c584bfc78ff89b2e3825b5cc82fc740c4875ec6b7d5e
|
|
| MD5 |
12ac6d93315b9fb7d0b0e929d93fe8bb
|
|
| BLAKE2b-256 |
48751049afa0d821f4726f9019aca937e45251a1002225df71925ececaceed0e
|
File details
Details for the file simspace-0.2.2-py3-none-any.whl.
File metadata
- Download URL: simspace-0.2.2-py3-none-any.whl
- Upload date:
- Size: 172.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc6991cd044f1eaa8302909cfdf8ea4c78736db492c85aa9a0e2294fe9a33020
|
|
| MD5 |
20abe653054d6f4ee8a360ee5392dbf1
|
|
| BLAKE2b-256 |
8f026b4383b3a85b77451e98c2f959ec01995ddbb15f8127a7a3d75b53c491bc
|