weizhouUMICH / SAIGE

GNU Lesser General Public License v3.0
187 stars 72 forks source link

Memory issue in step2_SPAtests.R in version 0.44 but not in 0.42 #382

Closed adrlar closed 2 years ago

adrlar commented 2 years ago

Hi there,

I am getting a memory error in step2, in the newest version. When I download an older version (0.42) it works fine. I note that there are a few memory error issues open already but I couldn't tell if they were actually the same error or not.

Here is the backtrace for the error, hopefully it will give you an indication of what might be the issue:

*** Error in `/usr/local/lib/R/bin/exec/R': double free or corruption (!prev): 0x00000000096af310 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9c13ebb7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f9c13ec437a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9c13ec853c]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_ZN5savvy7variant15deserialize_vcfERS0_RSiRKNS_10dictionaryEmNS_7phasingE+0x5e)[0x7f9b7075249e]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_ZN5savvy6reader11read_recordERNS_7variantE+0x31b)[0x7f9b7075dc9b]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_ZN22variant_group_iterator9incrementEv+0x5f1)[0x7f9b70766ab1]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_ZN22variant_group_iterator4initEv+0x4f6)[0x7f9b70767226]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_Z17getGenoOfGene_vcfNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEf+0x780)[0x7f9b70761cf0]
/usr/local/lib/R/library/SAIGE/libs/SAIGE.so(_SAIGE_getGenoOfGene_vcf+0x96)[0x7f9b706bcbc6]
/usr/local/lib/R/bin/exec/R[0x499802]
/usr/local/lib/R/bin/exec/R[0x4d088a]
/usr/local/lib/R/bin/exec/R(Rf_eval+0x330)[0x4da0c0]
/usr/local/lib/R/bin/exec/R[0x4db843]
/usr/local/lib/R/bin/exec/R[0x4d153f]
/usr/local/lib/R/bin/exec/R(Rf_eval+0x330)[0x4da0c0]
/usr/local/lib/R/bin/exec/R[0x4db843]
/usr/local/lib/R/bin/exec/R(Rf_eval+0x2e2)[0x4da072]
/usr/local/lib/R/bin/exec/R(Rf_ReplIteration+0x209)[0x507b39]
/usr/local/lib/R/bin/exec/R[0x507f18]
/usr/local/lib/R/bin/exec/R(run_Rmainloop+0x45)[0x507fc5]
/usr/local/lib/R/bin/exec/R(main+0x18)[0x41ab58]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9c13e64830]
/usr/local/lib/R/bin/exec/R(_start+0x29)[0x41ab89]

I will also attach the exact commands I was running here in case there is some issue with them:

This one has the memory error

singularity exec saige_0.44.6.5.sif step2_SPAtests.R \
    --vcfFile=chr1_230837119_236502915.vcf.gz \
    --vcfFileIndex=chr1_230837119_236502915.vcf.gz.csi \
    --vcfField=GT \
    --GMMATmodelFile=null_glmm.rda \
    --varianceRatioFile=null_glmm_var_ratio.varianceRatio.txt \
    --SAIGEOutputFile=chr1_230837119_236502915.output \
    --minMAF=0.0 \
    --minMAC=0.0 \
    --groupFile=chr1_230837119_236502915.regions.tsv \
    --sparseSigmaFile=null_glmm_var_ratio.varianceRatio.txt_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseSigma.mtx \
    --LOCO=FALSE \

This one works

singularity exec saige_0.42.1.sif step2_SPAtests.R \
    --vcfFile=chr1_230837119_236502915.vcf.gz \
    --vcfFileIndex=chr1_230837119_236502915.vcf.gz.csi \
    --vcfField=GT \
    --GMMATmodelFile=null_glmm.rda \
    --varianceRatioFile=null_glmm_var_ratio.varianceRatio.txt \
    --SAIGEOutputFile=chr1_230837119_236502915.output \
    --minMAF=0.0 \
    --minMAC=0.0 \
    --groupFile=chr1_230837119_236502915.regions.tsv \
    --sparseSigmaFile=null_glmm_var_ratio.varianceRatio.txt_relatednessCutoff_0.125_2000_randomMarkersUsed.sparseSigma.mtx \
    --LOCO=FALSE \

Please let me know if there is any other info that you might need.

Kind regards //Adrian

weizhouUMICH commented 2 years ago

Sorry for my late reply.

We have just released a new version 1.0.0. It has computational efficiency improvements for both Step 1 and Step 2 for single-variant and set-based tests. We have created a new program github page https://github.com/saigegit/SAIGE with the documentation provided https://saigegit.github.io/SAIGE-doc/ The docker has also been updated to 1.0.0.

The program will be maintained by multiple SAIGE developers there. Please feel free to try the version and report issues if any.

Thanks! Wei