This function estimate the dimension of low dimensional embedding for a given cell by gene expression matrix. For more details, see Franklin et al. (1995) and Crawford et al. (2010).
diagnostic.cor.eigs(object, ...)# S3 method for default
diagnostic.cor.eigs(
object,
q_max = 50,
plot = TRUE,
n.sims = 10,
parallel = TRUE,
ncores = 10,
seed = 1,
...
)
# S3 method for Seurat
diagnostic.cor.eigs(
object,
assay = NULL,
slot = "data",
nfeatures = 2000,
q_max = 50,
seed = 1,
...
)
A data.frame with attribute `q_est` and `plot`, which is the estimated dimension of low dimensional embedding. In addition, this data.frame containing the following components:
q - The index of eigen values.
eig_value - The eigen values on observed data.
eig_sim - The mean value of eigen values of n.sims simulated data.
q_est - The selected dimension in attr(obj, 'q_est').
plot - The plot saved in attr(obj, 'plot').
A Seurat or matrix object
Other arguments passed to diagnostic.cor.eigs.default
.
the upper bound of low dimensional embedding. Default is 50.
a indicator of whether plot eigen values.
number of simulaton times. Default is 10.
a indicator of whether use parallel analysis.
the number of cores used in parallel analysis. Default is 10.
a postive integer, specify the random seed for reproducibility
an optional string, specify the name of assay in the Seurat object to be used.
an optional string, specify the name of slot.
an optional integer, specify the number of features to select as top variable features. Default is 2000.
1. Franklin, S. B., Gibson, D. J., Robertson, P. A., Pohlmann, J. T., & Fralish, J. S. (1995). Parallel analysis: a method for determining significant principal components. Journal of Vegetation Science, 6(1), 99-106.
2. Crawford, A. V., Green, S. B., Levy, R., Lo, W. J., Scott, L., Svetina, D., & Thompson, M. S. (2010). Evaluation of parallel analysis methods for determining the number of factors.Educational and Psychological Measurement, 70(6), 885-901.
n <- 100
p <- 50
d <- 15
object <- matrix(rnorm(n*d), n, d) %*% matrix(rnorm(d*p), d, p)
diagnostic.cor.eigs(object, n.sims=2)
Run the code above in your browser using DataLab