LLMs-Universal-Life-Science-and-Clinical-Skills- sc-velocity
install
source · Clone the upstream repo
git clone https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- "$T" && mkdir -p ~/.claude/skills && cp -r "$T/Skills/Transcriptomics/sc-velocity" ~/.claude/skills/mdbabumiamssm-llms-universal-life-science-and-clinical-skills-sc-velocity && rm -rf "$T"
manifest:
Skills/Transcriptomics/sc-velocity/SKILL.mdsource content
⚡ Single-Cell RNA Velocity
Quantify transcriptional dynamics by coupling spliced and unspliced matrices using scVelo's stochastic and dynamical models. This skill ingests AnnData/loom counts, performs preconditioning (normalization, moments, phase portrait checks), computes velocities, and returns latent time embeddings with driver gene evidence suitable for trajectory-aware downstream workflows.
When to Trigger
- User mentions "RNA velocity," "latent time," "dynamic gene programs," or "spliced/unspliced layers"
- Input AnnData includes
and.layers["spliced"].layers["unspliced"] - Need to compare lineage directionality following clustering/integration steps
Supported Inputs
| Format | Notes |
|---|---|
| Preferred; expects /, annotations, optional kinetic priors |
| Auto-converted to AnnData; verifies |
| Matrices | Provide / MTX + metadata to build AnnData wrapper |
Typical Workflow
- Load + QC
import scvelo as scv adata = scv.read("sample.h5ad") scv.pp.filter_and_normalize(adata, min_shared_counts=30, n_top_genes=4000) scv.pp.moments(adata, n_pcs=30, n_neighbors=30) - Velocity Computation
scv.tl.velocity(adata, mode="dynamical") scv.tl.velocity_graph(adata) scv.tl.velocity_confidence(adata) - Latent Time & Drivers
scv.tl.recover_dynamics(adata) scv.tl.latent_time(adata) scv.tl.rank_velocity_genes(adata, groupby="leiden") - Visualization & Export
scv.pl.velocity_embedding_stream(adata, basis="umap", color="leiden") adata.write_h5ad("velocity_annotated.h5ad")
CLI Examples
# Run full pipeline with dynamical model, auto-detect PCA/neighbor params python omicsclaw.py run sc-velocity --input data/sample.h5ad --mode dynamical --out runs/sc_velocity # Skip recover_dynamics if kinetics already stored python omicsclaw.py run sc-velocity --input data/sample.h5ad --mode stochastic --skip-latent-time # Provide loom inputs and metadata python omicsclaw.py run sc-velocity --loom data/sample.loom --obs-meta obs.csv --var-meta var.csv
Key Parameters
| Flag | Default | Description |
|---|---|---|
| | , , or modeling |
| | Genes must appear with this many shared counts during normalization |
| | HVG count for kinetics modeling |
| | Principal components for moment calculation |
| | Neighborhood size for velocity graph construction |
| | Disable latent time + driver gene ranking to save runtime |
Outputs
- Annotated
with velocity layers, confidence, latent time, and driver gene tables.h5ad - Summary report (
) capturing runtime, parameter set, model diagnostics, QC thresholdsreport.md - PNG/PDF figures for streamlines, quiver plots, phase portraits, driver gene heatmaps
for orchestrator bookkeepingresult.json
Integration Touchpoints
- Upstream:
,sc-preprocessing
,sc-doublet-detectionsc-batch-integration - Downstream:
(uses latent time),sc-trajectory
(velocity-informed ligand prioritization),sc-cell-communicationspatial-velocity
Troubleshooting Cheatsheet
| Symptom | Fix |
|---|---|
Low velocity confidence ( < 0.4) | Increase , rerun normalization/moments, verify layers not log-normalized beforehand |
| Divergent dynamical fit | Initialize with , inspect phase portraits for genes with insufficient kinetics |
| Memory pressure (>32 GB) | Use to preselect driver genes or run on sparse-backed AnnData |
Source Reliability
| Source | Score | Notes |
|---|---|---|
| Theis Lab scVelo repo | 0.93 | Active upstream repository with peer-reviewed implementation |
| K-Dense Claude Scientific Skills | 0.90 | Provides standardized skill scaffolding we mirror for metadata/trigger design |