> ## 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.

# ReadVelocity()

> Read spliced/unspliced RNA counts from a velocyto loom file

`ReadVelocity()` reads a `.loom` file produced by velocyto and returns a list of spliced, unspliced, and ambiguous count matrices that can be loaded into Seurat.

## Syntax

```r theme={null}
ReadVelocity(
  file,
  engine = "hdf5r",
  verbose = TRUE
)
```

## Parameters

<ParamField path="file" type="character" required>
  Path to the `.loom` file generated by velocyto.
</ParamField>

<ParamField path="engine" type="character" default="hdf5r">
  HDF5 reading engine to use. Options: `"hdf5r"` or `"rhdf5"`. Passed to `velocyto.R::read.loom.matrices()`.
</ParamField>

<ParamField path="verbose" type="logical" default="TRUE">
  Print progress messages from velocyto.R.
</ParamField>

## Returns

A named list of sparse matrices:

* `spliced` — spliced RNA counts
* `unspliced` — unspliced (nascent) RNA counts
* `ambiguous` — ambiguously spliced counts

Use `as.Seurat()` on this list to create a Seurat object with three separate assays.

## Prerequisites

```r theme={null}
remotes::install_github("velocyto-team/velocyto.R")
```

## Examples

```r theme={null}
library(SeuratWrappers)

# Read velocity data
ldat <- ReadVelocity(file = "sample.loom")

# Convert to Seurat with three assays: spliced, unspliced, ambiguous
object <- as.Seurat(ldat)

# Set spliced as default and preprocess
DefaultAssay(object) <- "spliced"
object <- SCTransform(object)
object <- RunPCA(object)
object <- RunUMAP(object, dims = 1:30)

# Then run velocity estimation
object <- RunVelocity(object = object, reduction = "pca", ncores = 8)
```

## See Also

* [`RunVelocity()`](/api/run-velocity)
* [RNA Velocity method guide](/methods/velocity)
