We recommend CUDA 12.1 with cu* packages version ≥24.2 and <26.0. Ensure your CUDA driver version matches or exceeds your toolkit version (≥12.1 for CUDA 12.1).
Adjust package versions in the environment files below if your system requires a different package versions.
git clone https://github.com/dpeerlab/segger.git segger && cd seggerconda env create -n segger -f environment_cuda121.ymlAdjust environment_cuda121.yml for other CUDA versions (e.g., environment_cuda118.yml for CUDA 11.8).
pixi install -e cuda121Adjust the environment name in pixi.toml as needed for other CUDA versions.
Install GPU-accelerated PyTorch and RAPIDS compatible with your CUDA version before installing segger. All CUDA-enabled packages must be compiled for the same CUDA version.
- PyTorch & torchvision: Installation guide
- torch_scatter: Installation guide
- RAPIDS (cuDF, cuML, cuGraph): Installation guide
- CuPy: Installation guide
- cuSpatial: Installation guide
For example, on Linux with CUDA 12.1 and PyTorch 2.5.0:
# Install PyTorch and torchvision for CUDA 12.1
pip install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu121
# Install torch_scatter for CUDA 12.1
pip install torch_scatter -f https://data.pyg.org/whl/torch-2.5.0+cu121.html
# Install RAPIDS packages for CUDA 12.x
pip install --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 cudf-cu12 cuml-cu12 cugraph-cu12
# Install CuPy for CUDA 12.x
pip install cupy-cuda12xDecember 2025: To stay up-to-date with new developments, we recommend installing the latest version directly from GitHub:
# Clone segger repo and install locally
pip install -e .You can run segger from the command line with:
segger segment -i /path/to/your/ist/data/ -o /path/to/save/outputs/To see all available parameter options:
segger segment --helpsegger export writes a segger segmentation to plain files from which a SpatialData object can be
assembled. Name which elements to write: anndata (cell by gene table), transcripts (the assigned
transcripts), or boundaries (one polygon per cell). With no element named it writes anndata and
boundaries; add transcripts for the per-transcript assignment.
segger export -s outputs/segger_segmentation.parquet -i /path/to/ist/data/ -o export/ # anndata.h5ad + cell_boundaries.parquet
segger export anndata transcripts -s outputs/segger_segmentation.parquet -i /path/to/ist/data/ -o export/ # select which elements to writeBoundaries are traced with --method: delaunay (the default) prunes a Delaunay triangulation into a
concave outline, while convex_hull takes the convex hull; neither is smoothed by default, but
--chaikin-iterations rounds them with that many rounds of Chaikin corner-cutting. The exported
transcripts are controlled by --include-all-transcripts, --min-similarity, and --min-transcripts
(see segger export --help).
The column names follow SOPA's SpatialData conventions. anndata.h5ad and cell_boundaries.parquet
share cell_id, the instance key SOPA uses to join a table to its shapes. transcripts.parquet keeps
the segger assignment as segger_cell_id (plus row_index), a sibling column in the spirit of SOPA's
sopa_prior, so it merges onto an existing transcripts dataframe by row_index without overwriting
the vendor cell_id; its values match the cell_id in the other two files.