Commit 4a3ba830 authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

path computation

parent 68945d74
number_try = 10
threshold = 0.5
number_try = 25
threshold = 0.95
rule d2_path_generation:
......@@ -10,15 +10,20 @@ rule d2_path_generation:
output:
"{path}_d2_{type}_{method}_path.gexf"
run:
best = 0
for _ in range(number_try):
shell("python3 deconvolution/main/d2_to_path.py {input.barcode} {input.d2} > tmp_{output}.out")
shell("python3 deconvolution/main/d2_to_path.py {input.barcode} {input.d2} > {output}_tmp.out")
score = 0
with open("tmp_{output}.out") as out:
with open(f"{output}_tmp.out") as out:
score_line = out.readlines()[-2].strip()
score = float(score_line.split(' ')[-1])
print(score)
if score > best:
best = score
shell("cp {output} {output}.best")
if score > threshold:
print("Score sufficient: quitting...")
break
shell("rm tmp_{output}.out")
shell("rm {output}_tmp.out")
shell("cp {output}.best {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