Spatially informed and biologically interpretable analysis of cellular reprogramming
Installation · Paper · Figure notebooks · Plotting suite · Benchmarks
Spike enables spatially informed and biologically interpretable analysis of cellular reprogramming
Yingying Yu, Shiying Li, Zhiwen Wang, Wan Nie and Shuaicheng Li
Department of Computer Science, City University of Hong Kong
Spike connects counterfactual prediction of source-to-target expression changes with prior-guided interpretation of spatial cell–cell communication and downstream regulatory cascades across spot-level 10x Visium, single-cell MERFISH and subcellular 10x Xenium spatial transcriptomics. It models unpaired spatial transcriptomes using a conditional residual graph-attention predictor: source expression is combined with a training-population mean shift and a learned residual informed by active directed ligand–receptor edges across spatial neighbors. The model does not require cell-to-cell pairing or pseudotime.
Across seven paired 10x Visium datasets, ground-truth microenvironment-gated counterfactual benchmarks, cross-individual Visium/MERFISH/Xenium cohorts, and a 16-mouse anti-PD-1 MC38 tumor cohort, Spike resolves localized transcriptional remodeling and prioritizes candidate receptor–transcription factor–target cascades for experimental testing.
The notebooks verify the SHA-256 checksums of the bundled full-resolution images and display Figures 1–6, their individual panels, and Supplementary Figures S1–S18. Multi-panel publication plotting scripts are organized in plotting/, and the microenvironment-gated, cross-individual single-cell, and State capacity benchmark scripts and summary tables are in benchmarks/.
Clone this repository and create a Python 3.12 environment:
git clone https://github.com/deepomicslab/spike.git
cd spike
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-figures.txt
python -m ipykernel install --user --name spike-figures --display-name "Spike figures"On Windows, activate the environment with .venv\Scripts\activate instead. Alternatively, use conda create -n spike-figures python=3.12 and conda activate spike-figures before the pip command.
The current figure notebooks read the bundled manuscript images on CPU and verify every SHA-256 digest against assets/manuscript/sha256.json.
The published model implementation is ConditionalResidual. Its interface and frozen selection records are documented in docs/current_spike_model.md.
To use that implementation in a separate model environment, install PyTorch for your CPU/CUDA platform and PyTorch Geometric, then install this repository's data dependencies:
python -m pip install -r requirements.txt
python -c "from perturb.models.conditional_residual import ConditionalResidual; print(ConditionalResidual.__name__)"Run these commands from the repository root. The objective is population gene-mean MSE + neighborhood-contrast MSE + residual regularization (0.01 * mean(delta ** 2)). environment.full.yml records the Linux comparison environment; scripts/train.py and scripts/evaluate.py serve comparator methods, and benchmarks/ provides the microenvironment-gated, cross-individual single-cell, and State decoder-capacity benchmark pipelines.
RHY 1–4 denote the four mouse brain Visium datasets comparing saline controls with rhynchophylline (RHY) treatment. Each dataset contains a control section and a treated section; spots are not paired between sections.
| Manuscript display name | Stable data/code identifier |
|---|---|
| RHY 1 | brain_sleep1 |
| RHY 2 | brain_sleep2 |
| RHY 3 | brain_sleep3 |
| RHY 4 | brain_sleep4 |
WT, SHH and PSAPP retain their existing names. Original CSV identifiers, data paths and frozen provenance records are unchanged for reproducibility. The display mapping is defined in reproduction/common.py and plotting/style_common.py.
perturb/models/conditional_residual.py— Portable PyTorch implementation of Spike (ConditionalResidual), hash-verified byprovenance/current_spike_model.json.notebooks/&assets/manuscript/— Checksum-verified Jupyter notebooks and 350-DPI PNG assets for Figures 1–6, all 42 individual main-figure panels, and Supplementary Figures S1–S18.plotting/— Publication multi-panel plotting suite (.pdf,.svg,.png,.drawio) for Figures 1–6 and Supplementary Figures S1–S18.benchmarks/— Ground-truth microenvironment-gated benchmarks, cross-individual Visium/MERFISH/Xenium generalization, single-cell CPU scaling, and uncompressed State decoder benchmarks with precomputed summary CSVs.reproduction/— Preserved historical numerical snapshot (2026-10-13) and input table checksums.
Open the notebook collection, select the Spike figures kernel, and use Restart Kernel and Run All Cells:
jupyter lab notebooks/Or execute all eight notebooks non-interactively from fresh kernels:
python scripts/execute_figure_notebooks.pyThe collection covers Figures 1–6 (complete figures and individual panels) and Supplementary Figures S1–S18. Running the cells verifies each bundled image against its SHA-256 digest and displays it inline.
