Skip to content

Commit

Permalink
return more precise difference in orfs.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jun 30, 2023
1 parent b508a07 commit 7b71af3
Show file tree
Hide file tree
Showing 4 changed files with 519 additions and 517 deletions.
2 changes: 2 additions & 0 deletions intact/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,10 @@ def get_indel_impact(alignment):
exp_nucleotides = reference[e.start:e.end].upper()
if got_nucleotides:
orf_alignment = aligner.align(exp_nucleotides, got_nucleotides)[0]
best_match.distance = -1 * (orf_alignment.score / len(exp_nucleotides))
else:
orf_alignment = (exp_nucleotides, "-" * len(exp_nucleotides))
best_match.distance = len(exp_nucleotides) ** 2

deletions = max(0, len(exp_protein) - len(got_protein)) * 3
insertions = max(0, len(got_protein) - len(exp_protein)) * 3
Expand Down
Loading

0 comments on commit 7b71af3

Please sign in to comment.