Thanks so much for your help. I've tried it a bunch of ways with bcftools and can't get it to work. Looks like it doesn't want to filter at the genotype level but at the variant level.
I tried to make it simple and just filter out all hets first.
I keep getting errors like this:
Error: the tag "INFO/[%GT" is not defined in the VCF header
The command I used was:
bcftools filter -e [%GT=0/1] in.vcf > out.vcf
Thanks again.
But then, why do you have such a vcf format? Shouldn't you have the depth for each individual allele?
yes I do. The genotype fields are in the following format.
GT:PL:DP:SP:AD:GQ
So a typical genotype data field would look like this:
0/1:20,0,93:4:0:3,1:23
In this case, samtools is calling the position heterozygous for sample because there are 3 reads for the reference allele and one for the variant. I'd like to convert these calls to no call (./.) if there is just one reads supporting either allele.
I hope this makes sense. Thanks again for any help.