Commit bec109c6 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.{cpp,h}: FineSegmenter computes and checks left and right e-values

parent 43c73d8a
......@@ -738,6 +738,11 @@ FineSegmenter::FineSegmenter(Sequence seq, Germline *germline, Cost segment_c)
score_J=score_minus_J;
}
/* E-values */
int multiplier = 1 ;
evalue_left = multiplier * segment_cost.toPValue(score_V[0].first);
evalue_right = multiplier * segment_cost.toPValue(score_J[0].first);
evalue = evalue_left + evalue_right ;
/* Unsegmentation causes */
if (Jstart - Vend < germline->delta_min)
......@@ -747,14 +752,17 @@ FineSegmenter::FineSegmenter(Sequence seq, Germline *germline, Cost segment_c)
if (Vend == (int) string::npos)
{
because = UNSEG_TOO_FEW_V ;
evalue_left = BAD_EVALUE ;
}
if (Jstart == (int) string::npos)
{
because = UNSEG_TOO_FEW_J ;
evalue_right = BAD_EVALUE ;
}
double threshold = THRESHOLD_NB_EXPECTED ;
checkLeftRightEvaluesThreshold(threshold, reversed ? -1 : 1);
if (because != NOT_PROCESSED)
{
segmented = false;
......
......@@ -32,6 +32,7 @@
#define JSON_REMEMBER_BEST 4 /* The number of V/D/J predictions to keep */
#define NO_LIMIT_VALUE -1
#define BAD_EVALUE 1e10
#define THRESHOLD_NB_EXPECTED 1.0 /* Threshold of the accepted expected value for number of found k-mers */
......
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