Fix Allelic Imbalance Filtering Logic for bcftools v1.16+ #141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixing issue #134
What
This update addresses an issue with the bcftools allelic imbalance filtering command introduced in versions later than v1.16. Specifically, we want to exclude (write) variants only where all heterozygous calls have an allele balance (AB) < 0.15, but keep the variant if any heterozygous call has an AB > 0.15.
The previous bcftools allelic imbalance filtering command
only had the intended behavior until bcftools v1.16. With newer versions, bcftools filtering logic seem sot have changed from an any to all evaluation.
This results in all heterozygous variants being written to the variants to exclude file for versions > v1.16, even if a call meets the AB criterion.
The fixed bcftools command (suggested by @rdey-inistro)
has the intended version for either bcftools version (<=v1.16 & >v1.16).
Testing
The expected behavior of the new command was verified on the example vcf file using bcftools versions 1.12, 1.16, 1.18, 1.20.