brentp / vcfanno

annotate a VCF with other VCFs/BEDs/tabixed files
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-0973-5
MIT License
357 stars 55 forks source link

invalid memory address or nil pointer dereference #99

Closed komalsrathi closed 5 years ago

komalsrathi commented 5 years ago

Hi,

Here are the details of the issue I am facing. I have attached drive links to the query and annotation vcf files (they are both very small).

conf:

[[annotation]]
file="gnomad.exomes.r2.0.1.sites.subset.no-VEP.nohist.tidy.vcf.gz"
fields = ["AF", "AF_AFR", "AF_AMR", "AF_ASJ", "AF_FIN", "AF_NFE", "AF_OTH", "AF_SAS"]
names = ["gnomad_AF", "gnomad_AF_AFR", "gnomad_AF_AMR", "gnomad_AF_ASJ", "gnomad_AF_FIN", "gnomad_AF_NFE", "gnomad_AF_OTH", "gnomad_AF_SAS"]
ops=["max", "max", "max", "max", "max", "max", "max", "max"] 

Gnomad annotation (minimal subset): https://drive.google.com/open?id=1Adra0ddMWJEeGbEy9_CEWhYXDEsVkLt6

Minimal query file (vcf.gz): https://drive.google.com/open?id=1i4ndYYhn81iSxg6aV7kXX8WFXX_kZd3Y

Command:

vcfanno -lua rare-disease.lua rare-disease.conf 27571P-gatk-haplotype-annotated.vcf.gz | gzip -c > 27571P-gatk-haplotype-gnomad-annotated.vcf.gz

Error:


=============================================
vcfanno version 0.2.8 [built with go1.8]

see: https://github.com/brentp/vcfanno
=============================================
vcfanno.go:115: found 8 sources from 1 files
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xf8 pc=0x4fa206]

goroutine 1 [running]:
github.com/biogo/hts/bgzf.(*Reader).Read(0x0, 0xc4204aa000, 0x10000, 0x10000, 0x4, 0xc4203810c8, 0xc4201b93d0)
    /home/brentp/go/src/github.com/biogo/hts/bgzf/reader.go:513 +0x26
bufio.(*Reader).fill(0xc42046c2a0)
    /home/brentp/go/go1.8/src/bufio/bufio.go:97 +0x117
bufio.(*Reader).ReadSlice(0xc42046c2a0, 0xc4201b940a, 0x40ec92, 0xc4203a7f80, 0x30, 0x30, 0x79f7a0)
    /home/brentp/go/go1.8/src/bufio/bufio.go:338 +0xbb
bufio.(*Reader).ReadBytes(0xc42046c2a0, 0x20a, 0x7591c0, 0xc4201b9501, 0xc4202ffa00, 0x30, 0x0)
    /home/brentp/go/go1.8/src/bufio/bufio.go:416 +0x66
bufio.(*Reader).ReadString(0xc42046c2a0, 0xa, 0x40, 0xc4202ffa00, 0x0, 0x40)
    /home/brentp/go/go1.8/src/bufio/bufio.go:456 +0x38
github.com/brentp/vcfgo.NewReader(0x92b9e0, 0x0, 0x934301, 0xc420498000, 0xc4201b98b8, 0x4f95f6)
    /home/brentp/go/src/github.com/brentp/vcfgo/reader.go:70 +0x4b3
github.com/brentp/irelate/parsers.Vopen(0x92b9e0, 0x0, 0x0, 0x0, 0x0, 0xc4200c4ea0)
    /home/brentp/go/src/github.com/brentp/irelate/parsers/vcf.go:40 +0x48a
github.com/brentp/irelate/parsers.VCFIterator(0x92b9e0, 0x0, 0x1, 0x0, 0x92b9a0, 0xc420014470, 0x0)
    /home/brentp/go/src/github.com/brentp/irelate/parsers/vcf.go:83 +0x42
main.main()
    /home/brentp/go/src/github.com/brentp/vcfanno/vcfanno.go:154 +0xbd0
brentp commented 5 years ago

hi, sorry for the delay and thanks for the full data to reproduce. I am looking into it. You can get around this, it seems, by using -p 1 argument to vcfanno. I'll have a look at a real fix.

brentp commented 5 years ago

I pushed a fix for this, it will be out in next release. You can circumvent by either using a single thread, or by using a bgzipped query file (yours was just gzipped). Thanks again for reporting.