Entering edit mode
15 months ago
hellokwmin
•
0
Hello, Biostars,
I am working on generation of Heatmap.
My R code used for that is:
Heatmap(heat,
name = "Log2",
col = color_fun,
split = df$Family,
cluster_rows = T,
show_row_dend = F,
show_row_names = F,
row_title_side = "left",
row_title_gp = gpar(fontsize = 12, fontface = "bold"),
row_names_side = "left",
row_title_rot = 0,
width = unit(4, "cm"))
And then, I have this figure:
Since I run cluster_row = T
function, the order of row is not from 1 to 9. How could I make it from 1 to 9 keeping clustering?
Thank you.
Hi, One reason this is happening is because of the dendogram. Disable the dendogram for the columns and then check. In most usual cases it sorts the rows order wise
Alternatively you could use ggplots
geom_tile
to make the heatmap. Then you could setfacet_wrap(~Family)
, and change the order by setting the factor