Commit 1e3900b1 authored by Mikaël Salson's avatar Mikaël Salson

KmerSegmenter: CountKmerAffectAnalyser::searchMax now returns -1 on failture.

We update accordingly the tests to see if we're lacking V or J.
In some very specific cases we may have some V and some J, but still not be able to find a maximum.
We put the cause of unsegmentation to UNSEG_TOO_FEW_ZERO which may be misleading but somehow represents the reality (we have zero valuable information)
parent 8d98090f
......@@ -247,33 +247,37 @@ void KmerSegmenter::checkUnsegmentationCause(int strand, int delta_min, int delt
{
// Strand +
Vend = kaa->firstMax(AFFECT_V, AFFECT_J);
Jstart = kaa->lastMax(AFFECT_V, AFFECT_J);
if (Vend == 0)
if (Vend == -1) {
if (kaa->count(AFFECT_V) == 0)
{
because = UNSEG_TOO_FEW_V ;
}
if (Jstart == kaa->count()-1)
else if (kaa->count(AFFECT_J) == 0)
{
because = UNSEG_TOO_FEW_J ;
}
} else
because = UNSEG_TOO_FEW_ZERO; // Not really zero
} else
Jstart = kaa->lastMax(AFFECT_V, AFFECT_J);
}
else if (strand == -1)
{
// Strand -
Jstart = kaa->firstMax(AFFECT_J_BWD, AFFECT_V_BWD);
Vend = kaa->lastMax(AFFECT_J_BWD, AFFECT_V_BWD);
if (Vend == kaa->count()-1)
if (Jstart == -1) {
if (kaa->count(AFFECT_V_BWD) == 0)
{
because = UNSEG_TOO_FEW_V ;
}
if (Jstart == 0)
else if (kaa->count(AFFECT_J_BWD) == 0)
{
because = UNSEG_TOO_FEW_J ;
}
} else
because = UNSEG_TOO_FEW_ZERO; // Not really zero
} else
Vend = kaa->lastMax(AFFECT_J_BWD, AFFECT_V_BWD);
Vend = sequence.size() - Vend - 1;
Jstart = sequence.size() - Jstart - 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