This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there a BCFTools command to remove VCF rows missing the GT tag?

Hi everyone,

I have a vcf file that is produced following conversion from a set of .idat files. I find that the GT tag is not properly assigned to each position (potentially reflecting changes in the beadpool manifest file). Since I can't easily fix the error in the .idat to .vcf conversion I want to know if there is a bcftools command to remove rows missing the GT tag altogether.

enter image description here

I can use include/exclude to remove positions where GT=./. but I can't figure out how to remove rows where GT doesn't exist at all.

bcftools

1 answer

awk -F '\t' '$0 ~ /^#/ || $9=="GT"' in.vcf

Log in to answer this question.