Commit 3d77f5a2 authored by Mikaël Salson's avatar Mikaël Salson

segment.cpp: Also display alternative genes with the same score as the last one

Fix #3414
parent 0a23db36
......@@ -91,11 +91,14 @@ void AlignBox::addToOutput(CloneOutput *clone, int alternative_genes) {
clone->setSeg(key, j) ;
/*Export the N best genes if threshold parameter is specified*/
if(rep && !this->score.empty() && rep->size() <= (int)this->score.size() && alternative_genes > 0 && alternative_genes <= (int)this->score.size()){
if(rep && !this->score.empty() && rep->size() <= (int)this->score.size() && alternative_genes > 0){
json jalt = json::array();
for(int i = 0; i < alternative_genes;++i){
int last_score = this->score[0].first;
for(int i = 0; i < (int)this->score.size() &&
(i < alternative_genes || last_score == this->score[i].first);++i){
int r = this->score[i].second;
jalt.push_back(json::object({{"name",rep->label(r)}}));
last_score = this->score[i].first;
}
clone->setSeg(key + "alt", jalt);
}
......
......@@ -5,7 +5,9 @@ $ Presence of alternative:
1: "3alt"
1: "name": "IGHJ4.02"
1: "name": "IGHJ4.01"
1: "name": "IGHJ5.0[12]"
1: "name": "IGHJ5.01"
1: "name": "IGHJ5.02"
0: "name": "IGHJ[1236]
1: "4alt"
1: "name": "IGHD3-22.01"
1: "name": "IGHD3-10.02"
......@@ -15,5 +17,5 @@ $ Presence of alternative:
1: "name": "IGHV3-48.02"
1: "name": "IGHV3-48.04"
$ Correct number of "name" fields (1 clone + 3*1 'best' genes + 3*3 'alternative' genes)
w13:"name"
$ Correct number of "name" fields (1 clone + 3*1 'best' genes + 2*3 'alternative' genes + 4 alternative J genes)
w14:"name"
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