Skip to content

Commit

Permalink
Remove max_count/max_lineage 'voting' logic from usher_parsing -- refs
Browse files Browse the repository at this point in the history
  • Loading branch information
AngieHinrichs committed May 15, 2023
1 parent 40b9051 commit 09e78b1
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions pangolin/utils/report_collation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09e78b1

Please sign in to comment.