SpaceTravLR

Spatially perturbing Transcription factors, Ligands and Receptors

The advent of spatial omics has revolutionised our understanding of tissue biology; however, these technologies remain largely descriptive and do not capture how changes in gene regulation propagate across spatial neighbourhoods.

https://raw.githubusercontent.com/Koushul/SpaceTravLR/docs/assets/figure1.png

While in-silico perturbation methods and foundation models aim to model the impact of genetic perturbations, they are limited to single-cell approaches that lack spatial resolution.

https://raw.githubusercontent.com/Koushul/SpaceTravLR/docs/assets/other_methods.png

We address this major unmet need by developing SpaceTravLR (Spatially perturbing Transcription factors, Ligands and Receptors), a novel interpretable machine-learning approach that generalises across tissues and species, uncovering spatial features linked to functional outcomes, thereby capturing functional microniches with spatial resolution.

https://raw.githubusercontent.com/Koushul/SpaceTravLR/docs/assets/spatial_prop.png

SpaceTravLR infers how single or combinatorial genetic perturbations rewire signals across the tissue neighbourhood, by propagating effects through underlying spatially resolved molecular networks, thereby modelling how perturbations can reshape both the targeted cell and its surrounding neighbourhood.

Installation

From pip:

pip install SpaceTravLR

Or from source:

uv venv
source .venv/bin/activate
uv sync

Train

Quickstart

You can also train SpaceTravLR with friends by sharing the launch.py file.

And ensuring everyone shares the same output path.

from SpaceTravLR.spaceship import SpaceShip

adata = sc.read_h5ad('/data/brains/human_sample_001.h5ad')

spacetravlr = SpaceShip(
   name='human_brain_tissue_001',
   outdir='/output'
)

spacetravlr.setup_(adata)
assert spacetravlr.is_everything_ok()

spacetravlr.spawn_worker(
   partition='GPU-shared',
   clusters='bridges2',
   gres='gpu:1',
   job_name='SpaceTravLR',
   lifespan=1,
   python_path='.conda/envs/space/bin/python'
)

Infer

spacetravlr.setup_perturbations(
   adata=adata,
   use_float16=True
)

spacetravlr.perturb(
   target='FOXO1',
   propagation=4,
   gene_expr=0,
)

Analysis

Found a 🐞️ or would like to see a feature implemented? Feel free to submit an issue.