Skip to content

Shanuz v0.1.1

Choose a tag to compare

@shanikawm shanikawm released this 04 Jul 13:11

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 a Shanuz
    object with expression and populated per-FOV centroids (.images).
    load_xenium keeps only Gene Expression features by default (matching
    LoadXenium's assay split; keep_controls=True to retain controls).
  • Spatial-aware from_anndata — rebuilds .images from obsm['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's BuildNicheAssay), composition_test (directional Fisher/BH
    enrichment across a categorical split).
  • Spatial plots: image_dim_plot / image_feature_plot — matplotlib
    centroid scatter, immune to the ggplot2 4.x ImageDimPlot blank-render bug.
  • add_module_score(search=True) — case/punctuation-insensitive gene-symbol
    resolution (local UpdateSymbolList stand-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.typed marker.

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