Skip to content

Commit

Permalink
Handled condition where not trimming was done
Browse files Browse the repository at this point in the history
  • Loading branch information
ODiogoSilva committed Nov 9, 2017
1 parent 2c10e64 commit 5070a9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions trimmomatic_report.py
Expand Up @@ -90,8 +90,11 @@ def parse_log(log_file):

total_len = template["clean_len"] + template["total_trim"]

template["total_trim_perc"] = round(
(template["total_trim"] / total_len) * 100, 2)
if total_len:
template["total_trim_perc"] = round(
(template["total_trim"] / total_len) * 100, 2)
else:
template["total_trim_perc"] = 0

return template

Expand Down

0 comments on commit 5070a9d

Please sign in to comment.