brentp / slivar

genetic variant expressions, annotation, and filtering for great good.
MIT License
248 stars 23 forks source link

Error: unhandled exception: /home/brentp/src/slivar/src/slivar.nim(197, 16) `ovcf.write_variant(variant)` [AssertionDefect] #101

Closed raungar closed 3 years ago

raungar commented 3 years ago

Hi-

I get the following error

/home/brentp/src/slivar/src/slivar.nim(249) slivar /home/brentp/src/slivar/src/slivar.nim(246) main /home/brentp/src/slivar/src/slivar.nim(197) expr_main /nim/lib/system/assertions.nim(30) failedAssertImpl /nim/lib/system/assertions.nim(23) raiseAssert /nim/lib/system/fatal.nim(49) sysFatal Error: unhandled exception: /home/brentp/src/slivar/src/slivar.nim(197, 16) ovcf.write_variant(variant) [AssertionDefect]

Using the following command: slivar expr --js /path/slivar-functions.js --vcf tmp.vcf --ped tmp.ped.

I am attaching a sampled vcf/ped file that I get this error with. I've changed the attached files to a .txt file extension since github issues won't let me submit filetypes with a .vcf or .ped ending. tmp.ped.txt tmp.vcf.txt

brentp commented 3 years ago

Hi, when I run those, I see:

[W::vcf_parse_format] FORMAT 'AF' at 1:10611 is not defined in the header, assuming Type=String
[W::vcf_parse_format] FORMAT 'FT' at 1:10611 is not defined in the header, assuming Type=String
[E::vcf_format] Invalid BCF, the FORMAT tag id=24 at 1:10611 not present in the header

slivar needs those in the header so it (htslib) know where to get the per-sample values for depth, AD, GQ, etc. If I add:

##FORMAT=<ID=FT,Number=1,Type=Float,Description="FT">
##FORMAT=<ID=AF,Number=1,Type=Float,Description="AF">

to the header of your VCF, then it completes. You could verify that Number=1 is correct for both of those or adjust if not and then update your vcf header.

raungar commented 3 years ago

Hi-

Adding the header fixed the issue! Thank you!

-Rachel