Skip to content

Commit

Permalink
handle empty alignment error
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jun 24, 2023
1 parent 401cd47 commit bc695b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion intact/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ def get_indel_impact(alignment):

got_nucleotides = sequence.seq[best_match.start:best_match.start + len(got_protein) * 3]
exp_nucleotides = reference[e.start:e.end].upper()
orf_alignment = aligner.align(exp_nucleotides, got_nucleotides)[0]
if got_nucleotides:
orf_alignment = aligner.align(exp_nucleotides, got_nucleotides)[0]
else:
orf_alignment = (exp_nucleotides, "-" * len(exp_nucleotides))

deletions = (len(exp_protein) - len(got_protein)) * 3
insertions = (len(got_protein) - len(exp_protein)) * 3
Expand Down

0 comments on commit bc695b9

Please sign in to comment.