Adding a dendrogram to heatmaps
I know there is a duplicate issue, but it looks like that isn't being watched anymore and I'll add a little more detail here.
Duplicate issue: https://github.com/plotly/plotly.js/issues/1321
In many bioinformatics applications, heatmaps are made and need to be grouped on some factor relevant to each column in the heatmap. For example, you may have a heatmap where the columns are the samples and the rows are number of molecules A, B, C, and D found in each sample. Each sample is categorized as either female or male. In a normal heatmap, you would not be able to visualize the differences in numbers of molecules between male and female since they are randomly placed left to right. So, you add a dendrogram to sort the samples into similar groups based on the data used to generate the heatmap.
Since many bioinformaticians use R, they will use a package like pheatmap to create a heatmap with the dendrograms on both the x and y axes. This blog post shows a good example in a bioinformatics context. I am copying the image over for easy access:
I would like to have this in plotly js since I am creating a web application to visualize some bioinformatics data. Without the dengrogram, a lot of these plots are meaningless. I could create the plots on the backend and have the front end access them, but that is not as performant as moving the logic over to the front end. In the duplicate issue, there are references to dash_bios clustergram function, but that still requires the plot to be generated on the back end in cases when the front end is written in a javascript framework such as react.
To get this to work, we will need some sort of dendrogram creating tool. I did a cursory search and did not find anything; however, I am not really sure how this is implemented in python either. If someone has more knowledge, I would be interested to hear about it. I would be willing to commit some code to help implement it, but would need guidance from folks more familiar with plotly.js internals and dendrogram calculations.