Skip to content

a cutting-edge cell segmentation model specifically designed for single-molecule resolved spatial omics datasets. It addresses the challenge of accurately segmenting individual cells in complex imaging datasets, leveraging a unique approach based on graph neural networks (GNNs).

License

Notifications You must be signed in to change notification settings

gerstung-lab/segger

 
 

Repository files navigation

🍳 Welcome to segger!

pre-commit.ci status

segger is a cutting-edge tool for cell segmentation in single-molecule spatial omics datasets. By leveraging graph neural networks (GNNs) and heterogeneous graphs, segger offers unmatched accuracy and scalability.

How segger Works

Segger Model


Quick Links


Why segger?

  • Highly parallelizable – Optimized for multi-GPU environments
  • Fast and efficient – Trains in a fraction of the time compared to alternatives
  • Transfer learning – Easily adaptable to new datasets and technologies

Challenges in Segmentation

Spatial omics segmentation faces issues like:

  • Over/Under-segmentation
  • Transcript contamination
  • Scalability limitations

segger tackles these with a graph-based approach, achieving superior segmentation accuracy.


Installation Options

Important: PyTorch Geometric Dependencies

Segger highly depends on PyTorch Geometric. One must install its dependencies (such as torch-sparse and torch-scatter) based on their system’s specifications, especially CUDA and PyTorch versions.

Please follow the official PyTorch Geometric Installation Guide to install the correct versions of torch-sparse, torch-scatter, and other relevant libraries.

Here’s how to install them manually, e.g., for torch 2.0.0:

For CUDA 11.x:

pip install torch-scatter -f https://data.pyg.org/whl/torch-2.0.0+cu117.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-2.0.0+cu117.html

For CUDA 12.x:

pip install torch-scatter -f https://data.pyg.org/whl/torch-2.0.0+cu120.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-2.0.0+cu120.html

Afterwards choose the installation method that best suits your needs.

Micromamba Installation

To set up Segger with micromamba and install the required dependencies, use the following commands:

micromamba create -n segger-rapids --channel-priority 1 \
    -c rapidsai -c conda-forge -c nvidia -c pytorch -c pyg \
    rapids=24.08 python=3.* 'cuda-version>=11.4,<=11.8' jupyterlab \
    'pytorch=*=*cuda*' 'pyg=*=*cu118' pyg-lib pytorch-sparse
micromamba install -n segger-rapids --channel-priority 1 --file mamba_environment.yml
micromamba run -n segger-rapids pip install --no-deps ./

GitHub Installation

For a straightforward local installation from GitHub, clone the repository and install the package using pip:

git clone https://github.com/EliHei2/segger_dev.git
cd segger_dev
pip install -e "."

Pip Installation (RAPIDS and CUDA 11)

For installations requiring RAPIDS and CUDA 11 support, run:

pip install -e ".[rapids11]"

Pip Installation (RAPIDS and CUDA 12)

For installations requiring RAPIDS and CUDA 12 support, run:

pip install -e ".[rapids12]"

Powered by

  • PyTorch Lightning & PyTorch Geometric: Enables fast, efficient graph neural network (GNN) implementation for heterogeneous graphs.
  • Dask: Scalable parallel processing and distributed task scheduling, ideal for handling large transcriptomic datasets.
  • Shapely & Geopandas: Utilized for spatial operations such as polygon creation, scaling, and spatial relationship computations.
  • RAPIDS: Provides GPU-accelerated computation for tasks like k-nearest neighbors (KNN) graph construction.
  • AnnData & Scanpy: Efficient processing for single-cell datasets.
  • SciPy: Facilitates spatial graph construction, including distance metrics and convex hull calculations for transcript clustering.

Contributions

segger is open-source and welcomes contributions. Join us in advancing spatial omics segmentation!

About

a cutting-edge cell segmentation model specifically designed for single-molecule resolved spatial omics datasets. It addresses the challenge of accurately segmenting individual cells in complex imaging datasets, leveraging a unique approach based on graph neural networks (GNNs).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • Shell 1.7%
  • Dockerfile 0.2%