heatmap.2 has become very slow in plotting heatmap.
2
4
Entering edit mode
5.5 years ago
SP ▴ 280

I am working with gplots - heatmap.2 and recently it has become very slow in plotting matrix bigger than ~2000*120. Has anyone encountered this problem? Could it be some other package update which is causing the problem?


Thanks for you help in advance.

R heatmap • 6.4k views
ADD COMMENT
3
Entering edit mode

Hi Peeyush,

Give pheatmap a try. Also think using all the cores using foreach and parallel packages which utilizes all the cores.

ADD REPLY
3
Entering edit mode

I have the exact same issue! I updated some packages yesterday and today when I run the script that calls heatmap.2 on a more than 1000x140 matrix it just takes forever! It does not give me an error, but it uses awful amount of memory too! Gplots was not updated yesterday, but some of its dependencies were. They could be the ones that cause the problem?

ADD REPLY
0
Entering edit mode

I checked with heatmap3 and it is working fine. May be it is heatmap2 specific problem. Thanks for suggestions

ADD REPLY
0
Entering edit mode

I have the same problem. Have you solved with your heatmap.2, and is heatmap.3 the one within GMD? thank you!

ADD REPLY
0
Entering edit mode

I couldn't solve the problem, I even mailed maintainer of the package but he said nothing has been changed in the code. Instead of wasting time on heatmap2, I am now using heatmap3 which working fine and has the same arguments nothing to change. I took the code for heatmap3 and run it as a function before producing heatmap. This is the script.

ADD REPLY
4
Entering edit mode
5.0 years ago
ChristophH ▴ 40

The problem is in gplots

Version 3.0.0 (Mar 28, 2016) of gplots introduced a bug in heatmap.2 that makes it calculate dendrograms (using hclust and dist) even when Rowv or Colv is set to NA or FALSE or NULL. The solution is to use an older version or use the version I fixed: https://github.com/ChristophH/gplots

Btw, I agree that this question is not appropriate here, but decided to answer since it is the first thing that comes up when you do an internet search for "heatmap.2 slow"

ADD COMMENT
0
Entering edit mode

Thank you ChristophH! I ran your code from github, but now I got an error: "Error in heatmap.2(......) : could not find function "invalid" " What should I do now? Didn't find the answer from Google :)

ADD REPLY
0
Entering edit mode

The following commands will remove the existing gplots package from your system and install my version from github: remove.packages('gplots'); library('devtools'); install_github("ChristophH/gplots")

ADD REPLY
0
Entering edit mode

This worked for me like a charm:

remove.packages('gplots'); library('devtools'); install_github("ChristophH/gplots")

ADD REPLY
2
Entering edit mode
5.5 years ago
ivivek_ngs ★ 5.1k

I do not think people will agree to this post here since it is not very much inline with the directions of the forum. It is more of a stackoverflow question rather than Bioinformatics. In any case you have to be more specific about what you are trying and where it falters. Have you tried other packages like heatmap.3 or pheatmap or for d3heatmap. Check for all of these. In any case when you have too many rows and columns it is always advisable to run it via R script associating RAM to the script so that the processing is not halted. Local instances might not be a great idea to run for such huge matrices.

ADD COMMENT

Login before adding your answer.

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