4

I would like to change the column order of my heat map created with the R package pheatmap, but keep the same topology so that the dendrogram on top also reorders with the columns.

While explained in the documentation, I can't figure out how to implement it in R.

David C.
  • 1,974
  • 2
  • 19
  • 29
Sam Vanbergen
  • 145
  • 3
  • 11
  • By default, `pheatmap` would cluster rows and columns unless you set arguments `cluster_rows` and `cluster_cols` to `FALSE`. To achieve custom order of the columns, you need to re-structure your `data.frame` and set `cluster_cols=FALSE`. Similar operation can be done to rows. – David C. Jan 20 '18 at 23:37
  • 1
    I still need my columns to be clustered, but I want to flip around some of the nodes in my dendogram, so that the columns are in a different order. – Sam Vanbergen Jan 21 '18 at 01:38
  • You could explore by implementing `x <- pheatmap(...)`. This should give you a list object. Though a bit tricky, try to see if you can overwrite some options and then plot. – David C. Jan 21 '18 at 01:46
  • @SamVanbergen did you find and answer to this? I have the same issue – Ecg Feb 23 '21 at 19:38

0 Answers0