Teichlab / cellphonedb

MIT License
342 stars 105 forks source link

How to make the heatmap plot with row names in order? #319

Closed ilyiaZhao closed 3 years ago

ilyiaZhao commented 3 years ago

I notice that there is no function to order the row and column names in decreasing order when plotting heatmap. What can I do for that? Because I am comparing the cell and cell interactions among different condition. So it's better to have the rows in the same order. So what can I do for getting my goal?

prete commented 3 years ago

At this point I don't have an already tested solution, but, the source code for plotting heatmap is here: https://github.com/Teichlab/cellphonedb/blob/master/cellphonedb/src/plotters/R/plot_heatmaps.R

To achieve what you're after you can manually run that R script (passing all the parameters needed). Once you can do that, then you can edit the code the use something like the order function to sort the matrix before plotting I guess.

prete commented 3 years ago

Duplicated of #246