diagnostic.cor.eigs | R Documentation |
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, ...)
## Default S3 method:
diagnostic.cor.eigs(
object,
q_max = 50,
plot = TRUE,
n.sims = 10,
parallel = TRUE,
ncores = 10,
seed = 1,
...
)
## S3 method for class 'Seurat'
diagnostic.cor.eigs(
object,
assay = NULL,
slot = "data",
nfeatures = 2000,
q_max = 50,
seed = 1,
...
)
object |
A Seurat or matrix object |
... |
Other arguments passed to |
q_max |
the upper bound of low dimensional embedding. Default is 50. |
plot |
a indicator of whether plot eigen values. |
n.sims |
number of simulaton times. Default is 10. |
parallel |
a indicator of whether use parallel analysis. |
ncores |
the number of cores used in parallel analysis. Default is 10. |
seed |
a postive integer, specify the random seed for reproducibility |
assay |
an optional string, specify the name of assay in the Seurat object to be used. |
slot |
an optional string, specify the name of slot. |
nfeatures |
an optional integer, specify the number of features to select as top variable features. Default is 2000. |
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').
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.