Hello everyone! There is the following problem in my vcf file produced by GATK: a large proportion of heterozygous sites has a bias in allele depth values (AD). For example, AD is 43,7 which means that the 43 reads support one allele while 7 support another. In order to avoid possible false calls in GWAS, I want to switch such SNPs to no-calls (./.).
I know that it is possible to write a heavy-duty R or Python script substituting the heterozygous calls (0/1) for no-calls (./.) in case of significant AD bias, let's say when minor allele to major allele ratio is greater than 0.3. However, I wonder if there are ready-to-go solutions. I tried to find such a filter in GATK but failed.
In case if you faced a similar problem or know about the ready solution please share!
Can you clarify how the above script relates to allele balance (i.e., the proportion of reads corresponding to the reference/alternate allele), across heterozygotes? I would like to change any heterozygous call with AB<0.25 & AB>0.75 to a no-call (./.). The vcf file I am working with does not have the AB field but it does have AD.
Nice Code. Thank you! When do you expect
ad.length!=2to be true? in other words, in which case the allele depth of either reference or alternative is missing? Or in which case are there more than those two alle depth in the ad vector?