Commit 2460d41d authored by Mathieu Giraud's avatar Mathieu Giraud

fuse.py: do not fail if TOOL_SIMILARITY is not found

The tests launches fuse.py from another directory,
from where TOOL_SIMILARITY can not be found.
parent 243c60db
...@@ -42,6 +42,8 @@ from utils import * ...@@ -42,6 +42,8 @@ from utils import *
VIDJIL_JSON_VERSION = "2014.10" VIDJIL_JSON_VERSION = "2014.10"
FUSE_VERSION = "vidjil fuse" FUSE_VERSION = "vidjil fuse"
TOOL_SIMILARITY = "../algo/tools/similarity"
GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL'] GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL']
#### ####
...@@ -728,8 +730,11 @@ def main(): ...@@ -728,8 +730,11 @@ def main():
fasta += jlist_fused.d["clones"][i].d["id"] + "\n" fasta += jlist_fused.d["clones"][i].d["id"] + "\n"
fasta_file = open("tmp", 'w') fasta_file = open("tmp", 'w')
fasta_file.write(fasta) fasta_file.write(fasta)
jlist_fused.d["similarity"] = json.loads(subprocess.check_output(["../algo/tools/similarity", "-j", "tmp"])) try:
out = subprocess.check_output([TOOL_SIMILARITY, "-j", "tmp"])
jlist_fused.d["similarity"] = json.loads(out)
except OSError:
print("! failed: %s" % TOOL_SIMILARITY)
print("### Save merged file") print("### Save merged file")
jlist_fused.save_json(args.output) jlist_fused.save_json(args.output)
......
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