Skip to content

Commit

Permalink
Merge pull request #777 from umccr/bugfix/sequali-division-by-zero-error
Browse files Browse the repository at this point in the history
Resolve division by zero error
  • Loading branch information
alexiswl authored Dec 15, 2024
2 parents 3b86429 + 7aefdfd commit 51eb864
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ def get_insert_size_estimate(insert_sizes: List[int]) -> float:
"""

# Get the weighted average
# Dont include '0' insert sizes
# Dont include '0' insert

# Prevent ZeroDivisionError
if sum(insert_sizes[1:]) == 0:
return 0

insert_size_estimate = sum(
[
insert_size * insert_size_count
Expand Down

0 comments on commit 51eb864

Please sign in to comment.