Commit ad552cb7 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.cpp: KmerMultiSegmenter test all KmerSegmenter, and returns the best one

This is an important change in how the heuristics works with multi-germlines.

Now the segmentation may run 2x to 3x slower (with -g -i), but we ensure that
the best germline is selected for each read. This improves the results,
in particular with mixed data from regular and incomplete rearrangements.
parent 9b2193fe
......@@ -248,23 +248,27 @@ KmerSegmenter::~KmerSegmenter() {
KmerMultiSegmenter::KmerMultiSegmenter(Sequence seq, MultiGermline *multigermline)
{
int best_score = 0 ;
// Iterate over the germlines
for (list<Germline*>::const_iterator it = multigermline->germlines.begin(); it != multigermline->germlines.end(); ++it)
{
Germline *germline = *it ;
KmerSegmenter kseg(seq, germline);
the_kseg = kseg;
if (!best_score)
the_kseg = kseg;
if (kseg.isSegmented())
{
// Yes, it is segmented
return ;
if (kseg.score > best_score)
{
the_kseg = kseg ;
best_score = kseg.score ;
}
}
// If the germline was detected, do not test other germlines
if (kseg.isDetected())
return ;
} // end for (Germlines)
}
......
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