Metadata-Version: 2.5
Name: spatial-rx
Version: 1.0.0
Summary: Tools for exploring spatial omics data in notebooks
Project-URL: Homepage, https://github.com/ckmah/spatial-rx
Project-URL: Repository, https://github.com/ckmah/spatial-rx
Project-URL: Issues, https://github.com/ckmah/spatial-rx/issues
Author: ckmah
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.11
Requires-Dist: anndata>=0.10
Requires-Dist: anywidget>=0.9.2
Requires-Dist: geopandas>=1.1.4
Requires-Dist: matplotlib>=3.0
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: polars>=1.0
Requires-Dist: ruff>=0.16.6
Requires-Dist: scipy>=1.11
Requires-Dist: shapely>=2.1.2
Requires-Dist: traitlets>=5.0
Requires-Dist: wigglystuff>=0.5.32
Provides-Extra: demo
Requires-Dist: altair>=6.2.2; extra == 'demo'
Requires-Dist: cmcrameri>=1.10; extra == 'demo'
Requires-Dist: marimo>=0.24.0; extra == 'demo'
Requires-Dist: scanpy>=1.10; extra == 'demo'
Requires-Dist: squidpy>=1.6; extra == 'demo'
Requires-Dist: tifffile>=2026.3.3; extra == 'demo'
Provides-Extra: test
Requires-Dist: geopandas>=1.1.4; extra == 'test'
Requires-Dist: pandas>=2.0; extra == 'test'
Requires-Dist: pytest>=8.3.3; extra == 'test'
Requires-Dist: shapely>=2.1.2; extra == 'test'
Requires-Dist: spatialdata>=0.2; extra == 'test'
Description-Content-Type: text/markdown

# spatial-rx

Tools for exploring spatial omics data in notebooks — reactive widgets that stay
in sync with your Python analysis.


| Tool | Role | Demo |
| ---- | ---- | ---- |
| **LandmarksWidget** | Draw selections and landmarks on tissue coordinates; measure from the notebook | [![Open in molab](https://marimo.io/molab-shield.svg)](https://molab.marimo.io/github/ckmah/spatial-rx/blob/main/demos/landmarks.py) |
| **GalleryWidget** | Compact card gallery (e.g. analysis recipes / use cases) | [![Open in molab](https://marimo.io/molab-shield.svg)](https://molab.marimo.io/github/ckmah/spatial-rx/blob/main/demos/gallery.py) |


More widgets and helpers may land here over time.

## Install

```bash
pip install spatial-rx
```

From source:

```bash
uv sync --extra demo --group dev
```

## LandmarksWidget

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="assets/landmarks_widget_dark.png" />
  <source media="(prefers-color-scheme: light)" srcset="assets/landmarks_widget_light.png" />
  <img alt="Landmarks widget" src="assets/landmarks_widget_light.png" />
</picture>

Draw selections and landmarks on tissue coordinates (lasso, rectangle, ellipse; point,
line, spline, shape). Format data as `AnnData` with `obsm["spatial"]` and squidpy
neighbor graphs, then `LandmarksWidget(adata, color=..., genes=...)`. Persist
hits with `get_obs_names`.

## GalleryWidget

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="assets/gallery_widget_dark.png" />
  <source media="(prefers-color-scheme: light)" srcset="assets/gallery_widget_light.png" />
  <img alt="Gallery widget" src="assets/gallery_widget_light.png" />
</picture>

Selectable image cards for recipes or use cases. Synced selection is `selected_index`.
