Commit 17ab708c authored by marc's avatar marc Committed by Mathieu Giraud
Browse files

fuse.py: add a limit to similarity (don't compute gigantic similarity matrix)

parent fffd62b2
...@@ -46,6 +46,7 @@ from collections import defaultdict ...@@ -46,6 +46,7 @@ from collections import defaultdict
FUSE_VERSION = "vidjil fuse" FUSE_VERSION = "vidjil fuse"
TOOL_SIMILARITY = "../algo/tools/similarity" TOOL_SIMILARITY = "../algo/tools/similarity"
SIMILARITY_LIMIT = 1000
GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL'] GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL']
...@@ -739,6 +740,7 @@ def main(): ...@@ -739,6 +740,7 @@ def main():
print() print()
#compute similarity matrix #compute similarity matrix
if len(jlist_fused.d["clones"]) < SIMILARITY_LIMIT :
fasta = "" fasta = ""
for i in range(len(jlist_fused.d["clones"])) : for i in range(len(jlist_fused.d["clones"])) :
fasta += ">>" + str(i) + "\n" fasta += ">>" + str(i) + "\n"
...@@ -750,6 +752,8 @@ def main(): ...@@ -750,6 +752,8 @@ def main():
jlist_fused.d["similarity"] = json.loads(out) jlist_fused.d["similarity"] = json.loads(out)
except OSError: except OSError:
print("! failed: %s" % TOOL_SIMILARITY) 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)
os.unlink(fasta_file.name) os.unlink(fasta_file.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