Commit 25d0a6e5 authored by Mikaël Salson's avatar Mikaël Salson

fuse.py: Prevent division by zero error.

If no read was segmented we may encounter an error in that case
parent 300c92ce
Pipeline #87071 passed with stages
in 7 minutes and 33 seconds
......@@ -317,10 +317,11 @@ class ListWindows(VidjilJson):
for clone in self:
for i, s in enumerate(clone.d["reads"]):
for r in range(len(ranges)):
if s*1. / self.d['reads'].d['segmented'][i] >= ranges[r]:
break
result[r][i] += s
if self.d['reads'].d['segmented'][i] > 0:
for r in range(len(ranges)):
if s*1. / self.d['reads'].d['segmented'][i] >= ranges[r]:
break
result[r][i] += s
for r in range(len(ranges)):
ratio_in_string = '{0:.10f}'.format(ranges[r]).rstrip('0')
......
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