Commit b3ba64e0 authored by Mikaël Salson's avatar Mikaël Salson

core/segment.cpp: Discard dynamic programming optimisation with too many errors

13640493 discarded optimisation when there was too many end deletions.
However because of the optimisation we may find an incorrect gene with few end deletions
but with many substitutions/indels. Therefore a more reliable way of deactivating the optimisation
is to look at the score rather than looking at the number of end deletions.

Closes #3066
parent e3326fb9
......@@ -903,8 +903,9 @@ void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id
}
if (onlyBottomTriangle && (rep.sequence(box->ref_nb).size() - best_best_j) > BOTTOM_TRIANGLE_SHIFT) {
// Too many deletions, let's do a full DP
int score_with_limit_number_of_indels = (rep.sequence(box->ref_nb).size() - BOTTOM_TRIANGLE_SHIFT) * segment_cost.match - BOTTOM_TRIANGLE_SHIFT * segment_cost.insertion;
if (onlyBottomTriangle && best_score < score_with_limit_number_of_indels) {
// Too many indels/mismatches, let's do a full DP
align_against_collection(read, rep, forbidden_rep_id, reverse_ref, reverse_both,
local, box, segment_cost, false);
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment