I have been trying to understand an error that the EBI's vcf_validator gives when run on my vcf file. Consider this minimal file:
##fileformat=VCFv4.1
##reference=foo
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##contig=<ID=chr12>
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Sample1
chr12 529514 . AACAC AATAC 0.00 . . GT 0/1
chr12 529516 . C T . PASS . GT 0/1
If I then run vcf_validator on it, it complains about:
$ cat $(LC_ALL="C" ~/vcf_validator_linux -i test.vcf |& awk '/written to/{print $NF}' )
According to the VCF specification, the input file is not valid
Error: Duplicated variant chr12:529516:C>T found. This occurs 2 time(s), first time in line 6.
This is because the two variants are indeed the same. Changing
AACAC
to AATAC
at position 529514 just means change C
to T
at position 529516.
OK, but how is that against the VCF standard? What makes that an invalid VCF file? I am trying to automatically validate input VCF files and stop the analysis if they're invalid, but this seems like a perfectly valid file. Why is vcf_validator
not letting it through? The vcf-validator
perl script from vcftools doesn't complain about this. So is it just a bug in EBI's vcf_validator
or is it really somehow illegal to have duplicate variants in a VCF file according to the specs?
vcf_validator
to consider the file invalid, so I asked if there was anything in the specs that would actually make such files invalid. $\endgroup$