Cell segmentation for imaging-based spatial transcriptomics as graph-based transcript–cell assignment.
Segger is a graph neural network (GNN)-based method that formulates cell segmentation in imaging-based spatial transcriptomics (iST) as a problem of transcript–cell assignment. Rather than relying solely on geometric proximity, Segger assumes that a transcript belongs to a cell if it is consistent both with its local spatial context and with the gene expression programs that define cell identity, as captured in a shared latent representation.
Note
This release uses cuspa, which we developed together with NVIDIA, to support atera-scale,
billion-transcript whole-transcriptome datasets. It requires CUDA 13 and Python 3.13.
Full documentation - installation, quickstart, outputs, API reference, etc.: segger-segmentation.readthedocs.io
segger requires CUDA 13 and Python 3.13.
uv pip install seggerFor conda, pixi, installing from source and older CUDA versions, see the installation docs.
On HPC clusters, run the Docker image with Apptainer/Singularity. Pull it once (about 10-20 minutes), then run on a GPU node with --nv:
export APPTAINER_CACHEDIR=/path/to/cachedir
apptainer pull segger.sif docker://sailmskcc/segger:latest
apptainer exec --nv segger.sif segger --helpFor Docker, see Use a container.
segger segment \
-i /path/to/your/ist/data/ \
-o /path/to/save/outputs/ \
--export anndata boundaries # optional (e.g. anndata, boundaries, xeniumranger, ...)See notebooks/quickstart.ipynb for an end-to-end walkthrough.
If you run into a problem, first check the GitHub issues and the known issues in the docs.
See CONTRIBUTING.md.
If you use segger in your research, please cite:
@misc{heidari2026segger,
title={Segger: Fast and accurate cell segmentation of imaging-based spatial transcriptomics data},
author={Heidari, Elyas and Moorman, Andrew and others},
note={Methods description},
year={2026},
howpublished={\url{https://github.com/dpeerlab/segger/blob/main/segger_methods.pdf}}
}