Commit 16602f94 authored by Mathieu Giraud's avatar Mathieu Giraud

core/germline.{h,cpp}: zero-change refactoring, remove MultiGermline::load_standard_set()

Replaced by boolean 'one_index_per_germline' + parameterization of method 'add_germline'
parent 14988960
......@@ -134,8 +134,9 @@ ostream &operator<<(ostream &out, const Germline &germline)
}
MultiGermline::MultiGermline()
MultiGermline::MultiGermline(bool _one_index_per_germline)
{
one_index_per_germline = _one_index_per_germline;
}
MultiGermline::~MultiGermline() {
......@@ -152,7 +153,8 @@ void MultiGermline::insert(Germline *germline)
void MultiGermline::add_germline(Germline *germline, string seed)
{
germline->new_index(seed);
if (one_index_per_germline)
germline->new_index(seed);
germlines.push_back(germline);
}
......@@ -192,19 +194,7 @@ void MultiGermline::build_incomplete_set(string path)
add_germline(new Germline("IGK+", 'k', path + "/IGKV.fa", "", path + "/IGK-KDE.fa", -10, 80), SEED_S10);
}
void MultiGermline::load_standard_set(string path)
{
germlines.push_back(new Germline("TRA", 'A', path + "/TRAV.fa", "", path + "/TRAJ.fa", -10, 20));
germlines.push_back(new Germline("TRB", 'B', path + "/TRBV.fa", path + "/TRBD.fa", path + "/TRBJ.fa", -10, 20));
germlines.push_back(new Germline("TRG", 'G', path + "/TRGV.fa", "", path + "/TRGJ.fa", -10, 30));
germlines.push_back(new Germline("TRD", 'D', path + "/TRDV.fa", path + "/TRDD.fa", path + "/TRDJ.fa", 0, 80));
germlines.push_back(new Germline("IGH", 'H', path + "/IGHV.fa", path + "/IGHD.fa", path + "/IGHJ.fa", 0, 80));
germlines.push_back(new Germline("IGK", 'K', path + "/IGKV.fa", "", path + "/IGKJ.fa", -10, 20));
germlines.push_back(new Germline("IGL", 'L', path + "/IGLV.fa", "", path + "/IGLJ.fa", -10, 20));
}
/* if 'one_index_per_germline' was not set, this should be called once all germlines have been loaded */
void MultiGermline::insert_in_one_index(IKmerStore<KmerAffect> *_index)
{
for (list<Germline*>::const_iterator it = germlines.begin(); it != germlines.end(); ++it)
......
......@@ -78,6 +78,7 @@ ostream &operator<<(ostream &out, const Germline &germline);
class MultiGermline {
private:
bool one_index_per_germline;
public:
list <Germline*> germlines;
......@@ -85,14 +86,13 @@ class MultiGermline {
// A unique index can be used
IKmerStore<KmerAffect> *index;
MultiGermline();
MultiGermline(bool one_index_per_germline = true);
~MultiGermline();
void insert(Germline *germline);
void add_germline(Germline *germline, string seed);
void build_default_set(string path);
void build_incomplete_set(string path);
void load_standard_set(string path);
void insert_in_one_index(IKmerStore<KmerAffect> *_index);
void build_with_one_index(string seed);
......
......@@ -301,6 +301,7 @@ int main (int argc, char **argv)
bool multi_germline = false;
bool multi_germline_incomplete = false;
bool multi_germline_mark = false;
bool multi_germline_one_index_per_germline = true;
string multi_germline_file = DEFAULT_MULTIGERMLINE;
string forced_edges = "" ;
......@@ -717,7 +718,13 @@ int main (int argc, char **argv)
// LOAD GERMLINES //
/////////////////////////////////////////
MultiGermline *multigermline = new MultiGermline();
if (command == CMD_GERMLINES)
{
multi_germline = true ;
multi_germline_one_index_per_germline = false ;
}
MultiGermline *multigermline = new MultiGermline(multi_germline_one_index_per_germline);
{
cout << "Load germlines and build Kmer indexes" << endl ;
......@@ -728,11 +735,6 @@ int main (int argc, char **argv)
if (multi_germline_incomplete)
multigermline->build_incomplete_set(multi_germline_file);
}
else if (command == CMD_GERMLINES)
{
multigermline->load_standard_set(multi_germline_file);
multigermline->build_with_one_index(seed);
}
else
{
// Custom germline
......@@ -749,6 +751,9 @@ int main (int argc, char **argv)
cout << endl ;
if (!multi_germline_one_index_per_germline)
multigermline->build_with_one_index(seed);
if (multi_germline_mark)
multigermline->mark_cross_germlines_as_ambiguous();
......
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