opain / eQTL_to_TWAS

Methods for converting eQTL summary statistics into TWAS SNP-weights
GNU General Public License v3.0
13 stars 4 forks source link

Unexpected error in DBSLMM #15

Closed 1667857557 closed 1 year ago

1667857557 commented 1 year ago

Hi Oliver, We encountered a new unexpected error while computing the weights for one gene. The error seems to occur during the execution of the 'DBSLMM' mode. Below is the error report and the relevant file. Could you please provide some suggestions on how to address it? Thanks in advance!

Huang ENSG00000147996.txt

_Segmentation fault PLINK v1.90b7 64-bit (16 Jan 2023) www.cog-genomics.org/plink/1.9/ (C) 2005-2023 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to ./eQTL_to_TWAS/ENSG00000147996/SuSiE/ENSG00000147996.log. Options in effect: --bfile ./eQTL_to_TWAS/ENSG00000147996/ref/ref_chr9 --extract ./eQTL_to_TWAS/ENSG00000147996/SuSiE/ENSG00000147996_snps.txt --out ./eQTL_to_TWAS/ENSG00000147996/SuSiE/ENSG00000147996 --r square

7944 MB RAM detected; reserving 3972 MB for main workspace. 1 variant loaded from .bim file. 489 people (0 males, 0 females, 489 ambiguous) loaded from .fam. Ambiguous sex IDs written to ./eQTL_to_TWAS/ENSG00000147996/SuSiE/ENSG00000147996.nosex . --extract: 1 variant remaining. Using up to 15 threads (change this with --threads). Before main variant filters, 489 founders and 0 nonfounders present. Calculating allele frequencies... done. Total genotyping rate is exactly 1. 1 variant and 489 people pass filters and QC. Note: No phenotypes present. --r square to ./eQTL_to_TWAS/ENSG00000147996/SuSiE/ENSG00000147996.ld ... done. WARNING: XtX is not symmetric; forcing XtX to be symmetric by replacing XtX with (XtX + t(XtX))/2 Acccept Options: --summary: ./eQTL_to_TWAS/ENSG00000147996/DBSLMM/ENSG00000147996.DBSLMM.txt --plink: ./plink/plink --dbslmm: ./DBSLMM/software/dbslmm --ref: ./eQTL_to_TWAS/ENSG00000147996/ref/ref_chr9 --block: ./ldetect/EUR/fourier_ls-chr9.bed --outPath: ./eQTL_to_TWAS/ENSG00000147996/DBSLMM/ --n: 192 --nsnp: 1 --h2: 0.1 --h2f: 1 --type: d --mafMax: 0.2 --thread: 1 Warning: No significant --clump results. Skipping. Using , no significant SNPs. The most significant SNPs are regarded as fixed effect. Clumping time: 0.177 s. Options: -s: ./eQTL_to_TWAS/ENSG00000147996/DBSLMM/s_ENSG00000147996.txt -l: ./eQTL_to_TWAS/ENSG00000147996/DBSLMM/l_ENSG00000147996.txt -r: ./eQTL_to_TWAS/ENSG00000147996/ref/ref_chr9 -nsnp: 1 -n: 192 -mafMax: 0.2 -b: ./ldetect/EUR/fourier_ls-chr9.bed -h: 0.1 -t: 1 -eff: ./eQTL_to_TWAS/ENSG00000147996/DBSLMM/ENSG00000147996.dbslmm Reading PLINK FAM file from [./eQTL_to_TWAS/ENSG00000147996/ref/ref_chr9.fam] 489 individuals to be included from reference FAM file. Reading PLINK BIM file from [./eQTL_to_TWAS/ENSG00000147996/ref/ref_chr9.bim] Calculating MAF of reference panel ... 1 SNPs to be included from reference BIM file. Reading summary data of small effect SNPs from [./eQTL_to_TWAS/ENSG00000147996/DBSLMM/s_ENSG00000147996.txt] Segmentation fault Error in bmerge(i, x, leftcols, rightcols, roll, rollends, nomatch, mult, : Incompatible join types: x.SNP (integer) and i.SNP (character) Calls: merge -> merge.data.table -> [ -> [.data.table -> bmerge In addition: Warning messages: 1: In system2(command = opt$plink, args = paste0("--bfile ", opt$plink_ref_chr, : setting stdout = TRUE 2: In system(paste0(opt$gctb, " --sbayes R --seed 1 --ldm ", opt$gctb_ref, : running command './gctb/gctb --sbayes R --seed 1 --ldm ./gctb/ukbEURu_hm3_shrunk_sparse/ukbEURu_hm3_chr9.ldm.sparse --pi 0.95,0.02,0.02,0.01 --gamma 0.0,0.01,0.1,1 --gwas-summary ./eQTL_to_TWAS/ENSG00000147996/SBayesR/ENSG00000147996.txt --chain-length 10000 --exclude-mhc --burn-in 2000 --out-freq 1000 --out ./eQTL_to_TWAS/ENSG00000147996/SBayesR/ENSG00000147996.SBayesR' had status 139 3: In fread(paste0(opt$output, "/", gene_i, "/PRScs/", gene_i, "_pst_eff_a1_b0.5_phiauto_chr", : File './eQTL_to_TWAS/ENSG00000147996/PRScs/ENSG00000147996_pst_eff_a1_b0.5_phiauto_chr9.txt' has size 0. Returning a NULL data.table. 4: In system(paste0(opt$gctb, " --sbayes R --seed 1 --ldm ", opt$gctb_ref, : running command './gctb/gctb --sbayes R --seed 1 --ldm ./gctb/ukbEURu_hm3_shrunk_sparse/ukbEURu_hm3_chr9.ldm.sparse --pi 0.95,0.02,0.02,0.01 --gamma 0.0,0.01,0.1,1 --gwas-summary ./eQTL_to_TWAS/ENSG00000147996/SBayesR/ENSG00000147996.txt --robust --chain-length 10000 --exclude-mhc --burn-in 2000 --out-freq 1000 --out ./eQTL_to_TWAS/ENSG00000147996/SBayesRrobust/ENSG00000147996.SBayesR' had status 139 Execution halted ENSG00000147996.txt

opain commented 1 year ago

Hi Huang,

Thanks for sending through this issue.

Unfortunately I am unable to replicate the error. For me, DBSLMM also crashes (since there is only 1 SNP), but then the script correctly skips the subsequent DBSLMM code due to there being no output from DBSLMM.

It appears that when you run it, R is finding a file that is output by DBSLMM. I am not sure why this would be happening, but to avoid the issue, I have put in an additional statement to skip DBSLMM when there is a segmentation error from DBSLMM. I have pushed this change to the main branch just now.

This update will not affect the output of other methods or genes, so no need to rerun for all genes.

Let me know if this resolves the issue for you.

Best wishes,

Ollie

1667857557 commented 1 year ago

Hi Ollie,

The issue has been resolved. Thank you for your prompt response and assistance.

Best wishes,

Huang