Skip to main content

Spatialxgene

v0.2.1 — Browser-based spatial transcriptomics viewer and preprocessing (cellxgene-style). Launch the viewer to explore spatial plots (zoom/pan, color by gene or annotation, optional tissue image), or run infer / preprocess on raw h5ad.

Requirements

  • Python ≥3.9
  • If you install from PyPI (pip install spatialxgene): no other requirements; the frontend is included.
  • If you install from source (pip install -e .): Node.js is needed to build the frontend once (see docs/development.md).

Install

# From PyPI (recommended; frontend included)
pip install spatialxgene

# From source (e.g. for development)
git clone <repo> && cd spatialxgene
pip install -e .
# Then build frontend once: see docs/development.md

Commands

Command Description
spatialxgene launch Start the browser viewer; serve preprocessed h5ad from a directory.
spatialxgene infer Add spatial coordinates when the h5ad has none (e.g. Stereo-seq grid).
spatialxgene preprocess Expression pipeline: QC, normalize, HVG, PCA, UMAP, Leiden. Does not change spatial.

For development (frontend watch): spatialxgene dev — see docs/development.md.

Quick start

  1. Launch the viewer

    spatialxgene launch --data-dir /path/to/preprocessed/h5ad/dir
    

    Opens http://127.0.0.1:8000. Use the sidebar to pick a dataset, color by annotation or gene, choose a tissue background image (if present), and zoom/pan the plot.

  2. Infer spatial (when raw h5ad has no coordinates)

    spatialxgene infer /path/to/raw.h5ad
    # or a directory: spatialxgene infer /path/to/dir
    
  3. Preprocess expression (QC, reduce, cluster)

    spatialxgene preprocess /path/to/raw.h5ad
    # Writes *_preprocessed.h5ad (or input/preprocessed/ for a directory)
    

Data format (viewer)

Preprocessed h5ad for launch should have:

  • Spatial: obsm['spatial'] or obs['x'] and obs['y'].
  • Expression: X, var index = gene names.
  • Annotations (optional): e.g. obs['leiden'] for coloring.
  • Tissue images (optional): Visium-style uns['spatial'][sample]['images'] (e.g. hires, lowres) and scalefactors.

More options: spatialxgene launch --help, spatialxgene infer --help, spatialxgene preprocess --help.

Documentation

Metadata

Release files for spatialxgene 0.2.1

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

Built distribution (wheel)

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

Release files / spatialxgene-0.2.1-py3-none-any.whl

Download URL spatialxgene-0.2.1-py3-none-any.whl
Size 70.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37238754962131d0ed87aaa904bdbf30b6c925dfaec35d53f58cee222dd5bcf3
BLAKE2b-256 checksum
How to use checksums
5317361fa784a312b564c9cb7c32f0b4cb2fee47ae6aa12f827284c1a5bdb382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for spatialxgene 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

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