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,12 +102,14 @@ def compute_extra(id_file, id_config, min_threshold): ...@@ -102,12 +102,14 @@ def compute_extra(id_file, id_config, min_threshold):
try: try:
d = json.load(rf) d = json.load(rf)
loci_min = {} loci_min = {}
if 'reads' in d and 'germline' in d['reads']:
loci_totals = d['reads']['germline'] loci_totals = d['reads']['germline']
for locus in loci_totals: for locus in loci_totals:
if locus not in result: if locus not in result:
result[locus] = [0] result[locus] = [0]
loci_min[locus] = loci_totals[locus][0] * (min_threshold/100.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"]: for clone in d["clones"]:
germline = clone['germline'] germline = clone['germline']
if clone['reads'][0] >= loci_min[germline]: if clone['reads'][0] >= loci_min[germline]:
......
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