motifStack crashes for example from documentation
1
0
Entering edit mode
map2085 ▴ 40
@map2085-9227
Last seen 6.0 years ago
United States

motifStack crashes when trying to execute one of the examples from its own documentation (from page 5 of the vignette)

Namely, the following code exactly reproduces the crash:

 

pcms  <-  readPCM(file.path(find.package("motifStack"),"extdata"),"pcm$")

motifs  <-  lapply(pcms,pcm2pfm)

motifStack(motifs,layout="stack",ncex=1.0)

 

 

This causes R to segfault.  Below if the error message produced by R

 

> motifStack(motifs,layout="stack",ncex=1.0)

 *** caught segfault ***
address 0x3a00000000, cause 'memory not mapped'

Traceback:
 1: .Call("RS_XML_ParseTree", as.character(file), handlers, as.logical(ignoreBlanks),     as.logical(replaceEntities), as.logical(asText), as.logical(trim),     as.logical(validate), as.logical(getDTD), as.logical(isURL),     as.logical(addAttributeNamespaces), as.logical(useInternalNodes),     as.logical(isHTML), as.logical(isSchema), as.logical(fullNamespaceInfo),     as.character(encoding), as.logical(useDotNames), xinclude,     error, addFinalizer, as.integer(options), as.logical(parentFirst),     PACKAGE = "XML")
 2: xmlTreeParse(rgmlFile, ...)
 3: readPicture(paste(psfilename, ".xml", sep = ""))
 4: coloredSymbols(ncha, font, colset, rname, fontsize)
 5: plotMotifLogo(pfm = x@mat, motifName = x@name, p = x@background[rownames(x@mat)],     colset = x@color[rownames(x@mat)], ...)
 6: plot(pfms[[n - i + 1]], xlab = NA, ...)
 7: plot(pfms[[n - i + 1]], xlab = NA, ...)
 8: plotMotifLogoStack(pfms, ...)
 9: motifStack(motifs, layout = "stack", ncex = 1)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

 

motifstack • 2.0k views
ADD COMMENT
0
Entering edit mode

Hi,

I can't reproduce this. Your installation might be out-of-sync. Please show the output of:

library(motifStack)
sessionInfo()

Thanks,

H.

ADD REPLY
0
Entering edit mode
Ou, Jianhong ★ 1.3k
@ou-jianhong-4539
Last seen 2 days ago
United States

Hi,

Could you try code like this:

library(grImport)
tmp <- tempfile()
cat("%!PS\nnewpath\n0 0 moveto\n-5 10 lineto\n-10 20 10 20 5 10 curveto\n5 10 lineto\nclosepath\n0 setgray\nfill\n", file=tmp)
PostScriptTrace(tmp, outfile=paste0(tmp, ".xml"))
pic <- readPicture(paste0(tmp, ".xml"))
grid.picture(pic)

 

And let me know what happens.

 

ADD COMMENT
0
Entering edit mode

Hi, I installed ATACseqQC and met the same "* caught segfault *" problem. I traced to this post, tried this code. Here is the result.

BTW, the path of ghostscript has been set with Sys.setenv(RGSCMD="PATHTO_GS")

library(grImport)

Loading required package: grid

Loading required package: XML

tmp <- tempfile()

cat("%!PS\nnewpath\n0 0 moveto\n-5 10 lineto\n-10 20 10 20 5 10 curveto\n5 10 lineto\nclosepath\n0 setgray\nfill\n", file=tmp)

PostScriptTrace(tmp, outfile=paste0(tmp, ".xml"))

pic <- readPicture(paste0(tmp, ".xml"))

* caught segfault *

address 0x7fa900000000, cause 'memory not mapped'

Traceback:

1: xmlTreeParse(rgmlFile, ...)

2: readPicture(paste0(tmp, ".xml"))

Possible actions:

1: abort (with core dump, if enabled)

2: normal R exit

3: exit R without saving workspace

4: exit R saving workspace

ADD REPLY
0
Entering edit mode

Hi chenzixi,

Thank you for confirm this segment fault agian. Could you try to re-install grImport from source like this:

install.packages("grImport", type="source")

and then re-run the code above. Before you run pic <- readPicture(paste0(tmp, ".xml")), could you please run sessionInfo() and send me your session info. So I can repeat your error.

Jianhong.

ADD REPLY
0
Entering edit mode

Hi Jianhong,

Thanks for your reply.

I re-install the grImport package as you suggested. Here is the sessionInfo.

>sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS release 6.6 (Final)

Matrix products: default BLAS: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRblas.so LAPACK: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRlapack.so

locale: [1] LCCTYPE=enUS.UTF-8 LCNUMERIC=C
[3] LC
TIME=enUS.UTF-8 LCCOLLATE=enUS.UTF-8
[5] LC
MONETARY=enUS.UTF-8 LCMESSAGES=enUS.UTF-8
[7] LC
PAPER=enUS.UTF-8 LCNAME=C
[9] LCADDRESS=C LCTELEPHONE=C
[11] LCMEASUREMENT=enUS.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] grImport0.9-1.1 XML3.98-1.16

loaded via a namespace (and not attached): [1] compiler3.5.1 tools3.5.1

I also tried the motifStack script mentioned above, and got the same problem.

>Sys.setenv(RGSCMD="/TJPROJ1/RNA/WORK/software/Ghostscript/ghostscript-9.26-linux-x8664/gs") >pcms <- readPCM(file.path(find.package("motifStack"),"extdata"),"pcm$") >motifs <- lapply(pcms,pcm2pfm) >motifStack(motifs,layout="stack",ncex=1.0)

* caught segfault * address 0x7f3e00000000, cause 'memory not mapped'

Traceback: 1: xmlTreeParse(rgmlFile, ...) 2: readPicture(paste(psfilename, ".xml", sep = "")) 3: coloredSymbols(ncha, font, colset, rname, fontsize) 4: plotMotifLogo(pfm = x@mat, motifName = x@name, p = x@background[rownames(x@mat)], colset = x@color[rownames(x@mat)], ...) 5: plot(pfms[[n - i + 1]], xlab = NA, ...) 6: plot(pfms[[n - i + 1]], xlab = NA, ...) 7: plotMotifLogoStack(pfms, ...) 8: motifStack(motifs, layout = "stack", ncex = 1)

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace

Here is the sessionInfo of motifStack, before the "motifStack" command. Hope it could be helpful.

>sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS release 6.6 (Final)

Matrix products: default BLAS: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRblas.so LAPACK: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRlapack.so

locale: [1] LCCTYPE=enUS.UTF-8 LCNUMERIC=C
[3] LC
TIME=enUS.UTF-8 LCCOLLATE=enUS.UTF-8
[5] LC
MONETARY=enUS.UTF-8 LCMESSAGES=enUS.UTF-8
[7] LC
PAPER=enUS.UTF-8 LCNAME=C
[9] LCADDRESS=C LCTELEPHONE=C
[11] LCMEASUREMENT=enUS.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats4 parallel grid stats graphics grDevices utils
[8] datasets methods base

other attached packages: [1] motifStack1.26.0 Biostrings2.50.2 XVector0.22.0
[4] IRanges
2.16.0 S4Vectors0.20.1 ade41.7-13
[7] MotIV1.38.0 BiocGenerics0.28.0 grImport0.9-1.1
[10] XML
3.98-1.16

loaded via a namespace (and not attached): [1] Rcpp1.0.0 MASS7.3-51.1
[3] GenomicRanges1.34.0 zlibbioc1.28.0
[5] GenomicAlignments1.18.1 munsell0.5.0
[7] BiocParallel1.16.5 colorspace1.4-0
[9] BSgenome1.50.0 lattice0.20-38
[11] GenomeInfoDb1.18.1 tools3.5.1
[13] SummarizedExperiment1.12.0 Biobase2.42.0
[15] seqLogo1.48.0 htmltools0.3.6
[17] matrixStats0.54.0 digest0.6.18
[19] Matrix1.2-15 GenomeInfoDbData1.2.0
[21] rtracklayer1.42.1 htmlwidgets1.3
[23] bitops1.0-6 RCurl1.95-4.11
[25] rGADEM2.30.0 DelayedArray0.8.0
[27] compiler3.5.1 scales1.0.0
[29] Rsamtools_1.34.0

Thanks,

Zixi

ADD REPLY
0
Entering edit mode

BTW, ATACseqQC works well on my own Windows-based R-3.5.1, but "usually" failed on the footprint module on the CentOS server. Why I said "usually"? In fact I have successfully plot the footprint for the first time, but the segfault came back over and over again when I re-run the same script, and I still could not repeat the plot with the sample data.

Here is the sessionInfo after loading ATACseqQC, hope it could be helpful.

>sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS release 6.6 (Final)

Matrix products: default BLAS: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRblas.so LAPACK: /PUBLIC/software/RNA/R/R-3.5.1/lib64/R/lib/libRlapack.so

locale: [1] LCCTYPE=enUS.UTF-8 LCNUMERIC=C
[3] LC
TIME=enUS.UTF-8 LCCOLLATE=enUS.UTF-8
[5] LC
MONETARY=enUS.UTF-8 LCMESSAGES=enUS.UTF-8
[7] LC
PAPER=enUS.UTF-8 LCNAME=C
[9] LCADDRESS=C LCTELEPHONE=C
[11] LCMEASUREMENT=enUS.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] ATACseqQC1.6.4 S4Vectors0.20.1 BiocGenerics_0.28.0

loaded via a namespace (and not attached): [1] ProtGenerics1.14.0 bitops1.0-6
[3] matrixStats0.54.0 bit640.9-7
[5] progress1.2.0 httr1.4.0
[7] GenomeInfoDb1.18.1 tools3.5.1
[9] R62.3.0 rGADEM2.30.0
[11] KernSmooth2.23-15 seqLogo1.48.0
[13] DBI1.0.0 lazyeval0.2.1
[15] colorspace1.4-0 ade41.7-13
[17] motifStack1.26.0 prettyunits1.0.2
[19] bit1.1-14 curl3.3
[21] compiler3.5.1 VennDiagram1.6.20
[23] graph1.60.0 Biobase2.42.0
[25] formatR1.5 DelayedArray0.8.0
[27] grImport0.9-1.1 rtracklayer1.42.1
[29] scales1.0.0 randomForest4.6-14
[31] RBGL1.58.1 stringr1.3.1
[33] digest0.6.18 Rsamtools1.34.0
[35] XVector0.22.0 pkgconfig2.0.2
[37] htmltools0.3.6 ensembldb2.6.3
[39] limma3.38.3 BSgenome1.50.0
[41] regioneR1.14.0 htmlwidgets1.3
[43] rlang0.3.1 RSQLite2.1.1
[45] shiny1.2.0 BiocParallel1.16.5
[47] RCurl1.95-4.11 magrittr1.5
[49] polynom1.3-9 GO.db3.7.0
[51] GenomeInfoDbData1.2.0 futile.logger1.4.3
[53] Matrix1.2-15 Rcpp1.0.0
[55] munsell0.5.0 stringi1.2.4
[57] yaml2.2.0 MASS7.3-51.1
[59] SummarizedExperiment1.12.0 zlibbioc1.28.0
[61] AnnotationHub2.14.2 grid3.5.1
[63] blob1.1.1 promises1.0.1
[65] crayon1.3.4 lattice0.20-38
[67] Biostrings2.50.2 splines3.5.1
[69] multtest2.38.0 GenomicFeatures1.34.1
[71] hms0.4.2 GenomicScores1.6.0
[73] MotIV1.38.0 GenomicRanges1.34.0
[75] seqinr3.4-5 biomaRt2.38.0
[77] futile.options1.0.1 XML3.98-1.16
[79] lambda.r1.2.3 BiocManager1.30.4
[81] idr1.2 httpuv1.4.5.1
[83] assertthat0.2.0 mime0.6
[85] preseqR4.0.0 xtable1.8-3
[87] AnnotationFilter1.6.0 later0.7.5
[89] survival2.43-3 ChIPpeakAnno3.16.1
[91] GenomicAlignments1.18.1 AnnotationDbi1.44.0
[93] memoise1.1.0 IRanges2.16.0
[95] interactiveDisplayBase_1.20.0

ADD REPLY
0
Entering edit mode

Hi Jianhong,

I want to mention that even without setting the R_GSCMD (which means R could not find ghostscript), running the sample script of ATACseqQC still get the 'memory not mapped' fault.

In addition, if using a plot saving command (like CairoPNG("FP.png")) before the factorFootprints command, I could get a footprint plot without the motif logo after R breakdown. It looks like someting goes wrong with motifStack, but I do not know what happend.

Besides, I tested ATACseqQC on my own WLS ubuntu and it works well. On my own WLS ubuntu, all the requied system libs were installed using apt-get install. However on the server, some libs were installed manually from source to my own HOME_PATH and exported in bash_profile. Is it possible that I forgot to export some libs?

Zixi

ADD REPLY
0
Entering edit mode

Hi Zixi,

Sorry for the late reply. I tried to repeat your error in centOS 6.10 (docker to centOS 6.6 is not working). However I can not repeat it. I think main issue may be caused by the library of libxml2-devel or curl-devel. You can have a try to reinstall the grImport by giving it correct libxml2 lib and include path by Makevars file.

The testing docker:https://hub.docker.com/r/jianhong/motifstackcentos

ADD REPLY
0
Entering edit mode

Hi Jianhong, Thanks for your reply. I did not noticed the library of libxml2. After intalling libxml2 2.9.9, export the PATH, and reinstall the XML package in R, I could plot the footprint! Thanks!

Zixi

ADD REPLY
0
Entering edit mode

Hi Zixi,

Great to know you figure it out!

Jianhong

ADD REPLY

Login before adding your answer.

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