Browser-based spatial transcriptomics viewer (cellxgene-style)
Project description
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
-
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.
-
Infer spatial (when raw h5ad has no coordinates)
spatialxgene infer /path/to/raw.h5ad # or a directory: spatialxgene infer /path/to/dir
-
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']orobs['x']andobs['y']. - Expression:
X,varindex = gene names. - Annotations (optional): e.g.
obs['leiden']for coloring. - Tissue images (optional): Visium-style
uns['spatial'][sample]['images'](e.g.hires,lowres) andscalefactors.
More options: spatialxgene launch --help, spatialxgene infer --help, spatialxgene preprocess --help.
Documentation
- CHANGELOG.md — Release history.
- docs/ — Development, project layout, design, and plans: development.md, master_plan.md, implementation_plan.md, design_guidelines.md, tasks.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spatialxgene-0.2.1-py3-none-any.whl.
File metadata
- Download URL: spatialxgene-0.2.1-py3-none-any.whl
- Upload date:
- Size: 70.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37238754962131d0ed87aaa904bdbf30b6c925dfaec35d53f58cee222dd5bcf3
|
|
| MD5 |
7a5dcc2fdb13c7cfe84f4939908c4822
|
|
| BLAKE2b-256 |
5317361fa784a312b564c9cb7c32f0b4cb2fee47ae6aa12f827284c1a5bdb382
|