Commit 82f1934f authored by Mikael Salson's avatar Mikael Salson

AffectAnalyser: Correction to CountKmerAffectAnalyser heuristic

To define a maximum, make sure that we have some before'' affectations
before the position and, conversely, that we have some after'' affectations,
after the position
parent dcc6499b
......@@ -414,9 +414,11 @@ int CountKmerAffectAnalyser<T>::searchMax(const T&before, const T& after,
else
shiftedEnd += shift;
for (int i = shiftedStart; (i)*iter <= iter*shiftedEnd; i+=iter) {
int value = countBefore(before, i - shift) + countAfter(after, i);
if (value > max_value) {
max_value = value;
int valueBefore = countBefore(before, i - shift);
int valueAfter = countAfter(after, i);
if (valueAfter + valueBefore > max_value
&& valueAfter > 0 && valueBefore > 0) {
max_value = valueAfter + valueBefore;
first_pos_max = i;
}
}
......
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