samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
633 stars 241 forks source link

Is there a way to filter on fraction of reads supporting an allele? #2213

Open goeckeritz opened 2 weeks ago

goeckeritz commented 2 weeks ago

Hi there,

I was wondering if bcftools might have a feature I might be unaware of that I've used with other variant callers. I am comparing vcfs in polyploid individuals with various average read depths, and I fear some sites may be getting called incorrectly just due to chance if they are low depth. E.g., for a tetraploid, sites with AABB are more likely to get correctly called as heterozygous compared to sites that are AAAB, because each allele has 50% chance of being represented for every read sampled in the former scenario.

Without going into too much detail, I'd like to focus on sites that have a better chance of showing up correctly in low coverage data; I'm comparing a mother (higher coverage) to a child (lower coverage) where the father is unknown, and trying to see if sites match. I can provide more details if I'm being too vague or if this is confusing, but I didn't want this issue to be too long.

Is there an easy way to filter on the fraction of reads supporting each allele? A flag I might be unaware of that would make this easier?

Thanks so much for your time! Charity

pd3 commented 1 week ago

There is the plugin +fill-tags which can calculate FORMAT/VAF from FORMAT/AD, then one can filter on VAF using the -i/-e filtering expressions http://samtools.github.io/bcftools/bcftools.html#expressions