This page demonstrates how to compute RNA velocity quantifications stored in a Seurat object using SeuratWrappers and velocyto.R.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satijalab/seurat-wrappers/llms.txt
Use this file to discover all available pages before exploring further.
RNA velocity of single cells Gioele La Manno, Ruslan Soldatov, Amit Zeisel, Emelie Braun, Hannah Hochgerner, Viktor Petukhov, Katja Lidschreiber, Maria E. Kastriti, Peter Lönnerberg, Alessandro Furlan, Jean Fan, Lars E. Borm, Zehua Liu, David van Bruggen, Jimin Guo, Xiaoling He, Roger Barker, Erik Sundström, Gonçalo Castelo-Branco, Patrick Cramer, Igor Adameyko, Sten Linnarsson & Peter V. Kharchenko Nature, 2018. doi: 10.1038/s41586-018-0414-6For the scVelo (Python) extension, see:
Generalizing RNA velocity to transient cell states through dynamical modeling Volker Bergen, Marius Lange, Stefan Peidli, F. Alexander Wolf & Fabian J. Theis bioRxiv, 2019. doi: 10.1101/820936
Installation
The following packages are required before proceeding:
Workflow
Generate a loom file with velocyto
Before using
ReadVelocity(), you must run the velocyto command-line tool on your aligned BAM files to produce a .loom file containing spliced, unspliced, and ambiguous count matrices.See the velocyto documentation for instructions on generating loom files from your alignment output.Load velocity data
Use The result is a named list of sparse matrices: typically
ReadVelocity() to load the loom file into R. This is a wrapper around velocyto.R::read.loom.matrices() that redirects progress output to stderr rather than stdout.spliced, unspliced, and ambiguous.Create a Seurat object from velocity matrices
Pass the list of matrices to
as.Seurat(). Each matrix becomes a separate assay. The default assay is the first in the list (or the one specified by default.assay).Preprocess and cluster
Run standard Seurat preprocessing on the spliced assay before computing velocity.
Compute RNA velocity
RunVelocity() filters genes by minimum cluster-level expression, computes a cell-to-cell distance matrix from the PCA embedding, and calls velocyto.R::gene.relative.velocity.estimates(). Results are stored in the Seurat object via Tool(object) <- cd.Functions
ReadVelocity()
Loads a velocyto-generated .loom file and returns a named list of count matrices (spliced, unspliced, ambiguous). This wraps velocyto.R::read.loom.matrices() and redirects its progress messages to stderr so they do not pollute standard output.
Path to the
.loom file produced by the velocyto command-line tool.Backend to use when reading the HDF5-based loom file. Choose from
"hdf5r" or "h5".Whether to display progress messages from
velocyto.R::read.loom.matrices().RunVelocity()
Computes RNA velocity on a Seurat object that contains both spliced and unspliced assays. Gene filtering, cell-to-cell distance calculation, and velocity estimation are all performed inside this function. The resulting velocity object is stored using Tool(object) <- cd and can be retrieved with Tool(object, slot = "RunVelocity").
A Seurat object containing at minimum a spliced and unspliced assay.
Name of the assay containing spliced RNA counts.
Name of the assay containing unspliced (nascent) RNA counts.
Optional name of the assay containing ambiguously spliced counts. Pass
NULL to omit.Minimum required average expression count across clusters in the spliced matrix. Genes below this threshold are excluded before velocity estimation.
Minimum required average expression count across clusters in the unspliced matrix.
Name of the dimensional reduction whose embeddings are used to compute the cell-to-cell distance matrix.
Name of the cell-level metadata variable (or
"ident" for active identities) used to define clusters for gene filtering.Subset of cells to use as steady-state cells (passed to
gene.relative.velocity.estimates as steady.state.cells). Defaults to all cells.Optional name of a nearest-neighbor graph in the Seurat object to pass as
cellKNN to the velocity estimator.Number of cores to use for parallel computation.
Whether to display progress messages during gene filtering and distance matrix computation.
as.Seurat() for lists
Converts a named list of matrices (as returned by ReadVelocity()) into a Seurat object where each matrix becomes a separate assay.
A named list of dense (
matrix) or sparse (dgCMatrix) matrices. Unnamed entries are assigned names Assay1, Assay2, etc.Name or index of the matrix to set as the default assay.
Slot in which to store each matrix. Must be
"counts" or "data". Vectorized: different values can be specified per matrix.Minimum number of cells a feature must be detected in (applied only to matrices stored in
counts). Vectorized.Minimum number of features detected per cell (applied only to matrices stored in
counts). Vectorized.Whether to show a progress bar while constructing the Seurat object.