Question: color key - heatmap.2
0
9.6 years ago by
Amit Indap10
Amit Indap10 wrote:
Hi, I plotting a heat map using heatmap.2 command, where my rows are samples columns are sequence capture regions. The entry in the matrix is the average depth of coverage for that sample/target. heatmap.2 is doing what want, but the color key is showing a column z-score for mapping the colors. I would like to have the actual values in the color key. So if my sequence coverages ranged from 5-50X, the lighter colors would be the lower coverage values and the darker colors be the higher coverage values I have been searching thru the docs and doing google searches, but still not getting quite what I want. Thanks for any pointers. Amit library(gplots) library("RColorBrewer") coverage <- read.table("cov.txt", header=TRUE) # order the table by average coverage for the sample coverage <- (coverage[order(coverage$avg, decreasing=TRUE),]) cov_matrix <- data.matrix(coverage) #plot the heat map # heatmap.2(cov_matrix, Rowv=FALSE, Colv=FALSE, scale="column",margins=c(5,10), trace="none", density.info="none", xlab="target", ylab="samples", col=brewer.pal(9,"OrRd")) -- Amit Indap Dept. of Biology Boston College http://bioinformatics.bc.edu/marthlab/Main_Page [[alternative HTML version deleted]] coverage • 2.1k views ADD COMMENTlink modified 9.6 years ago by Sean Davis21k • written 9.6 years ago by Amit Indap10 Answer: color key - heatmap.2 0 9.6 years ago by Sean Davis21k United States Sean Davis21k wrote: On Fri, Mar 12, 2010 at 4:01 PM, Amit Indap <indapa at="" gmail.com=""> wrote: > Hi, > > I plotting a heat map using heatmap.2 command, where my rows are samples > columns are sequence capture regions. The entry in the matrix is the average > depth of coverage for that sample/target. ?heatmap.2 is doing what want, but > the color key is showing a ?column z-score for mapping the colors. I would > like to have the actual values in the color key. So if my sequence coverages > ranged from 5-50X, the lighter colors would be the lower coverage values and > the darker colors be the higher coverage values I have been searching thru > the docs and doing google searches, but still not getting quite what I > want. > > Thanks for any pointers. > > Amit > > library(gplots) > library("RColorBrewer") > > coverage <- read.table("cov.txt", header=TRUE) > > # order the table by average coverage for the sample > coverage <- (coverage[order(coverage$avg, decreasing=TRUE),]) > > cov_matrix <- data.matrix(coverage) > #plot the heat map > # > heatmap.2(cov_matrix, Rowv=FALSE, Colv=FALSE, > scale="column",margins=c(5,10), trace="none", density.info="none", > xlab="target", ylab="samples", col=brewer.pal(9,"OrRd")) Hi, Amit. Try scale="none" above, I think. Sean