Error running TOMplot in WGCNA package
2
0
Entering edit mode
Jon Bråte ▴ 260
@jon-brate-6263
Last seen 6 months ago
Norway

Hi,

This question may not be related to bioconductor, but I get an error running TOMplot in the WGCNA package. I got the heatmap and the color bars, but the dendrograms on the sides did not finish:

> TOMplot(plotTOM, geneTree, moduleColors, main = "Network heatmap plot, all genes")
Error in structure(NextMethod("[["), class = "dendrogram") :
  node stack overflow
Error during wrapup: node stack overflow
Error in dev.flush() : node stack overflow
Error during wrapup: node stack overflow

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] C

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

other attached packages:
[1] WGCNA_1.41-1        flashClust_1.01-2   dynamicTreeCut_1.62 impute_1.38.1      

loaded via a namespace (and not attached):
 [1] Formula_1.1-2       Hmisc_3.14-4        R.methodsS3_1.6.1   RColorBrewer_1.0-5
 [5] Rcpp_0.11.2         cluster_1.15.3      codetools_0.2-9     doParallel_1.0.8   
 [9] foreach_1.4.2       grid_3.1.0          iterators_1.0.7     lattice_0.20-29    
[13] latticeExtra_0.6-26 matrixStats_0.10.0  parallel_3.1.0      plyr_1.8.1         
[17] reshape_0.8.5       splines_3.1.0       survival_2.37-7     tools_3.1.0   
wgcna network • 5.2k views
ADD COMMENT
0
Entering edit mode

I've never used the WGCNA, but I'm curious if you can try reducing the size of your dataset and replotting it to see if you get the same errors?

ADD REPLY
0
Entering edit mode

I think you're right that it has to do with the size of the dataset. I have about 4400 genes. Will try to reduce it. Thanks.

ADD REPLY
1
Entering edit mode
@peter-langfelder-4469
Last seen 8 weeks ago
United States

How big is the data set (how many genes)? Is it bigger than options("expressions")? If so, try running options(expressions = 50000) or some number bigger than the number of columns in the TOM matrix you are trying to plot.

The underlying problem is that plot.dendrogram is written recursively and needs (roughly) as many recursions as there are nodes to plot (number of genes in your TOM).

Be aware though that TOMplot is very slow with large matrices, it may take up to several hours to plot the heatmap, which is due to some inefficiency in the heatmap function.

HTH,

Peter

 

ADD COMMENT
0
Entering edit mode

Thanks! I'm testing this right now. I have about 4400 genes in my TOM, and yes, it took about 2 hours to plot the heatmap.

Edit: I still get the same error. And plotting only the dendrogram works fine, so maybe it is something with memory usage and plotting the heatmap that creates problems?

ADD REPLY
0
Entering edit mode

Hi Peter,

I've been getting the same node stack overflow error when plotting the TOM. I'm using 20,000 genes in the TOM, I don't think its the issue with memory of the system since I'm running it on 250 gb RAM machine. Here's the error I'm getting it.

Error in structure(r, class = "dendrogram") : node stack overflow

Calls: TOMplot ... rev.dendrogram -> rev -> [[ -> [[.dendrogram -> structure

Execution halted Error in (function (e) : node stack overflow

I did try this hack mentioned by Gregory in the post on stack overflow (https://stackoverflow.com/questions/16559250/error-in-heatmap-2-gplots) as @keith Hughitt suggested but it gives the same error even when I fix the (expression = 50000). I want to include all the 20000 genes in my analysis. Does this have to anything with version of R I'm using? I ran the script on R v3.2.2. Can you please help me on how to fix this error. 

ADD REPLY
1
Entering edit mode
Keith Hughitt ▴ 180
@keith-hughitt-6740
Last seen 10 months ago
United States

There is an explanation and work-around for dealing with the same issue for `heatmap.2` from the `gplots` library. It might be worth a shot in your case. If it does help, please give credit to the original poster on SO.

ADD COMMENT

Login before adding your answer.

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