Commit 5298c86f authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.cpp: UNSEG_ONLY_V/J only when there are enough V/J k-mers detected

There are two places where the segmentation can fail with UNSEG_ONLY_V/J.
The first one, when there is no segmentation point, previously returned UNSEG_ONLY_V/J
even when there was only one (possibly noisy) V/J k-mer.

This is now corrected, UNSEG_ONLY_V/J is triggered only when one has at least DETECT_THRESHOLD k-mers (now 5).
Ideally, we should use here an e-value check, but the segmentation point returned by kaa->getMaximum()
is not really meaningfull in these cases and my lead to false statistics computations.
parent c1079464
......@@ -430,17 +430,17 @@ void KmerSegmenter::computeSegmentation(int strand, KmerAffect before, KmerAffec
// We did not find a good segmentation point
if (!max.max_found) {
// We labeled it detected if there were both enough affect_5 and enough affect_3
bool detected = (max.nb_before_left + max.nb_before_right >= DETECT_THRESHOLD)
&& (max.nb_after_left + max.nb_after_right >= DETECT_THRESHOLD);
if (max.nb_before_left + max.nb_before_right + max.nb_after_left + max.nb_after_right == 0)
because = UNSEG_TOO_FEW_ZERO ;
else if ((strand == 1 && max.nb_before_left == 0) || (strand == -1 && max.nb_after_right == 0))
because = detected ? UNSEG_AMBIGUOUS : UNSEG_TOO_FEW_V ;
else if ((strand == 1 && max.nb_after_right == 0)|| (strand == -1 && max.nb_before_left == 0))
because = detected ? UNSEG_AMBIGUOUS : UNSEG_TOO_FEW_J ;
bool detected_before = (max.nb_before_left + max.nb_before_right >= DETECT_THRESHOLD);
bool detected_after = (max.nb_after_left + max.nb_after_right >= DETECT_THRESHOLD);
if (detected_before && detected_after)
because = UNSEG_AMBIGUOUS ;
else if ((strand == 1 && detected_before) || (strand == -1 && detected_after))
because = UNSEG_TOO_FEW_J ;
else if ((strand == 1 && detected_after) || (strand == -1 && detected_before))
because = UNSEG_TOO_FEW_V ;
else
because = UNSEG_AMBIGUOUS;
because = UNSEG_TOO_FEW_ZERO ;
return ;
}
......
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