Alignment of spatial transcriptomics slices across diseases, platforms and conditions
Yu Wang, Zaiyi Liu, Qingchen Zhang, Xiaoke Ma
AlignDG is the network-based model for aligning distant slices without prior information, covering scenarios such as non-consecutive, non-continuous, across different tissues and diseases conditions that cannot be properly handled with available methods. Furthermore, AlignDG joints feature learning and slice alignment, where features are learned under the guidance of alignment, thereby improving discriminative and quality of features. Extensive experimental results demonstrate the superiority of AlignDG over existing state-of-the-art in terms of precision, robustness and efficiency. AlignDG precisely tracks development of tissues from spatial-temporal slices by only using approximately 50% slices in datasets, which provides biologists with a new perspective to design experiments and analyze spatial transcriptomics data.
Installation
(Note: To accelerate AlignDG by using GPU: If you have an NVIDIA GPU and using Linux OS, please install Pytorch and jaxlib-cuda in previous, the CPU version of them will be installed by default for you. Here is the installation guide of PyTorch and the installation guide of jaxlib)
The detailed tutorials for install AlginDG is available at: https://aligndg-tutorials.readthedocs.io/en/latest/Installation.html
1. Start by using python virtual environment with conda:
conda create --name aligndg_py python=3.10
conda activate aligndg_py
Note: If you encounter the error message "ImportError: Please install the skmisc package via pip install --user scikit-misc" while executing sc.pp.highly_variable_genes(adata, flavor='seurat_v3', n_top_genes=3000), please execute the following command in your terminal: pip install --user scikit-misc.
Then, you can install AlignDG via Pypi:
pip install aligndg
2. From source code (Github)
git clone https://github.com/xkmaxidian/AlignDG.git
cd your_dir/AlignDG/AlignDG_package
python setup.py build
python setup.py install
Tutorial
-
Tutorial documentation for AlignDG generated using
ReadTheDocsis accessible from: https://aligndg-tutorials.readthedocs.io/en. -
The tutorials for AlignDG source code are summarized as:
The jupyter Notebooks of the tutorial for the balanced simulate data (data 1 and 2) are also accessible from :
https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_Simulate1_Banalced.ipynb
https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_Simulate2_Balanced.ipynb
The jupyter Notebook of the tutorial for the unbalanced simulate data is accessible from : https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_simulate.ipynb
The tutorials for AlignDG on real spatial transcriptomics are accessible from:
- For DLPFC: https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_DLPFC_Align.ipynb
- For MERFISH: https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_MERFISH_Align.ipynb
Tutorials for AlignDG on multiple slices and 3D reconstruction are accessible from:
- For AlignDG (Pairwise): https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_DLPFC_pairwise.ipynb
- For AlignDG (Reference): https://github.com/xkmaxidian/AlignDG/blob/master/Tutorials/Tutorials_DLPFC_reference.ipynb
Note: Please install jupyter notebook in order to open this notebook.
Compared slice alignment algorithms in this paper:
Algorithms that are compared include:
We also acknowledge the authors who provided source code and data which inspire us a lot. They include:
Contact:
We are continuing adding new features. Bug reports or feature requests are welcome. Last update: 10/20/2025, version 1.0.1
Please send any questions or found bugs to Xiaoke Ma xkma@xidian.edu.cn.
Reference
Our paper is under review.
Metadata
Release files for aligndg 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aligndg-1.0.2.tar.gz | 101.3 kB | Without provenance | Details for aligndg-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aligndg-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for aligndg-1.0.2-py3-none-any.whl |
Total release size: 220.7 kB
Release files / aligndg-1.0.2.tar.gz
| Download URL | aligndg-1.0.2.tar.gz |
|---|---|
| Size | 101.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69977dd92287d7225a6584edd58a9610c5b924f1bbe44dcfd5c2821163277b76
|
|
BLAKE2b-256 checksum How to use checksums |
560fd511083ef9c4c82714efe2b109dad2e126cf1a13c26f5eabefbfe3394c51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Release files / aligndg-1.0.2-py3-none-any.whl
| Download URL | aligndg-1.0.2-py3-none-any.whl |
|---|---|
| Size | 119.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b95374277efc32f44277209f26a9a84fb824a5a9545eecc65850a01f5abc788e
|
|
BLAKE2b-256 checksum How to use checksums |
bff1de699e5a5f2c6c0cb3903dd41fb8adc53e7029ee26cdb59d075ad2a3ef4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Security for aligndg 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.