Milume
Milume: a thinking surface for spatial omics.
A tactile, reactive widget that harnesses your scientific intuition.
Layer your data, select what catches your eye, and pick up where you left off in code.
Milume is a simple, reactive Jupyter (anywidget) surface for forming intuition about spatial omics data, which then drives the analysis that follows. The name comes from mille (thousand, as in mille-feuille, layers) + lume (light).
| Tool | Role | Demo |
|---|---|---|
| LandmarksWidget | Draw selections and landmarks on tissue coordinates; measure from the notebook |
More widgets and helpers may land here over time.
Install
pip install milume
Formerly spatial-rx
Milume was called spatial-rx. The API is unchanged; only the names moved:
pip uninstall spatial-rx
pip install milume
import milume # was: import spatial_rx
The final spatial-rx release is a thin shim that depends on milume and
re-exports it from spatial_rx with a DeprecationWarning.
Alongside other viewers
Milume complements other viewers. Use Milume to form intuition: layer images, cells,
and transcripts in a notebook, select what stands out, and carry the selection straight
into your analysis code. Use heavier viewers when you need to inspect in depth.
Landmarks and selections round-trip as plain geometry and obs_names, so you can hand
the same regions to any viewer.
From source:
uv sync --extra demo --group dev
LandmarksWidget
Draw selections and landmarks on tissue coordinates, color by category or gene, expand neighborhoods, and inspect the 3D tissue under a window.
import milume
w = milume.peek(adata, color="cell_type") # AnnData with obsm["spatial"]
w = milume.peek(sdata, color="cell_type") # SpatialData on disk: adds the 3D cube
From a SpatialData, the widget finds the table, the labels element it
annotates, a 3D image on the same grid, and their µm frame (override with
table=, image=, labels=; contrast_limits= for the image). Press I
(Inspect): hovering shows a live coarse preview of the tissue under the
cursor, and a click places a 300 µm window and docks a floating
full-resolution cube of it, colored like the map, with your landmarks drawn on
top. Save in the dock's title bar adds the window as an inspect
selection to its history strip. Read the inspected cells back with
w.get_obs_names(adata, "<inspect id>") or w.selections. Hold
Space to pan in any tool.
Read results back in Python:
| Need | Call |
|---|---|
| Cells in a selection | w.get_obs_names(adata, selection_id), w.assign_obs_mask(adata, key, selection_id) |
| Landmarks as geometry | landmarks_to_geodataframe(w.landmarks) |
| Measure against landmarks | distances, composition, along_positions (+ write_obs) |
| Compare a subset with the tissue | enrichment(adata, obs_names, obs_key=...) |
| XY vs 3D neighbors | nearest_distances(adata, seeds, obs_key=...) (needs obsm["spatial"] x, y, z) |
| Map colors for other plots | w.category_colors("cell_type") |
| Inspect window and cube cut | w.inspect_cx, w.inspect_cy, w.inspect_size_um; w.volume_cut = x0, x1, y0, y1, z0, z1 µm (intersect X/Y with the window for the shown box) |
Large expression matrices are sent sparse; pass genes= to limit the gene
catalog.
Metadata
Release files for milume 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| milume-1.1.0.tar.gz | 6.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| milume-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 MB
Release files / milume-1.1.0.tar.gz
| Download URL | milume-1.1.0.tar.gz |
|---|---|
| Size | 6.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca99152214d94862536e2dcc69dac96a4c0c5c1e6a0cb61d6ff219991c6415b8
|
|
BLAKE2b-256 checksum How to use checksums |
8c46c724779e625519fded01aceb8af4f561d6693c97969ebd197d1682c7135a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","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 / milume-1.1.0-py3-none-any.whl
| Download URL | milume-1.1.0-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80935544db8f61077dae21851932794d72caadb4602780d82c072d65254f9b2f
|
|
BLAKE2b-256 checksum How to use checksums |
6a1645b4f9dc093be80f84b608c846984039703f272539d0e24a4cf97e763cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","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}
|