Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
3d77f5a2
Commit
3d77f5a2
authored
Apr 04, 2019
by
Mikaël Salson
Browse files
segment.cpp: Also display alternative genes with the same score as the last one
Fix
#3414
parent
0a23db36
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/segment.cpp
View file @
3d77f5a2
...
...
@@ -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
);
}
...
...
algo/tests/should-get-tests/alternative_genes.should-get
View file @
3d77f5a2
...
...
@@ -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)
w1
3
:"name"
$ Correct number of "name" fields (1 clone + 3*1 'best' genes +
2
*3 'alternative'
genes + 4 alternative J
genes)
w1
4
:"name"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment