Skip to main content

SimSpace: a comprehensive in-silico spatial omics data simulation framework

Project description

SimSpace

Docs PyPI

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.

SimSpace Workflow

For full figure reproduction (all analyses and scripts) for the SimSpace manuscript, see: https://github.com/TianxiaoNYU/simspace-reproducibility

📦 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:

  1. Ensure that R (version 4.4 or compatible) is installed on your system. You can download it from CRAN.
  2. 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.

📖 Documentation

Full documentation for SimSpace is available at:

➡️ simspace.readthedocs.io

The documentation includes:

  • Installation instructions (Python + optional R setup)
  • Tutorials (reference-free & reference-based simulation)
  • API reference for all modules and functions

📘 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 notebooks are located in the tutorials/ 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()

# Check and save the simulated spatial data
sim.meta.head()
# sim.meta.to_csv('simspace.csv')

🙋‍♀️ 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: Zhao T, Zhang K, Hollenberg M, Zhou W, Fenyo D. SimSpace: a comprehensive in-silico spatial omics data simulation framework. bioRxiv. 2025:2025.07.18.665587.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simspace-0.3.2.tar.gz (171.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simspace-0.3.2-py3-none-any.whl (175.4 kB view details)

Uploaded Python 3

File details

Details for the file simspace-0.3.2.tar.gz.

File metadata

  • Download URL: simspace-0.3.2.tar.gz
  • Upload date:
  • Size: 171.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for simspace-0.3.2.tar.gz
Algorithm Hash digest
SHA256 310779a71a84f4df3641fc3e89b8b4a6a1a50a027fa39cf68288df9c303f968d
MD5 5fe73bcfa7c2f0e96fc985bbeac8657d
BLAKE2b-256 a505314c7b37b701cd6811e7a4f20c245c9636f07f511c231203bdd7d22c7133

See more details on using hashes here.

File details

Details for the file simspace-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: simspace-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 175.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for simspace-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 876b1bfb4bb04e52f9f0169313a53f2d21efc3ccc5c21a61beb72ad5b808896f
MD5 05e788cc9c4e55c4447c6640255739e1
BLAKE2b-256 332955f4891b640fe0c66818fa4db5ade96bd917179c6ae570e754e4156d3c98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page