Question: How can I reorder row clusters using complexheatmap
0
gravatar for smyiz
13 months ago by
smyiz30
smyiz30 wrote:

I want to change order of clusters on the heatmap using Complex Heatmap package and I used pearson distance method and average method. When I cut the row dendrogram, cluster order is 1,3,2,4. How can I change it to this order :2,1,3,4

      clusters = dendextend::cutree(hx, k = 4)
      col_fun = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
      split <- factordim.cl$clusters, levels =c(2,1,3,4))

      Heatmap(z, split = split, show_row_names = FALSE, name = "log2(FC)", col = col_fun)
complexheatmap R • 1.5k views
ADD COMMENTlink modified 13 months ago by Kevin Blighe63k • written 13 months ago by smyiz30
2
gravatar for Kevin Blighe
13 months ago by
Kevin Blighe63k
Kevin Blighe63k wrote:

Ready made solution for you: A: Complex Heatmap: Changing order of clusters

Kevin

ADD COMMENTlink written 13 months ago by Kevin Blighe63k
2

the problem is solved. just need to add this parameter:

cluster_row_slices = FALSE

ADD REPLYlink written 13 months ago by smyiz30

Yep, please also see the manual, it is outstandingly comprehensive.

ADD REPLYlink written 13 months ago by ATpoint36k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 688 users visited in the last hour