I expected the same pattern but here I am not able to compare the patterns as the order of genes does not seem the same. I mean how I can have two heat maps on which the order of genes are the same so I woulds be able to compare the block of yellow and blue colors in two heat maps.
I have used this code
require("RColorBrewer") myCol <- colorRampPalette(c("dodgerblue", "black", "yellow"))(100) myBreaks <- seq(-2, 2, length.out=101) heat <- t(scale(t(sc_DEGG))) hr <- hclust(as.dist(1-cor(t(y), method="pearson")), method="complete") heatmap.2( heat, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc), col=myCol, breaks=myBreaks, main="Title", key=T, keysize=1.0, scale="none", density.info="none", reorderfun=function(d,w) reorder(d, w, agglo.FUN=mean), trace="none", cexRow=0.2, cexCol=0.8, distfun=function(x) dist(x, method="euclidean"), hclustfun=function(x) hclust(x, method="ward.D2") )
I have made a pair of heat maps based on your code in complexheatmap package. The right heat map is lighter than the left one. I don't know which one has been clustered based on the another one. How I can make the right one darker so that both seem more similar??