Commit 37b171a4 authored by Mikaël Salson's avatar Mikaël Salson

bug20150629: Don't output a name if there is none.

This should be correctly handled in the browser but we make sure
that no name will be output if the name is empty.

This is the same behaviour as with -c segment.

grep was changed for sed because when no occurrence is found grep
exits with code 1, which is not the case of sed.
parent ad6e82e8
!LAUNCH: ../../../vidjil -c clones -r 1 -g ../../../germline/homo-sapiens.g:IGH bug20150629.fa >/dev/null && python ../../../tools/format_json.py out/bug20150629.vidjil| grep '\\"name\\"'
!LAUNCH: ../../../vidjil -c clones -r 1 -g ../../../germline/homo-sapiens.g:IGH bug20150629.fa >/dev/null && python ../../../tools/format_json.py out/bug20150629.vidjil| sed -n '/\\"name\\"/p'
$ The sequence is not segmented
0:IGHV
$ The sequence should have a name
$ The sequence should have a non-empty name (if any)
0:"\\s*"
......@@ -1417,7 +1417,8 @@ int main (int argc, char **argv)
// From FineSegmenter
json_clone["name"] = seg.code;
if (seg.code.length() > 0)
json_clone["name"] = seg.code;
json json_fseg = seg.toJson();
for (json::iterator it = json_fseg.begin(); it != json_fseg.end(); ++it) {
json_clone["seg"][it.key()] = it.value();
......
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