From 09e78b1d4e92d22772bcf53a09055798bc236a08 Mon Sep 17 00:00:00 2001 From: Angie Hinrichs Date: Mon, 15 May 2023 11:09:41 -0700 Subject: [PATCH] Remove max_count/max_lineage 'voting' logic from usher_parsing -- refs #492. (#521) --- pangolin/utils/report_collation.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pangolin/utils/report_collation.py b/pangolin/utils/report_collation.py index ce92660..d3ada0c 100644 --- a/pangolin/utils/report_collation.py +++ b/pangolin/utils/report_collation.py @@ -25,26 +25,16 @@ def usher_parsing(usher_result,output_report): histo_list = [ i for i in histogram.split(",") if i ] conflict = 0.0 if len(histo_list) > 1: - max_count = 0 - max_lineage = "" selected_count = 0 total = 0 for lin_counts in histo_list: m = re.match('([A-Z0-9.]+)\(([0-9]+)/([0-9]+)\)', lin_counts) if m: lin, place_count, total = [m.group(1), int(m.group(2)), int(m.group(3))] - if place_count > max_count: - max_count = place_count - max_lineage = lin if lin == lineage: selected_count = place_count - if selected_count < max_count: - # The selected placement was not in the lineage with the plurality - # of placements; go with the plurality. - lineage = max_lineage - conflict = (total - max_count) / total - elif total > 0: - conflict = (total - selected_count) / total + break + conflict = (total - selected_count) / total histogram_note = "Usher placements: " + " ".join(histo_list) else: lineage = lineage_histogram