Effort: extensive
Compose scanpy, scvi-tools, scvelo, and cellxgene-census into
an end-to-end single-cell trajectory inference workflow: ingest a
raw counts matrix (h5ad/h5/mtx) or pull a Census query, run QC and
batch-corrected embedding with scVI, infer RNA velocity with scVelo,
compute a cell-fate transition matrix and latent-time ordering, and
persist the resulting cell-fate map as an interactive artifact a
debate can cite when arguing trajectory claims.
q-rdp-cellxgene-target-expression exposes per-gene Census expression,
but trajectory inference is qualitatively different — it infers
causal cell-state transitions from spliced/unspliced kinetics, not
just snapshot abundance. A neurodegen hypothesis "PV+ interneurons
trans-differentiate to a hyper-excitable state during AD progression"
is debatable today only via literature. With a trajectory pipeline,
the Skeptic can demand actual scVelo evidence and the Theorist can
provide it. This is the highest-value missing capability for cell-state
hypotheses across every vertical.
scidex/forge/singlecell_trajectory.py (≤1000 LoC):ingest(source) — accepts h5ad/h5/mtx local file OR a Census{organism, cell_type, tissue, disease}); returnsAnnData.qc_and_filter(adata) — scanpy standard QC: mt%, n_counts,scrublet; emits filterembed_with_scvi(adata, batch_key) — fits scVI on raw countscompute_velocity(adata) — calls scvelo.tl.velocity andscvelo.tl.velocity_graph; computes latent time and dynamic-cell_fate_map(adata) — derives transition probabilities,pipeline(source) — composes; outputs go todata/scidex-artifacts/sc_trajectory/<run_id>/ with thesc_trajectory_run(run_id PRIMARY KEY,tools.py registers singlecell_trajectory_pipeline with@log_tool_call; CPU job hard-cap at 50 K cells; GPU at 500 K.
/artifacts/<id> renders the UMAP with velocity arrows + avelocity_evidence block whenq-rdp-cellxgene-target-expression.
python -m scidex.forge.singlecell_trajectoryn_terminal_states is plausible (≥1, ≤20) and the reporttests/test_sc_trajectory.py — synthetic 200-cell AnnDatacellxgene-census skill;obs_query to limit cells.
scanpy, scvi-tools, scvelo, anndata, cellxgene-censusq-rdp-cellxgene-target-expression — reuses the Census handle.data/scidex-artifacts/ submodule.