Skip to content

Commit

Permalink
potential fix for #196
Browse files Browse the repository at this point in the history
functional tests failed to hit chain collapse
  • Loading branch information
ACEnglish committed Feb 11, 2024
1 parent d424140 commit 1429779
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion truvari/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parse_args(args):
help="Output directory")
parser.add_argument("-f", "--reference", type=str, default=None,
help="Fasta used to call variants. Turns on reference context sequence comparison")
parser.add_argument("--short", action="store_true",
parser.add_argument("--short", action="store_true",
help="Short circuit comparisions. Faster, but fewer annotations")
parser.add_argument("--debug", action="store_true", default=False,
help="Verbose logging")
Expand Down
11 changes: 10 additions & 1 deletion truvari/collapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ def gt_conflict(self, other, which_gt):
self.genotype_mask |= o_mask
return False

def consolidate(self, other):
"""
Add other's calls/matches to self's matches
"""
self.matches.append(other.entry)
self.matches.extend(other.matches)
self.gt_consolidate_count += other.gt_consolidate_count
if self.genotype_mask != "" and other.genotype_mask != "":
self.genotype_mask |= other.genotype_mask

def chain_collapse(cur_collapse, all_collapse, matcher):
"""
Expand Down Expand Up @@ -144,7 +153,7 @@ def collapse_chunk(chunk, matcher):
if mat.state:
m_collap.matches.append(mat)
elif mat.sizesim is not None and mat.sizesim < matcher.params.pctsize:
# Can we do this? The sort tells us that we're going through most->least
# Can we do this? The sort tells us that we're going through most->least
# similar size. So the next one will only be worse...
break

Expand Down

0 comments on commit 1429779

Please sign in to comment.