Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
normalize distance to [0, 1) with f(average_dist) = 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Sep 20, 2023
1 parent 7394784 commit a4d5c39
Show file tree
Hide file tree
Showing 7 changed files with 1,037 additions and 1,034 deletions.
3 changes: 3 additions & 0 deletions intact/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@ def get_indel_impact(alignment):
orf_alignment = (exp_protein, "-" * len(exp_protein))
best_match.distance = aligner.match_score - ((aligner.open_gap_score + len(exp_protein) * aligner.extend_gap_score) / max(1, len(exp_protein)))

average_distance = 0.62
best_match.distance = 1 - (average_distance / (best_match.distance + average_distance)) # normalise it to the [0, 1) interval, with f(average_distance) = 0.5.

# Max deletion allowed in ORF exceeded
if deletions > e.deletion_tolerence:

Expand Down
902 changes: 451 additions & 451 deletions tests/expected-results-large-csv/orfs.csv

Large diffs are not rendered by default.

902 changes: 451 additions & 451 deletions tests/expected-results-large/orfs.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions tests/expected-results-single-csv/orfs.csv

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions tests/expected-results-single/orfs.json

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions tests/expected-results-small-csv/orfs.csv

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions tests/expected-results-small/orfs.json

Large diffs are not rendered by default.

0 comments on commit a4d5c39

Please sign in to comment.