Add code to remove star alleles that are conflicting with downstream tools
Description
Fixes issue #11 (closed)
Handle asterisk alleles by removing them from the VCF in as clean manner as possible.
This is done in two steps:
- "Dereferences" genotypes referring to the asterisk. These genotypes will now point to REF instead.
- Remove alt alleles not seen in genotype fields with bcftools view --trim-alt-alleles
Step 1 drops the connection between the spanning deletion and the variant, but the spanning deletion should be part of the VCF if it is not filtered in the pipeline. However, we have functionality in ELLA to flag nearby variants (initially thought to warn about variants in the same codon). I will modify this to explicitly warn user that a variant is overlapping.
After step 2 we have no more '*'-ALTs, meaning no problems for any downstream tools.
Type of change
-
New feature -
Breaking change -
Bug fix -
Improvement
Testing
-
Tests have been added that prove my fix is effective or that my feature works -
Previous tests have been modified/removed -
Testing done by manual inspection of results (specify) -
Approved by customer (specify) -
Unit tests and lint pass -
CI tests pass (if applicable)
Tested with a HG002 whole genome sample. Verified that:
- No asterisks are left in the VCF
- No relevant ALT alleles are removed.
Sliced on the Mendeliome gene panel:
- It imports without issues into ELLA
- Results in ELLA looks consistent (checked multiple locations with overlapping deletions)
Other
Any risks? Are there points in the code the reviewer needs to double check or where you would like advice?
Checklist:
-
I have performed a self-review of my own code -
My code and commit messages follows the style guidelines in Code Review checklist procedure -
I have commented my code, particularly in hard-to-understand areas -
My branch has recently been updated with new changes in dev (and tested) before this merge request -
I have made corresponding changes to the documentation (state where)