This vignette provides a comprehensive overview of the mathematical framework underlying RNA velocity analysis as implemented in scVeloR. Understanding these principles is essential for proper interpretation of velocity results and for making informed decisions about model selection.
Gene expression involves a series of biochemical processes:
RNA velocity leverages the distinction between unspliced (nascent) and spliced (mature) mRNA to infer the direction and rate of gene expression changes.
The dynamics of mRNA abundance can be described by a system of ordinary differential equations (ODEs):
\[\frac{du}{dt} = \alpha(t) - \beta u\]
\[\frac{ds}{dt} = \beta u - \gamma s\]
Where:
When \(\alpha(t) = \alpha\) (constant), the system has analytical solutions:
Unspliced mRNA: \[u(t) = u_0 e^{-\beta t} + \frac{\alpha}{\beta}(1 - e^{-\beta t})\]
Spliced mRNA: \[s(t) = s_0 e^{-\gamma t} + \frac{\alpha}{\gamma}(1 - e^{-\gamma t}) + \frac{\alpha - u_0 \beta}{\gamma - \beta}(e^{-\gamma t} - e^{-\beta t})\]
When transcription stops (\(\alpha = 0\)):
\[u(t) = u_0 e^{-\beta t}\]
\[s(t) = s_0 e^{-\gamma t} + \frac{\beta u_0}{\gamma - \beta}(e^{-\gamma t} - e^{-\beta t})\]
At equilibrium (\(du/dt = 0\), \(ds/dt = 0\)):
\[u_{ss} = \frac{\alpha}{\beta}\]
\[s_{ss} = \frac{\alpha}{\gamma}\]
The ratio at steady state defines a fundamental relationship:
\[\frac{u_{ss}}{s_{ss}} = \frac{\gamma}{\beta}\]
Phase portrait showing the trajectory of gene expression during induction (blue) and repression (red) phases.
Assumption: Cells are near transcriptional steady state.
At steady state: \(\gamma \approx \beta u / s\)
Velocity: The deviation from steady state indicates the direction of change:
\[v_s = \beta u - \gamma s\]
If \(v_s > 0\): gene is being upregulated If \(v_s < 0\): gene is being downregulated
Implementation in scVeloR:
Assumption: Account for transcriptional noise through second-order moments.
The stochastic model uses both first moments (mean expression) and second moments (variance, covariance):
\[\text{Var}(u) = E[u^2] - E[u]^2\] \[\text{Cov}(u,s) = E[us] - E[u]E[s]\]
This provides more robust velocity estimates when transcriptional bursting is present.
Assumption: Full kinetics model without steady-state assumption.
The dynamical model infers all kinetic parameters (\(\alpha\), \(\beta\), \(\gamma\)) and the switching time (\(t_-\)) using an Expectation-Maximization (EM) algorithm.
E-step: Assign latent time to each cell M-step: Update kinetic parameters
EM algorithm iteratively refines parameter estimates and time assignments.
The velocity graph captures cell-cell transitions based on velocity correlation:
\[\text{cosine}(v_i, \delta_{ij}) = \frac{v_i \cdot \delta_{ij}}{||v_i|| \cdot ||\delta_{ij}||}\]
Where: - \(v_i\): velocity vector for cell \(i\) - \(\delta_{ij}\): expression difference between cell \(i\) and \(j\)
The transition probability from cell \(i\) to cell \(j\):
\[P_{ij} = \frac{\max(0, \text{cosine}(v_i, \delta_{ij}))}{\sum_k \max(0, \text{cosine}(v_i, \delta_{ik}))}\]
Schematic of velocity-based transition probabilities.
The root cells are identified as those with: 1. High connectivity in the velocity graph 2. Velocity vectors pointing “outward” (high end-point probability)
| Criterion | Steady-State | Stochastic | Dynamical |
|---|---|---|---|
| Speed | Fast | Medium | Slow |
| Data requirement | Low | Medium | High |
| Transcriptional dynamics | Equilibrium | Bursting | Transient |
| Parameter inference | γ only | γ only | α, β, γ, t_ |
| Recommended use | Exploration | Default | Publication |
Bergen, V., Lange, M., Peidli, S., Wolf, F. A., & Theis, F. J. (2020). Generalizing RNA velocity to transient cell states through dynamical modeling. Nature Biotechnology, 38, 1408–1414.
La Manno, G., Soldatov, R., Zeisel, A., et al. (2018). RNA velocity of single cells. Nature, 560, 494–498.
Svensson, V., & Pachter, L. (2018). RNA velocity: Molecular kinetics from single-cell RNA-seq. Molecular Cell, 72, 7–9.
sessionInfo()
#> R version 4.6.0 (2026-04-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.4 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] ggplot2_4.0.3 rmarkdown_2.31
#>
#> loaded via a namespace (and not attached):
#> [1] vctrs_0.7.3 cli_3.6.6 knitr_1.51 rlang_1.2.0
#> [5] xfun_0.57 otel_0.2.0 generics_0.1.4 S7_0.2.2
#> [9] jsonlite_2.0.0 labeling_0.4.3 glue_1.8.1 buildtools_1.0.0
#> [13] htmltools_0.5.9 maketools_1.3.2 sys_3.4.3 sass_0.4.10
#> [17] scales_1.4.0 grid_4.6.0 tibble_3.3.1 evaluate_1.0.5
#> [21] jquerylib_0.1.4 fastmap_1.2.0 yaml_2.3.12 lifecycle_1.0.5
#> [25] compiler_4.6.0 dplyr_1.2.1 RColorBrewer_1.1-3 pkgconfig_2.0.3
#> [29] farver_2.1.2 digest_0.6.39 R6_2.6.1 tidyselect_1.2.1
#> [33] pillar_1.11.1 magrittr_2.0.5 bslib_0.11.0 withr_3.0.2
#> [37] tools_4.6.0 gtable_0.3.6 cachem_1.1.0