Skip to main content

spatial-rx

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

Tool Role
LandmarksWidget Draw selections and landmarks on tissue coordinates; measure from the notebook
GalleryWidget Compact card gallery (e.g. analysis recipes / use cases)

More widgets and helpers may land here over time.

Install

Library only:

pip install spatial-rx

From source (includes demo notebook deps and test tools):

uv sync --extra demo --group dev

LandmarksWidget

An anywidget for spatial coordinates: top tool bar, left sidebar, drawing-only synced state.

  • Selections — lasso, rectangle, rotatable ellipse
  • Landmarks — point, line, spline, shape
  • Layer tools — spline tension; directional buffer on lines/splines (left / both / right)

Use get_mask / get_indices(selection_id=...) to restrict points. Distance, composition, gradient, and other tables belong in the notebook.

Matplotlib (static figure)

from spatial_rx import LandmarksWidget

w = LandmarksWidget(fig)
idx = w.get_indices(x, y, selection_id="selection 1")

Scatter (pan / zoom)

Interactive points use regl-scatterplot (same WebGL engine as jupyter-scatter). In Pan/Zoom mode, navigate the scatter; switch to lasso / landmark tools to draw.

from spatial_rx import LandmarksWidget

w = LandmarksWidget.from_points(x, y, color=cell_type, width=900, height=900)
w.set_color(gene_expression)  # update colors without rebuilding
idx = w.get_indices(x, y, selection_id="selection 1")

Demo

Spatial transcriptomics playground (demos/landmarks.py; data under demos/data/):

Open in molab

Or run locally:

git clone https://github.com/ckmah/spatial-rx.git
cd spatial-rx
uv sync --extra demo
uv run marimo edit demos/landmarks.py

Metadata

Release files for spatial-rx 0.1.0

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

Source distribution (sdist)

Source distribution for spatial-rx 0.1.0
File Size Uploaded
spatial_rx-0.1.0.tar.gz 4.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for spatial-rx 0.1.0
File Interpreter ABI Platform
spatial_rx-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 MB

Release files / spatial_rx-0.1.0.tar.gz

Download URL spatial_rx-0.1.0.tar.gz
Size 4.6 MB
Tags Source
SHA-256 checksum
How to use checksums
cc5f485668ba5512e160f3c150be343dbc04788574581dc6323acd8d140a95b2
BLAKE2b-256 checksum
How to use checksums
7766d88250c4772ce861d848373b1a33c8041a21563f2458ce5528951abcd2a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spatial_rx-0.1.0-py3-none-any.whl

Download URL spatial_rx-0.1.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf720e64e255cc1e12008f5b2712b0f25c8842fbe344d4d4e30f041b22939f1a
BLAKE2b-256 checksum
How to use checksums
39ba1d1e7d7eb600697f9de2ebd73af27acce69dfe87c1fd57d5c564eb429aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

This release

0.1.0 This release

2 release files

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