Skip to content

Repository files navigation

segger

GNN-based cell segmentation of spatial transcriptomics data.

segger overview

The accurate assignment of transcripts to their cells of origin remains the Achilles heel of imaging-based spatial transcriptomics, despite being critical for nearly all downstream analyses. We introduce segger, a versatile graph neural network based on a heterogeneous graph representation of individual transcripts and cells, that frames cell segmentation as a transcript-to-cell link prediction task and can leverage single-cell RNA-seq information to improve transcript assignments. On multiple Xenium dataset benchmarks, segger exhibits superior sensitivity and specificity, while requiring orders of magnitude less compute time than existing methods.

— Heidari, Moorman, et al. (2025)

Full documentation - installation, quickstart, outputs, API reference, etc.: segger-segmentation.readthedocs.io

Installation

pixi with Python 3.11 (conda and Python 3.13 support coming soon):

curl -fsSL https://pixi.sh/install.sh | sh
git clone https://github.com/dpeerlab/segger.git
cd segger
pixi install -e cuda121

Usage

# run segger segmentation
segger segment \
  -i /path/to/your/ist/data/ \
  -o /path/to/save/outputs/

# export different data formats (e.g. boundaries, spatialdata, anndata, xeniumranger, ...)
segger export boundaries \
  -s /path/to/save/outputs/segger_segmentation.parquet \
  -o /path/to/export/

See notebooks/quickstart.ipynb for an end-to-end walkthrough.

Contributing

See CONTRIBUTING.md.

Preprint

Heidari, E., Moorman, A., et al. Segger: Fast and accurate cell segmentation of imaging-based spatial transcriptomics data. bioRxiv (2025).

Citation

If you use segger in your research, please cite:

@article{heidari2025segger,
  title={Segger: Fast and accurate cell segmentation of imaging-based spatial transcriptomics data},
  author={Heidari, Elyas and Moorman, Andrew and others},
  journal={bioRxiv},
  year={2025},
  doi={10.1101/2025.03.14.643160}
}

About

GNN-based cell segmentation of spatial transcriptomics data

Resources

Contributing

Stars

26 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages