This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bcftools filtering only 10% missing and heterozygous calls

Hello,

I would like to keep only 90% of missinfg and heterogygous genotype on all my samples. According to link I can filter missing like this bcftools view -i 'F_MISSING<0.1' in.vcf. What about heterozygous calls?

EDIT: I tried something like this, it doesn't seem to work.

-i 'F_MISSING<0.1 & F_PASS(GT="het")<0.1'
bcftools

1 answer

I solve like this, not sure it is the best way, but it works:

-i 'F_MISSING<0.1 && (COUNT(GT="0/1")/total_number_of_gen)<=0.1'

Log in to answer this question.