Skip to main content

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.

Alevin is a tool within the Salmon ecosystem for quantifying gene abundances from droplet-based scRNA-seq data. ReadAlevin() wraps tximport to load alevin output files directly into a Seurat-compatible count matrix, with optional support for genomic range metadata via tximeta.
Citation: Srivastava et al. (2019) Alevin efficiently estimates accurate gene abundances from dscRNA-seq data. Genome Biology, 20(1):65. doi: 10.1186/s13059-019-1670-ySource: COMBINE-lab/salmon (GitHub)

Installation

# Required
BiocManager::install(c('tximport', 'fishpond'))

# Optional: for genomic range metadata
BiocManager::install('tximeta')

Key Function

ReadAlevin() — Reads the quants_mat.gz file produced by alevin and returns a Seurat object with the count matrix populated.

How It Works

ReadAlevin() calls tximport (or tximeta when getMeta = TRUE) to parse alevin’s compressed output into a gene-by-cell count matrix. The matrix is then passed to CreateSeuratObject. Optionally, meanAndVariance = TRUE stores bootstrapped mean estimates in the counts slot and variance estimates in the data slot.

ReadAlevin Parameters

file
character
required
Path to the quants_mat.gz file within the alevin output directory. This file is located at <alevin_out>/alevin/quants_mat.gz.
getMeta
logical
default:"FALSE"
If TRUE, uses tximeta to programmatically fetch genomic range information for each gene. Range data is stored in the meta.features slot under columns chr, start, and end. Requires the tximeta package.
meanAndVariance
logical
default:"FALSE"
If TRUE, retrieves bootstrapped mean and variance estimates from the alevin output instead of point estimates. Mean counts are stored in the counts slot; variance estimates are stored in the data slot.
...
extra arguments
Additional arguments passed through to tximport. For example, alevinArgs = list(filterBarcodes = TRUE) activates alevin’s internal barcode filtering.

Workflow

1

Run alevin

Run alevin externally to produce quantification output. The output directory will contain an alevin/ subdirectory with quants_mat.gz.
salmon alevin \
  -l ISR \
  --index /path/to/index \
  -1 read1.fastq.gz \
  -2 read2.fastq.gz \
  --chromiumV3 \
  -p 8 \
  --tgMap txp2gene.tsv \
  -o alevin_out
2

Import counts into Seurat

library(SeuratWrappers)
library(tximport)

pbmc <- ReadAlevin("~/alevin_out/alevin/quants_mat.gz")
ReadAlevin returns a fully constructed Seurat object ready for downstream processing.
3

Standard Seurat analysis

The returned object can be used directly with the standard Seurat workflow:
pbmc <- NormalizeData(pbmc)
pbmc <- FindVariableFeatures(pbmc)
pbmc <- ScaleData(pbmc)
pbmc <- RunPCA(pbmc)
pbmc <- FindNeighbors(pbmc, dims = 1:10)
pbmc <- FindClusters(pbmc)
pbmc <- RunUMAP(pbmc, dims = 1:10)
DimPlot(pbmc)

Advanced Options

Barcode filtering

Pass alevin-specific arguments through ... to tximport:
pbmc <- ReadAlevin(
  "~/alevin_out/alevin/quants_mat.gz",
  alevinArgs = list(filterBarcodes = TRUE)
)

Mean and variance estimates

For bootstrap-based uncertainty quantification, retrieve mean and variance estimates:
pbmc <- ReadAlevin(
  "~/alevin_out/alevin/quants_mat.gz",
  meanAndVariance = TRUE
)
# counts slot contains bootstrapped mean expression
# data slot contains bootstrapped variance

Genomic range metadata

Attach chromosomal position information to the feature metadata:
pbmc <- ReadAlevin(
  "~/alevin_out/alevin/quants_mat.gz",
  getMeta = TRUE
)
# Accesses chr, start, end from the RNA assay meta.features
head(pbmc[["RNA"]][[]])
getMeta = TRUE requires the tximeta Bioconductor package. If tximeta is not installed, ReadAlevin will stop with an informative error.

Build docs developers (and LLMs) love