Skip to content

Commit

Permalink
Cleaning dead code
Browse files Browse the repository at this point in the history
Stray pieces formerly called by refactored code
  • Loading branch information
ACEnglish committed Feb 2, 2025
1 parent 3e51eb3 commit 9915718
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
13 changes: 0 additions & 13 deletions truvari/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,6 @@ def calc_performance(self):
self["gt_concordance"] = float(self["TP-comp_TP-gt"]) / (self["TP-comp_TP-gt"] +
self["TP-comp_FP-gt"])

def clean_out(self):
"""
When reusing a StatsBox (typically inside refine), gt numbers
are typically invalidated. This removes those numbers from self to make
a cleaner report
"""
del self["TP-comp_TP-gt"]
del self["TP-comp_FP-gt"]
del self["TP-base_TP-gt"]
del self["TP-base_FP-gt"]
del self["gt_concordance"]
del self["gt_matrix"]

def write_json(self, out_name):
"""
Write stats as json to file
Expand Down
47 changes: 0 additions & 47 deletions truvari/collapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,6 @@ def gt_conflict(self, other, which_gt):
self.genotype_mask |= o_mask
return False

def combine(self, other):
"""
Add other's calls/matches to self's matches
"""
self.matches.extend(other.matches)
self.gt_consolidate_count += other.gt_consolidate_count
if self.genotype_mask is not None and other.genotype_mask is not None:
self.genotype_mask |= other.genotype_mask


def find_new_matches(base, remaining_calls, dest_collapse, params):
"""
Expand Down Expand Up @@ -241,44 +232,6 @@ def collapse_into_entry(entry, others, hap_mode=False):
return entry, n_consolidate


def gt_conflict(cur_collapse, entry, which_gt):
"""
Return true if entry's genotypes conflict with any of the current collapse
which_gt all prevents variants present in the same sample from being collapsed
which_gt het only prevents two het variants from being collapsed.
Might be deprecated, now?
"""
if which_gt == 'off':
return False

def checker(base, comp):
"""
Return true if a conflict
"""
i = 0
samps = list(base.samples)
while i < len(samps):
sample = samps[i]
gtA = base.samples[sample].allele_indices
gtB = comp.samples[sample].allele_indices
if which_gt == 'all':
if 1 in gtA and 1 in gtB:
return True
elif gtA.count(1) == 1 and gtB.count(1) == 1:
return True
i += 1
return False
# Need to check the kept entry
if checker(cur_collapse.entry, entry):
return True
# And all removed entries
for mat in cur_collapse.matches:
if checker(entry, mat.comp):
return True

return False


def get_ac(gt):
"""
Helper method to get allele count. assumes only 1s as ALT
Expand Down

0 comments on commit 9915718

Please sign in to comment.