Commit ee77c411 authored by Mathieu Giraud's avatar Mathieu Giraud

core/germline.{h,cpp}: factorize the three Germline constructors with Germline::init()

parent 1a05fe6a
#include "germline.h"
Germline::Germline(string _code, char _shortcut,
string f_rep_5, string f_rep_4, string f_rep_3,
int _delta_min, int _delta_max)
void Germline::init(string _code, char _shortcut,
int _delta_min, int _delta_max)
{
code = _code ;
shortcut = _shortcut ;
index = 0 ;
affect_5 = "V" ;
affect_4 = "" ;
affect_3 = "J" ;
delta_min = _delta_min ;
delta_max = _delta_max ;
stats.setLabel(code);
}
Germline::Germline(string _code, char _shortcut,
string f_rep_5, string f_rep_4, string f_rep_3,
int _delta_min, int _delta_max)
{
init(_code, _shortcut, _delta_min, _delta_max);
f_reps_5.push_back(f_rep_5);
f_reps_4.push_back(f_rep_4);
f_reps_3.push_back(f_rep_3);
affect_5 = "V" ;
affect_4 = "";
affect_3 = "J" ;
rep_5 = Fasta(f_rep_5, 2, "|", cout);
rep_4 = Fasta(f_rep_4, 2, "|", cout);
rep_3 = Fasta(f_rep_3, 2, "|", cout);
delta_min = _delta_min ;
delta_max = _delta_max ;
stats.setLabel(code);
}
......@@ -32,18 +38,12 @@ Germline::Germline(string _code, char _shortcut,
list <string> _f_reps_5, list <string> _f_reps_4, list <string> _f_reps_3,
int _delta_min, int _delta_max)
{
code = _code ;
shortcut = _shortcut ;
index = 0 ;
init(_code, _shortcut, _delta_min, _delta_max);
f_reps_5 = _f_reps_5 ;
f_reps_4 = _f_reps_4 ;
f_reps_3 = _f_reps_3 ;
affect_5 = "V" ;
affect_4 = "";
affect_3 = "J" ;
for (list<string>::const_iterator it = f_reps_5.begin(); it != f_reps_5.end(); ++it)
rep_5 = Fasta(*it, 2, "|", cout); // TODO: something like 'rep_5 += ...'
......@@ -52,11 +52,6 @@ Germline::Germline(string _code, char _shortcut,
for (list<string>::const_iterator it = f_reps_3.begin(); it != f_reps_3.end(); ++it)
rep_3 = Fasta(*it, 2, "|", cout);
delta_min = _delta_min ;
delta_max = _delta_max ;
stats.setLabel(code);
}
......@@ -64,24 +59,11 @@ Germline::Germline(string _code, char _shortcut,
Fasta _rep_5, Fasta _rep_4, Fasta _rep_3,
int _delta_min, int _delta_max)
{
code = _code ;
shortcut = _shortcut ;
index = 0 ;
// affect_5 = KmerAffect("", "V", 0) ;
// affect_3 = KmerAffect("", "J", 0) ;
affect_5 = "V" ;
affect_4 = "" ;
affect_3 = "J" ;
init(_code, _shortcut, _delta_min, _delta_max);
rep_5 = _rep_5 ;
rep_4 = _rep_4 ;
rep_3 = _rep_3 ;
delta_min = _delta_min ;
delta_max = _delta_max ;
stats.setLabel(code);
}
void Germline::new_index(string seed)
......
......@@ -12,6 +12,9 @@ using namespace std;
class Germline {
private:
void init(string _code, char _shortcut,
int _delta_min, int _delta_max);
void update_index();
public:
......
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