Skip to content

Commit

Permalink
Match.score correction
Browse files Browse the repository at this point in the history
Need to be None to prevent annotation on non-matching variants
  • Loading branch information
ACEnglish committed Jan 30, 2025
1 parent 97541ab commit fffaa0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions truvari/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self):
self.gt_match = None
self.multi = None
self.state = False
self.score = 0
self.score = None

def calc_score(self):
"""
Expand All @@ -82,8 +82,8 @@ def s_abs(value):
"""
return -abs(value) if value is not None else -float('inf')
return (
(self.state, self.score, s_abs(self.st_dist), s_abs(self.ed_dist)) <
(other.state, other.score, s_abs(other.st_dist), s_abs(other.ed_dist))
(self.state, self.score if self.score is not None else 0, s_abs(self.st_dist), s_abs(self.ed_dist)) <
(other.state, other.score if other.score is not None else 0, s_abs(other.st_dist), s_abs(other.ed_dist))
)

def __eq__(self, other):
Expand Down

0 comments on commit fffaa0e

Please sign in to comment.