Skip to content

Commit

Permalink
check if the expanded lineage starts with a voc/vui from the list dur…
Browse files Browse the repository at this point in the history
…ing false positive removal
  • Loading branch information
rmcolq committed Oct 20, 2021
1 parent 1b0d2f1 commit 8770fb8
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions pangolin/scripts/pangolearn.smk
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,14 @@ rule generate_report:
else:
expanded_pango_lineage = expand_alias(row['lineage'], alias_dict)
while expanded_pango_lineage and len(expanded_pango_lineage) > 3:
if expanded_pango_lineage in voc_list:
# have no scorpio call but a pangolearn voc/vui call
new_row['note'] += f'pangoLEARN lineage assignment {row["lineage"]} was not supported by scorpio'
new_row['lineage'] = UNASSIGNED_LINEAGE_REPORTED
new_row['conflict'] = ""
new_row['ambiguity_score'] = ""
break
for voc in voc_list:
if expanded_pango_lineage.startswith(voc + "."):
# have no scorpio call but a pangolearn voc/vui call
new_row['note'] += f'pangoLEARN lineage assignment {row["lineage"]} was not supported by scorpio'
new_row['lineage'] = UNASSIGNED_LINEAGE_REPORTED
new_row['conflict'] = ""
new_row['ambiguity_score'] = ""
break
expanded_pango_lineage = ".".join(expanded_pango_lineage.split(".")[:-1])
writer.writerow(new_row)

Expand Down Expand Up @@ -405,14 +406,15 @@ rule usher_to_report:
expanded_pango_lineage = expand_alias(lineage, alias_dict)
lineage_unassigned = False
while expanded_pango_lineage and len(expanded_pango_lineage) > 3:
if expanded_pango_lineage in voc_list:
# have no scorpio call but an usher voc/vui call
note += f'usher lineage assignment {lineage} was not supported by scorpio'
note += f'; {histogram_note}'
lineage = UNASSIGNED_LINEAGE_REPORTED
conflict = ""
lineage_unassigned = True
break
for voc in voc_list:
if expanded_pango_lineage.startswith(voc + "."):
# have no scorpio call but an usher voc/vui call
note += f'usher lineage assignment {lineage} was not supported by scorpio'
note += f'; {histogram_note}'
lineage = UNASSIGNED_LINEAGE_REPORTED
conflict = ""
lineage_unassigned = True
break
expanded_pango_lineage = ".".join(expanded_pango_lineage.split(".")[:-1])

if not lineage_unassigned:
Expand Down

0 comments on commit 8770fb8

Please sign in to comment.