API Reference (cellucid-python)#

This section is the canonical reference for the public cellucid Python API (and the cellucid CLI).

Choose your path


Which function should I call?#

You have…

You want…

Use…

AnnData (in memory / .h5ad / .zarr)

The fastest “just show me” notebook view

show_anndata()

Exported dataset directory

Notebook embedding

show()

Exported dataset directory

Browser tab (local HTTP server)

serve() or cellucid serve

.h5ad / .zarr

Browser tab without exporting first

serve_anndata() or cellucid serve

A session captured in the web app

Apply highlights/fields back onto AnnData

CellucidSessionBundle + apply_cellucid_session_to_anndata()

A transition matrix + embedding

Vector field overlay in Cellucid

compute_transition_drift() / add_transition_drift_to_obsm()


API map#

Jupyter

Notebook embedding, hooks/events, and controlling the viewer from Python.

Jupyter (notebook embedding + hooks)
Server

Run a local server for exported datasets or AnnData (including SSH-tunnel workflows).

Server (browser tab + local HTTP server)
Export / Data Preparation

prepare(...) and the exported on-disk format used by the web viewer.

Export / Data Preparation (prepare)
Viewers

CellucidViewer and AnnDataViewer classes (Jupyter widgets + hooks).

Viewer classes (Jupyter objects you control from Python)
Adapters

AnnDataAdapter (server-side adapter for .h5ad/.zarr/in-memory AnnData).

Adapters (AnnData → Cellucid data model)
Sessions

.cellucid-session bundles: read, inspect, and apply back to AnnData.

Sessions (.cellucid-session bundles)
Vector Fields

Compute/store vector overlays (e.g., CellRank drift) for visualization.

Vector fields (velocity / drift overlays)
CLI

cellucid serve auto-detects .h5ad, .zarr, or exported directories.

CLI (cellucid)

Reference conventions#

  • Exported dataset directory” means a folder created by prepare() (contains dataset_identity.json, obs_manifest.json, and points_*d.bin(.gz)).

  • AnnData mode” means serving data directly from an AnnData object or .h5ad/.zarr without running prepare first (convenient, but typically slower).

  • Many APIs are lazy-imported from cellucid.__init__ to keep CLI startup fast; importing cellucid is intentionally lightweight.