Shanuz v0.1.1
Spatial transcriptomics (Xenium / Visium / CosMx)
This release adds a spatial analysis layer to shanuz — Seurat-parity loaders and
neighbourhood/niche analysis, validated end-to-end against R Seurat.
Added
- Loaders:
load_xenium,load_visium,load_cosmx— each returns aShanuz
object with expression and populated per-FOV centroids (.images).
load_xeniumkeeps onlyGene Expressionfeatures by default (matching
LoadXenium's assay split;keep_controls=Trueto retain controls). - Spatial-aware
from_anndata— rebuilds.imagesfromobsm['spatial']+
obs['fov']instead of misfiling it as a bogus PCA-style reduction. - Neighbourhood / niche analysis:
get_tissue_coordinates,spatial_knn,
nearest_neighbor_distance,local_neighborhood,build_niche_assay
(Seurat v5'sBuildNicheAssay),composition_test(directional Fisher/BH
enrichment across a categorical split). - Spatial plots:
image_dim_plot/image_feature_plot— matplotlib
centroid scatter, immune to theggplot24.xImageDimPlotblank-render bug. add_module_score(search=True)— case/punctuation-insensitive gene-symbol
resolution (localUpdateSymbolListstand-in).datasets.xenium_mouse_brain()— one-line auto-download (~20 MB) of a
public 10x Xenium dataset for the new tutorial.- Tutorial 5 — Xenium spatial (R vs Python): side-by-side R Seurat / shanuz
walkthrough on a public 10x Xenium mouse-brain section (36,602 cells x 248
genes — the dataset in Seurat's own spatial vignette). Every deterministic
anchor (cell counts, marker-defined cell types, nearest-neighbour distances,
local density, composition test) matches R to 8 significant figures. - GitHub Actions CI (ruff + pytest across Python 3.10-3.12),
py.typedmarker.
Notes
- Still open for the spatial milestone (tracked in
ROADMAP.md): a MERSCOPE
loader,FindSpatiallyVariableFeatures(Moran's I), and Visium tissue-image
(SpatialDimPlot/SpatialFeaturePlot) plots. - No breaking changes — all additions are backward compatible; the four
existing tutorials (PBMC 3k, PBMC 8k, CBMC CITE-seq, SCTransform) were rerun
end-to-end post-merge with no regressions.
Full changelog: v0.1.0...v0.1.1