
scvelo
Performs RNA velocity analysis with scVelo from spliced and unspliced single-cell RNA counts. Fits deterministic or dynamical models, examines gene phase portraits, builds velocity graphs, estimates relative latent time, and ranks velocity-associated genes. Use for directional trajectory hypotheses and kinetic-model diagnostics alongside Scanpy; velocity alone does not establish cell fate or causal drivers.
- Installs
- 1.9K
- Last 24h
- +13
- Trending rank
- #7726
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill scvelo- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads scvelo automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
scVelo RNA Velocity
When to use
Use for kinetic analysis of aligned spliced/unspliced RNA counts, directional trajectory hypotheses, gene-level phase portraits, and dynamical latent time. Use the model reference for assumptions, transition probabilities, and an optional CellRank handoff.
RNA velocity estimates an expression derivative under a model. Smooth arrows are not observed cell movement, lineage tracing, causal drivers, or proof of future fate. The dynamical estimator is not automatically more accurate than a steady-state estimator on every dataset.
Tested environment and compatibility
The maintained workflow targets scVelo 0.3.4, Scanpy 1.12.4, AnnData 0.13.4, NumPy 2.5.3, pandas 2.3.3, SciPy 1.18.1, Matplotlib 3.11.2, and loompy 3.0.8 on Python 3.13. Use an isolated environment:
uv venv --python 3.13 .venv-velocity
uv pip install --python .venv-velocity/bin/python \
scvelo==0.3.4 scanpy==1.12.4 anndata==0.13.4 numpy==2.5.3 \
pandas==2.3.3 scipy==1.18.1 matplotlib==3.11.2 loompy==3.0.8
The packages above were resolved from cache and tested in an isolated uv
environment; shell paths above use POSIX syntax. Installation requires network
access unless packages are cached. No API key is required.
- Deterministic and dynamical models: native synthetic fitting, graphs, relative times, plots and H5AD round trips are tested on this stack.
- Stochastic model: scVelo 0.3.4's default GLS scalar assignment fails with
NumPy 2. Scanpy 1.12 requires NumPy 2, so installing
numpy<2beside current Scanpy is not a solution. A separately validated legacy Scanpy/NumPy environment is required; that legacy stack was not executed in this review. The helper rejects this combination before modifying data, without changing the model. - pandas 3: scVelo 0.3.4 dynamical fitting and some plots use operations no longer supported by pandas 3. Keep the explicit pandas pin.
- The upstream stable tutorial still contains removed
scv.readand older preprocessing calls. Check the 0.3.4 source when a tutorial disagrees with the installed API.
Input contract
- Obtain spliced and unspliced counts from a velocity-aware quantifier. Keep quantifier/version, reference annotation, counting mode, sample IDs and cell barcode mapping. Upstream quantification is outside the bundled script.
- Supply cells by genes matrices in
adata.layers['spliced']andadata.layers['unspliced'], with identical cell/gene ordering and unique IDs. Counts must be finite and nonnegative; fractional count estimates are allowed. Never use logged, scaled, residualized, or batch-corrected values as counts. Numerical inspection alone cannot establish that data are raw. - Inspect per-library/cluster coverage, doublets, ambient RNA, zero-count cells, and annotation compatibility before fitting. Preserve the original full-gene count file. Retained-gene backups do not preserve filtered-out genes.
- Resolve barcode prefixes and gene identifiers explicitly when combining files. Do not silently strip library IDs, intersect away most cells, or make duplicated biological IDs unique without understanding why they repeat.
Read H5AD through AnnData. scVelo 0.3.4 has no scv.read or scv.DataFrame:
import anndata as ad
adata = ad.read_h5ad("velocity_counts.h5ad")
For legacy loom input use ad.io.read_loom('counts.loom', X_name='spliced', sparse=True). AnnData 0.13 deprecates loom; convert to H5AD for further work.
Its layers[None] aliases X: do not delete it or iterate all layers as if every
key were a string. The helper accesses only named velocity layers. Native loom
reading and exact, reordered metadata alignment are covered by the tests;
AnnData 0.13 write_loom is not used.
Run the maintained workflow
The bundled script accepts local files and never downloads a demonstration dataset on startup:
MPLBACKEND=Agg .venv-velocity/bin/python scripts/rna_velocity_workflow.py \
velocity_counts.h5ad --mode dynamical --groupby clusters \
--n-top-genes 2000 --n-neighbors 30 --n-jobs 1 --output-dir velocity_results
# Import a loom and align its raw counts to an existing annotation file:
MPLBACKEND=Agg .venv-velocity/bin/python scripts/rna_velocity_workflow.py \
counts.loom --processed-h5ad annotated.h5ad --groupby clusters \
--mode deterministic --output-dir velocity_check
Run these from the skill directory. Input filenames and biological annotations
are illustrative; the same CLI and functions are tested on small generated
kinetic fixtures. Omit --groupby when annotations are unavailable. Use
--no-plots for analysis without computing UMAP.
The helper performs these steps:
- Validate layers, IDs, model compatibility and grouping; refuse previously generated moments/velocity so preprocessing cannot silently run twice.
- Back up retained raw layers as
spliced_countsandunspliced_countsand rebuildXfrom raw spliced counts. Filter genes and normalizeXand the two count layers on a linear scale. - Apply
sc.pp.log1ponly to X, select highly variable genes with Scanpy, and rebuild PCA and neighbors after subsetting. Reusing stale PCA/neighbors from an unrelated feature set can silently change the velocity model. - Compute
MsandMuwithscv.pp.moments(adata, n_neighbors=None)from the explicit Scanpy graph. Moments are dense: budget memory for multiple cells-by-genes arrays, not only the sparse input. - For dynamical mode, call
recover_dynamics(var_names='all')on the selected genes beforevelocity(mode='dynamical'); otherwise fit the selected model. Require usable genes and a nonempty velocity graph. - Compute velocity coherence and velocity pseudotime; add latent time only for
dynamical fits. Rank velocity-associated genes only with at least two groups
and at least two cells per group. Record/warn about nonfinite or constant
time/coherence outputs in
uns['velocity_workflow']['diagnostics']; a constant pseudotime does not support a trajectory ordering. Ranking is exploratory. - For plots, recompute UMAP from the rebuilt graph, project velocities, save PNGs directly to the requested directory, then save H5AD with package versions and selected parameters. Existing labels remain annotations, not validated cell identities.
The Python function mutates its argument in place; pass adata.copy() to keep
the original object. The CLI writes to output_dir/adata_velocity.h5ad.
Version 2 changes the former helper's behavior deliberately: raw layer geometry
is rebuilt, missing requested labels are errors, and plots/parallelism can be
controlled explicitly. Runtime depends on cells, genes and fit difficulty;
there is no universal 10–30 minute expectation.
Inspect the evidence before interpretation
After a dynamical run (dataset-specific gene selection is illustrative):
import pandas as pd
import scvelo as scv
# Candidate kinetic genes, not experimentally established drivers.
candidates = adata.var['fit_likelihood'].dropna().nlargest(6).index.tolist()
scv.pl.velocity(adata, var_names=candidates, basis='umap', show=False)
# This ranks group-associated velocities, not causal influence or condition DE.
scv.tl.rank_velocity_genes(adata, groupby='clusters', min_corr=0.3)
ranked = pd.DataFrame(adata.uns['rank_velocity_genes']['names'])
scv.tl.velocity_confidence(adata)
scv.pl.scatter(adata, color=['velocity_length', 'velocity_confidence'], show=False)
Inspect spliced-versus-unspliced phase portraits, coverage across induction and repression, fitted parameters, failed/NaN fits, and branch-specific kinetics. Check sensitivity to gene set, neighbors, subsampling and model assumptions. Use time-course labels, perturbations, lineage tracing or labeling experiments as independent directional evidence where available. A plausible UMAP alone cannot validate a fit, and tuning until arrows match a desired story is not a validation strategy.
There is no general minimum of 2,000 cells, universal unspliced fraction, or rule that root cells must have the highest unspliced/spliced ratio. Coverage of relevant kinetic states and measurement quality matter. Negative velocity can represent repression or model misspecification; it is not by itself evidence that layers were swapped.
Output interpretation
| Field | Interpretation |
|---|---|
layers['velocity'] | Model-estimated derivative in processed gene-expression space |
var['velocity_genes'] | Genes selected for the velocity graph; distinct from all HVGs |
layers['Ms'], layers['Mu'] | Neighbor-averaged linear-scale spliced/unspliced expression |
layers['fit_t'] | Gene-specific fitted time coordinates, dynamical model only |
var['fit_alpha/beta/gamma'] | Fitted rates on the model's inferred scale; not calibrated physical rates |
var['fit_likelihood'] | Relative model-fit diagnostic; not a posterior probability of biological truth |
uns['velocity_graph'] | Sparse positive cosine correlations for candidate transitions; not row-stochastic |
obsm['velocity_umap'] | Projected vectors, only after embedding computation/plotting |
obs['velocity_pseudotime'] | Graph-based relative ordering |
obs['latent_time'] | Coupled dynamical ordering; normally scaled 0–1, not elapsed hours |
obs['velocity_length'] | Processed-space vector magnitude; not physical cell speed |
obs['velocity_confidence'] | Neighbor velocity coherence, not calibrated uncertainty |
For fate probabilities use an explicitly normalized transition kernel and a validated terminal-state definition; see the optional CellRank example in the reference. PAGA requires optional igraph and compatible Scanpy internals; it is not part of the tested core workflow or a substitute for fate inference.
Troubleshooting
| Problem | Action |
|---|---|
| Missing or mismatched layers | Revisit quantification and explicit ID alignment; X cannot substitute for unspliced counts |
| Very few velocity genes | Inspect depth, state coverage and phase portraits before altering thresholds |
| Smooth but implausible arrows | Check model assumptions, batch geometry and individual genes; compare independent evidence |
| Nonfinite fit or empty graph | Stop interpretation and investigate degenerate features/coverage |
| Excessive memory or fitting time | Use a justified gene set and n_jobs=1; account for dense moments and fit arrays |
| Stochastic failure on NumPy 2 | Use a separately validated compatible legacy stack or explicitly reconsider the model |
pandas unique error in fit/plot | Use the tested pandas 2.3.3 pin |
Sources and verification scope
Reviewed 2026-10-01 against the released source, API, kinetic-model caveats, and AnnData loom reader. The main paper is Bergen et al., 2020. Synthetic execution tests verify software contracts and file/figure production; they do not establish biological accuracy, identifiability or dataset-specific parameter recovery. Optional CellRank/PAGA analyses remain source-reviewed, illustrative extensions. No authenticated remote service is used.
FAQ
What does the scvelo skill do?
Performs RNA velocity analysis with scVelo from spliced and unspliced single-cell RNA counts. Fits deterministic or dynamical models, examines gene phase portraits, builds velocity graphs, estimates relative latent time, and ranks velocity-associated genes. Use for directional trajectory hypotheses and kinetic-model diagnostics alongside Scanpy; velocity alone does not establish cell fate or causal drivers.
How do I install scvelo?
Run npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill scvelo in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/scvelo/ (personal) or .claude/skills/scvelo/ (project).
Which AI agents can use scvelo?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is scvelo safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains scvelo?
It is published by k-dense-ai in k-dense-ai/scientific-agent-skills. It has 1,890 recorded installs.
More from k-dense-ai/scientific-agent-skills
scientific-writing
k-dense-ai/scientific-agent-skills
Drafts, revises, and audits scientific manuscripts or reports with explicit evidence provenance, reporting-guideline coverage, authorship accountability, confidentiality controls, and local consistency checks. Use for manuscript sections, references, declarations, tables, figures, or submission preparation when scientific accuracy and traceability matter.
scientific-visualization
k-dense-ai/scientific-agent-skills
Creates and audits truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use it for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning.
scientific-critical-thinking
k-dense-ai/scientific-agent-skills
Evaluates scientific claims and evidence quality. Applies to experimental design validity, biases and confounders, statistical interpretation, evidence grading frameworks (GRADE, Cochrane Risk of Bias), and teaching critical analysis. Supports evidence appraisal and identifying flaws; formal peer review writing belongs to peer-review.
literature-review
k-dense-ai/scientific-agent-skills
Conducts systematic, scoping, and narrative literature reviews using PubMed, arXiv, bioRxiv, Semantic Scholar, and other appropriate sources. Use for research synthesis, reproducible literature searches, screening, citation checking, or preparing Markdown and PDF reviews. Tracks search coverage, records versus studies, and evidence limitations; supports meta-analysis planning but does not supply a meta-analysis engine.
scientific-brainstorming
k-dense-ai/scientific-agent-skills
Facilitates evidence-aware scientific ideation with independent generation, structured discussion, explicit assumptions, transparent evaluation, adversarial review, and decision logs. Use for early-stage research brainstorming or prioritizing candidate directions; hand off empirical validation, study design, ethics or regulatory review, and clinical questions to appropriate experts or skills.
statistical-analysis
k-dense-ai/scientific-agent-skills
Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required sample sizes, or write up results - even if they never name a specific test. Covers t-tests, ANOVA, chi-square, correlation, regression, non-parametric and Bayesian methods. For low-level model APIs, see the statsmodels and pymc skills.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available