Closed RodrigoGM closed 2 years ago
Can you try the version on GitHub (2.9.4)? I think the problem is from plotting the dendrogram which is calculated from a matrix containing identical rows (or rows of all zeros). I remember it has been fixed in recent versions. If the error is still there, then I will have a deep look.
Hi ! thanks for the prompt response. I've installed the GitHub version (2.9.4), and had no segfaults during the test run from above. However, there was a different error (below), note that I'm plotting the same object TM1_DDRC_Hm
and only changing the pdf dimensions for e.g. from a square-sized, to an A4. When I reload TM1_DDRC_Hm
from an .rda, and plot only the A4, the plot goes through. The different sizes are to facilitate combining the plots on Inkscape
thanks again,
2473 > ## Plot as Square + legend
2474 > pdf(file.path(panelDir, "TM1_DDRC_Heatmap_002.pdf"),
2475 + width = 224/25.4, height = 210/25.4)
2476 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))
2477 > dev.off()
2478 quartz
2479 2
2480 > ## Plot in A4
2481 > pdf(file.path(panelDir, "TM1_DDRC.pdf"),
2482 + width = 298/25.4, height = 210/25.4)
2483 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))
2484 Error in serialize(object, connection = NULL, ascii = ascii, version = serializeVersion) :
2485 bad version value
2486 invalid option "error"
2487 > dev.off()
2488 > save(TM1_DDRC_Hm, file = "TM1_DDRC_Hm.rda")
... ## load libraries
2559 > load("TM1_DDRC_Hm.rda")
2560 >
2561 > data(legSeg) ## legend
2562 > ## Plot in A4
2563 > pdf(file.path(panelDir, "TM1_DDRC.pdf"),
2564 + width = 298/25.4, height = 210/25.4)
2565 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))
2566 Loading required namespace: Cairo
2567 Loading required namespace: magick
2568 > dev.off()
2569 null device
2570 1
Is data(legSeg)
(I mean the legSeg.rda
file) generated under R 3. and you are working under R 4.?
No, both are under R 4.x. The last update of the legend object was on Nov. 11 2020, I had v4.0.3 at the time. I'm now on v4.0.5. I'll regenerate them now see if that works. Thanks for the support
14 bash-3.2$ ls -l data/legSeg.rda
15 -rw-r--r-- 1 gularter MSKCC\Domain Users 1096 Nov 11 2020 data/legSeg.rda
Hi @jokergoo,
I'm plotting a relatively fair number of matrices with genome-wide copy number data. I can only get one, maybe two heatmaps out, and then get a segfault (example below). Once I quit, restart, load the objects again, and go straight to where I left off, I can generate the plot. The segfault is produced when creating a series of heatmaps with minor variations e.g. tracks, subsets, annotations, etc. Segfault is also independent of exporting to pdf, png, or to a graphics device. It also occurs in the same fashion in R weather on a Linux server and on my Mac.
Any idea on what could be happening? The issues began with the upgrade to R ≥4.0 and have not gone away with newer versions. Error and session info (at the start of the script prior to segfault) below.
Since the data is heavily reliant on heatmap visualization, I'm finding it difficult to have reproducible images across all samples and data sets.
Any support would be useful, thank you