Commit 3cb5cfdc authored by Ryan Herbert's avatar Ryan Herbert
Browse files write compute extra to results_file

instead of creating a new file, write the information under reads ->
parent 8a0eeeec
......@@ -93,14 +93,12 @@ def compute_contamination(sequence_file_id, results_file_id, config_id):
def compute_extra(id_file, id_config, min_threshold):
result = {}
d = None
results_file = db((db.results_file.sequence_file_id == id_file) &
(db.results_file.config_id == id_config)
id_data =
out_folder = defs.DIR_OUT_VIDJIL_ID % id_data
output_filename = defs.BASENAME_OUT_VIDJIL_ID % id_data
out_extra = out_folder+'/'+output_filename+'.vidjil.extra'
with open(defs.DIR_RESULTS+results_file.data_file, "rb") as rf:
filename = defs.DIR_RESULTS+results_file.data_file
with open(filename, "rb") as rf:
d = json.load(rf)
loci_min = {}
......@@ -117,8 +115,9 @@ def compute_extra(id_file, id_config, min_threshold):
except ValueError as e:
return "FAIL"
with open(out_extra, 'wb') as extra:
json.dump(result, extra)
d['reads']['distribution'] = result
with open(filename, 'wb') as extra:
json.dump(d, extra)
return "SUCCESS"
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