Skip to content

Spatially Resolved Transcriptomics Integration Algorithm

License

Notifications You must be signed in to change notification settings

STOmics/Spatialign

Repository files navigation

python >=3.8.0 Documentation Status Downloads

spatiAlign: An Unsupervised Contrastive Learning Model for Data Integration of Spatially Resolved Transcriptomics

DOI
Integrative analysis of spatially resolved transcriptomics datasets empowers a deeper understanding of complex biological systems. However, integrating multiple tissue sections presents challenges for batch effect removal, particularly when the sections are measured by various technologies or collected at different times. Here, we propose spatiAlign, an unsupervised contrastive learning model that employs the expression of all measured genes and the spatial location of cells, to integrate multiple tissue sections. It enables the joint downstream analysis of multiple datasets not only in low-dimensional embeddings but also in the reconstructed full expression space. In benchmarking analysis, spatiAlign outperforms state-of-the-art methods in learning joint and discriminative representations for tissue sections, each potentially characterized by complex batch effects or distinct biological characteristics. Furthermore, we demonstrate the benefits of spatiAlign for the integrative analysis of time-series brain sections, including spatial clustering, differential expression analysis, and particularly trajectory inference that requires a corrected gene expression matrix.

🔥News

Citation

If you use spatiAlign in your work, please cite the publication as follows:

Zhang C, Liu L, Zhang Y, et al. spatiAlign: an unsupervised contrastive learning model for data integration of spatially resolved transcriptomics[J]. GigaScience, 2024, 13: giae042.         

Dependences

anndata-0.8.0 scanpy-1.8.2 torch-1.10.0 torch_geometric-2.0.2 torch_cluster-1.5.9 torch_scatter-2.0.9 torch_sparse-0.6.12

Please pay attention to the matching versions of torch, torch_geometric, torch_cluster, torch_scatter and torch_sparse when installing.

Install

  • Install through Pypi
pip install spatialign
  • or git clone
git clone https://github.com/STOmics/Spatialign.git

cd Spatialign

python setup.py install
  • or docker env
docker pull zhangchao162/spatialign

Tutorial

from spatialign import Spatialign

data_lists = $DATA_PATH  # dataset list
model = Spatialign(*data_lists,
                   min_genes=20,
                   min_cells=20,
                   batch_key='batch',
                   is_norm_log=True,
                   is_scale=False,
                   is_hvg=False,
                   is_reduce=False,
                   n_pcs=100,
                   n_hvg=2000,
                   n_neigh=15,
                   is_undirected=True,
                   latent_dims=100,
                   gpu=0,
                   save_path='./output')

model.train(tau1=0.05, tau2=0.01, tau3=0.1)  # training model
model.alignment()  # remove batch effects and align datasets distibution

Note: For more formal parameter descriptions, see the comments of corresponding functions.

Publicly available datasets

Disclaimer

This is not an official product.

About

Spatially Resolved Transcriptomics Integration Algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published