Commit 535e4796 authored by Mikaël Salson's avatar Mikaël Salson

algo/core/segment.cpp: Deactivate banded optimization depending on evalue

If the evalue is above the threshold we need to deactivate the optimization
to make sure that there is not a better solution.

Fix #3354
parent aaf2e250
Pipeline #32759 failed with stages
in 1 minute and 32 seconds
......@@ -919,7 +919,9 @@ void align_against_collection(string &read, BioReader &rep, int forbidden_rep_id
int min_number_of_matches = min(int(length * FRACTION_ALIGNED_AT_WORST), length - BOTTOM_TRIANGLE_SHIFT); // Minimal number of matches we can have with a triangle
int max_number_of_insertions = length - min_number_of_matches;
int score_with_limit_number_of_indels = min_number_of_matches * segment_cost.match + max_number_of_insertions * segment_cost.insertion;
if (onlyBottomTriangle && best_score < score_with_limit_number_of_indels) {
float evalue = sequence_or_rc.size() * rep.totalSize() * segment_cost.toPValue(best_score);
if (onlyBottomTriangle && (best_score < score_with_limit_number_of_indels
|| evalue > evalue_threshold)) {
// 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,evalue_threshold);
......
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