Skip to main content

single-cell spatial omics analysis that makes you happy.

Project description

Harpy logo

Single-cell spatial omics analysis that makes you happy.

PyPI Downloads Build Status documentation badge Test Status codecov License GitHub repo size uv Ruff

Documentation · Quick Start · Tutorials · Harpy Vitessce

💫 If you find Harpy useful, please give us a ! It helps others discover the project and supports continued development.

Why Harpy?

Harpy is a spatial omics analysis library for spatial transcriptomics and proteomics. Within the scverse stack, it bridges SpatialData and downstream analysis tools such as AnnData, Scanpy, and Squidpy. It provides scalable, image- and geometry-aware computation to transform raw spatial data into analysis-ready representations, with a strong emphasis on interoperability and large-scale workflows.

In practice, Harpy offers fast, out-of-core image preprocessing, tiled segmentation, along with efficient aggregation workflows to generate AnnData tables and compute per-cell features from images, segmentation masks, and transcript coordinates. It also supports deep feature extraction, pixel- and cell-level clustering, and the construction of single-cell representations from highly multiplexed images.

  • Multi-platform support for spatial transcriptomics and proteomics data.
  • Interoperable outputs built on SpatialData.
  • Scales to (very) large images: tiled workflows with Dask; optional GPU acceleration with CuPy and PyTorch.
  • Scalable computational building blocks for segmentation, feature extraction, clustering, and spatial analysis.

Installation

pip install harpy-analysis

With extras

pip install "harpy-analysis[extra]"

[extra] installs optional dependencies for:

  • Segmentation: cellpose
  • OpenCV support: opencv-python-headless
  • FlowSOM Clustering: flowsom
  • Notebook workflows: ipywidgets, tqdm, bokeh, textalloc, joypy, supervenn, nbconvert, ipython
  • CLI workflows: hydra-core

With extras and napari

pip install "harpy-analysis[extra,napari]"

[napari] adds:

  • napari[all]
  • napari-spatialdata

Only for developers. Clone this repository locally, install the .[dev] instead of the [extra] dependencies and read the contribution guide.

# Clone repository from GitHub
uv venv --python=3.12  # create venv, set python version (>=3.11)
source .venv/bin/activate  # activate the virtual environment
uv pip install -e '.[dev]'  # editable install with dev tooling
python -c 'import harpy; print(harpy.__version__)'  # check if the package is installed
# make changes
python -m pytest  # run the tests

It is possible to install Harpy using Anaconda although we recommend uv, see the installation guide.

Quickstart

See the short, runnable guide.

🧭 Tutorials and Guides

Explore how to use Harpy for segmentation, shallow and deep feature extraction, clustering, and spatial analysis of gigapixel-scale multiplexed data with these step-by-step notebooks:


  • 🌐 Multiple samples and coordinate systems

    Learn how to work with multiple samples, intrinsic and micron coordinates. 👉 Tutorial


  • 📐 Rasterize and vectorize labels and shapes

    Learn how to convert a segmentation mask (array) into its vectorized form, and segmentation boundaries (polygons) into their rasterized equivalents. This conversion is useful, for example, when integrating annotations (e.g., from QuPath) into downstream spatial omics analysis.👉 Tutorial


📚 For a complete list of tutorials, visit the Harpy documentation.

Computational benchmark

Explore the benchmark performance of Harpy on a large MACSima tonsil proteomics dataset. 👉 Results

Contributing

See the contribution guide for info on how to contribute to Harpy.

Citation

If you use Harpy in your work, please cite:

Benjamin Rombaut, Arne Defauw, Frank Vernaillen, Julien Mortier, Evelien Van Hamme, Sofie Van Gassen, Ruth Seurinck, Yvan Saeys. Scalable analysis of whole slide spatial proteomics with Harpy. Bioinformatics (2026), btag122. https://doi.org/10.1093/bioinformatics/btag122

If you use Harpy for spatial transcriptomics analysis, please cite:

Lotte Pollaris, Bavo Vanneste, Benjamin Rombaut, Arne Defauw, Frank Vernaillen, Julien Mortier, Wout Vanhenden, Liesbet Martens, Tinne Thone, Jean-Francois Hastir, Anna Bujko, Wouter Saelens, Jean-Christophe Marine, Hilde Nelissen, Evelien Van Hamme, Ruth Seurinck, Charlotte L. Scott, Martin Guilliams, Yvan Saeys. SPArrOW: a flexible, interactive and scalable pipeline for spatial transcriptomics analysis. https://doi.org/10.1101/2024.07.04.601829

License

Check the license. Harpy is free for academic usage. For commercial usage, please contact Saeyslab.

Issues

If you encounter any problems, please file an issue along with a detailed description.

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

harpy_analysis-0.3.5.tar.gz (21.3 MB view details)

Uploaded Source

Built Distribution

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

harpy_analysis-0.3.5-py3-none-any.whl (464.6 kB view details)

Uploaded Python 3

File details

Details for the file harpy_analysis-0.3.5.tar.gz.

File metadata

  • Download URL: harpy_analysis-0.3.5.tar.gz
  • Upload date:
  • Size: 21.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harpy_analysis-0.3.5.tar.gz
Algorithm Hash digest
SHA256 3a6dd41c82ac302a55033c2f663738326a71bb0d2636b152bc9f9fec28fa711e
MD5 c9aaa244af5ce77440f0d1bebf55451b
BLAKE2b-256 ae0a37fca585b9ad9f1b2c58aaf0d0595285e26b31b7117fc14a89e5e7e4fdf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for harpy_analysis-0.3.5.tar.gz:

Publisher: release.yaml on saeyslab/harpy

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

File details

Details for the file harpy_analysis-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: harpy_analysis-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 464.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harpy_analysis-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3629a7fcc72e5883d7f377be34e94e71049c8a34ce4689a60829c30b51a87b98
MD5 8211fc2d1d5871e7f202d6dfa1fcf572
BLAKE2b-256 fdde80562b1910b085221074f5efbb6095ceef4e00cb05309ca9d03b19ba6db1

See more details on using hashes here.

Provenance

The following attestation bundles were made for harpy_analysis-0.3.5-py3-none-any.whl:

Publisher: release.yaml on saeyslab/harpy

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