Skip to content

Commit

Permalink
avoid division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Proost committed Aug 29, 2016
1 parent 2981bd2 commit 4bf7c89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper/htseq_count_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
print('sample', 'mapped_reads', 'no_feature', 'ambiguous', '% mapped', '% no_feature', '% ambiguous', sep='\t')
for s, m, n, a in zip(values['samples'], values['mapped_reads'], values['__no_feature'], values['__ambiguous']):
total = sum([m, n, a])
print(s, m, n, a, m*100/total, n*100/total, a*100/total, sep='\t')
if total > 0:
print(s, m, n, a, m*100/total, n*100/total, a*100/total, sep='\t')

0 comments on commit 4bf7c89

Please sign in to comment.