Skip to content

Commit

Permalink
entry.within edge case
Browse files Browse the repository at this point in the history
Variants on chromosomes not in a tree return false
  • Loading branch information
ACEnglish committed Jan 11, 2025
1 parent f90f194 commit 624d72a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions truvari/variant_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ def within_tree(self, tree):
Extract entry and tree boundaries to call `truvari.coords_within`
"""
qstart, qend = self.boundaries()
if self.chrom not in tree:
return False
m_ovl = tree[self.chrom].overlap(qstart, qend)
if len(m_ovl) != 1:
return False
Expand Down

0 comments on commit 624d72a

Please sign in to comment.