K_selection | R Documentation |
K
selection based on *dev.ortho*A low rank K
selection method based on *dev.ortho*, the normalized difference between \mathbf{W}^T\mathbf{W}
and \mathbf{I}
. It runs the PNMF algorithm on every candidate K
provided by the user, and find the elbow point K
as the suggested one.
However, this process can be time-consuming as it needs to run the PNMF algorithm on every candidate K
. Empirically we recommend the users to skip this section, and directly use K=20
in function [PNMFfun()], as we found it reaches stability for most scRNA-seq data.
K_selection(
X,
K.seq = 10L:30L,
ncores = 1,
tol = 0.001,
maxIter = 500,
verboseN = FALSE,
zerotol = 1e-10,
method = "EucDist",
label = NULL,
mu = 1,
lambda = 0.01,
seed = 123
)
X |
Input data matrix, where rows represent features (genes), columns represent samples (cells). Rownames (gene names) and colnames (cell names) are required. |
K.seq |
An integer vector of candidate |
ncores |
The number of cores to use. |
tol |
A threshold below which would be considered converged. Default is 1e-3. |
maxIter |
Number of max iteration times. Default is 500. |
verboseN |
A boolean value indicating whether to print number of iterations. |
zerotol |
A threshold on basis loadings below which would be considered zero. Default is 1e-10. |
method |
A character string indicating which method to be used. One of |
label |
A character vector indicating the cluster type for each cell. Required only when |
mu |
A numerical value which controls the penalty term. Larger |
lambda |
A numerical value which controls the magnituide of within class distances. Larger |
seed |
Random seed of the initialization. |
A list with components:
BestK
The selected elbow point K
.
BestRes
The list containing the Weight
and Score
returned by the PNMF algorithm corresponding to BestK
.
plot.dev.ortho
dev.ortho
plot.
AllRes
A list containing all PNMF outputs for all candidate K
's in K.seq
.
Kexin Li, aileenlikexin@outlook.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.