Segmentation fault (core dumped)

243 views
Skip to first unread message

NM

unread,
Aug 28, 2018, 2:14:09 AM8/28/18
to PRSice
Hi Sam, 

I have similar segmentation fault (core dumped) error. But also with an added  "Warning: SNPs with chromosome number larger than 26. They will be ignored!". 

Log is below: 

nm31208081@hypatia:~/simulation/hapgen$ Rscript /home/nm31208081/PRSice.R --dir /home/nm31208081/simulation/hapgen --prsice /home/nm31208081/PRSice_linux --base hapgen_assoclog.assoc.logistic --target hapgen_test --no-clump --thread 1 --stat OR --ignore-fid --binary-target T --ignore-fid --out hapgen_prs

Trying to install optparse in /home/nm31208081/simulation/hapgen/lib


PRSice 2.1.3.beta (10 August 2018) 

https://github.com/choishingwan/PRSice

(C) 2016-2017 Shing Wan (Sam) Choi, Jack Euesden, Cathryn M. Lewis, Paul F. O'Reilly

GNU General Public License v3


If you use PRSice in any published work, please cite:

Jack Euesden Cathryn M. Lewis Paul F. O'Reilly (2015)

PRSice: Polygenic Risk Score software.

Bioinformatics 31 (9): 1466-1468


2018-08-22 11:19:49

/home/nm31208081/PRSice_linux \

    --A1 A1 \

    --bar-levels 0.001,0.05,0.1,0.2,0.3,0.4,0.5,1 \

    --base hapgen_assoclog.assoc.logistic \

    --binary-target T \

    --bp BP \

    --chr CHR \

    --ignore-fid  \

    --info-base INFO,0.9 \

    --interval 0.000050 \

    --lower 0.000100 \

    --model add \

    --no-clump  \

    --out hapgen_prs \

    --pvalue P \

    --seed 1032243675 \

    --snp SNP \

    --stat OR \

    --target hapgen_test \

    --thread 1 \

    --upper 0.500000



Loading Genotype file: hapgen_test (bed) 

 


100 people (0 male(s), 0 female(s)) observed 

100 founder(s) included 

 


Warning: SNPs with chromosome number larger than 26. They will be ignored!


Segmentation fault (core dumped)

Error: 

Execution halted



Many thanks in advance
Novia

Sam Choi

unread,
Aug 29, 2018, 9:55:17 AM8/29/18
to PRSice
Hm... it is difficult to tell what are the problem when segmentation fault happens. If you don't mind, could you wait for a day? I have just completed the full auditing of PRSice code and am in the process of generating test cases to test if PRSice run as expected. After this, PRSice should have significantly less bugs and problem and maybe you would be able to repeat your analysis?

Side note: I noticed your file name contain the word hapgen, do it happen that you are doing simulation with HapGen2 software? If that's the case, maybe try checking the relatedness of the sample generated? From my experience, the HapGen sample can be highly related. 

NM

unread,
Aug 30, 2018, 1:20:54 AM8/30/18
to PRSice
Hi Sam, 

Thanks for your reply. Sure I will wait and in the mean time I will check with hapgen. Yes I did simulation via hapgen and use the results to generate PRS using PRSice. 


Sam Choi

unread,
Aug 30, 2018, 6:32:47 PM8/30/18
to PRSice
Yup, thanks. It'd be great to know if it was my mistake that caused the generation of related sample or does HapGen truly generate related sample. 

NM

unread,
Sep 1, 2018, 3:25:35 AM9/1/18
to PRSice
Hi Sam, 

I found out the error was caused by hapgen not having chr id - i.e. in CHR column the put snp_0, snp_1 etc. So I did update chr in plink to 'correct' that into chr 1 (just for my simulation purpose). PRSice was happy with it, but I got a warning about mismatched SNPs between base and target. My log is below: 

nm31208081@hypatia:~/simtrial/hapgen$ Rscript /home/nm31208081/PRSice.R --dir /home/nm31208081/simtrial/hapgen --prsice /home/nm31208081/PRSice_linux --base hapgen_assoclog.assoc.logistic --target hapgen_test --no-clump --thread 1 --stat OR --ignore-fid --binary-target T --out hapgen_prs


PRSice 2.1.3.beta (10 August 2018) 

https://github.com/choishingwan/PRSice

(C) 2016-2017 Shing Wan (Sam) Choi, Jack Euesden, Cathryn M. Lewis, Paul F. O'Reilly

GNU General Public License v3


If you use PRSice in any published work, please cite:

Jack Euesden Cathryn M. Lewis Paul F. O'Reilly (2015)

PRSice: Polygenic Risk Score software.

Bioinformatics 31 (9): 1466-1468


2018-09-01 15:16:01

/home/nm31208081/PRSice_linux \

    --A1 A1 \

    --bar-levels 0.001,0.05,0.1,0.2,0.3,0.4,0.5,1 \

    --base hapgen_assoclog.assoc.logistic \

    --binary-target T \

    --bp BP \

    --chr CHR \

    --ignore-fid  \

    --info-base INFO,0.9 \

    --interval 0.000050 \

    --lower 0.000100 \

    --model add \

    --no-clump  \

    --out hapgen_prs \

    --pvalue P \

    --seed 788077011 \

    --snp SNP \

    --stat OR \

    --target hapgen_test \

    --thread 1 \

    --upper 0.500000



Loading Genotype file: hapgen_test (bed) 

 


100 people (0 male(s), 0 female(s)) observed 

100 founder(s) included 

 


117 ambiguous variant(s) excluded 

883 variant(s) included 

 


1 region included 


Start processing hapgen_assoclog.assoc 

============================== 

 


Reading 100.00%

Base file: hapgen_assoclog.assoc.logistic 

1000 variant(s) observed in base file, with: 

117 variant(s) not found in target file 

16 mismatched variant(s) excluded 

744 NA stat/p-value observed 

495 total variant(s) included from base file 

 

Warning: Mismatched SNPs detected between base and 

         target!You should check the files are based on the same 

         genome build, or that can just be InDels 

 


There are a total of 1 phenotype to process 

 



Processing the 1 th phenotype

Phenotype is a binary phenotype 

50 control(s) 

50 case(s) 

 


Processing 100.00%

There are 1 region(s) with p-value between 0.1 and 1e-5 

(may not be significant); Please note that these 

results are inflated due to the overfitting inherent in 

finding the best-fit PRS (but it's still best to find the 

best-fit PRS!). 

You can use the --perm option (see manual) to calculate an 

empirical P-value. 


Plotting Bar Plot

Plotting the high resolution plot

Warning message:

In max(pheno$Pheno) : no non-missing arguments to max; returning -Inf

Sam Choi

unread,
Sep 1, 2018, 3:25:30 PM9/1/18
to PRSice
Ar, I see. Yes, chromosome pattern should follow the chr or no chr format. Though I am rather surprise PLINK's function didn't capture that (PLINK"s function is what I used).  As for the mismatch, that's also normal, because you have not provided A2. Simply put, if in the target we've got A C and you've only got C or G in the base, without the information of A2, we won't match the two SNP as we are not sure if the flipping should  be carried out. Basically, without both A1 and A2, we will not perform flipping. 

I wonder what's your phenotype coded as considering there's this warning message from the Rscript section. 

Btw, did you manage to check the relatedness of the HapGen simulation?

NM

unread,
Sep 2, 2018, 12:51:28 AM9/2/18
to PRSice
Hi Sam, 

I don't know how to check the relatedness of HapGen simulation. The ones I used so far were from their example batch. I searched for more hapmap data for my simulation but so far couldn't find the appropriate ones. Any thoughts/tips? 

Thanks
Novia

Sam Choi

unread,
Sep 2, 2018, 6:02:34 PM9/2/18
to PRSice
I'd just tried to use PLINK to perform pruning and IBD/IBS calculation and see if the samples are related

NM

unread,
Sep 6, 2018, 12:02:31 AM9/6/18
to PRSice
Hi Sam, 

The phenotype is coded as 1 (case); 2 (control) as in plink. Not sure then why PRSice came up with warning from RScript?
Warning message:

In max(pheno$Pheno) : no non-missing arguments to max; returning -Inf


I did check the relatedness by calculating IBD/IBS in plink. The results are attached. 


Thanks

Novia 



chr1_relatedness.genome
chr1_relatedness.log
chr1_relatedness.nosex

Sam Choi

unread,
Sep 6, 2018, 1:06:35 PM9/6/18
to PRSice
Did you perform pruning? For now, it seems like the samples are related (first cousin), but this is much less than what I've previously observed. Interesting

Sonia Hesam

unread,
Feb 12, 2019, 12:50:07 AM2/12/19
to PRSice
Hi Sam,

I am trying to run PRSice2 with example files, but I got this Segmentation fault (core dumped) error. What do you think can be the reason?

Sam Choi

unread,
Feb 12, 2019, 5:31:20 PM2/12/19
to PRSice
Do you have the log file?

Sonia Hesam

unread,
Feb 12, 2019, 8:19:22 PM2/12/19
to PRSice
I downloaded the exact file for PRSice2, but I cannot see any log file between the example files.

Sonia Hesam

unread,
Feb 12, 2019, 8:31:44 PM2/12/19
to PRSice
I am getting the error in this stage:

.
.
.
Clumping Progress: 100.00%

Number of variant(s) after clumping : 88836 
 


Processing the 1 th phenotype
Phenotype is a binary phenotype 
1000 control(s) 
1000 case(s) 
 

Processing 100.00%
There are 1 region(s) with p-value less than 1e-5. Please 
note that these results are inflated due to the overfitting 
inherent in finding the best-fit PRS (but it's still best 
to find the best-fit PRS!). 
You can use the --perm option (see manual) to calculate an 
empirical P-value. 

Plotting Bar Plot
Invalid zlib compression method or flags in IDAT
Plotting the high resolution plot

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

Traceback:
 1: grDevices::dev.off()
 2: eval(expr, envir, enclos)
 3: eval(expr, pf)
 4: withVisible(eval(expr, pf))
 5: evalVis(expr)
 6: utils::capture.output({    grDevices::dev.off()    if (old_dev > 1)         grDevices::dev.set(old_dev)})
 7: ggsave(paste(prefix, "_HIGH-RES_PLOT_", Sys.Date(), ".", device,     sep = ""), ggfig.points, height = 10, width = 10)
 8: plot.high.res(argv, PRS, prefix, barchart.levels, argv$device)
 9: high_res_plot(prsice.result, prefix, parameters, use.ggplot)
10: process_plot(argv$out, covariance.base, binary_target[1], pheno.file,     argv, pheno.index[1], use.data.table, use.ggplot, "-")
aborting ...
Segmentation fault (core dumped)

Sam Choi

unread,
Feb 13, 2019, 5:37:01 PM2/13/19
to PRSice
It seems like your zlib installation was faulty and caused R to crash. If you run without the Rscript, you should not encounter this problem (though no plot will be generated)

It's difficult for me to debug your R installation remotely. Could you please check if your zlib is installed correctly? (e.g. can you print a plot from R to a png file?)





Sonia Hesam

unread,
Feb 14, 2019, 11:07:37 PM2/14/19
to PRSice
Yes, you are right. I could run PRSice, but without having the plots. How can I fix it? (Sorry I am at the beginning of learning these things)

Sam Choi

unread,
Feb 15, 2019, 6:29:33 AM2/15/19
to PRSice
As I mention, that'd be a problem with your R installation. Unfortunately, it will be difficult for me to figure out why your R installation have problem. Maybe try re-install R and see if that helps?

Sonia Hesam

unread,
Feb 17, 2019, 7:53:24 PM2/17/19
to PRSice
I tried to run PRSice2 through ubuntu and it worked. But we have a big data and I'd like to run it on our server as it is much faster. Server's R version is 3.5.1, and I could run PRSice1 through it successfully.
Does PRSice2 compatible with the last version of R?


Sam Choi

unread,
Feb 18, 2019, 5:36:18 PM2/18/19
to PRSice
That'd most likely be a problem of some package installation. If you don't mind, maybe try the following in your server R and see if it produce the same error:


library(ggplot2)
d
<- data.frame(x=rnorm(100, y=rnorm(100))
g
<- ggplot(d, aes(x=x, y=y))+geom_point()
ggsave
("Test.png", g, weight=7,height=7)


If it is indeed a problem of the package installation, then the above code should produce the same error. In that case, I'd suggest you reinstall your ggplot package

Reply all
Reply to author
Forward
0 new messages