Commit 701deb25 authored by Mikaël Salson's avatar Mikaël Salson

Segment: Use getMaximum() in the segmentation heuristic

parent 90cab056
...@@ -246,45 +246,35 @@ void KmerSegmenter::computeSegmentation(int strand, int delta_min, int delta_max ...@@ -246,45 +246,35 @@ void KmerSegmenter::computeSegmentation(int strand, int delta_min, int delta_max
{ {
because = UNSEG_STRAND_NOT_CONSISTENT ; because = UNSEG_STRAND_NOT_CONSISTENT ;
} }
else if (strand == 1) else
{ {
// Strand + // Strand +
Vend = kaa->firstMax(AFFECT_V, AFFECT_J); affect_infos max;
if (strand == 1)
if (Vend == -1) { max = kaa->getMaximum(AFFECT_V, AFFECT_J);
if (kaa->count(AFFECT_V) == 0) else
{ max = kaa->getMaximum(AFFECT_J_BWD, AFFECT_V_BWD);
because = UNSEG_TOO_FEW_V ;
} if (! max.max_found) {
else if (kaa->count(AFFECT_J) == 0) if ((strand == 1 && max.nb_before == 0)
|| (strand == -1 && max.nb_after == 0))
because = UNSEG_TOO_FEW_V ;
else if ((strand == 1 && max.nb_after == 0)
|| (strand == -1 && max.nb_before == 0))
{ {
because = UNSEG_TOO_FEW_J ; because = UNSEG_TOO_FEW_J ;
} else } else
because = UNSEG_TOO_FEW_ZERO; // Not really zero because = UNSEG_AMBIGUOUS;
} else } else {
Jstart = kaa->lastMax(AFFECT_V, AFFECT_J); Vend = max.first_pos_max;
Jstart = max.last_pos_max + 1;
if (strand == -1) {
int tmp = sequence.size() - Vend - 1;
Vend = sequence.size() - Jstart - 1;
Jstart = tmp;
}
}
} }
else if (strand == -1)
{
// Strand -
Jstart = kaa->firstMax(AFFECT_J_BWD, AFFECT_V_BWD);
if (Jstart == -1) {
if (kaa->count(AFFECT_V_BWD) == 0)
{
because = UNSEG_TOO_FEW_V ;
}
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;
}
if (! because) if (! because)
{ {
......
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