Skip to content

PMBio/segger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

pip

Before installing segger, please install GPU-accelerated versions of PyTorch, RAPIDS, and related packages compatible with your system. Please ensure all CUDA-enabled packages are compiled for the same CUDA version.

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-cuda12x

December 2025: To stay up-to-date with new developments, we recommend installing the latest version directly from GitHub:

# Clone segger repo and install locally
git clone https://github.com/dpeerlab/segger.git segger && cd segger
pip install -e .

Usage

Show top-level CLI help:

segger --help

Modes

segger segment

Train + predict in one run (end-to-end segmentation).

segger segment -i /path/to/input_data -o /path/to/run_output

segger predict

Run prediction-only from a saved checkpoint.

segger predict \
  -c /path/to/checkpoint.ckpt \
  -i /path/to/input_data \
  -o /path/to/predict_output

segger export

Convert segmentation outputs to downstream formats (xenium_explorer, merged, anndata, spatialdata).

segger export \
  -s /path/to/segger_segmentation.parquet \
  -i /path/to/source_data \
  -o /path/to/export_output \
  --format xenium_explorer

segger validate

Compute lightweight quality metrics from Segger outputs.

segger validate \
  -s /path/to/segger_segmentation.parquet \
  -i /path/to/source_data \
  -o /path/to/validation_metrics.tsv

Run selected metrics only:

segger validate \
  -s /path/to/segger_segmentation.parquet \
  -i /path/to/source_data \
  --assigned --border-contamination --vsi

segger plot

Plot training curves from metrics.csv in an output directory.

segger plot -o /path/to/run_output

Quick terminal plot (no image written):

segger plot -o /path/to/run_output --quick

segger atlas

Reference management subcommands for CellxGENE Census:

segger atlas fetch colon
segger atlas preview colon
segger atlas list
segger atlas clear --tissue colon

Help per mode

Use mode-specific help for the full parameter list:

segger segment --help
segger predict --help
segger export --help
segger validate --help
segger plot --help
segger atlas --help

Optional extras

Install optional dependencies as needed:

pip install "segger[plot]"        # for plotting support
pip install "segger[spatialdata]" # for SpatialData input/output
pip install "segger[census]"      # for atlas reference fetching

About

GNN-based cell segmentation of spatial transcriptomics data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%