Skip to main content

goatpy — Spatial Glycomics Analysis Toolkit

PyPI version Documentation Status License: MIT Python 3.10+

goatpy is a Python toolkit for spatial glycomics analysis, combining MALDI mass spectrometry imaging with H&E histology. It provides automatic image registration, pseudo-image generation, spatial PCA, and annotation tools built on top of the SpatialData framework.

Features

  • Automatic H&E registration — align MALDI ion images to whole-slide H&E images using normalised cross-correlation with full 360° rotation search
  • QuPath annotation support — transform GeoJSON annotations from QuPath into the registered coordinate system
  • Spatial GraphPCA — dimensionality reduction with optional spatial smoothing via k-nearest-neighbour graphs
  • Pseudo-image generation — create spatial images from categorical or continuous obs columns
  • Landmark alignment GUI — interactive napari-based landmark alignment tool
  • SpatialData native — all outputs are standard SpatialData objects, compatible with the scverse ecosystem
  • Deconvolution — analyse mixed signals in spatial glycomics data.
  • Single-cell H&E analysis — segment cells in H&E images with SOPA and StarDist, align cell boundaries with MALDI imaging data, and use pixel_to_cells to assign pixel-level measurements to overlapping cells for pseudo-single-cell analysis and clustering.

Installation

Download environment.yml and create the environment:

conda env create -f environment.yml
conda activate maldi
pip install goatpy

PyPI

pip install goatpy

For napari visualisation support:

pip install "goatpy[napari]"

From source

pip install git+https://github.com/agc888/goatpy.git

Quick start

import goatpy as gp

# Load and register MALDI + H&E
sdata = gp.load_and_align(
    imzml_path="my_sample.imzML",
    he_path="my_sample.svs",
    geojson_path="annotations.geojson",  # optional QuPath annotations
)

# Normalise intensities
sdata = gp.normalize_spatialdata(sdata, table_name="maldi_adata", method="TIC")

# Dimensionality reduction
sdata = gp.graphpca_spatialdata(sdata, n_components=30, alpha=0.5)

# Cluster
sdata = gp.get_kmean_clusters(sdata, n_clusters=8)

# Visualise in napari
from napari_spatialdata import Interactive
Interactive([sdata]).run()

Documentation

Full documentation is available at goatpy.readthedocs.io.

Citation

If you use goatpy in your research, please cite:

Causer, A. (2025). goatpy: Spatial Glycomics Analysis Toolkit. https://github.com/agc888/goatpy

License

MIT — see LICENSE for details.

Metadata

Release files for goatpy 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goatpy 1.1.0
File Size Uploaded Provenance Actions
goatpy-1.1.0.tar.gz 197.8 kB Without provenance Details for goatpy-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for goatpy 1.1.0
File Interpreter ABI Platform Actions
goatpy-1.1.0-py3-none-any.whl Python 3 none any Details for goatpy-1.1.0-py3-none-any.whl

Total release size: 401.0 kB

Release files / goatpy-1.1.0.tar.gz

Download URL goatpy-1.1.0.tar.gz
Size 197.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bc3813a7d8662e5bc910c0e2a38bfd3676c97905a285d5c926afd53e073701b8
BLAKE2b-256 checksum
How to use checksums
75dad3a5cb94fc4356c704f2963dc16b65ff40e80fb69f310543afdeb5065a0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / goatpy-1.1.0-py3-none-any.whl

Download URL goatpy-1.1.0-py3-none-any.whl
Size 203.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
918cab7e68da43751367a7842815782c3eba6578e1adb5abd87a979774b8bc61
BLAKE2b-256 checksum
How to use checksums
24ae978b5682b072af06cea40a6d7281cf4e2cafd8d65c7acfd584661b96f82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Security for goatpy 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page