Skip to main content

Gaussian Process Spatial Alignment (GPSA)

Project description

Gaussian Process Spatial Alignment (GPSA)

The gpsa-engelhardt package implements Gaussian Process Spatial Alignment, a probabilistic model for aligning spatial genomics data into a shared coordinate system using deep Gaussian processes.

Install name: gpsa-engelhardt
Import name: gpsa

Paper: Alignment of spatial genomics and histology data using deep Gaussian processes
➤️ https://www.biorxiv.org/content/10.1101/2022.01.10.475692v1

View the Code on GitHub


🚀 Installation

pip install gpsa-engelhardt
# Usage
import gpsa
from gpsa.models import GPSA, VariationalGPSA

Requires Python 3.10+ and PyTorch.


🔬 Overview

gpsa provides two primary classes:

  • GPSA — core generative model for probabilistic spatial alignment
  • VariationalGPSA — variational approximation for scalable inference

Use GPSA to jointly model multiple spatial genomics datasets and correct spatial misalignments across experiments or modalities.


🧪 Example (Test the published PyPI package)

A minimal, runnable example is provided in examples/grid_example.py. It simulates a small synthetic dataset and runs GPSA alignment.

# Make a new virtual environment (Python 3.11 shown; 3.10 also works)
python3.11 -m venv gpsa_test_venv

# Activate the virtual environment
source gpsa_test_venv/bin/activate

# (optional) Upgrade pip
pip install --upgrade pip

# Clone the repository (for the example script)
git clone https://github.com/engelhardtgpsa/spatial-alignment.git
cd spatial-alignment

# Install GPSA from PyPI (pin to a specific version if desired)
pip install gpsa-engelhardt==0.6.14

# Run the example
python examples/grid_example.py

# Deactivate the virtual environment when done
deactivate

📊 Visualization

Example output showing the alignment of two misaligned spatial views:

(Place image here if desired)

The aligned coordinates converge during training:

(Place animation here if desired)

GUI backends (e.g., matplotlib with tkinter) may require extra setup on some systems.


🐞 Bug Reports

Please open issues at:
https://github.com/engelhardtgpsa/spatial-alignment/issues


📔 Citation

If you use GPSA in your work, please cite:

Jones, A. C., et al. Alignment of spatial genomics and histology data using deep Gaussian processes. bioRxiv (2022).
https://www.biorxiv.org/content/10.1101/2022.01.10.475692v1


📜 License

Apache-2.0

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

gpsa_engelhardt-0.6.14.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

gpsa_engelhardt-0.6.14-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file gpsa_engelhardt-0.6.14.tar.gz.

File metadata

  • Download URL: gpsa_engelhardt-0.6.14.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for gpsa_engelhardt-0.6.14.tar.gz
Algorithm Hash digest
SHA256 7bbb9f9a8a6c01fd7751c9e2bdc8d8fda847ca6fb934b4ba8e4f1908a2b7a248
MD5 15c34ecd448745b5ed864eb6e8be0684
BLAKE2b-256 73e3678968163399e57a71e1052174d76133580f2472959a266a8e9265348306

See more details on using hashes here.

File details

Details for the file gpsa_engelhardt-0.6.14-py3-none-any.whl.

File metadata

File hashes

Hashes for gpsa_engelhardt-0.6.14-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4bf05a8f90de78aa46f5f56f24229a41ca791db54ccc8b81b98dd80800d34e
MD5 c23c3da63097f3d86896519eb23cb0c4
BLAKE2b-256 afc74d709e709eae85db4443d5a34ef6917bb875e4f9d094b1e8b68a4942771b

See more details on using hashes here.

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