populationgenomics / automated-interpretation-pipeline

Rare Disease variant prioritisation MVP
MIT License
5 stars 4 forks source link

Fix Comp-Het test #343

Closed MattWellie closed 5 months ago

MattWellie commented 5 months ago

Fixes

Proposed Changes

In AIP variant representation there are 3 types of category which can be assigned to a variant:

When testing that 2 variants can form a Comp-Het, we screen out cases where both variants are only supporting. The logic in this test was:

if var1 is support ONLY and var2 is support ONLY: fail

The method testing whether a variant is Support ONLY checked:

if variant.has_support and not variant.has_sample_category

missing out the boolean category case. The behaviour this has lead to is unintentional:

The only way to form a Comp-Het in AIP is when a variant with the Support category combines with a variant without the Support category, or where neither variant has the support category assigned.

This is an unintended consequence of the logic being too convoluted. This is a patch for the comp-het test, and I'll schedule a more detailed look into this.

Checklist

MattWellie commented 5 months ago

Also uses the built-in get_logger functionality, to make sure intended logs are really being printed