Those commands for the random dataset certainly work. It must be a bug in my code, I'll look at it again and redo the whole thing. Thanks for the fix!
Im using the heatmap.2 function in R to create a clustered heatmap of some microarray data. My commands are written as this:
heatmap.2 (as.matrix(highly_variable_genes,col=rev(morecols(50)),trace="none", main="Top 500 most variable genes across samples",ColSideColors=col.cell,scale="row"))
But even though I have specified that I don't want that hideous cyan squiggly 'trace' over my cells, which obscures everything, it keeps coming up. I've tried re-writing the command a few different ways and cannot get rid of it. Does anyone see what I have done wrong?
This command is taken wholesale from a tutorial that has no trace over its heatmap cells so I really dont know whats going on here...unless the commands have been updated in R.
Many thanks for your help.
1 answer
I agree that the tracing leaves much to be desired and I have never used it.
There is something peculiar about the way you have written your code - take a closer look at it. You are passing all of the following to
as.matrix(), which fails to issue any warning: x,col=rev(morecols(50)),trace="none", main="Top 500 most variable genes across samples",,scale="row"
Here is a simple solution:
require(gplots)
generate random data
x <- matrix(rexp(200, rate=.1), ncol=20)
reproduce the 'bug' with trace lines
heatmap.2(as.matrix(x,col=rev(morecols(50)), trace="none", main="Top 500 most variable genes across samples",,scale="row"))
get rid of trace lines
heatmap.2(as.matrix(x), trace="none", main="Top 500 most variable genes across samples", scale="row")
Log in to answer this question.


haha, hideous is right