New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node stack overflow error in dendro_data #27
Comments
Please provide a reproducible example |
Hi , I have attached two sample files.
Below is the code in which i read data from csv file scaledData<-read.csv("mydata1.csv",header=TRUE) |
Yes, I can replicate the problem. I'm not going to be able to investigate any time soon. Meanwhile you can try:
|
The issue is still present when dealing with large dendrograms ..... |
Hi, the issue still persists. It is extremely problematic when analyzing genetic data. Any chance it will be resolved soon ? best, |
Do you get the same problem when using |
Sorry for the late reply, was very busy the last months. Quote: "Do you get the same problem when using rpart() ?" I am not sure how to use rpart, but will look it up. The problem is with co-expression network analyses, which typically result in dendrograms with 20.000+ leafs. Plotting the dendrogram with the normal plotting fuction is not a problem. However, I would love to integrate this into ggplot2 since I think this is a really great way to write papers. |
The issue is sill present in the latest release.I tried to plot a dendrogram generated by hclust with roughly 14695. I think the problem lies with a recursive function call within the as.dendrogram function. |
Correct. Since |
Sorry, I said Still, if you can find a solution using base R, this will demonstrate that the problem lies with |
Hi Andrie, thanks for the prompt reply. Plotting the dendrogram with plot(hclustobject) is no problem at all. The function as.dendrogram works fine. The culprit is the gg.plotNode function defined in the dendrogram_data function, I believe the recursive function call in line 282-285 of dendrogram.R I hope that helps. Dendrograms of this size are nothing unusual in -omics data analysis, and it would be really nice to be able to plot dendrograms in ggplot. Plotting them using plot and reimporting the png file is - let's put it this way - suboptimal. best, and thanks for your work ! |
Hi, I'm running into the same issue. Is there any update on this issue? Thanks a lot for your work! |
Hi there, just wanted to bump this issue as I've had problems with it as well. As thommor pointed out, the issue is caused by this recursive call to Attached is a plot from
Github doesn't allow uploading RData files to issues, so I ran the hclust result through I appreciate any help, ggdendro is awesome! |
This problem happens because there is too much identical branches and the recursive function invoked overflow the limit. A work around is adding a small random value to the original matrix to make sure there are not so many identical rows. |
Hi @andrie, The problem lies with Thank you in advance! Best, |
I have pushed a fix to the main branch on github. Please can you install the latest version from github and let me know if this works on your real world data. Using the example provided by @GuptaPriyanshu , I now get this plot output: |
Re-opening, since there are some performance optimisation gains possible. |
The example now runs in ~1.5 seconds on my machine. |
Hi @andrie, Thank you for fixing the issue. The latest GitHub version of Best, |
I am delighted to finally close this bug, after 6 years. Version 0.2.0 was accepted by CRAN on 2023-02-24. |
Hi,
We are trying to plot dendrogram but unfortunately for some cases we are getting error in dendro_data function.
hcdata <- dendro_data(hc, type="rectangle")
Error in : node stack overflow
No stack trace available
Is there any way i can get rid of this error ?
Thanks,
Priyanshu
The text was updated successfully, but these errors were encountered: