GenOT: Generative optimal transport for continuous spatiotemporal modeling of cross-platform spatial transcriptomics
Spatial transcriptomics (ST) technologies have revolutionized the analysis of spatial gene expression patterns within tissues. However, existing computational methods still face challenges in integrating spatial information and generating cross-heterogeneous sample data. To address this, we developed GenOT - a spatial data generation framework based on graph self-supervised contrastive learning and optimal transport theory. The framework employs a multimodal feature learning architecture to dynamically identify important genes and hierarchically aggregate spatial neighborhood information, achieving high-precision spatial domain clustering and biologically interpretable feature extraction. The core innovation of GenOT lies in introducing an optimal transport barycenter-based interpolation algorithm, which mathematically models cross-sample spatial distribution differences to reconstruct spatiotemporal continuous gene expression dynamics. Experiments on multiple datasets including human dorsolateral prefrontal cortex (10x visium), mouse embryonic development (Stereo-seq), and olfactory bulb/hippocampal tissues (Slide-seqV2) demonstrate that GenOT significantly outperforms existing methods in spatial domain identification, cross-technology platform integration, and developmental trajectory reconstruction. This provides an innovative tool for tissue structure analysis at single-cell resolution and developmental process modeling.

First, clone and navigate to the repository.
git clone https://github.com/wrab12/GenOT
cd GenOTThis process can take several minutes, depending on network speed.
Create and activate a virtual environment using python 3.9 with conda,
# conda
conda create -n GenOT python=3.9
conda activate GenOTInstall dependencies and the local library with pip.
pip install -r requirements.txtThis process usually takes around 5 minutes.
Next, you need to install torch and torch_geometric. The installation depends on your computer's CUDA version. Please follow these steps:
- Run
nvidia-smito check your CUDA version. - Install the appropriate version of
torchaccording to your CUDA version. Refer to the official guide: PyTorch Installation. - After installing
torch, installtorch_geometric. - For detailed instructions, visit PyTorch Geometric Installation Guide.
Specifically, you can use the following command:
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
pip install torch_geometricReplace ${TORCH} and ${CUDA} with your specific PyTorch and CUDA versions.
For more details, see the official documentation for PyTorch and PyTorch Geometric.
You also need to install R. You can download the installer and run it from the official CRAN website: https://cran.r-project.org/
- Download all datasets from this Google Drive link.
See detailed documentation and examples at https:/GenOT.readthedocs.io/en/latest/index.html.
We thank the developers of GraphST (GitHub), Somde (GitHub), Paste2 (GitHub), and POT (GitHub) for their valuable tools and resources.