Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PLoS Computational Biology 2025] SpaMask: Dual Masking Graph Autoencoder with Contrastive Learning for Spatial Transcriptomics

Notifications You must be signed in to change notification settings

wenwenmin/SpaMask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

SpaMask: Dual Masking Graph Autoencoder with Contrastive Learning for Spatial Transcriptomics

πŸ”₯ Introduction

Understanding the spatial locations of cell within tissues is crucial for unraveling the organization of cellular diversity. Recent advancements in spatial resolved transcriptomics (SRT) have enabled the analysis of gene expression while preserving the spatial context within tissues. Spatial domain characterization is a critical first step in SRT data analysis, providing the foundation for subsequent analyses and insights into biological implications. Graph neural networks (GNNs) have emerged as a common tool for addressing this challenge due to the structural nature of SRT data. However, current graph-based deep learning approaches often overlook the instability caused by the high sparsity of SRT data. Masking mechanisms, as an effective self-supervised learning strategy, can enhance the robustness of these models. To this end, we propose SpaMask, dual masking graph autoencoder with contrastive learning for SRT analysis. Unlike previous GNNs, SpaMask masks a portion of spot nodes and spot-to-spot edges to enhance its performance and robustness. SpaMask combines Masked Graph Autoencoders (MGAE) and Masked Graph Contrastive Learning (MGCL) modules, with MGAE using node masking to leverage spatial neighbors for improved clustering accuracy, while MGCL applies edge masking to create a contrastive loss framework that tightens embeddings of adjacent nodes based on spatial proximity and feature similarity. We conducted a comprehensive evaluation of SpaMask on eight datasets from five different platforms. Compared to existing methods, SpaMask achieves superior clustering accuracy and effective batch correction.

SpaMask.jpg

🌐 Data

  • All public datasets used in this paper are available at Zenodo

πŸ”¬ Setup

  • pip install -r requirement.txt

πŸš€ Get Started

We provided codes for reproducing the experiments of the paper, and comprehensive tutorials for using SpaMask.

  • Please see TutorialDonor.ipynb.

πŸ”₯Citing

The corresponding BiBTeX citation are given below:

@article{min2025spamask,
 title={SpaMask: Dual masking graph autoencoder with contrastive learning for spatial transcriptomics},
 author={Min, Wenwen and Fang, Donghai and Chen, Jinyu and Zhang, Shihua},
 journal={PLOS Computational Biology},
 volume={21},
 number={4},
 pages={e1012881},
 year={2025},
 publisher={Public Library of Science San Francisco, CA USA}
}

Article link

About

[PLoS Computational Biology 2025] SpaMask: Dual Masking Graph Autoencoder with Contrastive Learning for Spatial Transcriptomics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /