brentp / smoove

structural variant calling and genotyping with existing tools, but, smoothly.
Apache License 2.0
222 stars 21 forks source link

error when starting lumpy, panic: runtime error: invalid memory address or nil pointer dereference #146

Closed xyxss closed 3 years ago

xyxss commented 3 years ago

Whether -p 1 or others will get same error. I had run it at other linux HPC, but this one can't do it. Please help me fix it. Thanks a lot.

Installed smoove by conda,

conda create -n smoove -c bioconda smoove

Run code

smoove call \
    -p 1 \
    --outdir ${wd} \
    --exclude $gap \
    --name ${wd}/${id}.part1 \
    --fasta $ref_fa \
    --genotype ${id}.rmdup.bam

Logs

[smoove] 2021/04/12 09:32:41 starting with version 0.2.6
[smoove] 2021/04/12 09:32:41 calculating bam stats for 1 bams
[smoove] 2021/04/12 09:33:18 done calculating bam stats
[smoove] 2021/04/12 09:34:43 removed 0 alignments out of 150976 (0.00%) with low mapq, depth > 1000, or from excluded chroms from GLGS30.disc.bam in 85 seconds
[smoove] 2021/04/12 09:34:43 removed 0 alignments out of 150976 (0.00%) that were bad interchromosomals or flanked-splitters from GLGS30.disc.bam
[smoove] 2021/04/12 09:34:46 kept 5985 putative orphans
[smoove] 2021/04/12 09:34:46 removed 580 discordant orphans in 2 seconds
[smoove] 2021/04/12 09:34:50 removed 1160 singletons and isolated interchromosomals of 150976 reads (0.77%) from GLGS30.disc.bam in 7 seconds
[smoove] 2021/04/12 09:34:50 149816 reads (99.23%) of the original 150976 remain from GLGS30.disc.bam
[smoove] 2021/04/12 09:36:08 removed 0 alignments out of 224804 (0.00%) with low mapq, depth > 1000, or from excluded chroms from GLGS30.split.bam in 78 seconds
[smoove] 2021/04/12 09:36:08 removed 0 alignments out of 224804 (0.00%) that were bad interchromosomals or flanked-splitters from GLGS30.split.bam
[smoove] 2021/04/12 09:38:20 kept 122864 putative orphans
[smoove] 2021/04/12 09:38:20 removed 1269 split orphans in 115 seconds
[smoove] 2021/04/12 09:38:25 removed 2538 singletons of 224804 reads (1.13%) from GLGS30.split.bam in 137 seconds
[smoove] 2021/04/12 09:38:25 222266 reads (98.87%) of the original 224804 remain from GLGS30.split.bam
[smoove] 2021/04/12 09:38:27 starting lumpy
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9cc780]

goroutine 1 [running]:
os.(*File).Name(...)
        /home/brentp/go/src/os/file.go:54
github.com/brentp/smoove/lumpy.run_lumpy(0xc0001ada00, 0x1, 0x1, 0x7fff5d342a1d, 0x4c, 0x7fff5d34292b, 0x3d, 0x0, 0x7fff5d3429ca, 0x4a, ...)
        /home/brentp/go/go/src/github.com/brentp/smoove/lumpy/lumpy.go:163 +0x5f0
github.com/brentp/smoove/lumpy.Lumpy(0x7fff5d3429ca, 0x4a, 0x7fff5d342a1d, 0x4c, 0x7fff5d34292b, 0x3d, 0xc000187610, 0x1, 0x1, 0xc000190a00, ...)
        /home/brentp/go/go/src/github.com/brentp/smoove/lumpy/lumpy.go:132 +0x39b
github.com/brentp/smoove/lumpy.Main()
        /home/brentp/go/go/src/github.com/brentp/smoove/lumpy/lumpy.go:335 +0x261
main.main()
        /home/brentp/go/go/src/github.com/brentp/smoove/cmd/smoove/smoove.go:121 +0x1ce
xyxss commented 3 years ago

And Lumpy can run itself for smoove generated file histo.

lumpy \
    -mw 4 \
    -tt 0 \
    -pe id:GLGS30,bam_file:GLGS30.disc.bam,histo_file:GLGS30.histo,mean:500,stdev:50,read_length:101,min_non_overlap:101,discordant_z:5,back_distance:10,weight:1,min_mapping_threshold:10 \
    > sample.vcf

Logs

1       1000000
2       1000000
3       1000000
4       1000000
5       1000000
6       1000000
7       1000000
8       1000000
9       1000000
10      1000000
11      1000000

Output

(smoove) [shuli@io2 smoove]$ cat sample.vcf | head -n 100
##fileformat=VCFv4.2
##source=LUMPY
##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
...
##ALT=<ID=DEL,Description="Deletion">
...
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
...
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  GLGS30
1       392679  1       N       <DEL>   .       .       SVTYPE=DEL;STRANDS=+-:4;SVLEN=-716;END=393395;CIPOS=-10,329;CIEND=-224,9;CIPOS95=0,92;CIEND95=-51,2;IMPRECISE;SU=4;PE=4       GT:SU:PE        ./.:4:4
1       10      2_1     N       [1:5438[N       .       .       SVTYPE=BND;STRANDS=--:14;EVENT=2;MATEID=2_2;CIPOS=-9,0;CIEND=-204,3;CIPOS95=-9,0;CIEND95=-49,0;IMPRECISE;SU=14;PE=14  GT:SU:PE        ./.:14:14
1       5438    2_2     N       [1:10[N .       .       SVTYPE=BND;STRANDS=--:14;SECONDARY;EVENT=2;MATEID=2_1;CIPOS=-204,3;CIEND=-9,0;CIPOS95=-49,0;CIEND95=-9,0;IMPRECISE;SU=14;PE=14        GT:SU:PE        ./.:14:14
1       1725352 3_1     N       N]1:1726807]    .       .       SVTYPE=BND;STRANDS=++:4;EVENT=3;MATEID=3_2;CIPOS=-10,361;CIEND=-10,190;CIPOS95=-1,105;CIEND95=-1,59;IMPRECISE;SU=4;PE=4       GT:SU:PE        ./.:4:4
1       1726807 3_2     N       N]1:1725352]    .       .       SVTYPE=BND;STRANDS=++:4;SECONDARY;EVENT=3;MATEID=3_1;CIPOS=-10,190;CIEND=-10,361;CIPOS95=-1,59;CIEND95=-1,105;IMPRECISE;SU=4;PE=4     GT:SU:PE        ./.:4:4
1       1725289 4_1     N       [1:1726772[N    .       .       SVTYPE=BND;STRANDS=--:4;EVENT=4;MATEID=4_2;CIPOS=-375,7;CIEND=-344,9;CIPOS95=-107,0;CIEND95=-93,2;IMPRECISE;SU=4;PE=4 GT:SU:PE        ./.:4:4
1       1726772 4_2     N       [1:1725289[N    .       .       SVTYPE=BND;STRANDS=--:4;SECONDARY;EVENT=4;MATEID=4_1;CIPOS=-344,9;CIEND=-375,7;CIPOS95=-93,2;CIEND95=-107,0;IMPRECISE;SU=4;PE=4       GT:SU:PE        ./.:4:4
brentp commented 3 years ago

looks smoove is trying to create whatever you specified as the outdir and it's not able to. you can create it beforehand or make sure you have write permissions there. I'll push a fix shortly so the error is more informative.

xyxss commented 3 years ago

How can I install the new version of lumpy.go

brentp commented 3 years ago

The simplest thing is to just make the directory (and ensure it is writable) before starting smoove.

xyxss commented 3 years ago

I've checked. The process droped when start lumpy. It generated split.bam and disc.bam in that directory. Then I run lumpy following, and get ouput. The qusetion is lumpy can't launch by smoove

brentp commented 3 years ago

you can try this binary (unzip and chmod +x) but it sounds like it might not fix the problem. does lumpy fail quickly? smoove_c.gz

xyxss commented 3 years ago

It is failed after extrating discordant and splited bam. I will try and give you report soon

xyxss commented 3 years ago

panic: open ${wd}/${wd}/${id}.part1-lumpy-cmd.sh: no such file or directory. It may cause by ${wd}

--outdir ${wd} \
--exclude $gap \
--name ${wd}/${id}.part1 \

We will try by changing ${wd} to ./

xyxss commented 3 years ago

It is runing, the bug is caused by I added ${wd} at front of output file name in --name. Fixed. Thanks