This is a test version of Biostars. For the public version, visit https://www.biostars.org.
vcf filtering based on % of heterozygosity

Hi all

Is it possible to use vcftools to filter vcf files based on % of heterozygosity ?!

best

M

snp vcf vcftools hapmap

1 answer

You can use vcflib for arbitrary filtering based on values in the INFO field. Once you download and install it there are specific examples of filtering based on criteria from the info field here.

I don't think you can't do that using vcffilter

'GT=1|1' >= 0.05

If you're looking to do something like that you'll need to use a tool that already calculated the number of heterozygotes in your multi-sample VCF, write a wrapper script around another tool, or use the vcftools Perl API. I had assumed you already had your % heterozygosity calculated using an annotation tool and had it in your VCF in the INFO field. Otherwise you need to calculate this before you can filter on it.

Log in to answer this question.