Commit 14988960 authored by Mathieu Giraud's avatar Mathieu Giraud

core/germline.{h,cpp}: zero-change refactoring, extract...

core/germline.{h,cpp}: zero-change refactoring, extract MultiGermline::add_germline(), seeds in tools.h
parent b2595c6a
......@@ -150,40 +150,25 @@ void MultiGermline::insert(Germline *germline)
germlines.push_back(germline);
}
void MultiGermline::add_germline(Germline *germline, string seed)
{
germline->new_index(seed);
germlines.push_back(germline);
}
void MultiGermline::build_default_set(string path)
{
// Should parse 'data/germlines.data'
Germline *germline;
germline = new Germline("TRG", 'G', path + "/TRGV.fa", "", path + "/TRGJ.fa", -10, 30);
germline->new_index("#####-#####");
germlines.push_back(germline);
germline = new Germline("IGH", 'H', path + "/IGHV.fa", path + "/IGHD.fa", path + "/IGHJ.fa", 0, 80);
germline->new_index("######-######");
germlines.push_back(germline);
germline = new Germline("TRD", 'D', path + "/TRDV.fa", path + "/TRDD.fa", path + "/TRDJ.fa", 0, 80);
germline->new_index("#####-#####");
germlines.push_back(germline);
germline = new Germline("IGK", 'K', path + "/IGKV.fa", "", path + "/IGKJ.fa", -10, 20);
germline->new_index("#####-#####");
germlines.push_back(germline);
germline = new Germline("TRA", 'A', path + "/TRAV.fa", "", path + "/TRAJ.fa", -10, 20);
germline->new_index("#######-######");
germlines.push_back(germline);
germline = new Germline("TRB", 'B', path + "/TRBV.fa", path + "/TRBD.fa", path + "/TRBJ.fa", 0, 80);
germline->new_index("######-######");
germlines.push_back(germline);
germline = new Germline("IGL", 'L', path + "/IGLV.fa", "", path + "/IGLJ.fa", -10, 20);
germline->new_index("#####-#####");
germlines.push_back(germline);
add_germline(new Germline("TRA", 'A', path + "/TRAV.fa", "", path + "/TRAJ.fa", -10, 20), SEED_S13);
add_germline(new Germline("TRB", 'B', path + "/TRBV.fa", path + "/TRBD.fa", path + "/TRBJ.fa", 0, 80), SEED_S12);
add_germline(new Germline("TRG", 'G', path + "/TRGV.fa", "", path + "/TRGJ.fa", -10, 30), SEED_S10);
add_germline(new Germline("TRD", 'D', path + "/TRDV.fa", path + "/TRDD.fa", path + "/TRDJ.fa", 0, 80), SEED_S10);
add_germline(new Germline("IGH", 'H', path + "/IGHV.fa", path + "/IGHD.fa", path + "/IGHJ.fa", 0, 80), SEED_S12);
add_germline(new Germline("IGK", 'K', path + "/IGKV.fa", "", path + "/IGKJ.fa", -10, 20), SEED_S10);
add_germline(new Germline("IGL", 'L', path + "/IGLV.fa", "", path + "/IGLJ.fa", -10, 20), SEED_S10);
}
void MultiGermline::build_incomplete_set(string path)
......@@ -191,36 +176,20 @@ void MultiGermline::build_incomplete_set(string path)
// Should parse 'data/germlines.data'
Germline *germline;
// DH-JH
germline = new Germline("IGH+", 'h', path + "/IGHD.fa", "", path + "/IGHJ.fa", -10, 20);
germline->new_index("######-######");
germlines.push_back(germline);
// VdJa
germline = new Germline("VdJa", 'a', path + "/TRDV.fa", path + "/TRDD.fa", path + "/TRAJ.fa", -10, 80);
germline->new_index("#######-######");
germlines.push_back(germline);
add_germline(new Germline("VdJa", 'a', path + "/TRDV.fa", path + "/TRDD.fa", path + "/TRAJ.fa", -10, 80), SEED_S13);
// DD2-DD3
germline = new Germline("TRD+", 'd', path + "/TRDD2-01.fa", "", path + "/TRDJ.fa", -10, 60);
germline->new_index("#########");
germlines.push_back(germline);
germline = new Germline("TRD+", 'd', path + "/TRDV.fa", "", path + "/TRDD3-01.fa", -10, 50);
germline->new_index("#########");
germlines.push_back(germline);
germline = new Germline("TRD+", 'd', path + "/TRDD2-01.fa", "", path + "/TRDD3-01.fa", -10, 50);
germline->new_index("#########");
germlines.push_back(germline);
add_germline(new Germline("TRD+", 'd', path + "/TRDD2-01.fa", "", path + "/TRDJ.fa", -10, 60), SEED_9);
add_germline(new Germline("TRD+", 'd', path + "/TRDV.fa", "", path + "/TRDD3-01.fa", -10, 50), SEED_9);
add_germline(new Germline("TRD+", 'd', path + "/TRDD2-01.fa", "", path + "/TRDD3-01.fa", -10, 50), SEED_9);
// DH-JH
add_germline(new Germline("IGH+", 'h', path + "/IGHD.fa", "", path + "/IGHJ.fa", -10, 20), SEED_S12);
// IGK: KDE, INTRON
germline = new Germline("IGK+", 'k', path + "/IGK-INTRON.fa", "", path + "/IGK-KDE.fa", -10, 80);
germline->new_index("#####-#####");
germlines.push_back(germline);
germline = new Germline("IGK+", 'k', path + "/IGKV.fa", "", path + "/IGK-KDE.fa", -10, 80);
germline->new_index("#####-#####");
germlines.push_back(germline);
add_germline(new Germline("IGK+", 'k', path + "/IGK-INTRON.fa", "", path + "/IGK-KDE.fa", -10, 80), SEED_S10);
add_germline(new Germline("IGK+", 'k', path + "/IGKV.fa", "", path + "/IGK-KDE.fa", -10, 80), SEED_S10);
}
......
......@@ -7,6 +7,7 @@
#include "kmeraffect.h"
#include "kmerstore.h"
#include "stats.h"
#include "tools.h"
using namespace std;
......@@ -88,6 +89,7 @@ class MultiGermline {
~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);
......
......@@ -16,8 +16,11 @@ using namespace std;
#define SEED_YES '#'
// Common seeds
#define SEED_9 "#########"
#define SEED_S10 "#####-#####"
#define SEED_S12 "######-######"
#define SEED_S13 "#######-######"
string seed_contiguous(int k);
......
......@@ -583,13 +583,13 @@ int main (int argc, char **argv)
if (k == DEFAULT_K)
{
if (germline_system.find("TRA") != string::npos)
seed = "#######-######" ;
seed = SEED_S13 ;
else if ((germline_system.find("TRB") != string::npos)
|| (germline_system.find("IGH") != string::npos))
seed = "######-######" ;
seed = SEED_S12 ;
else // TRD, TRG, IGK, IGL
seed = "#####-#####" ;
seed = SEED_S10 ;
k = seed_weight(seed);
}
......
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