This is a test version of Biostars. For the public version, visit https://www.biostars.org.
vcftools keep only indels not working

Hi, I am trying to filter a vcf file so that I only get indels from it. I am using vcftools with the following command:

vcftools --vcf NIST_RTG_PlatGen_merged_highconfidence_v0.2_Allannotate.vcf --max-alleles 2 --min-alleles 2 --keep-only-indels --recode --recode-INFO-all --out indels

I get the following error:

Error: Flag Type must have 0 entries: ID=isPolymorphic,Number=1,Type=Flag,Description="Sites that are polymorphic in the CEPH1493 pedigree

First time I see this kind of error, I have been filtering vcf files without problems until now. Any idea why vcftools it not filtering this particular vcf?

Thanks!

software error

1 answer

The error is raised here: https://github.com/vcftools/vcftools/blob/master/src/cpp/header.cpp#L141

in your VCF header you should have:

##INFO=<ID=isPolymorphic,Number=0,Type=Flag,Description="Sites...

instead of

##INFO=<ID=isPolymorphic,Number=1,Type=Flag,Description="Sites...

use sed to fix this.

Okay, thanks!

How can I change that though?

as mentioned by @pierre lindenbaum by

sed

Log in to answer this question.