Superimpose 2 Heatmaps
1
1
Entering edit mode
11.4 years ago
datanerd ▴ 520

I need to superimpose two heatmaps. Any tools other than Matlab? Thanks in advance!

• 7.4k views
ADD COMMENT
7
Entering edit mode

Why don't you create a third matrix m3 where the z-values are calculated by summing/substracting the z-values from the m1 and m2?

ADD REPLY
0
Entering edit mode

Can you elaborate on what you are interested in doing? A heatmap in multiple dimensions or a correlation of two heat maps?

ADD REPLY
0
Entering edit mode

Hi, I have same dimension 2 heatmaps from 2 different studies, with the same exact row and columns. I want to overlay them , so to visualize the resultant effect (colors multiply) please let me know if am still not clear.

ADD REPLY
6
Entering edit mode
11.4 years ago
Pavel Senin ★ 1.9k

what about this approach?

library(reshape)
library(ggplot2)
library(scales)
library(gridExtra)

data1 <- matrix(runif(9),ncol=3,dimnames=list(c("A","B","C"),c("D","E","F")))
data1.m = melt(data1)
p1 <- ggplot(data1.m, aes(X1, X2)) + geom_tile(aes(fill=value), colour="white") +
  scale_fill_gradient(low = "white", high = "steelblue") + ggtitle("data 1")

data2 <- matrix(runif(9),ncol=3,dimnames=list(c("J","K","L"),c("P","Q","R")))
data2.m = melt(data2)
p2 <- ggplot(data2.m, aes(X1, X2)) + geom_tile(aes(fill=value), colour="white") +
 scale_fill_gradient(low = "white", high = "steelblue") + ggtitle("data 2")

d=rescale(data1+data2)
rownames(d)=paste(rownames(data1),rownames(data2))
colnames(d)=paste(colnames(data1),colnames(data2))
d.m = melt(d)
p3 <- ggplot(d.m, aes(X1, X2)) + geom_tile(aes(fill=value), colour="white") +
  scale_fill_gradient(low = "white", high = "steelblue") + ggtitle("data 1 + data 2")

print(arrangeGrob(p1, p2, p3, ncol=1))

enter image description here

ADD COMMENT
0
Entering edit mode

looks exactly what i was looking for. Thank you so much Seninp! Will try this.

ADD REPLY
0
Entering edit mode

you are very welcome :).

ADD REPLY
0
Entering edit mode

hello,

suppose that i have already downloaded GSE63706 and normalized that and i have a normalized text file now. and i have also a list of probsets (a text file of my interest probsets) in this array...i want to have a heat map showing the expression pattern of my interest probsets in this array, for example in this array i have 4 varieties and different tissues (rind and flesh) and phases (0,10,20,30,40 and 50 days after harvesting). heat maps showing the expression pattern of my probsets in varieties, tissues and phases i mean

please..

ADD REPLY

Login before adding your answer.

Traffic: 3008 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6