Commit 760d6e05 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

core/germline.{h,cpp}: new constructors, insert(), load_default_set()

parent a563a8d8
#include "germline.h"
Germline::Germline(string _code, char _shortcut,
string f_rep_5, string f_rep_4, string f_rep_3,
string seed,
int _delta_min, int _delta_max)
{
code = _code ;
shortcut = _shortcut ;
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 ;
build_index(seed);
}
Germline::Germline(Fasta _rep_5, Fasta _rep_4, Fasta _rep_3,
string seed,
int _delta_min, int _delta_max)
{
// code = 'TRG' ;
// shortcut = 'G' ;
// description = "" ;
code = "X" ;
shortcut = 'X' ;
description = "x" ;
// affect_5 = KmerAffect("", "V", 0) ;
// affect_3 = KmerAffect("", "J", 0) ;
......@@ -19,6 +38,11 @@ Germline::Germline(Fasta _rep_5, Fasta _rep_4, Fasta _rep_3,
delta_min = _delta_min ;
delta_max = _delta_max ;
build_index(seed);
}
void Germline::build_index(string seed)
{
bool rc = true ;
index = KmerStoreFactory::createIndex<KmerAffect>(seed, rc);
......@@ -40,9 +64,8 @@ ostream &operator<<(ostream &out, const Germline &germline)
}
MultiGermline::MultiGermline(Germline *germline)
MultiGermline::MultiGermline()
{
germlines.push_back(germline);
}
......@@ -70,5 +93,15 @@ MultiGermline::MultiGermline(string f_germlines_json)
}
void MultiGermline::insert(Germline *germline)
{
germlines.push_back(germline);
}
void MultiGermline::load_default_set()
{
germlines.push_back(new Germline("TRG", 'G', "germline/TRGV.fa", "", "germline/TRGJ.fa", "#####-#####", -10, 20));
germlines.push_back(new Germline("IGH", 'H', "germline/IGHV.fa", "germline/IGHD.fa", "germline/IGHJ.fa", "######-######", 0, 80));
}
......@@ -11,6 +11,7 @@ using namespace std;
class Germline {
private:
void build_index(string seed);
public:
/*
......@@ -21,9 +22,16 @@ class Germline {
* so that the segmentation is accepted
* (left bound: end of V, right bound : start of J)
*/
Germline(Fasta rep_5, Fasta rep_4, Fasta rep_3,
Germline(string _code, char _shortcut,
string f_rep_5, string f_rep_4, string f_rep_3,
string seed,
int _delta_min, int _delta_max);
Germline(Fasta _rep_5, Fasta _rep_4, Fasta _rep_3,
string seed,
int delta_min, int delta_max);
int _delta_min, int _delta_max);
~Germline();
string code ;
......@@ -52,8 +60,11 @@ class MultiGermline {
public:
list <Germline*> germlines;
MultiGermline(Germline *germline);
MultiGermline();
MultiGermline(string f_germlines_json);
void insert(Germline *germline);
void load_default_set();
};
......
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