Skip to main content

Spatial Glycomics Analysis Toolkit — MALDI imaging + H&E registration and analysis.

Project description

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

Installation

Recommended: conda environment

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.

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

goatpy-0.2.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

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

goatpy-0.2.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file goatpy-0.2.0.tar.gz.

File metadata

  • Download URL: goatpy-0.2.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for goatpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 758aa411b33d80b5d7e9d432aa6f76d337b0554cf56859cd8934023a4468d3f0
MD5 d59fe6eb6dda488aafcef126c266a523
BLAKE2b-256 502715cb62c7c8980ea7f72213467c8523582b6b6b85a5157063a97a1aa46808

See more details on using hashes here.

Provenance

The following attestation bundles were made for goatpy-0.2.0.tar.gz:

Publisher: publish.yaml on agc888/goatpy

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

File details

Details for the file goatpy-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for goatpy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6976f8373eb1eaf397ce0d5742b2c281cf39b3334ec768e78b42f1213ac26caa
MD5 828af87ac987f8b40c792cec1299783d
BLAKE2b-256 04f6f3d36356d88d2e4d71847cc1e16fdc2151b2d6943c0ac997e17853160317

See more details on using hashes here.

Provenance

The following attestation bundles were made for goatpy-0.2.0-py3-none-any.whl:

Publisher: publish.yaml on agc888/goatpy

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