scvelo
RNA velocity analysis with scVelo. Estimate cell state transitions from unspliced/spliced mRNA dynamics, infer trajectory directions, compute latent time, and identify driver genes in single-cell RNA-seq data. Complements Scanpy/scVI-tools for trajectory inference.
By k-dense-ai · 1,402 installs
npx skills add k-dense-ai/scientific-agent-skills --skill scvelo
Source repository · Upstream listing
scVelo — RNA Velocity Analysis
Overview
scVelo is the leading Python package for RNA velocity analysis in single cell RNA seq data. It infers cell state transitions by modeling the kinetics of mRNA splicing — using the ratio of unspliced (pre mRNA) to spliced (mature mRNA) abundances to determine whether a gene is being upregulated or downregulated in each cell. This allows reconstruction of developmental trajectories and identification of cell fate decisions without requiring time course data.
Installation: uv pip install scvelo
Key resources:
Documentation: https://scvelo.readthedocs.io/
GitHub: https://github.com/theislab/scvelo
Paper: Bergen et al. (2020) Nature Biotechnology. PMID: 32747759
When to Use This Skill
Use scVelo when:
Trajectory inference from snapshot data : Determine which direction cells are differentiating
Cell fate prediction : Identify progenitor cells and their downstream fates
Driver gene identification : Find genes whose dynamics best explain observed trajectories
Developmental biology : Model hematopoiesis, neurogenesis, epithelial to mesenchymal transitions
Latent time estimation : Order cells along a pseudotime derived from splicing dynamics
Complement to Scanpy : Add directional information to UMAP embeddings
Prerequisites
scVelo requires count matrices for both unspliced and spliced RNA. These are generated by:
1. STARsolo or kallisto bustools with lamanno mode
2. velocyto CLI: velocyto run10x / velocyto run
3. alevin fry / simpleaf with spliced/unspliced output
Data is stored in an AnnData object with layers["spliced"] and layers["unspliced"] .
Standard RNA Velocity Workflow
1. Setup and Data Loading
2. Preprocessing
3. Velocity Estimation — Stochastic Model
The stochastic model is fast and suitable for exploratory analysis:
4. Velocity Estimation — Dynamical Model (Recommended)
The dynamical model fits the full splicing kinetics and is more accurate:
5. Latent Time
The dynamical model enables computation of a shared latent time (pseudotime):
6. Driver Gene Analysis
7. Velocity Arrows and Pseudotime
8. PAGA Trajectory Graph
Complete Workflow Script
Key Output Fields in AnnData
After running the workflow, the following fields are added:
Location Key Description
adata.layers velocity RNA velocity per gene per cell
adata.layers fit t Fitted latent time per gene per cell
adata.obsm velocity umap 2D velocity vectors on UMAP
adata.obs velocity pseudotime Pseudotime from velocity
adata.obs latent time Latent time from dynamical model
adata.obs velocity length Speed of each cell
adata.obs velocity confidence Confidence score per cell
adata.var fit likelihood Gene level model fit quality
adata.var fit alpha Transcription rate
adata.var fit beta Splicing rate
adata.var fit gamma Degradation rate
adata.uns velocity graph Cell cell transition probability matrix
Velocity Models Comparison
Model Speed Accuracy When to Use
stochastic Fast Moderate Exploratory; large datasets
deterministic Medium Moderate Simple linear kinetics
dynamical Slow High Publication quality; identifies driver genes
Best Practices
Start with stochastic mode for exploration; switch to dynamical for final analysis
Need good coverage of unspliced reads : Short reads (< 100 bp) may miss intron coverage
Minimum 2,000 cells : RNA velocity is noisy with fewer cells
Velocity should be coherent : Arrows should follow known biology; randomness indicates issues
k NN bandwidth matters : Too few neighbors → noisy velocity; too many → oversmoothed
Sanity check : Root cells (progenitors) should have high unspliced/spliced ratios for marker genes
Dynamical model requires distinct kinetic states : Works best for clear differentiation processes
Troubleshooting
Problem Solution
Missing unspliced layer Re run velocyto or use STARsolo with soloFeatures Gene Velocyto
Very few velocity genes Lower min shared counts ; check sequencing depth
Random looking arrows Try different n neighbors or velocity model
Memory error with dynamical Set n jobs=1 ; reduce n top genes
Negative velocity everywhere Check that spliced/unspliced layers are not swapped
Additional Resources
scVelo documentation : https://scvelo.readthedocs.io/
Tutorial notebooks : https://scvelo.readthedocs.io/tutorials/
GitHub : https://github.com/theislab/scvelo
Paper : Bergen V et al. (2020) Nature Biotechnology. PMID: 32747759
velocyto (preprocessing): http://velocyto.org/
CellRank (fate prediction, extends scVelo): https://cellrank.readthedocs.io/
dynamo (metabolic labeling alternative): https://dynamo release.readthedocs.io/