Run partial singular value decomposition using irlba

RunSVD(object, ...)

# Default S3 method
RunSVD(
  object,
  assay = NULL,
  n = 50,
  scale.embeddings = TRUE,
  reduction.key = "LSI_",
  scale.max = NULL,
  verbose = TRUE,
  irlba.work = n * 3,
  tol = 1e-05,
  ...
)

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

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

# S3 method for class 'Seurat'
RunSVD(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "LSI_",
  reduction.name = "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).

reduction.key

Key for dimension reduction object

scale.max

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

verbose

Print messages

irlba.work

work parameter for irlba. Working subspace dimension, larger values can speed convergence at the cost of more memory use.

tol

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

features

Which features to use. If NULL, use variable features

reduction.name

Name for stored dimension reduction object. Default 'svd'

Value

Returns a Seurat object

Examples

x <- matrix(data = rnorm(100), ncol = 10)
RunSVD(x)
#> Running SVD
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Scaling cell embeddings
#> Warning: No assay specified, setting assay as RNA by default.
#> Warning: Requested number is larger than the number of available items (10). Setting to 10.
#> LSI_ 1 
#> Positive:  8, 6, 2, 9, 4 
#> Negative:  7, 3, 1, 10, 5 
#> Warning: Requested number is larger than the number of available items (10). Setting to 10.
#> LSI_ 2 
#> Positive:  6, 2, 10, 3, 1 
#> Negative:  4, 5, 7, 8, 9 
#> Warning: Requested number is larger than the number of available items (10). Setting to 10.
#> LSI_ 3 
#> Positive:  4, 1, 6, 8, 2 
#> Negative:  10, 5, 9, 3, 7 
#> Warning: Requested number is larger than the number of available items (10). Setting to 10.
#> LSI_ 4 
#> Positive:  2, 7, 4, 8, 9 
#> Negative:  5, 1, 6, 3, 10 
#> Warning: Requested number is larger than the number of available items (10). Setting to 10.
#> LSI_ 5 
#> Positive:  9, 2, 3, 4, 5 
#> Negative:  7, 8, 6, 10, 1 
if (FALSE) { # \dontrun{
RunSVD(atac_small[['peaks']])
} # }
if (FALSE) { # \dontrun{
RunSVD(atac_small[['peaks']])
} # }
if (FALSE) { # \dontrun{
RunSVD(atac_small)
} # }