RunSVD: Run singular value decomposition

View source: R/generics.R

RunSVDR Documentation

Run singular value decomposition

Description

Run partial singular value decomposition using RSpectra::svds

Usage

RunSVD(object, ...)

## Default S3 method:
RunSVD(
  object,
  assay = NULL,
  n = 50,
  scale.embeddings = !pca,
  pca = FALSE,
  reduction.key = ifelse(pca, "PCA_", "LSI_"),
  scale.max = NULL,
  verbose = TRUE,
  tol = 1e-05,
  ...
)

## S3 method for class 'Assay'
RunSVD(
  object,
  assay = NULL,
  features = NULL,
  pca = FALSE,
  n = 50,
  reduction.key = ifelse(pca, "PCA_", "LSI_"),
  scale.max = NULL,
  verbose = TRUE,
  ...
)

## S3 method for class 'StdAssay'
RunSVD(
  object,
  assay = NULL,
  features = NULL,
  pca = FALSE,
  n = 50,
  reduction.key = ifelse(pca, "PCA_", "LSI_"),
  scale.max = NULL,
  verbose = TRUE,
  ...
)

## S3 method for class 'Seurat'
RunSVD(
  object,
  assay = NULL,
  features = NULL,
  layer = "data",
  n = 50,
  pca = FALSE,
  reduction.key = ifelse(pca, "PCA_", "LSI_"),
  reduction.name = ifelse(pca, "pca", "lsi"),
  scale.max = NULL,
  verbose = TRUE,
  ...
)

Arguments

object

A Seurat object

...

Arguments passed to other methods

assay

Which assay to use. If NULL, use the default assay

n

Number of singular values to compute

scale.embeddings

Scale cell embeddings within each component to mean 0 and SD 1 (default TRUE).

pca

Run PCA. Setting this option to TRUE will perform implicit scaling and centering of the input matrix to enable memory-efficient computation of the principal components.

reduction.key

Key for dimension reduction object

scale.max

Clipping value for cell embeddings. Default (NULL) is no clipping.

verbose

Print messages

tol

Tolerance (tol) parameter for RSpectra::svds(). Larger values speed up convergence due to greater amount of allowed error.

features

Which features to use. If NULL, use variable features

layer

Name of layer to use.

reduction.name

Name for stored dimension reduction object.

Value

Returns a SeuratObject::Seurat() object

Examples

x <- matrix(data = rnorm(100), ncol = 10)
RunSVD(x)
## Not run: 
RunSVD(atac_small[['peaks']])

## End(Not run)
## Not run: 
RunSVD(atac_small[['peaks']])

## End(Not run)
RunSVD(atac_small, features = rownames(atac_small))

Signac documentation built on April 1, 2026, 5:06 p.m.