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.

RunALRA() implements the ALRA imputation algorithm. It computes a rank-k approximation of the normalized expression matrix, then adaptively thresholds values based on the distribution of negative values in the approximation. Zero values are preserved only when they are truly absent.

Syntax

RunALRA(
  object,
  k = NULL,
  q = 10,
  quantile.prob = 0.001,
  use.mkl = FALSE,
  mkl.seed = -1,
  assay = NULL,
  slot = "data",
  setDefaultAssay = TRUE,
  genes.use = NULL,
  K = NULL,
  p.val.th = 1e-10,
  noise.start = NULL,
  q.k = 2,
  k.only = FALSE,
  ...
)

Parameters

object
Seurat
required
A Seurat object. Also accepts a matrix-like object when called as a default method.
k
integer
default:"NULL"
Rank of the low-rank approximation. Set to NULL for automated selection of k.
q
integer
default:"10"
Number of additional power iterations in randomized SVD when computing the rank-k approximation.
quantile.prob
numeric
default:"0.001"
Quantile probability used to calculate the per-gene threshold.
use.mkl
logical
default:"FALSE"
Use the Intel MKL-based SVD implementation (requires rpca-mkl package).
mkl.seed
integer
default:"-1"
Seed for the MKL SVD random generator. Any negative value uses the current timestamp. Only relevant when use.mkl = TRUE.
assay
character
default:"NULL"
Name of the assay to use. Defaults to the active default assay.
slot
character
default:"data"
Slot within the assay to use as input.
setDefaultAssay
logical
default:"TRUE"
If TRUE, sets the resulting alra assay as the default assay after imputation.
genes.use
character vector
default:"NULL"
Subset of genes to impute. Defaults to all genes in the assay.
K
integer
default:"NULL"
Number of singular values to compute when choosing k automatically. Must be less than the smallest matrix dimension. Defaults to 100 or the smallest dimension, whichever is less.
p.val.th
numeric
default:"1e-10"
P-value threshold for significance when choosing k automatically.
noise.start
integer
default:"NULL"
Index from which all smaller singular values are considered noise during automatic k selection. Defaults to K - 20.
q.k
integer
default:"2"
Number of additional power iterations when choosing k automatically.
k.only
logical
default:"FALSE"
If TRUE, computes the optimal k and stores it in the object without performing imputation. Use with ALRAChooseKPlot() to visualize the choice.

Returns

A Seurat object with a new assay named alra containing the imputed expression matrix. When setDefaultAssay = TRUE, this becomes the default assay. When k.only = TRUE, returns the object with the computed k stored in the tool slot.

Examples

library(SeuratWrappers)

# Simple one-step imputation
pbmc_small <- RunALRA(object = pbmc_small)

# Two-step: choose k first, then impute
pbmc_alra <- RunALRA(pbmc_small, k.only = TRUE)
ggouts <- ALRAChooseKPlot(pbmc_alra)
do.call(gridExtra::grid.arrange, c(ggouts, nrow = 1))
pbmc_alra <- RunALRA(pbmc_alra)

See Also

Build docs developers (and LLMs) love