adjusting pheatmap based on common genes
1
0
Entering edit mode
5 months ago
Meghan.T • 0

Hey everyone,

We are trying to compare the transcriptional changes of a treatment of a cell line. we have used the monomer and the dimer form of the treatment. We then selected the top 40 DEGs based on logFC of the dimer form of treatment and plotted a heatmap like below (left): ( values are logFC compared to control) enter image description here

We also plotted a heatmap using the top 40 DEGs of monomer form of treatment. As you can see some genes are common in both plots but show different colors. for example SOCS2 is more yellow in plot1 compared to plot2.

I guess my question is: is there any way to normalize or use pheatmap options so that the same values in both plots show the same color?

Thank you in advance.

RNA-seq heatmap • 518 views
ADD COMMENT
2
Entering edit mode
5 months ago

pheatmap defines colours based on a set of numeric 'breaks'. You can think of it as the fingers and spaces between each finger on your hand. The fingers are the breaks and the gaps are the colours. So if you have 100 colours you need 100+1 breaks. When you feed pheatmap a matrix, it defines the breaks on the fly using the range of the values in the matrix. So if you want consistent breaks you can define them yourself.

Based on your data, you could specify a set of breaks using the following:

ph.breaks <- seq(from = 0, to = 10, length.out = 101)
ph.cols <- colorRampPalette(c("blue", "white", "red"))(100)

pheatmap(..., breaks = ph.breaks, color = ph.cols)

Although given that your data isn't strictly bimodal and is a continuous scale, you could think of other colour palettes like viridis or a more colourblind friendly one than blue-white-red.

ADD COMMENT
0
Entering edit mode

Great. Thank you very much!

ADD REPLY
0
Entering edit mode

btw, do you know which color pallete pheatmap uses as default?

ADD REPLY
0
Entering edit mode

It's from the RColorBrewer package: colorRampPalette(rev(brewer.pal(n = 7, name = "RdYlBu")))(100)

ADD REPLY
0
Entering edit mode

Thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 2113 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