Question: How to make heatmap more bright with proper color spectrum ?
0
gravatar for jack
4.2 years ago by
jack750
Germany
jack750 wrote:

Hi,

I need to create heatmap with bright colors which different values have different colors. all the enteris of my matrix is between -0.1- 0.9.

I have tried the following command, but the heatmap is not interesting. How can I make it nice with more colors such that the different values have differnetiable color ?

Here is my command :

heatmap.2(Gene, col=greenred(10),   key=TRUE, symkey=FALSE, symm=F,symbreaks=T,cexRow=1,cexCol=1,margins=c(6,11), scale= "column" ,trace="none",srtCol=45)
dev.off()

Here is the image :

ADD COMMENTlink modified 4.2 years ago by Manvendra Singh2.0k • written 4.2 years ago by jack750
1

Have you tried rainbow() instead of greenred()?
 

ADD REPLYlink written 4.2 years ago by Devon Ryan88k
1

What about scale = "row"? Assuming rows represent different genes the heatmap just highlights most abundant genes when scale = "column".

ADD REPLYlink written 4.2 years ago by mikhail.shugay3.3k

BTW, linking to an image in your gmail inbox won't work. You need to post it somewhere and then link to it there. Well, unless you want to give us your email login details, but that's a bad idea...

ADD REPLYlink written 4.2 years ago by Devon Ryan88k

i thought that I have copeid inot the post. well, where can I upload image ?

ADD REPLYlink written 4.2 years ago by jack750
1

Imgur, tinypic, postimage, etc. Just google "free image hosting" for more sites than you could ever need.

ADD REPLYlink written 4.2 years ago by Devon Ryan88k

I updated the post.

ADD REPLYlink written 4.2 years ago by jack750
2
gravatar for Devon Ryan
4.2 years ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k wrote:

Your problem is largely due to using symmetric colors. The other thing to consider is using manual color breaks. See the answer from "Lippy" here for an example of how to change these.

ADD COMMENTlink written 4.2 years ago by Devon Ryan88k

the enteris of the matrix is the correlation value and I don't scale it. I did with colum(which was wrong and I tried without scaling , the plot more or less was the same)/

ADD REPLYlink written 4.2 years ago by jack750
2
gravatar for Manvendra Singh
4.2 years ago by
Manvendra Singh2.0k
Berlin, Germany
Manvendra Singh2.0k wrote:

the problem is with your range of values thatswhy on the either ways to zero its 1;9 and then you scale coloumns, try with scaling rows and add breaks in your heatmap command as;

breaks=c(-0.1,0,0.2,0.3,0.4,0.5,0.6,0.7,0,8,0.9)

or better to plot a heatmap of z-score and use colors from RColorBrewer

e.g. I would do in this way

library(gplots)
library(RColorBrewer)
hr <- hclust(as.dist(1-cor(t(Gene), method="pearson")), method="average"); 
hc <- hclust(as.dist(1-cor(Gene, method="spearman")), method="average")  
# Cuts the tree and creates color vector for clusters.
mycl <- cutree(hr,k=4, h=max(hr$height)/1.5); 
mycolhc <- rainbow(length(unique(mycl)), start=0.1, end=0.9)
mycolhc <- mycolhc[as.vector(mycl)] ; myheatcol <- bluered(75)
heatmap.2(as.matrix(Gene), Colv=as.dendrogram(hc), 
          col=myheatcol, scale="row", density.info="none", 
          trace="none", RowSideColors=mycolhc,cexRow=1.5, 
          cexCol=1.5, keysize=1,margins=c(20,10))

 

hth

ADD COMMENTlink modified 4.2 years ago • written 4.2 years ago by Manvendra Singh2.0k
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: 1624 users visited in the last hour