rlbarter / superheat

An r package for generating beautiful and customizable heatmaps
https://rlbarter.github.io/superheat/
234 stars 29 forks source link

Hierarchical clustering #6

Open senbabay opened 7 years ago

senbabay commented 7 years ago

Hi Rebecca,

Great work!

What is the linkage and distance metric used in hierarchical clustering? Is Ward linkage an option?

Also, when samples are grouped by user-input labels, what is the ordering of samples inside each group?

Thank you very much! Yasin

rlbarter commented 7 years ago

Hi Yasin,

The hierarchical clustering by default uses Euclidean distance, but you can change that to any of "maximum", "manhattan", "canberra", "binary", or "minkowski" using the dist.method argument. I hadn't actually implemented options for linkage (the default was "complete") but have done so now. You can now use the linkage.method argument (the options corresponds to the method argument for the hclust() function in R). Please install the latest development version of the package from github.

I will also update the documentation describing these options. Apologies that there was no explanation of this before!

When using manual grouping labels, the ordering should be the same as they were provided in the original matrix. For example, if I had 5 rows and I provided membership.rows = c(1, 2, 1, 1, 2), then the row order would be {1, 3, 4 | 2, 5}, if that makes sense... If this is not the case, please let me know!

I hope that helps!

Rebecca