Commit da20ed7d authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-s/3626-robust_compute_extra' into 'dev'

compute extra check for keys and NoneType

Closes #3626

See merge request !355
parents f0c83fa5 8e070fb3
Pipeline #49443 passed with stages
in 6 minutes and 20 seconds
......@@ -102,16 +102,18 @@ def compute_extra(id_file, id_config, min_threshold):
try:
d = json.load(rf)
loci_min = {}
loci_totals = d['reads']['germline']
for locus in loci_totals:
if locus not in result:
result[locus] = [0]
loci_min[locus] = loci_totals[locus][0] * (min_threshold/100.0)
for clone in d["clones"]:
germline = clone['germline']
if clone['reads'][0] >= loci_min[germline]:
result[germline][0] += 1
if 'reads' in d and 'germline' in d['reads']:
loci_totals = d['reads']['germline']
for locus in loci_totals:
if locus not in result:
result[locus] = [0]
loci_min[locus] = loci_totals[locus][0] * (min_threshold/100.0)
if 'clones' in d and d['clones'] is not None:
for clone in d["clones"]:
germline = clone['germline']
if clone['reads'][0] >= loci_min[germline]:
result[germline][0] += 1
except ValueError as e:
print('invalid_json')
return "FAIL"
......
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