Skip to main content

Utility functions for scalable image DVP image analysis

Project description

Snakemake workflow: dvp-imaging-pipeline

Snakemake Test

A Snakemake workflow for Scalable processing of DVP imaging data with snakemake.

About

Pipeline

Workflow

flowchart LR


style QCTissue1 fill:#ffffff,stroke:#222222,stroke-width:2px,color:#000
style QCSegmentation1 fill:#ffffff,stroke:#222222,stroke-width:2px,color:#000
style QCClassification1 fill:#ffffff,stroke:#222222,stroke-width:2px,color:#000
style QCClassification2 fill:#ffffff,stroke:#222222,stroke-width:2px,color:#000

%% colors
%% DONE: #0097A7
style IO fill:#ffffff,stroke:#0097A7,stroke-width:4px,color:#000
style Segmentation1a fill:#ffffff,stroke:#0097A7,stroke-width:2px,color:#000
style Classification1a fill:#ffffff,stroke:#0097A7,stroke-width:2px,color:#000
style Classification2a fill:#ffffff,stroke:#0097A7,stroke-width:2px,color:#000




IO[Generate spatialdata]

Tissue1[Tissue Identification]
Tissue2[Dearraying]
Tissue3a[Tissue QC, IF]
Tissue3b[Tissue QC, HE]

Segmentation1a[Cell/Nuclei segmentation, IF]
Segmentation1b[Cell/Nuclei segmentation, HE]


Classification1a[QC, IF]
Classification2a[Cell Classification, IF]
Classification2b[Cell Classification, HE]

QCTissue1(Tissue Plots)
QCSegmentation1(Segmentation Plots + Metrics)
QCClassification1(QC Plots + Metrics)
QCClassification2(Classification Plots + Metrics)


IO --> Tissue1
Tissue1 -->|TMA| Tissue2
Tissue1 -->|WSI| Tissue3a
Tissue1 -->|WSI| Tissue3b

Tissue2 --> Tissue3a
Tissue2 --> Tissue3b


Tissue3a --> Segmentation1a
Tissue3b --> Segmentation1b

Segmentation1a --> Classification1a --> Classification2a
Segmentation1b --> Classification2b

Scope

Priority Current implementation/status
Must have
Spatialdata IO :white_check_mark: (dvpio)
Nuclei+Cell segmentation :white_check_mark: (harpy)
Align cells+nuclei (harpy)
Tissue QC (GrandQC, custom)
Cell QC :white_check_mark: (custom)
Cell classification :white_check_mark: (GMM)
Workflow manager (Snakemake)
Documentation+Tutorials
Nice to have
Automated Reports
Spatialdata database
Config editor
Train cellpose models in spatialdata
Dockerized solution
Not in scope
Complete GUI

Usage

Detailed information about input data and workflow configuration can also be found in the config/README.md.

If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this repository or its DOI.

Deployment options

To run the workflow from the command line, change the working directory.

From repository

Clone this repository or download it via (Code > Download ZIP)

git clone https://github.com/lucas-diedrich/dvp-imaging-pipeline.git
cd path/to/dvp-imaging-pipeline

Adjust options in the default config file config/config.yaml. Before running the complete workflow, you can perform a dry run using:

snakemake --dry-run

To run the workflow with test files using conda:

snakemake --logger snkmt --cores 2 --sdm conda --directory workflow --configfile tests/integration/config/config.yaml

Results (spatialdata objects + logs + plots) can be found in the /tests/results directory.

Logging

Monitor the progress of the workflow in the workflow directory with snkmt, see also the documentation

snkmt console

Install utility functions

The utility functions in the src/ directory are a viable python package (dvpimg) and can be installed with pip.

  1. In the shell, go to your favorite directory. Create a suitable environment, e.g. with mamba
mamba create -n dvpimg python=3.12 -y && mamba activate dvpimg
  1. Clone the repository
git clone https://github.com/lucas-diedrich/dvp-imaging-pipeline.git
cd dvp-imaging-pipeline
  1. Install the package
pip install .

Docker

Todo

HPC

You can run this workflow on an high-performance computing cluster

On the cluster, create the snakemake base environment the environment

conda create -n snakemake -y
conda env update --n snakemake --file environment.yaml

Additionally install the snakemake-executor-plugin-slurm:

pip install snakemake-executor-plugin-slurm

Then submit the provided workflow script on a cluster. Please checkout the script and the official snakemake slurm plugin documentation to be learn about relevant flags and settings.

cd /workflow/
sbatch snakemake.sbatch

Tests

You can run an example workflow with hatch (it automatically manages the required dependencies)

# Install hatch
pip install hatch

# Install all dependencies+environments for package + snakemake workflow
hatch run workflow:install

# Dry run
hatch run workflow:dry-run

# Full test with example data
hatch run workflow:run-test

Components

See the documentation for more information on the individual components and detailed instructions on their configuration.

References

(alphabetical order)

dvp-io: MannLabs/dvp-io. Lucas Diedrich (2025). https://github.com/MannLabs/dvp-io.git

Harpy: saeyslab/harpy. Saeys Lab (2025). https://github.com/saeyslab/harpy.git

Lazyslide: Zheng, Y., Abila, E., Chrenková, E., Winkler, J. & Rendeiro, A. F. LazySlide: accessible and interoperable whole slide image analysis. 2025.05.28.656548 Preprint at https://doi.org/10.1101/2025.05.28.656548 (2025).

Snakemake Köster, J., Mölder, F., Jablonski, K. P., Letcher, B., Hall, M. B., Tomkins-Tinch, C. H., Sochat, V., Forster, J., Lee, S., Twardziok, S. O., Kanitz, A., Wilm, A., Holtgrewe, M., Rahmann, S., & Nahnsen, S. Sustainable data analysis with Snakemake. F1000Research, 10:33, 10, 33, 2021. https://doi.org/10.12688/f1000research.29032.2.

Spatialdata: Marconato, L. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods 1–5 (2024) doi:10.1038/s41592-024-02212-x.

Citation

DVP-Imaging-Pipeline [Computer software]. https://github.com/lucas-diedrich/dvp-imaging-pipeline.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvpimg-0.0.1a38.tar.gz (665.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dvpimg-0.0.1a38-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file dvpimg-0.0.1a38.tar.gz.

File metadata

  • Download URL: dvpimg-0.0.1a38.tar.gz
  • Upload date:
  • Size: 665.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dvpimg-0.0.1a38.tar.gz
Algorithm Hash digest
SHA256 94af88abd5649073c6ebc4ca1f0df98f135794f0c22d714d01d508ce070c31ae
MD5 7a1840c37bcc6d29fbf3aab755427ba2
BLAKE2b-256 46fbd048b4d3ede1895e1ba82691197b2b713dc0edca0ff55b557c12f481f2d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvpimg-0.0.1a38.tar.gz:

Publisher: release-pypi.yaml on lucas-diedrich/dvp-imaging-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dvpimg-0.0.1a38-py3-none-any.whl.

File metadata

  • Download URL: dvpimg-0.0.1a38-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dvpimg-0.0.1a38-py3-none-any.whl
Algorithm Hash digest
SHA256 dbb8ca0c2a3d8511aab0378e283e503b6ada11a52db8a2d206f0c617f7e56a61
MD5 fd1fd09c3ac29312e38b8da10816b1f8
BLAKE2b-256 86ae2b9d759e17183ead3a8fbfd228f12a61b109f51622c26f18ed935f28f977

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvpimg-0.0.1a38-py3-none-any.whl:

Publisher: release-pypi.yaml on lucas-diedrich/dvp-imaging-pipeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page