Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit f787d626 authored by Mathieu Giraud's avatar Mathieu Giraud

core/affectanalyser.cpp: .getMaximum(), further simplify main test

The condition on ratioMin is now strict (the default ratioMin is now 1.9 instead of 2.0),
and obscure conditions are removed.
A few borderline cases could now pass here (max_found), but they should anyway be discarded
by the following e-values tests (and yield the same unsegmentation cause than before).

The whole test is now cleaner and more symmetrical.
parent 9f0d0079
......@@ -172,17 +172,14 @@ affect_infos KmerAffectAnalyser::getMaximum(const KmerAffect &before,
results.nb_after_right,
seq.size() - 1 - results.first_pos_max);
/* Main test:
1) 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 'ratioMin' more in good positions
2) there should be at least one 'before' and one 'after' (? CHECK ?)
*/
if ((results.nb_after_right >= results.nb_after_left*ratioMin)
&& (results.nb_before_left >= results.nb_before_right*ratioMin)
&& (results.nb_after_right > 0 || results.nb_before_right == 0)
&& currentValue < results.max_value
&& results.max_value > 0) {
/* 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.
As the comparison is strict, passing this test implies that there is at least one 'before' kmer at the left
and one 'after' kmer at the right.
*/
if ((results.nb_after_right > results.nb_after_left*ratioMin)
&& (results.nb_before_left > results.nb_before_right*ratioMin)) {
results.max_found = true;
}
......
......@@ -163,18 +163,18 @@ class KmerAffectAnalyser: public AffectAnalyser {
* maximise the number of affectations before, minus the number of
* affectations after the returned positions.
*
* The maximum reached must be above max(0, total number of <before>)
* and such that the numbers of <before>/<after> in "good" positions
* The maximum reached must be
* such that the numbers of <before>/<after> in "good" positions
* (at the left of the leftmost max position for <before>,
* and at the right of the rightmost max position for <after>)
* are at least <ratioMin> times than the numbers of <before>/<after>
* are more than <ratioMin> times than the numbers of <before>/<after>
* in "bad" positions. If no so much maximum is found,
* the boolean <max_found> is set to false in the structure.
*
* @complexity time: linear in count(), space: constant
*/
affect_infos getMaximum(const KmerAffect &before, const KmerAffect &after,
float ratioMin=2.,
float ratioMin=1.9,
int maxOverlap=1);
......
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