[BioC] color key - heatmap.2

Sean Davis seandavi at gmail.com
Fri Mar 12 22:04:36 CET 2010


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



More information about the Bioconductor mailing list