retentioneering-tools
Python toolkit, MCP server, and agent skills for reproducible, auditable clickstream and event log analytics. Helps AI agents, data scientists and analysts build, validate, and cross-check product ana
A static, reactive browser for spatial transcriptomics and snRNA-seq, and the CLI that builds its data bundles.
DataPython · TypeScriptGitHub @MicTottOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
A static, highly reactive web browser for spatial transcriptomics and snRNA-seq
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
A static, reactive browser for spatial transcriptomics and snRNA-seq.
One pip install turns a SpatialExperiment or AnnData into a dataset you can open locally or publish as a website.
Seventeen Visium sections of human dorsal anterior cingulate cortex on one canvas: H&E under PRECAST layer labels, one legend for all of them.Read the full README ↗Browsing a spatial transcriptomics or snRNA-seq dataset should feel immediate: every section of a study in view at once, a new gene in milliseconds, a link that reopens the exact view, and nothing to run but a static web host. spatialscape is a viewer built for that, and the command line that turns your data into something it can show.
pip install spatialscape
spatialscape synth demo-src # two fake sections, an embedding and a dataset.yaml
spatialscape build demo-src/dataset.yaml # -> demo-src/bundles/synthetic
spatialscape serve demo-src/bundles --open # viewer + data at http://127.0.0.1:8787/
From a folder of your project, from a saved R object (SpatialExperiment / SingleCellExperiment / Seurat as .rds or .rda, parsed in Python, no R needed) or from AnnData / SpatialData files:
mkdir -p spatialscape && cd spatialscape
spatialscape init ../analysis/spe_dlpfc.rds --id dlpfc --name "Human DLPFC" # writes ./dlpfc.yaml, a menu of the data, and prints what it assumed
# edit dlpfc.yaml: keep the annotations you want, name them, pick colors and the opening gene
spatialscape build dlpfc.yaml # -> bundles/dlpfc; rerun after any edit
spatialscape serve bundles --open
spatialscape site build bundles -o site # viewer + gallery + data, ready to upload
init maps the columns that look like spatial domains, cell types and QC metrics, lists every other column as a comment, and says which platform, coordinate units and layer it took for granted, so most edits are deleting or uncommenting a line. build is incremental: a rename or a new palette takes seconds, a re-exported file rebuilds that one sample. For a gallery of several datasets with a title, paper links and "coming soon" cards, spatialscape site init writes a site.yaml and spatialscape site build site.yaml builds it.
myproject/
analysis/spe_dlpfc.rds your object, never modified
spatialscape/
dlpfc.yaml yours to edit: samples, annotations, names, colors
site.yaml yours to edit: title, cards, paper links (optional)
bundles/dlpfc/ the built dataset: upload this to a data host
bundles/.cache/ R objects converted to AnnData; local only
site/ the finished website: upload this
The documentation walks through every step: how it fits together, writing dataset.yaml, making changes, publishing a site and the CLI reference.
No yaml, no site: show the object you have in memory, lasso cells, take them back out.
import spatialscape
s = spatialscape.show(adata, color="cell_type") # builds once into a cache, opens under the cell
cells = s.selection() # obs names inside the last lasso
sub = adata[cells] # straight into a DE test
From R, reticulate::py_require("spatialscape"), one saveRDS, and ss$show("spe.rds") does the same for a SpatialExperiment (guide).
| In the viewer | In the pipeline |
|---|---|
| Color by gene, by two blended gene sets, by any annotation or by cell type weights | Visium, Visium HD, Xenium, MERFISH and snRNA-seq in one dataset, laid out in microns |
| Filter independently of color: a gene threshold, a QC range, a category | H&E and fluorescence images as OME-Zarr pyramids under the points |
| Hover for every annotation; lasso a region for composition, gene statistics and a CSV of cell ids | Cell boundaries, nucleus boundaries and every transcript at high zoom |
| A dot plot of the current gene by annotation that doubles as a filter | Dataset-level vocabularies: one label, one code, one color across samples and platforms |
| A split view with the snRNA-seq embedding, resizable, left or right | Validation of every bundle, locally and over HTTP (CORS and Range checks) |
| Copy a link to the exact view; export a PNG with legend and scale bar | Incremental builds with a per-sample fingerprint; a conversion cache for R objects |
spatialscape build writes a bundle: a folder of static files holding manifest.json, the gene lists and, per sample, a gene-major uint8 expression array (sharded Zarr v3), positions in microns, categorical codes, images, outlines and polygons. The viewer (React 19, deck.gl 9, Viv, zarrita) draws every sample in one WebGL context, decodes in a worker and recolors by uploading one byte per cell. Details: bundle format, architecture.
app/ the viewer: Vite + React 19 + TypeScript (deck.gl 9, Viv, zarrita, Zustand)
python/ the spatialscape CLI (anndata, zarr v3, pydantic); the built viewer ships inside the wheel
docs/ the documentation site (VitePress); the CLI pages are generated from the help text
examples/ dataset yamls for the LIBD amygdala, dACC and cross-species BLA datasets, and the synthetic demo
git clone https://github.com/MicTott/spatialscape && cd spatialscape
python3 -m venv python/.venv && python/.venv/bin/pip install -e "python[dev]"
npm install
npm run dev # viewer at http://127.0.0.1:5173
python/.venv/bin/spatialscape serve examples --port 8787 # data; the dev server proxies /examples to it
python/.venv/bin/python -m pytest python/tests && npm test && npm run e2e
npm run build && python/.venv/bin/python python/scripts/bundle_app.py refreshes the viewer copy inside the package. See CONTRIBUTING.md.
Developed at the Lieber Institute for Brain Development for its spatial transcriptomics and snRNA-seq data releases, and meant for any lab that wants to put a dataset online next to a paper. Planned: multi-frame compare, named waypoints, more LIBD datasets.
MIT license. Cite with CITATION.cff.