0

I have a problem with the heatmap.2 function from gplots (version 3.0.1.1): it processes extremely slowly when both row and column clusterings are set to FALSE.

Sample matrix:

x <- matrix(rnorm(25000), ncol=2)

With both clusterings:

heatmap.2(x, Rowv=TRUE, Colv=TRUE, dendrogram="both")

it lasts only a few seconds.

If I remove both clusterings it runs for such a long time that I have to kill it:

heatmap.2(x, Rowv=FALSE, Colv=FALSE, dendrogram="none")

In theory it should be faster than when computing both row and column clusterings...

Is it something wrong with the package version, or with the options I use? Can it be something wrong in my environment?

I'm a little stuck here, any help is welcome!

sessionInfo()

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.2 (Nitrogen)

Matrix products: default
BLAS/LAPACK: /nfs/software/as/el7.2/EasyBuild/CRG/software/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_sandybridgep-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gplots_3.0.1.1

loaded via a namespace (and not attached):
[1] compiler_3.5.0     KernSmooth_2.23-15 gdata_2.18.0       caTools_1.17.1    
[5] bitops_1.0-6       gtools_3.5.0      
sargg
  • 323
  • 3
  • 8
  • 2
    try heatmap(x, Rowv = NULL, Colv = NULL) this is from base stats package. Had the same issue as you , `heatmap.2` was slow and had to kill it. guessing there's a bug in the code. Alternatively try d3heatmap ot newer version - https://cran.r-project.org/web/packages/heatmaply/index.html personally, if you don't want re-ordering just use geom_tile https://jcoliver.github.io/learn-r/006-heatmaps.html and here's an illuminative thread :https://www.biostars.org/p/192033/ – infominer Mar 14 '19 at 16:52
  • I saw that last thread before but, as I have the latest version of the package, I thought the fix should be included. I'm clustering RNA-seq data and using that clustering to show the corresponding coverage of ChIP-seq data, so I was hoping to solve this to keep the same "style"! I won't use geom_tile for this but will give the other functions a try! Thanks!! – sargg Mar 15 '19 at 08:45
  • you can always make the output from heatmap adhere to heatmap.2 style! curious as to why you don/t want to use geom_tile? seems ideal for your use case, seeing you already have clustered data? – infominer Mar 15 '19 at 17:53
  • I've noticed a similar problem. If I don't cluster rows or columns, or I cluster only columns, the output takes excessively long. But clustering by row, or both is fairly quick. – Steve Apr 27 '20 at 18:18

0 Answers0