Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix partner variant bug #486

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Fix partner variant bug #486

wants to merge 4 commits into from

Conversation

MattWellie
Copy link
Collaborator

Fixes

  • A bug in the support category checking prevented variants reaching the report if... they had other categories assigned, but the partner variant didn't?
  • A weird one for sure, it meant that if a Cat6 only and a Cat1 only were in the VCF, and Cat6 was a support, the only variant which would reach the report was the 6 🙃

Proposed Changes

Checklist

  • Related Issue created
  • Tests covering new change
  • Linting checks pass

Comment on lines +377 to +378
self.pedigree.by_id[sample_id].affected != '2'
or not principal.sample_category_check(sample_id, allow_support=False)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of this ended up being relevant, but it makes the logic easier to read

Comment on lines +104 to +109
# thin out the possible partners by alt depth
return [
var
for var in comp_hets[sample].get(first_variant, [])
if not var.check_minimum_alt_depth(sample, min_alt_depth)
]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was the issue - I was getting a Bool value for if the current variant was support-only, then using that to decide if a partner could also be support-only. It was a mess of booleans, so I've dropped it from here completely. Once we find all the partners, there's a simpler test on each pair that at least one must be non-support.

return [
var
for var in comp_hets[sample].get(first_variant, [])
if not var.check_minimum_alt_depth(sample, min_alt_depth)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it is not part of this PR, but the check_minimum_alt_depth method name is a bit curly (ie the not in front of it confused me)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I think I should revisit all the method names to optimise the logic they're involved in...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants