runCINMF | R Documentation |
This is an experimental function and is subject to change.
Performs consensus integrative non-negative matrix factorization (c-iNMF)
to return factorized H
, W
, and V
matrices. In order to
address the non-convex nature of NMF, we built on the cNMF method proposed by
D. Kotliar, 2019. We run the regular iNMF multiple times with different
random starts, and cluster the pool of all the factors in W
and
V
s and take the consensus of the clusters of the largest population.
The cell factor loading H
matrices are eventually solved
with the consensus W
and V
matrices.
Please see runINMF
for detailed introduction to the regular
iNMF algorithm which is run multiple times in this function.
The consensus iNMF algorithm is developed basing on the consensus NMF (cNMF) method (D. Kotliar et al., 2019).
runCINMF(object, k = 20, lambda = 5, rho = 0.3, ...)
## S3 method for class 'liger'
runCINMF(
object,
k = 20,
lambda = 5,
rho = 0.3,
nIteration = 30,
nRandomStarts = 10,
HInit = NULL,
WInit = NULL,
VInit = NULL,
seed = 1,
nCores = 2L,
verbose = getOption("ligerVerbose", TRUE),
...
)
## S3 method for class 'Seurat'
runCINMF(
object,
k = 20,
lambda = 5,
rho = 0.3,
datasetVar = "orig.ident",
layer = "ligerScaleData",
assay = NULL,
reduction = "cinmf",
nIteration = 30,
nRandomStarts = 10,
HInit = NULL,
WInit = NULL,
VInit = NULL,
seed = 1,
nCores = 2L,
verbose = getOption("ligerVerbose", TRUE),
...
)
object |
A liger object or a Seurat object with
non-negative scaled data of variable features (Done with
|
k |
Inner dimension of factorization (number of factors). Generally, a
higher |
lambda |
Regularization parameter. Larger values penalize
dataset-specific effects more strongly (i.e. alignment should increase as
|
rho |
Numeric number between 0 and 1. Fraction for determining the
number of nearest neighbors to look at for consensus (by
|
... |
Arguments passed to methods. |
nIteration |
Total number of block coordinate descent iterations to
perform. Default |
nRandomStarts |
Number of replicate runs for creating the pool of
factorization results. Default |
HInit |
Initial values to use for |
WInit |
Initial values to use for |
VInit |
Initial values to use for |
seed |
Random seed to allow reproducible results. Default |
nCores |
The number of parallel tasks to speed up the computation.
Default |
verbose |
Logical. Whether to show information of the progress. Default
|
datasetVar |
Metadata variable name that stores the dataset source
annotation. Default |
layer |
For Seurat>=4.9.9, the name of layer to retrieve input
non-negative scaled data. Default |
assay |
Name of assay to use. Default |
reduction |
Name of the reduction to store result. Also used as the
feature key. Default |
liger method - Returns updated input liger object
A list of all H
matrices can be accessed with
getMatrix(object, "H")
A list of all V
matrices can be accessed with
getMatrix(object, "V")
The W
matrix can be accessed with
getMatrix(object, "W")
Seurat method - Returns updated input Seurat object
H
matrices for all datasets will be concatenated and
transposed (all cells by k), and form a DimReduc object in the
reductions
slot named by argument reduction
.
W
matrix will be presented as feature.loadings
in the
same DimReduc object.
V
matrices, an objective error value and the dataset
variable used for the factorization is currently stored in
misc
slot of the same DimReduc object.
Joshua D. Welch and et al., Single-Cell Multi-omic Integration Compares and Contrasts Features of Brain Cell Identity, Cell, 2019
Dylan Kotliar and et al., Identifying gene expression programs of cell-type identity and cellular activity with single-cell RNA-Seq, eLife, 2019
pbmc <- normalize(pbmc)
pbmc <- selectGenes(pbmc)
pbmc <- scaleNotCenter(pbmc)
if (requireNamespace("RcppPlanc", quietly = TRUE)) {
pbmc <- runCINMF(pbmc)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.