We proposed an unsupervised multi-model SPAtially embedded Deep Attentional graph Clustering (SpaDAC) method, which uses the deep learning framework to learn low-dimensional embeddings for spatial transcriptomics data. SpaDAC can efficiently identify spatial domains while reconstructing denoised gene expression profiles. We applied it to sixteen datasets covering three situations. Benchmark results demonstrated that SpaDAC outperforms other algorithms in most cases. We expected SpaDAC to offer a valuable computational tool for researchers to understand tissue organization and function.
git clone https://github.com/huoyuying/SpaDAC.git
cd SpaDAC
We take 10X sample 151673 as an running example. After grabbing the source codes, you can see the folder hierarchy as follows:
.
├── datasets
│ └── 151673
│ └── notpca
├── denoising
│ └── 151673_cor
├── image_feature_learning_tool
│ ├── cut_image
│ │ └── 151673
│ │ ├── cor
│ │ ├── img_151673_224
│ │ └── img_151673_299
│ ├── inception_resnet_v2
│ │ ├── _
│ │ └── variables
│ ├── inception_v3
│ │ └── variables
│ └── resnet50
│ ├── _
│ └── variables
├── pretrain
│ └── 151673
├── result
│ └── 151673
├── pretrain_dual.py # dual-mode pretraining code
├── pretrain_triple.py # triple-mode pretraining code
├── daegc_dual.py # dual-mode training code
├── daegc_triple.py # triple-mode training code
├── model.py
├── model_plus.py
├── utils.py
└── evaluation.py
(Recommended) Using python virtual environment with conda
# Configuring the virtual environment
conda create -n SpaDAC_env python=3.8
conda activate SpaDAC_env
pip install -r SpaDAC_requirement.txt
cd SpaDAC/image_feature_learning_tool
pip install -r muse_requirement.txt
cd cut_image
python deal_cut.py --name 151673 --size 224 (or 299)
cd SpaDAC/image_feature_learning_tool
python deal_inception.py --name 151673 --model inception_v3 (or inception_resnet_v2 or resnet50)
cd SpaDAC/image_feature_learning_tool
python deal_network.py --name 151673 --model inception_v3 (or inception_resnet_v2 or resnet50) --distance euc (or cos or pea) --neighbor 6 (or 4)
cd SpaDAC
python pretrain_plus.py --name 151673 --exp 3000 --adj adj1 --img adj6 --max_epoch 50
cd SpaDAC
python daegc_plus.py --name 151673 --exp 3000 --adj adj1 --img adj6 --epoch 49 --max_epoch 100
cd SpaDAC
python clustering.py
cd SpaDAC/denoising
python denoising.py
Platform | Tissue | SampleID |
---|---|---|
10x Visium | Human dorsolateral pre-frontal cortex (DLPFC) | 151507, 151508, 151509, 151510, 151669, 151670, 151671, 151672, 151673, 151674, 151675, 151676 |
10x Visium | Mouse brain section | Sagittal-Anterior, Sagittal-Posterior |
10x Visium | Human breast cancer | Ductal Carcinoma In Situ & Invasive Carcinoma |
Stereo-Seq | Mouse olfactory bulb | Olfactory bulb |
ST | Pancreatic ductal adenocarcinoma tissue | PDAC1, PDAC2 |
Spatial transcriptomics data of other platforms can be downloaded https://www.spatialomics.org/SpatialDB/
Feel free to submit an issue or contact us at [email protected] for problems about the packages.