Run partial singular value decomposition using irlba

RunSVD(object, ...)

# S3 method for default
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 Assay
RunSVD(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "LSI_",
  scale.max = NULL,
  verbose = TRUE,
  ...
)

# S3 method for 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.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> 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.
#> Error in if (positive[num] == negative[num]) {    negative <- negative[-num]}: argument is of length zero
RunSVD(atac_small[['peaks']])
#> 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.
#> LSI_ 1 
#> Positive:  chr1-2157847-2188813, chr1-2471903-2481288, chr1-3815928-3820356, chr1-6843960-6846894, chr1-6051145-6055407, chr1-2515241-2519350, chr1-6659264-6664388, chr1-8935313-8940649, chr1-1549446-1552535, chr1-2343197-2348396 
#> 	   chr1-2322313-2323985, chr1-1708510-1715065, chr1-8020317-8022548, chr1-1051006-1053102, chr1-3540009-3542500, chr1-1849693-1853920, chr1-6672613-6675785, chr1-6085254-6089147, chr1-2486054-2489237, chr1-1240091-1245762 
#> Negative:  chr1-1532974-1533319, chr1-9153374-9153983, chr1-3759680-3759895, chr1-8685625-8685837, chr1-9161610-9161990, chr1-7975875-7976274, chr1-9143106-9143741, chr1-8469105-8469816, chr1-6651141-6652061, chr1-9239865-9240117 
#> 	   chr1-2077596-2078445, chr1-9327071-9327557, chr1-9006466-9007566, chr1-9191514-9192075, chr1-3612122-3612609, chr1-3692008-3692971, chr1-8621060-8621547, chr1-8166762-8167329, chr1-5541924-5542287, chr1-2585232-2586236 
#> LSI_ 2 
#> Positive:  chr1-1135873-1137356, chr1-1562519-1567986, chr1-1980856-1982929, chr1-967806-970136, chr1-6523645-6526848, chr1-6507013-6510383, chr1-2573495-2575472, chr1-2454600-2456271, chr1-1140204-1144858, chr1-2227715-2234197 
#> 	   chr1-1147592-1153647, chr1-6557001-6558057, chr1-1071616-1073471, chr1-6519517-6521256, chr1-6418151-6420435, chr1-3688192-3690359, chr1-3662633-3664352, chr1-973840-977754, chr1-2756472-2757468, chr1-6295272-6296706 
#> Negative:  chr1-2082091-2083429, chr1-2157847-2188813, chr1-6843960-6846894, chr1-7830534-7832331, chr1-6659264-6664388, chr1-3593401-3595956, chr1-928630-937949, chr1-8000672-8003534, chr1-1695549-1696821, chr1-6639159-6642773 
#> 	   chr1-1708510-1715065, chr1-8284654-8285560, chr1-9222989-9224547, chr1-1309645-1311492, chr1-6115973-6117096, chr1-9335457-9336176, chr1-2071091-2071791, chr1-1800682-1801583, chr1-3585229-3585878, chr1-2515241-2519350 
#> LSI_ 3 
#> Positive:  chr1-2143708-2144981, chr1-2312793-2314371, chr1-2063672-2065744, chr1-6639159-6642773, chr1-1140204-1144858, chr1-6258846-6260407, chr1-1147592-1153647, chr1-2507261-2510518, chr1-8933459-8934461, chr1-2756472-2757468 
#> 	   chr1-6483424-6485428, chr1-1788464-1789189, chr1-6761132-6762608, chr1-6613890-6615140, chr1-8186838-8187845, chr1-9064752-9065614, chr1-3540009-3542500, chr1-1849693-1853920, chr1-1057192-1058404, chr1-6500054-6501132 
#> Negative:  chr1-1549446-1552535, chr1-8013637-8014963, chr1-762106-763359, chr1-3773000-3774956, chr1-1333514-1336003, chr1-1207999-1210168, chr1-8584964-8586531, chr1-8008972-8009703, chr1-2486054-2489237, chr1-1562519-1567986 
#> 	   chr1-6452328-6454679, chr1-7022276-7023784, chr1-1051006-1053102, chr1-2322313-2323985, chr1-2227715-2234197, chr1-6801917-6804384, chr1-1283373-1285555, chr1-6407925-6409601, chr1-1804025-1804468, chr1-7727502-7728223 
#> LSI_ 4 
#> Positive:  chr1-7763862-7766072, chr1-6684553-6686243, chr1-1051006-1053102, chr1-2082091-2083429, chr1-2079917-2080950, chr1-2189545-2192208, chr1-3593401-3595956, chr1-3446985-3448712, chr1-6319594-6322140, chr1-8020317-8022548 
#> 	   chr1-1306174-1308201, chr1-2507261-2510518, chr1-1509089-1511050, chr1-1333514-1336003, chr1-901313-902847, chr1-2312793-2314371, chr1-9202229-9203756, chr1-8467741-8468104, chr1-8000672-8003534, chr1-3369629-3371833 
#> Negative:  chr1-9188154-9190941, chr1-3806419-3808097, chr1-894021-896898, chr1-2241757-2247855, chr1-7841489-7844891, chr1-8013637-8014963, chr1-9335457-9336176, chr1-6639159-6642773, chr1-1655226-1656410, chr1-1819732-1824104 
#> 	   chr1-3815928-3820356, chr1-2125466-2127403, chr1-1341794-1343522, chr1-6304964-6307369, chr1-1562519-1567986, chr1-9293115-9295644, chr1-1597084-1597513, chr1-3565942-3569718, chr1-1397565-1398360, chr1-1839727-1841458 
#> LSI_ 5 
#> Positive:  chr1-954372-958413, chr1-8020317-8022548, chr1-9293115-9295644, chr1-3773000-3774956, chr1-7830534-7832331, chr1-1288121-1291291, chr1-6659264-6664388, chr1-875427-878705, chr1-1839727-1841458, chr1-6085254-6089147 
#> 	   chr1-9241288-9242647, chr1-804872-805761, chr1-1788464-1789189, chr1-1002063-1006231, chr1-6268667-6270086, chr1-713460-714823, chr1-6187544-6188439, chr1-3535177-3536355, chr1-6208425-6209293, chr1-1240091-1245762 
#> Negative:  chr1-2486054-2489237, chr1-6258846-6260407, chr1-6639159-6642773, chr1-3712392-3713775, chr1-1057192-1058404, chr1-1446312-1448163, chr1-1259506-1261414, chr1-928630-937949, chr1-1655226-1656410, chr1-3565942-3569718 
#> 	   chr1-994056-995654, chr1-6672613-6675785, chr1-2135022-2137621, chr1-762106-763359, chr1-6051145-6055407, chr1-8762907-8763964, chr1-973840-977754, chr1-2082091-2083429, chr1-1549446-1552535, chr1-1608771-1610748 
RunSVD(atac_small)
#> Running SVD
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Scaling cell embeddings
#> An object of class Seurat 
#> 1323 features across 100 samples within 3 assays 
#> Active assay: peaks (323 features, 323 variable features)
#>  2 other assays present: bins, RNA
#>  2 dimensional reductions calculated: lsi, umap