With the advent of spatial multi-omics, we can mosaic integrate such datasets with partially overlapping modalities to construct higher dimensional views of the source tissue. SpaMosaic is a spatial multi-omics mosaic integration tool that employs contrastive learning and graph neural networks to construct a modality-agnostic and batch-corrected latent space suited for analyses like spatial domain identification and imputing missing omes.
We tested our code on a server running Ubuntu 18.04.5 LTS, equipped with 4 NVIDIA A6000 GPUs. The installation process typically takes 10–15 minutes.
git clone https://github.com/JinmiaoChenLab/SpaMosaic.git
cd SpaMosaic
conda create -n SpaMosaic python=3.8.8
conda activate SpaMosaic
pip install -r requirements.txt
# install torch
pip install torch==2.1.1+cu121 -f https://download.pytorch.org/whl/torch_stable.html
# install torch_geometrics
pip install torch_geometric==2.4.0 pyg_lib==0.3.1+pt21cu121 torch_scatter==2.1.2+pt21cu121 torch_sparse==0.6.18+pt21cu121 torch_cluster==1.6.3+pt21cu121 torch_spline_conv==1.2.2+pt21cu121 -f https://data.pyg.org/whl/torch-2.1.1+cu121.html
python setup.py install
R package mclust
is needed to perform clustering and make sure it installed in a R environment.
We provided detailed tutorials on applying SpaMosaic to various integration or imputation tasks. Please refer to https://spamosaic.readthedocs.io/en/latest/.
Source of public datasets:
- Mouse embryonic brain dataset:
three slices
- Mouse postnatal brain dataset (rna+atac): {
slice 1, 2
}, {slice 3
} - Mouse postnatal brain dataset (rna+h3k4me3): {
slice 1, 2
}, {slice 3
} - Mouse postnatal brain dataset (rna+h3k27me3): {
slice 1,2
}, {slice 3
} - Mouse postnatal brain dataset (rna+h3k27ac):
three slices
- Mouse embryo: {
slice 1
}, {slice 2,3,4
} - Five-modal mouse brain dataset (rna+atac+histone):
four slices
We have compiled the simulation, in-house, and public datasets into h5ad files. Please refer to zenodo.
To reproduce SpaMosaic's results, please visit reproduce
folder.
To reproduce compared methods' results, including CLUE
, Cobolt
, scMoMaT
, StabMap
, MIDAS
, TotalVI
, MultiVI
, Babel
, please visit https://github.com/XiHuYan/Spamosaic-notebooks
.