spatial-gpu v0.1.0

Get Started

GPU-accelerated spatial omics analysis framework

Overview

spatial-gpu is a GPU-accelerated spatial omics analysis framework that serves as a drop-in replacement for Squidpy, delivering 10–100x speedup on common spatial transcriptomics workflows.

The package provides a comprehensive Python reimplementation of the SpaCET cell type deconvolution algorithm and the SecAct secreted protein activity inference pipeline, plus spatial graph construction, neighborhood enrichment, co-occurrence analysis, and cell segmentation integration.

Key features:

Installation

Install the latest release from PyPI:

pip install spatialgpu

For development (editable install with dev dependencies):

git clone https://github.com/psychemistz/spatial-gpu.git
cd spatial-gpu
pip install -e ".[dev]"

GPU acceleration requires a CUDA toolkit. Install the appropriate CuPy backend for your CUDA version:

# CUDA 12
pip install cupy-cuda12x

# CUDA 11
pip install cupy-cuda11x

Quick Start

Below is a minimal example that loads 10X Visium data, runs cell type deconvolution, and visualizes the results.

import spatialgpu.deconvolution as spacet

# 1. Load 10X Visium data from Space Ranger output
adata = spacet.create_spacet_object_10x("path/to/spaceranger/outs")

# 2. Run two-stage hierarchical deconvolution
adata = spacet.deconvolution(adata, cancer_type="BRCA")

# 3. Visualize cell type fractions
spacet.visualize_spatial_feature(
    adata,
    spatial_type="CellFraction",
    spatial_features=["Malignant", "Macrophage"],
)

# 4. Infer secreted protein activity
adata = spacet.secact_inference(adata)

# 5. Visualize signaling velocity
spacet.visualize_secact_velocity(adata, gene="SPP1")

Tutorials

Explore the full set of tutorials for detailed, end-to-end workflows:

For the full API listing, see the Reference page.