Skip to main content

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 reference-based spatial layouts 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 omics profile simulation via R-based tools including scDesign3, SRTsim, and splatter. You can either install these packages manually or use the renv package to recreate the exact R environment used by SimSpace.

Steps:

  1. Ensure that R (version 4.4 or compatible) is installed on your system.
  2. Navigate to the R project folder and restore the environment:
cd simspace/R
Rscript -e 'install.packages("renv"); renv::restore()'

This will install all required R dependencies in a reproducible, isolated environment.

🚀 Quick Start

Here’s a basic example to simulate a 2D tissue with 2 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),
    num_iteration=4, 
    n_iter=6, 
    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:

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.2.0.tar.gz (27.5 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.2.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simspace-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dc752e54b4e1b1c7961743025ef942d8d1b49dfbdca7e1852c2b0d1f98208601
MD5 ffdf6f44b389212abeb19fab512483d0
BLAKE2b-256 5f35ca637adb0d93de8e0dd48a072273e3aef333ea6e7af43f2502611366275e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for simspace-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2195076fafa289591ba1f358954036ee14ec86d40e905145caa7be09be9926c
MD5 6aefb4c5a72d4a312bce93eca067353b
BLAKE2b-256 424b1d781aa6c2c3635b3fa6a29a14f1f848c3e5570173204891ce0fd9cb9aff

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