Welcome to gsMap’s documentation!

gsMap: genetically informed spatial Mapping of cells for complex traits.

gsMap integrates spatial transcriptomics (ST) data, from 2D tissue sections to 3D tissues, with genome-wide association study (GWAS) summary statistics to map cells associated with human complex traits and diseases.

Note

This documentation describes gsMap 2.x, currently in beta. gsMap 1.x users should read Upgrading to gsMap 2.0. The gsMap 1.x documentation remains at gsMap 1.x Documentation.

What’s New in gsMap 2.0

Important

  • Support for 3D ST data mapping of registered sections and thick tissues

  • Dual-embedding strategy for more accurate gene specificity scoring

  • GPU support for embeddings, gene specificity scoring and spatial LDSC

  • Multi-trait and multi-GPU spatial LDSC with interactive reports

Features

  • Spatially-aware High-Resolution Trait Mapping: Maps trait-associated cells at single-cell resolution, offering insights into their spatial distributions.

  • Spatial Region Identification: Aggregates trait-cell association p-values into trait-tissue region association p-values, prioritizing tissue regions relevant to traits of interest.

  • Putative Causal Genes Identification: Prioritizes putative causal genes by associating gene expression levels with cell-trait relevance.

  • Scalability: Supports CPU/GPU computation and disk-backed arrays for large spatial datasets.

Explore gsMap

Installation

Get gsMap running on your system using uv, pip, or conda.

Go to Installation

Key Concepts

Learn basic CLI/Python usage, input formats, key settings and the biological workflow.

Go to Key Concepts

Tutorials

Step-by-step guides for 2D and 3D spatial data.

2D Tutorial | 3D Tutorial

Output Files

Understand the output directory structure and file formats.

Go to Output Files Reference

Customization Guide

Change input fields, embeddings, graph/matching settings and LD references.

Go to Customization Guide

Scalability

E16.5 examples for CPU/GPU, SSD storage, memory tuning and cluster jobs.

Go to Scalability Guide

Overview of the gsMap Method

gsMap operates on a four-step process:

  1. Gene Specificity Assessment in 3D Spatial Contexts: To address technical noise and capture spatial correlations of gene expression across consecutive ST sections, gsMap constructs batch-corrected dual embeddings of molecular and spatial features. These embeddings jointly model transcriptomic similarity and local spatial context to identify homogeneous cells in 3D space. Gene specificity scores (GSS) are then computed by aggregating normalized gene expression ranks across these 3D homogeneous cells, enabling robust identification of genes that are both highly and specifically expressed in focal cells.

  2. Linking Gene Specificity to Genetic Variants: gsMap links gene specificity scores to single nucleotide polymorphisms (SNPs) by assigning GSS to SNPs based on their proximity to gene transcription start sites (TSS) and SNP-to-gene epigenetic linking maps, thereby connecting spatially resolved gene expression patterns with trait-associated genetic variation.

  3. 3D Spatial S-LDSC for Cell–Trait Association: To quantify cell–trait associations in 3D space, gsMap integrates the 3D gene specificity scores with genome-wide association study (GWAS) summary statistics using stratified LD score regression (S-LDSC). This framework enables the estimation of trait relevance for individual cells by associating their stratified LD scores with GWAS signals.

  4. Spatial Region–Trait Association Analysis: To evaluate associations between traits and spatial regions, gsMap aggregates p-values from cells within a given 3D spatial region using the Cauchy combination test, yielding region-level association statistics that reflect coordinated genetic effects across spatially organized cell populations.

gsMap Method Schematic

How to Cite

If you use gsMap in your studies, please cite:

gsMap: Song, L., Chen, W., Hou, J., Guo, M. & Yang, J. “Spatially resolved mapping of cells associated with human complex traits.” Nature (2025). doi:10.1038/s41586-025-08757-x

gsMap 2.0 (under revision): a citation for the 2.0 methods will be added here when available.

If you view 3D results with SpatialVista, please also cite:

SpatialVista: Wei, W., Li, L., Song, L., Chen, W., Wang, K., Guo, M. & Yang, J. “SpatialVista as a unified ecosystem for high-performance visualization and exploration of 3D spatial transcriptomics data.” Nature Genetics (2026). doi:10.1038/s41588-026-02696-7