Commit a0d13502 authored by Mathieu Giraud's avatar Mathieu Giraud

vidjil.cpp, -c segment: uses multigermline

The CMD_SEGMENT scenario now tries the germlines in the multigermline (until the read is segmented).
parent d4034f77
......@@ -653,7 +653,6 @@ int main (int argc, char **argv)
MultiGermline *multigermline = new MultiGermline();
if (command == CMD_GERMLINES || command == CMD_CLONES || command == CMD_WINDOWS)
{
cout << "Build Kmer indexes" << endl ;
......@@ -677,6 +676,8 @@ int main (int argc, char **argv)
germline = new Germline(germline_system, 'X',
rep_V, rep_D, rep_J,
delta_min, delta_max);
if (command == CMD_WINDOWS || command == CMD_CLONES)
germline->new_index(seed);
multigermline->insert(germline);
......@@ -1315,28 +1316,37 @@ int main (int argc, char **argv)
//reads = OnlineFasta(f_reads, 1, " ");
Fasta rep_V(f_rep_V, 2, "|", cout);
Fasta rep_D(f_rep_D, 2, "|", cout);
Fasta rep_J(f_rep_J, 2, "|", cout);
while (reads->hasNext())
{
reads->next();
Germline *germline;
Sequence seq = reads->getSequence() ;
bool segmented = false ;
germline = new Germline(germline_system, 'X',
rep_V, rep_D, rep_J,
delta_min, delta_max);
for (list<Germline*>::const_iterator it = multigermline->germlines.begin(); it != multigermline->germlines.end(); ++it)
{
Germline *germline = *it ;
while (reads->hasNext())
FineSegmenter s(seq, germline, segment_cost);
if (s.isSegmented())
{
reads->next();
FineSegmenter s(reads->getSequence(), germline, segment_cost);
if (s.isSegmented()) {
if (segment_D)
if (segment_D && germline->rep_4.size())
s.FineSegmentD(germline);
cout << s << endl;
} else {
cout << "Unable to segment" << endl;
cout << reads->getSequence();
cout << endl << endl;
segmented = true ;
break ;
}
else
{
if (verbose)
cout << "# " << germline->code << ": unable to segment" << endl;
}
}
if (!segmented)
{
seq.label += " unsegmented";
cout << seq << endl;
}
}
......
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