omicverse-single-cell-trajectory-inference
Installation
SKILL.md
OmicVerse Single-Cell Trajectory Inference
Goal
Run the reusable trajectory-analysis part of the OmicVerse notebook on a cluster-ready AnnData: choose a TrajInfer method branch, set origin and optional terminal states, compute pseudotime or fate outputs, and optionally summarize the trajectory with PAGA. Keep raw QC and preprocessing outside this skill; hand off to the preprocessing skill first when the object is not already graph-ready.
Quick Workflow
- Inspect the input
AnnDataand confirm it already has a usable representation, plotting basis, and cluster labels. - Choose the trajectory branch up front:
method='diffusion_map',method='slingshot', ormethod='palantir'. - Instantiate
ov.single.TrajInfer(...)with explicitbasis,use_rep,n_comps,n_neighbors, andgroupby. - Call
set_origin_cells(...)before every trajectory run; callset_terminal_cells(...)when the branch supports or benefits from constrained terminal states. - Run
TrajInfer.inference(...). - For lineage topology, use the unified
ov.pl.trajectory(...)/ov.pl.trajectory_overlay(...)plotters — they consume the trajectory state written intoadataand share the same visual grammar acrossdiffusion_map/slingshot/palantir/monocle/sctour/ CellRank.ov.utils.cal_paga(...)+ov.utils.plot_paga(...)remain valid for explicit PAGA computation. - Summarize the branch structure with
ov.pl.branch_streamplot(adata, group_key=..., pseudotime_key=...)— river-style plot driven only by a pseudotime vector and cluster labels, interoperable across methods. - Fit marker trends with the shared GAM stack:
ov.single.dynamic_features(adata, genes=..., pseudotime=...)→ov.pl.dynamic_trends(res, ...)for per-gene curves andov.pl.dynamic_heatmap(adata, var_names=..., pseudotime=...)for many-gene panels. The same backend is used by every trajectory skill, so output is interoperable. - If you chose
palantir, optionally runpalantir_cal_branch(...)and thenpalantir_cal_gene_trends(...)only when the extra dependencies and expression layer are available. - Validate the expected
obs,obsm,varm, andunskeys before treating the result as finished.