View source: R/findSuggestedK.R
findSuggestedK | R Documentation |
Performs a grid search over a range of k values to assess cluster stability.
findSuggestedK(
scCNA,
embedding = "umap",
ncomponents = 2,
k_range = NULL,
method = c("hdbscan", "leiden", "louvain"),
metric = c("median", "mean"),
seed = 17,
B = 200,
BPPARAM = bpparam()
)
hdbscanCBI(data, minPts, diss = inherits(data, "dist"), ...)
leidenCBI(data, k, seed_leid, diss = inherits(data, "dist"), ...)
louvainCBI(data, k, seed_leid, diss = inherits(data, "dist"), ...)
scCNA |
The CopyKit object. |
embedding |
String with the name of the reducedDim embedding. |
ncomponents |
An integer with the number of components dimensions to use from the embedding. |
k_range |
A numeric range of values to be tested. |
method |
A string with the method of clustering to be tested. |
metric |
A string with the function to summarize the jaccard similarity value from all clusters. |
seed |
A numerical scalar with a seed value to be passed on to
|
B |
A numeric with the number of bootstrapping iterations passed on to
|
BPPARAM |
A BiocParallelParam specifying how the function should be parallelized. |
Performs a grid-search over a range of k values and returns the value that maximizes the jaccard similarity. Importantly, while this approach does not guarantee optimal clustering, it provides a guide that maximizes cluster stability.
The default tested range is from 7 to the square root of the number of cells in the scCNA object. If sqrt(n_cells) is smaller than 7 a range of 5 to 15 is tested.
Adds a table with the mean jaccard coefficient of clusters for each
tested k and the suggested k value to be used for clustering to
metadata
Hennig, C. (2007) Cluster-wise assessment of cluster stability. Computational Statistics and Data Analysis, 52, 258-271.
Hennig, C. (2008) Dissolution point and isolation robustness: robustness criteria for general cluster analysis methods. Journal of Multivariate Analysis 99, 1154-1176.
clusterboot
plotSuggestedK
set.seed(1000)
copykit_obj <- copykit_example_filtered()[,sample(300)]
copykit_obj <- findSuggestedK(copykit_obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.