Elbow method Average silhouette method Gap statistic method Using NbCLust Sources Elbow method The basic idea is to find minimal the total intra-cluster variation or total Within-cluster Sum ofSquares (WSS).
Plot number of clusters ~ WSS show how WSS is reduced with increase of number of clusters. The optimal number of clusters is when adding another cluster doesn’t improve much better the total WSS.
The optimal number of clusters can be defined as follow:
Here you can find a beautiful example of differential expression analysis using standard R packages.
Here you can find how to work with k-means cluster analysis.
Here you can find how to work with hierarchical cluster analysis, how choose number of cluseter and how to choose the best model.