doSVD | R Documentation |
Computes a truncated SVD on a matrix using the implicitly restarted Lanczos bidiagonalization algorithm (IRLBA).
doSVD(x, svdMaxRatio = 0.08, nCeil = 2000, nCores)
x |
A numeric matrix to perform SVD on. |
svdMaxRatio |
(Optional) The maximum proportion of singular vectors
used for generating subsets (default: |
nCeil |
(Optional) The maximum number of cells used to compute the
proportion of singular vectors (default: |
nCores |
The number of cores to use for parallel processing. |
This function utilizes the 'irlba' function from the 'irlba' package to efficiently calculate the truncated SVD of the input matrix 'x'. The returned matrix contains 'nv' right singular vectors, which are often used for dimensionality reduction and feature extraction in various applications.
A matrix containing the right singular vectors of 'x'.
library(scater)
library(splatter)
sce <- splatSimulate(group.prob = rep(1, 5)/5, sparsify = FALSE,
batchCells=100, nGenes=1000, method = "groups", verbose = FALSE,
dropout.type = "experiment")
sce <- logNormCounts(sce)
cores <- 2
logX <- as.matrix(logcounts(sce))
w <- rowVars_fast(logX, cores)
corMat <- getCorM("spearman", logcounts(sce), w, cores)
v <- doSVD(corMat, nCores=cores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.