brentp / vcfanno

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

Produces empty INFO fields #85

Closed garrettjstevens closed 6 years ago

garrettjstevens commented 6 years ago

Hello there,

I've noticed that if vcfanno doesn't find an annotation for a line and the INFO field for that line doesn't have any existing entries, the INFO field in the output is empty. I would think it should be a dot ("."). I've attached the files I used to generate this, but here's a sample output illustrating what I mean:

vcfanno test.toml test_dest.vcf > test_dest_ann.vcf
##fileformat=VCFv4.1
##INFO=<ID=cadd_phred,Number=1,Type=Float,Description="phred-scaled cadd score (from test_source.vcf.gz)">
##INFO=<ID=cadd_raw,Number=1,Type=Float,Description="raw cadd score (from test_source.vcf.gz)">
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT
1   10001   .   T   C   .   .   cadd_phred=4.1;cadd_raw=0.1
1   10001   .   T   G   .   .   

If I run this VCF through vcfanno again, I get an warning complaining about a bad VCF line because the info field is completely empty:

vcfanno test.toml test_dest_ann.vcf > /dev/null
=============================================
vcfanno version 0.2.8 [built with go1.8]

see: https://github.com/brentp/vcfanno
=============================================
vcfanno.go:115: found 2 sources from 1 files
XXXXX: bad VCF line '1  10001   .   T   G   .   .   'vcfanno.go:241: annotated 2 variants in 0.00 seconds (7262.0 / second)

Also, on a separate note, vcfanno adds a "FORMAT" column header to the output VCF even if the input VCF didn't have one. This doesn't seem to break anything in my workflow, but may cause unexpected behavior for someone.

test_files.tar.gz

Thanks!

brentp commented 6 years ago

I pushed a fix for this to vcfgo. It will be out in the next vcfanno release. thanks for reporting

garrettjstevens commented 6 years ago

Thanks for the quick fix and for great software!