Commit 45cba37c authored by Mathieu Giraud's avatar Mathieu Giraud

core/germline.{h,cpp}, vidjil.cpp: SEG_METHOD_{53,543}

Instead of testing whether rep_4 is empty, we define
two different segmentation methods.
parent 594343f0
......@@ -7,7 +7,7 @@ void Germline::init(string _code, char _shortcut,
int _delta_min,
int max_indexing)
{
seg_method = SEG_METHOD_REGULAR ;
seg_method = SEG_METHOD_53 ;
code = _code ;
shortcut = _shortcut ;
index = 0 ;
......@@ -47,6 +47,9 @@ Germline::Germline(string _code, char _shortcut,
rep_5 = Fasta(f_rep_5, 2, "|");
rep_4 = Fasta(f_rep_4, 2, "|");
rep_3 = Fasta(f_rep_3, 2, "|");
if (rep_4.size())
seg_method = SEG_METHOD_543 ;
}
......@@ -73,6 +76,9 @@ Germline::Germline(string _code, char _shortcut,
for (list<string>::const_iterator it = f_reps_3.begin(); it != f_reps_3.end(); ++it)
rep_3.add(*it);
if (rep_4.size())
seg_method = SEG_METHOD_543 ;
}
......@@ -86,6 +92,9 @@ Germline::Germline(string _code, char _shortcut,
rep_5 = _rep_5 ;
rep_4 = _rep_4 ;
rep_3 = _rep_3 ;
if (rep_4.size())
seg_method = SEG_METHOD_543 ;
}
Germline::Germline(string code, char shortcut, string path, json json_recom, int max_indexing)
......@@ -128,7 +137,9 @@ Germline::Germline(string code, char shortcut, string path, json json_recom, int
f_reps_3.push_back(path + filename);
rep_3.add(path + filename);
}
if (rep_4.size())
seg_method = SEG_METHOD_543 ;
}
void Germline::new_index(string seed)
......
......@@ -11,9 +11,10 @@
#include "../lib/json.hpp"
enum SEGMENTATION_METHODS {
SEG_METHOD_REGULAR,
SEG_METHOD_MAX12,
SEG_METHOD_MAX1U
SEG_METHOD_53, // Regular or incomplete germlines, 5'-3'
SEG_METHOD_543, // Regular or incomplete germlines, 5'-3', with an additional middle gene (such a D gene)
SEG_METHOD_MAX12, // Pseudo-germline, most two frequent kmer affectations (-2)
SEG_METHOD_MAX1U // Pseudo-germline, most frequent kmer affection and unknwon affectation (-4)
} ;
using namespace std;
......
......@@ -1259,7 +1259,7 @@ int main (int argc, char **argv)
// FineSegmenter
FineSegmenter seg(representative, segmented_germline, segment_cost);
if (segmented_germline->rep_4.size())
if (segmented_germline->seg_method == SEG_METHOD_543)
seg.FineSegmentD(segmented_germline);
if (detect_CDR3)
......@@ -1321,7 +1321,8 @@ int main (int argc, char **argv)
// Output best V, (D) and J germlines to CLONE_FILENAME-*
out_clone << segmented_germline->rep_5.read(seg.best_V) ;
if (segmented_germline->rep_4.size()) out_clone << segmented_germline->rep_4.read(seg.best_D) ;
if (segmented_germline->seg_method == SEG_METHOD_543)
out_clone << segmented_germline->rep_4.read(seg.best_D) ;
out_clone << segmented_germline->rep_3.read(seg.best_J) ;
out_clone << endl;
} // end if (seg.isSegmented())
......@@ -1477,7 +1478,7 @@ int main (int argc, char **argv)
if (s.isSegmented())
{
if (germline->rep_4.size())
if (germline->seg_method == SEG_METHOD_543)
s.FineSegmentD(germline);
if (detect_CDR3)
......
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