Commit 46add06a authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-a/3414-output-equal-score-alternative-genes' into 'dev'

Algo: output equal score alternative genes

Closes #3414

See merge request !459
parents 0e317911 53162f32
Pipeline #72548 passed with stages
in 6 minutes and 46 seconds
...@@ -91,11 +91,14 @@ void AlignBox::addToOutput(CloneOutput *clone, int alternative_genes) { ...@@ -91,11 +91,14 @@ void AlignBox::addToOutput(CloneOutput *clone, int alternative_genes) {
clone->setSeg(key, j) ; clone->setSeg(key, j) ;
/*Export the N best genes if threshold parameter is specified*/ /*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(); json jalt = json::array();
for(int i = 0; i < alternative_genes;++i){ int last_score = this->score[0].first;
int r = this->score[i].second; for(int i = 0; i < (int)this->score.size() &&
jalt.push_back(json::object({{"name",rep->label(r)}})); (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); clone->setSeg(key + "alt", jalt);
} }
......
...@@ -135,7 +135,7 @@ class AlignBox ...@@ -135,7 +135,7 @@ class AlignBox
/* Marked position, for Cys104 and Phe118/Trp118 */ /* Marked position, for Cys104 and Phe118/Trp118 */
int marked_pos; int marked_pos;
/* Identifiers and scores of other possible reference sequence */ /* Scores and identifiers of other possible reference sequence */
vector<pair<int, int> > score; vector<pair<int, int> > score;
}; };
......
...@@ -5,7 +5,9 @@ $ Presence of alternative: ...@@ -5,7 +5,9 @@ $ Presence of alternative:
1: "3alt" 1: "3alt"
1: "name": "IGHJ4.02" 1: "name": "IGHJ4.02"
1: "name": "IGHJ4.01" 1: "name": "IGHJ4.01"
1a: "name": "IGHJ5.01" 1: "name": "IGHJ5.01"
1: "name": "IGHJ5.02"
0: "name": "IGHJ[1236]
1: "4alt" 1: "4alt"
1: "name": "IGHD3-22.01" 1: "name": "IGHD3-22.01"
1: "name": "IGHD3-10.02" 1: "name": "IGHD3-10.02"
...@@ -15,5 +17,5 @@ $ Presence of alternative: ...@@ -15,5 +17,5 @@ $ Presence of alternative:
1: "name": "IGHV3-48.02" 1: "name": "IGHV3-48.02"
1: "name": "IGHV3-48.04" 1: "name": "IGHV3-48.04"
$ Correct number of "name" fields (1 clone + 3*1 'best' genes + 3*3 'alternative' genes) $ Correct number of "name" fields (1 clone + 3*1 'best' genes + 2*3 'alternative' genes + 4 alternative J genes)
w13:"name" 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