Metadata-Version: 2.4
Name: dvpimg
Version: 0.0.1a42
Summary: Utility functions for scalable image DVP image analysis
Project-URL: changelog, https://github.com/lucas-diedrich/dvp-imaging-pipeline/releases
Project-URL: repository, https://github.com/lucas-diedrich/dvp-imaging-pipeline.git
Author-email: Lucas Diedrich <diedrich@biochem.mpg.de>, Anton Schüle <schuele@biochem.mpg.de>
Maintainer-email: Lucas Diedrich <diedrich@biochem.mpg.de>
License: MIT License
        
        Copyright (c) 2021, AUTHORS
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: bioimage,deep visual proteomics,image analysis,microscopy,spatial data
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: anndata<0.13
Requires-Dist: dask[distributed]
Requires-Dist: pydantic
Requires-Dist: scikit-image
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: seaborn
Requires-Dist: spatialdata>=0.4
Requires-Dist: typer
Provides-Extra: all
Requires-Dist: dvp-io; extra == 'all'
Requires-Dist: harpy-analysis>=0.3; extra == 'all'
Requires-Dist: lazyslide; extra == 'all'
Requires-Dist: spatialdata-plot; extra == 'all'
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: pre-commit>=3.3; extra == 'dev'
Requires-Dist: ruff>=0.0.280; extra == 'dev'
Provides-Extra: doc
Requires-Dist: docutils!=0.18.*,!=0.19.*,>=0.8; extra == 'doc'
Requires-Dist: ipykernel; extra == 'doc'
Requires-Dist: ipython; extra == 'doc'
Requires-Dist: myst-nb>=1.1; extra == 'doc'
Requires-Dist: setuptools; extra == 'doc'
Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
Requires-Dist: sphinx-book-theme>=1; extra == 'doc'
Requires-Dist: sphinx-copybutton; extra == 'doc'
Requires-Dist: sphinx-tabs; extra == 'doc'
Requires-Dist: sphinx>=4; extra == 'doc'
Requires-Dist: sphinxcontrib-bibtex>=1; extra == 'doc'
Requires-Dist: sphinxcontrib-typer[html]; extra == 'doc'
Requires-Dist: sphinxext-opengraph; extra == 'doc'
Provides-Extra: histo
Requires-Dist: lazyslide; extra == 'histo'
Provides-Extra: io
Requires-Dist: dvp-io; extra == 'io'
Provides-Extra: mif
Requires-Dist: harpy-analysis>=0.3; extra == 'mif'
Provides-Extra: plot
Requires-Dist: spatialdata-plot; extra == 'plot'
Provides-Extra: stable
Requires-Dist: anndata<0.13; extra == 'stable'
Requires-Dist: dask[distributed]==2026.1.1; extra == 'stable'
Requires-Dist: dvp-io==0.4.1; extra == 'stable'
Requires-Dist: harpy-analysis==0.4.2; extra == 'stable'
Requires-Dist: lazyslide==0.11.1; extra == 'stable'
Requires-Dist: pydantic==2.13.4; extra == 'stable'
Requires-Dist: scikit-image==0.26; extra == 'stable'
Requires-Dist: scikit-learn==1.9; extra == 'stable'
Requires-Dist: scipy==1.17.1; extra == 'stable'
Requires-Dist: seaborn==0.13.2; extra == 'stable'
Requires-Dist: spatialdata-plot==0.4; extra == 'stable'
Requires-Dist: spatialdata==0.7.3; extra == 'stable'
Requires-Dist: typer==0.27.1; extra == 'stable'
Requires-Dist: wsidata==0.10.1; extra == 'stable'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# Snakemake workflow: `dvp-imaging-pipeline`

[![Snakemake](https://img.shields.io/badge/snakemake-≥8.0.0-brightgreen.svg)](https://snakemake.github.io)
[![Test](https://github.com/lucas-diedrich/dvp-imaging-pipeline/actions/workflows/test.yaml/badge.svg)](https://github.com/lucas-diedrich/dvp-imaging-pipeline/actions/workflows/test.yaml)

<!-- [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) -->
<!-- [![workflow catalog](https://img.shields.io/badge/Snakemake%20workflow%20catalog-darkgreen)](https://snakemake.github.io/snakemake-workflow-catalog/docs/workflows/MannLabs/dvp-imaging-pipeline) -->

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

![Pipeline](docs/_static/image/pipeline.png)

## Usage

<!-- The usage of this workflow is described in the [Snakemake Workflow Catalog](https://snakemake.github.io/snakemake-workflow-catalog/docs/workflows/MannLabs/dvp-imaging-pipeline). -->

Detailed information about input data and workflow configuration can also be found in the [`workflow/config/README.md`](workflow/config/README.md).

### Deployment options

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

```shell
git clone https://github.com/lucas-diedrich/dvp-imaging-pipeline.git
```

2. Change your working directory into the repository

```shell
cd path/to/dvp-imaging-pipeline
```

3. Create and activate the environment that provides snakemake. The environment is named `snakemake` by `environment.yaml`.

```shell
conda env create -n snakemake --file environment.yaml && conda activate snakemake
```

4. Test your setup on a small artificial dataset before running the workflow on your own data

```shell
snakemake --cores 2 --sdm conda --directory workflow --configfile tests/integration/config/config.yaml
```

Results (spatialdata objects, logs, and plots) are written to `tests/integration/results`.

5. Adapt the configuration files

Adjust options in the config file `workflow/config/config.yaml`. Use the test file `tests/integration/config/config.yaml` as template.

6. Run the workflow

Run the workflow locally (not recommended for large datasets).

```shell
snakemake --cores all --sdm conda --directory workflow --configfile workflow/config/config.yaml
```

For large datasets, submit the workflow to a SLURM cluster instead, see [HPC](#hpc) below.

#### HPC

You can run this workflow on a high-performance computing cluster.

On the cluster, create the `snakemake` base environment:

```shell
conda env create --file environment.yaml
```

Then submit the provided workflow script on a cluster. Please check the script and the official [snakemake slurm plugin documentation](https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/slurm.html#snakemake-executor-plugin-slurm) to learn about relevant flags and settings.

```shell
cd workflow
sbatch snakemake.sbatch
```

#### Logging

Monitor the progress of the workflow in the workflow directory with [snkmt](https://github.com/cademirch/snkmt), see also [the documentation](./docs/tutorials/workflow/logger.md).

The `snkmt` logger is not part of `environment.yaml` and has to be installed into the `snakemake` environment separately:

```shell
pip install snakemake-logger-plugin-snkmt
```

Add `--logger snkmt` to the `snakemake` calls above, then follow the run from the workflow directory:

```shell
snkmt console
```

#### Install utility functions

The utility functions used by the workflow (source in `src/`) are published as the python package `dvpimg`.

```shell
conda create -n dvpimg python=3.12 -y && conda activate dvpimg
# only pre-releases are available so far
pip install --pre dvpimg
```

To install the version in this repository instead, run `pip install .` from the repository root.

## Components

See the [documentation](./docs/usage.md) 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

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.

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