Skip to content

Commit

Permalink
updated empty bf code
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmitchell committed Jan 12, 2024
1 parent e534317 commit 3d478ac
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lusSTR/scripts/repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,17 @@ def repeat_copy_number(bf, repeat):
The input is a sequence string collapsed to bracketed sequence form.
"""
longest = 0
if bf != "":
for block in bf.split(" "):
if block == repeat:
if 1 > longest:
longest = 1
match = re.match(r"\[" + repeat + r"\](\d+)", block)
if match:
length = int(match.group(1))
if length > longest:
longest = length
if bf == "":
return 0
for block in bf.split(" "):
if block == repeat:
if 1 > longest:
longest = 1
match = re.match(r"\[" + repeat + r"\](\d+)", block)
if match:
length = int(match.group(1))
if length > longest:
longest = length
return str(longest)


Expand Down

0 comments on commit 3d478ac

Please sign in to comment.