Skip to content

Commit

Permalink
util: use convert helper for both HXB2 conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jun 17, 2023
1 parent b24a4db commit 950cfd6
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions util/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,7 @@ def convert_from_hxb2_to_subtype(position, subtype):

alignment = wrappers.mafft(sequences)

hxb2_pos = 0
subtype_pos = 0
for i in range(len(alignment[0])):
if hxb2_pos == position:
return subtype_pos
if alignment[0][i] != "-":
hxb2_pos += 1
if alignment[1][i] != "-":
subtype_pos += 1

return len(alignment[0])
return convert_from_aligned_to_reference(position, (alignment[1], alignment[0]))

def convert_from_subtype_to_hxb2(position, orientation, subtype):
"""
Expand Down

0 comments on commit 950cfd6

Please sign in to comment.