Spatial Transcriptomics Simulator
Project description
FEAST | From features to slice: parameter-cloud modeling of spatial transcriptomics for simulation and 3D interpolatory augmentation
FEAST (Feature-space-based modeling of Spatial Transcriptomics) is a comprehensive computational framework for simulating and interpolating spatial transcriptomics (ST) data. By modeling gene expression through a "parameter cloud" - a latent manifold capturing mean, variance, and sparsity - FEAST generates high-fidelity synthetic ST slices with controllable biological and technical variations. This work has been submitted to top conference in computational biology RECOMB 2026, and will release preprint soon.
Key Features
- High-Fidelity Simulation: Generate realistic ST data that preserves gene-level statistics, spatial patterns, and biological heterogeneity
- Controllable Alterations: Systematically modify gene expression (mean, variance, sparsity) for robust benchmarking
- Multiple ST Technologies: Support for Visium, MERFISH, Stereo-seq, Slide-seq, Xenium, and OpenST
- Alignment Benchmarks: Create paired datasets with controlled geometric transformations (rotation, warping) for testing alignment algorithms
- Deconvolution Ground Truth: Generate multi-resolution data with known cell-type compositions
- 3D Interpolation: Reconstruct missing tissue slices using optimal transport in parameter space
Installation
From PyPI (Recommended)
pip install FEAST-py
Directly From Source
git clone https://github.com/maiziezhoulab/FEAST
cd FEAST
pip install -e .
Dependencies
- Python >= 3.8
- scanpy
- anndata
- numpy
- scipy
- pandas
- scikit-learn
- pyvinecopulib
- POT (Python Optimal Transport)
- tps (Thin Plate Spline)
Quick Start
Single Slice Simulation
from FEAST import simulator
import scanpy as sc
# Load your reference data
adata = sc.read_h5ad("your_spatial_data.h5ad")
# Simple simulation with default parameters
simulated_adata = simulator.simulate_single_slice(
adata=adata,
sigma=1.0, # Spatial smoothness parameter
verbose=True
)
# Simulation with expression alteration
from FEAST.modeling.marginal_alteration import AlterationConfig
alteration_config = AlterationConfig.mean_only(fold_change=2.0)
altered_adata = simulator.simulate_single_slice(
adata=adata,
alteration_config=alteration_config,
sigma=1.0
)
Alignment Simulation
from FEAST.alignment.alignment_simulator import simulate_alignment_rotation
# Generate paired datasets with rotation for alignment benchmarking
original, rotated = simulate_alignment_rotation(
adata=adata,
rotation_angle=30.0, # degrees
data_type='imaging', # or 'sequencing'
sigma=0 # Perfect pattern preservation
)
Deconvolution Simulation
from FEAST.deconvolution.generate_deconvolution import create_deconvolution_benchmark_data
# Generate multi-resolution data with known cell-type compositions
deconv_adata = create_deconvolution_benchmark_data(
adata=single_cell_adata,
downsampling_factor=0.25,
grid_type='hexagonal',
cell_type_key='cell_type'
)
3D Slice Interpolation
from FEAST.interpolation.interpolation_pipeline import interpolate_slices
# Interpolate missing slices between consecutive sections
interpolated_slices = interpolate_slices(
adata_list=[slice_k, slice_k_plus_1],
n_interpolate=3, # Number of intermediate slices
alpha=0.01,
verbose=True
)
Tutorials
Try FEAST with notebook! Comprehensive Jupyter notebooks are provided in the repository:
-
example_single_sim.ipynb: Basic single-slice simulation for both sequencing-based and imaging-based ST data
-
example_interpolation.ipynb: Interpolation augumentation for MERFISH slices
Architecture
FEAST/
├── FEAST_core/ # Core simulation engine
│ ├── simulator.py # Main simulation logic (G-SRBA algorithm)
│ ├── parameter_cloud.py # Parameter cloud modeling
│ └── APIs.py # Unified FEAST API
├── alignment/ # Alignment simulation
│ ├── alignment_simulator.py
│ └── spatial_align_alter.py # Rotation & warping transformations
├── deconvolution/ # Deconvolution simulation
│ ├── deconvolution_simulator.py
│ └── generate_deconvolution.py
├── interpolation/ # 3D interpolation
│ ├── interpolation_pipeline.py
│ ├── parameter_interpolation.py
│ └── coordinate_generation.py
└── modeling/ # Statistical models
├── StudentT_mixture_model.py
├── Beta_mixture_model.py
└── marginal_alteration.py
Reproduction Scripts
The reproduction/ folder contains scripts to reproduce all benchmarking results from the paper. Each subdirectory corresponds to a specific analysis:
reproduction/
├── 1_Simulator_benchmark/ # Figure 2: Simulation fidelity evaluation
├── 2_Clustering_simulation/ # Figure 3: Clustering robustness testing
├── 3_Alignment_simulation/ # Figure 4: Alignment algorithm benchmarking
├── 4_Deconvolution_simulation/# Supp Fig: Deconvolution ground truth generation
└── 5_Interpolation_simulation/# Figure 5: 3D slice interpolation evaluation
Dataset Organization
All scripts expect datasets in a data/ directory with the following naming convention:
data/
├── DLPFC_{sample_id}.h5ad # Human DLPFC sections
├── MERFISH_{slice_id}.h5ad # Mouse brain MERFISH slices
├── OpenST_{slice_id}.h5ad # Lymph node OpenST slices
├── Stereoseq_{sample_id}.h5ad # Mouse embryo Stereo-seq slices
├── Slideseq_{sample_id}.h5ad # Slide-seqV2 slices
└── Xenium_{sample_id}.h5ad # Xenium tissue slices
Required Datasets
| Dataset | Technology | Source | Usage | Files |
|---|---|---|---|---|
| DLPFC | 10X Visium | spatialLIBD | Simulation, Clustering, Alignment | DLPFC_151670.h5adDLPFC_151676.h5adDLPFC_151675.h5ad |
| MERFISH | MERFISH | Allen Brain Atlas | Simulation, Deconvolution, Interpolation | MERFISH_006.h5adMERFISH_007.h5adMERFISH_005-009.h5ad (5 files) |
| OpenST | OpenST | GEO: GSE251926 | Simulation | OpenST_005.h5adOpenST_006.h5ad |
| Stereo-seq | Stereo-seq | MOSTA | Simulation | Stereoseq_E14_5_E2S2.h5ad |
| Slide-seq | Slide-seqV2 | SODB | Simulation | Slideseq_001.h5ad |
| Xenium | Xenium | 10X Genomics | Simulation | Xenium_LymphNode.h5ad |
Note: FEAST is actively maintained. If you have any question, please let me know!
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 feast_py-1.0.1.tar.gz.
File metadata
- Download URL: feast_py-1.0.1.tar.gz
- Upload date:
- Size: 66.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ddd9d613b392c2e03fe10ce5b18fdacb97d4c0f5bc3442aef9434d9186bccd0
|
|
| MD5 |
a26f1341f58b931ca4babe22c77a3769
|
|
| BLAKE2b-256 |
fc6cee9e321153f78d21e4b7acb62b682c6fed63fdbaaa2e7c9a53b3436dac6a
|
Provenance
The following attestation bundles were made for feast_py-1.0.1.tar.gz:
Publisher:
publish.yml on maiziezhoulab/FEAST
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feast_py-1.0.1.tar.gz -
Subject digest:
1ddd9d613b392c2e03fe10ce5b18fdacb97d4c0f5bc3442aef9434d9186bccd0 - Sigstore transparency entry: 716453285
- Sigstore integration time:
-
Permalink:
maiziezhoulab/FEAST@f66055901f6d412fe8a4460891784b863317be09 -
Branch / Tag:
refs/tags/v1.0.1b - Owner: https://github.com/maiziezhoulab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f66055901f6d412fe8a4460891784b863317be09 -
Trigger Event:
release
-
Statement type:
File details
Details for the file feast_py-1.0.1-py3-none-any.whl.
File metadata
- Download URL: feast_py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 72.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f244f74df0158b916aeb841d9c1f20e11c2ac6bf4f1e1562b1f782f77467534
|
|
| MD5 |
138d947af5ddd2fba3b2ffd676e06542
|
|
| BLAKE2b-256 |
db291fe84f4cdcbb35f3bd1dd598b8069d9dc14fedd9b1261d1be2ac60d33fdb
|
Provenance
The following attestation bundles were made for feast_py-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on maiziezhoulab/FEAST
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
feast_py-1.0.1-py3-none-any.whl -
Subject digest:
3f244f74df0158b916aeb841d9c1f20e11c2ac6bf4f1e1562b1f782f77467534 - Sigstore transparency entry: 716453288
- Sigstore integration time:
-
Permalink:
maiziezhoulab/FEAST@f66055901f6d412fe8a4460891784b863317be09 -
Branch / Tag:
refs/tags/v1.0.1b - Owner: https://github.com/maiziezhoulab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f66055901f6d412fe8a4460891784b863317be09 -
Trigger Event:
release
-
Statement type: