Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
1d8b517d
Commit
1d8b517d
authored
Jul 11, 2016
by
Mathieu Giraud
Browse files
core/segment.cpp, tests: json output, update seg.evalue format
parent
05442c65
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/segment.cpp
View file @
1d8b517d
...
...
@@ -1195,16 +1195,20 @@ json FineSegmenter::toJson(){
return
seg
;
}
json
toJsonSegVal
(
string
s
)
{
return
{{
"val"
,
s
}};
}
json
KmerSegmenter
::
toJson
()
{
json
seg
;
int
sequenceSize
=
sequence
.
size
();
if
(
evalue
>
NO_LIMIT_VALUE
)
seg
[
"
_
evalue"
]
=
scientific_string_of_double
(
evalue
);
seg
[
"evalue"
]
=
toJsonSegVal
(
scientific_string_of_double
(
evalue
)
)
;
if
(
evalue_left
>
NO_LIMIT_VALUE
)
seg
[
"
_
evalue_left"
]
=
scientific_string_of_double
(
evalue_left
);
seg
[
"evalue_left"
]
=
toJsonSegVal
(
scientific_string_of_double
(
evalue_left
)
)
;
if
(
evalue_right
>
NO_LIMIT_VALUE
)
seg
[
"
_
evalue_right"
]
=
scientific_string_of_double
(
evalue_right
);
seg
[
"evalue_right"
]
=
toJsonSegVal
(
scientific_string_of_double
(
evalue_right
)
)
;
seg
[
"affectValues"
]
=
{
{
"start"
,
1
},
...
...
algo/tests/should-get-tests/stanford-json.should-get
View file @
1d8b517d
...
...
@@ -50,4 +50,4 @@ $ Second sequence has a DNA sequence provided
1:"id": "CTGTGCGAGAGGTTACTATGATAGTAGTGGTTATTACGGGGTAGGGCAGTACTACTACTA".*"sequence": "[ACGT]+",
$ Second sequence also has evalues
1:"id": "CTGTGCGAGAGGTTACTATGATAGTAGTGGTTATTACGGGGTAGGGCAGTACTACTACTA".*"
_
evalue": "[0-9\.e-]+"
1:"id": "CTGTGCGAGAGGTTACTATGATAGTAGTGGTTATTACGGGGTAGGGCAGTACTACTACTA".*"evalue":
."val":
"[0-9\.e-]+"
Write
Preview
Markdown
is supported
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