calculate_stability: Calculate the stability index of the obtained clusters when...

Description Usage Arguments Details Value

View source: R/ShinyFunctions.R


Stability index shows how stable each cluster is accross the selected range of k. The stability index varies between 0 and 1, where 1 means that the same cluster appears in every solution for different k.


calculate_stability(consensus, k)



consensus item of the sc3 slot of an object of 'SingleCellExperiment' class


number of clusters k


Imagine a given cluster is split into N clusters when k is changed (all possible values of k are provided via ks argument in the main sc3 function). In each of the new clusters there are given_cells of the given cluster and also some extra_cells from other clusters. Then we define stability as follows:

\frac{1}{ks*N^2}∑_{ks}∑_{N}\frac{given\_cells}{given\_cells + extra\_cells}

Where one N corrects for the number of clusters and the other N is a penalty for splitting the cluster. ks corrects for the range of k.


a numeric vector containing a stability index of each cluster

hemberg-lab/SC3 documentation built on May 11, 2018, 4:32 p.m.