From 33fefab6cabc31998c3de46bc0b2bccfb5007a43 Mon Sep 17 00:00:00 2001 From: Adam English Date: Sun, 7 Jan 2024 01:19:20 -0500 Subject: [PATCH] test fix --- truvari/__init__.py | 2 -- truvari/comparisons.py | 7 +------ truvari/matching.py | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/truvari/__init__.py b/truvari/__init__.py index 108a2543..05ed6b5a 100644 --- a/truvari/__init__.py +++ b/truvari/__init__.py @@ -51,7 +51,6 @@ :meth:`chunker` :meth:`cmd_exe` :meth:`consolidate_phab_vcfs` -:meth:`coord_distance` :meth:`count_entries` :meth:`file_zipper` :meth:`help_unknown_cmd` @@ -102,7 +101,6 @@ ) from truvari.comparisons import ( - coord_distance, create_pos_haplotype, entry_boundaries, entry_distance, diff --git a/truvari/comparisons.py b/truvari/comparisons.py index d4bb8d08..7dd9d3b8 100644 --- a/truvari/comparisons.py +++ b/truvari/comparisons.py @@ -82,14 +82,9 @@ def entry_distance(entryA, entryB): """ astart, aend = entry_boundaries(entryA) bstart, bend = entry_boundaries(entryB) - return coord_distance(astart, aend, bstart, bend) - -def coord_distance(astart, aend, bstart, bend): - """ - Return start and end distances - """ return astart - bstart, aend - bend + def entry_gt_comp(entryA, entryB, sampleA=None, sampleB=None): """ Compare the genotypes of two entries diff --git a/truvari/matching.py b/truvari/matching.py index 2af80faf..67a13803 100644 --- a/truvari/matching.py +++ b/truvari/matching.py @@ -223,7 +223,7 @@ def build_match(self, base, comp, matid=None, skip_gt=False, short_circuit=False ret.comp_gt_count = sum(1 for _ in ret.comp_gt if _ == 1) ret.gt_match = abs(ret.base_gt_count - ret.comp_gt_count) - ret.ovlpct = truvari.reciprocal_overlap(bstart, bend, cstart, cend) + ret.ovlpct = truvari.entry_reciprocal_overlap(base, comp) if ret.ovlpct < self.params.pctovl: logging.debug("%s and %s overlap percent is too low (%.3f)", str(base), str(comp), ret.ovlpct) @@ -243,7 +243,7 @@ def build_match(self, base, comp, matid=None, skip_gt=False, short_circuit=False else: ret.seqsim = 0 - ret.st_dist, ret.ed_dist = truvari.coord_distance(bstart, bend, cstart, cend) + ret.st_dist, ret.ed_dist = bstart - cstart, bend - cend ret.calc_score() return ret