VariantFiltration: how to filter samples where less then 95% of reads agree with the called genotype

I've been looking over the documentation for VariantFilteration and jexl ( to figure out how to do this, but I can seem to find an answer.

I would like to filter snips where there are many reads that disagree with the called genotype (eg FORMAT 1:20,60:80:99:1900,0).

In pseudo code, I'd like to write something like "AD[GT]/DP<0.95", where the allelic depth (AD) for the called genotype (GT) divided by the total depth (DP) < 0.95. However, the docs indicate that it is not possible to access GT:
"For now, you can filter based on most fields as normal (e.g. GQ < 5.0), but the GT (genotype) field is an exception"

Is there another way to accomplish what I want using VariantFiltration? It seems like a common sense filter, and it's also something I frequently see in the literature for snips in haploid organisms.

Best Answer


  • rsleerslee Member

    Hi there,

    I'm hoping someone can advise on this. I've been trying to do something very similar to the above, except selecting only sites with AD_ALT / DP > 0.9. Only variant sites are in my vcf.

    However, using the following code, I find that only SNP loci that have NO reference alleles present are exported - despite the fact that I have many sites where the reference allele is present but in under 10% of the reads.

    java -Xmx2g -jar GenomeAnalysisTK.jar -T SelectVariants -R ref.fa -V SNPs_only.vcf -select 'vc.getGenotype("sample").getAD().1 / vc.getGenotype("sample").getDP() > 0.9' -o filtered.vcf

    My JEXL expression seems in line with what's above, and with the example here, so I'm not sure what's happening.

    Thank you in advance!


  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin

    Hi R,

    Yea, I am not sure what is happening here. Your command looks fine. Which version of GATK are you using? Can you try with some other values than 0.9? Does that change the result and how?


Sign In or Register to comment.