color key - heatmap.2
1
0
Entering edit mode
Amit Indap ▴ 10
@amit-indap-3958
Last seen 2.1 years ago
United States
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 Coverage • 3.3k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
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
ADD COMMENT

Login before adding your answer.

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