Hi Alex, These genes are the smallest subset I could extract. If anyone has written a script/tool to plot large datasets then that will be helpful.
Hi All,
I have created a heatmap for expression data of 2000 genes across 40 different conditions. But it is not informative at all, gene names are not visible etc.. Can anyone suggest me how to do a better heatmap. It will be ok if the heatmap is drawn on a big pdf file or multiple pages pdf file.
Thanks,
RT
3 answers
Cluster expression data or otherwise reduce those 2000 rows to a smaller set showing aggregate behavior.
Can you try Matrix2png?
Sorry, are you asking how to make a heatmap, or how to make a better heatmap?
If you're just asking how to make a heatmap, then matrix2png is a good recommendation. However, it will crash on large datasets, unless you explicitly specify the numbers of rows and columns as numr and numc options, which enable it to set up the required memory ahead of time.
If you're asking how to make a better heatmap, then reducing the heatmap to general features is recommended. You could use R with the gplots library, which has a heatmap.2 routine that makes it easy to render clusters via row- and column-based dendrograms alongside the heatmap, e.g.,:
> library(gplots)
> m_table <- read.table("foo.txt", as.is=T, header=T, stringsAsFactors=T)
> m_matrix <- data.matrix(m_table)
> pdf("foo.pdf", height=30, width=5)
> hwsr <- heatmap.2(m_matrix, hclustfun=function(x) hclust(x, method="ward"), scale="row", cexCol=0.5, cexRow=0.075)
> dev.off()
Hi Alex,
Thanks for this. I use R for drawing heatmaps. I used the following code for clustering as a first trial and got the following errors. Can you please help!
hc <- hclust(as.dist(1-cor(data_matrix, method="spearman")), method="complete")
hr <- hclust(as.dist(1-cor(t(data_matrix), method="pearson")),method="complete")
heatmap.2(data_matrix, col=brewer.pal(11,"RdBu"), cexCol=0.7, labRow=NA, Colv=as.dendrogram(hc), density.info="none", scale="row",trace="none",symm = T)
Error in hclust(as.dist(1 - cor(t(data_matrix), method = "pearson")), :
NaN dissimilarity value.
In addition: Warning message:
In cor(t(data_matrix), method = "pearson") : the standard deviation is zero
Log in to answer this question.