Commit 50331bad authored by Cyprien Borée's avatar Cyprien Borée

add alternative_genes in AlignBox

This parameter is used to export the N best genes in the JSON file.
For more informations, see #1409.
parent 593922df
......@@ -70,7 +70,7 @@ string AlignBox::getSequence(string sequence) {
return sequence.substr(start, end-start+1);
}
void AlignBox::addToJson(json &seg) {
void AlignBox::addToJson(json &seg, int alternative_genes) {
json j;
......@@ -947,12 +947,13 @@ string format_del(int deletions)
return deletions ? *"(" + string_of_int(deletions) + " del)" : "" ;
}
FineSegmenter::FineSegmenter(Sequence seq, Germline *germline, Cost segment_c, double threshold, double multiplier, int kmer_threshold)
FineSegmenter::FineSegmenter(Sequence seq, Germline *germline, Cost segment_c,
double threshold, double multiplier, int kmer_threshold, int alternative_genes)
{
box_V = new AlignBox("5");
box_D = new AlignBox("4");
box_J = new AlignBox("3");
this->alternative_genes = alternative_genes;
segmented = false;
dSegmented = false;
because = NOT_PROCESSED ;
......@@ -1333,7 +1334,7 @@ json FineSegmenter::toJson(){
for (AlignBox *box: boxes)
{
box->addToJson(seg);
box->addToJson(seg, this->alternative_genes);
}
if (isSegmented()) {
......
......@@ -101,7 +101,7 @@ class AlignBox
AlignBox(string key = "", string color="");
string getSequence(string sequence);
void addToJson(json &seg);
void addToJson(json &seg, int alternative_genes=NO_LIMIT_VALUE);
/**
* Returns 'V', 'D', 'J', or possibly '5', '4', '3', '?', depending on the ref_label and on the key
......@@ -355,6 +355,8 @@ class KmerMultiSegmenter
class FineSegmenter : public Segmenter
{
private:
int alternative_genes;
public:
vector<pair<int, int> > score_V;
vector<pair<int, int> > score_D;
......@@ -375,7 +377,7 @@ class FineSegmenter : public Segmenter
*/
FineSegmenter(Sequence seq, Germline *germline, Cost segment_cost,
double threshold = THRESHOLD_NB_EXPECTED, double multiplier=1.0,
int kmer_threshold=NO_LIMIT_VALUE);
int kmer_threshold=NO_LIMIT_VALUE, int alternative_genes=NO_LIMIT_VALUE);
~FineSegmenter();
......
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