Commit 6bf8ecb0 authored by Mathieu Giraud's avatar Mathieu Giraud

core/affectanalyser.cpp: e-value estimation, more precise count of positions

This completes 2e23e720, by taking into account
 - only the half of the central region
 - add the span of the seed (that is removed later in getProbabilityAtLeastOrAbove())

See #2656.
parent 8bd47858
......@@ -165,12 +165,18 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before,
results.nb_before_right++;
}
/* The p-values are computed by taking into account a number of positions including, in addition to the matching zone,
half (rounded up) of the central region and the seed span.
*/
int more_pos = (results.last_pos_max - results.first_pos_max + 1) / 2 + span ;
left_evalue = kms.getProbabilityAtLeastOrAbove(before,
results.nb_before_left,
1 + results.last_pos_max);
1 + results.first_pos_max + more_pos);
right_evalue = kms.getProbabilityAtLeastOrAbove(after,
results.nb_after_right,
seq.size() - 1 - results.first_pos_max);
seq.size() - 1 - results.last_pos_max + more_pos);
/* Do we have enough affectations in good positions ('before' at the left and 'after' at the right) ?
We tolerate some of them in bad positions, but there must be more than 'ratioMin' more in good positions.
......
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