Skip to content

Commit

Permalink
return original if assertion error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer committed Nov 4, 2023
1 parent 1059dee commit 14ccbcd
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions gapmm2/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,7 @@ def left_update_paf_plus(paf, align, slide, offset):
try:
assert intron_len > 0, "Introns cannot be less than zero"
except AssertionError as e:
print(f"Assertion failed: {str(e)}")
print(paf)
print(align)
raise SystemExit(1)
return paf
new_cs = "cs:Z::{}~gt{}ag{}".format(
align["cigar"].strip("="), intron_len, new_cs_str
)
Expand Down Expand Up @@ -199,10 +196,7 @@ def left_update_paf_minus(paf, align, slide, offset):
try:
assert intron_len > 0, "Introns cannot be less than zero"
except AssertionError as e:
print(f"Assertion failed: {str(e)}")
print(paf)
print(align)
raise SystemExit(1)
return paf
new_cs = "cs:Z:{}~ct{}ac:{}".format(
new_cs_str, intron_len, align["cigar"].strip("=")
)
Expand Down Expand Up @@ -251,10 +245,7 @@ def right_update_paf_plus(paf, align, slide, offset):
try:
assert intron_len > 0, "Introns cannot be less than zero"
except AssertionError as e:
print(f"Assertion failed: {str(e)}")
print(paf)
print(align)
raise SystemExit(1)
return paf
new_cs = "cs:Z:{}~gt{}ag:{}".format(
old_cs, intron_len, align["cigar"].strip("=")
)
Expand Down Expand Up @@ -301,14 +292,7 @@ def right_update_paf_minus(paf, align, slide, offset):
try:
assert intron_len > 0, "Introns cannot be less than zero"
except AssertionError as e:
print(f"Assertion failed: {str(e)}")
print(f"function=right_update_paf_minus")
print(f"paf={paf}")
print(f"align={align}")
print(f"slide={slide}")
print(f"offset={offset}")
print(f"old_cs_tup={old_cs_tup}")
raise SystemExit(1)
return paf
new_cs = "cs:Z::{}~ct{}ac{}".format(
align["cigar"].strip("="), intron_len, new_cs_str
)
Expand Down

0 comments on commit 14ccbcd

Please sign in to comment.