API Reference (cellucid-python)#
This section is the canonical reference for the public cellucid Python API (and the cellucid CLI).
Choose your path
Wet lab / beginner: start with Jupyter (notebook embedding + hooks) (notebooks) or CLI (cellucid) (terminal).
Computational user: start with Data preparation (prepare) (Cellucid-ready AnnData) + Server (browser tab + local HTTP server) (serving AnnData).
Power user / developer: start with Sessions (.cellucid-session files) (session bundles) + Vector fields (velocity / drift overlays) (velocity/drift overlays).
Which function should I call?#
You have… |
You want… |
Use… |
|---|---|---|
|
The fastest “just show me” notebook view |
|
Arrays, an |
A Cellucid-ready AnnData (or MuData) file |
|
Any file or folder Cellucid reads ( |
Browser tab (local HTTP server) |
|
A viewer, or the web app’s exports (CSV, GMT, session) |
Everything made in Cellucid (highlights, labels, scores, gene sets) as |
|
An |
Shown in the viewer |
|
A session saved in the web app (the history of every step) |
Its trackers, branches and steps; the state at any step (labels, highlights, fields, gene sets) planned, then applied onto |
|
A transition matrix + embedding |
Vector field overlay in Cellucid |
API map#
Notebook embedding, hooks/events, and controlling the viewer from Python.
Run a local server for any file or folder Cellucid reads, or an AnnData or MuData object (including SSH-tunnel workflows).
prepare(...): write a Cellucid-ready AnnData (.h5ad, .zarr, .zarr.zip) or MuData (.h5mu, MuData Zarr).
The AnnDataViewer class (Jupyter widget + hooks).
Pull highlights, labels, scores and gene sets into obs in one call; push columns and gene sets; GMT.
.cellucid-session files: read the history (trackers, branches, steps), plan and apply a step back to AnnData.
Compute/store vector overlays (e.g., CellRank drift) for visualization.
cellucid serve: detects and serves any file or folder Cellucid reads.
Reference conventions#
“Cellucid-ready AnnData” means a standard AnnData written by
prepare()(or R’scellucid_prepare()): gene-major, chunked for range reads, naming itself inuns['cellucid'].Every viewing API hands a file or folder, or an in-memory
AnnDataorMuData, to the viewer, which reads it itself: in place with HTTP range requests where the format allows it (AnnData, MuData, Loom, 10x), once from the start for an R object or a MatrixMarket folder. An in-memory AnnData, and an AnnData, MuData, Loom or 10x file (orouts/folder) not in priority order, are served as a store with their cells in priority order, made as the viewer reads it and holding what the viewer presents from the file itself; an in-memory MuData as a MuData store, the same way. Expression matrices held in memory, and a cell-majorXof a file, are laid out gene-major in the background, so the viewer opens at once.Many APIs are lazy-imported from
cellucid.__init__to keep CLI startup fast; importingcellucidis intentionally lightweight.