Draw heatmaps for large dataset 2000x40
3
0
Entering edit mode
9.2 years ago
GR ▴ 400

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

Heatmap R • 4.1k views
ADD COMMENT
0
Entering edit mode
9.2 years ago

Cluster expression data or otherwise reduce those 2000 rows to a smaller set showing aggregate behavior.

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode
9.2 years ago
Siva ★ 1.9k

Can you try Matrix2png?

ADD COMMENT
0
Entering edit mode
9.2 years ago

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()
ADD COMMENT
0
Entering edit mode

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
ADD REPLY

Login before adding your answer.

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