Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Sep 12, 2016
2 parents 1782bba + 4bf7c89 commit 5fddef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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')
9 changes: 6 additions & 3 deletions pipeline/check/quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ def check_htseq(filename, cutoff=0, log=None):
else:
values[gene] = int(value)

total = sum([mapped_reads, values['__no_feature'], values['__ambiguous']])
total = sum([mapped_reads,
values['__no_feature'] if '__no_feature' in values.keys() else 0,
values['__ambiguous'] if '__ambiguous' in values.keys() else 0]
)

percentage_mapped = (mapped_reads*100)/total
percentage_mapped = ((mapped_reads*100)/total) if total > 0 else 0

if percentage_mapped >= cutoff:
return True
else:
if log is not None:
if log is not None:
print('WARNING:', filename, 'didn\'t pass HTSEQ-Count Quality check!', percentage_mapped
, 'reads mapped. Cutoff,', cutoff, file=log)

Expand Down

0 comments on commit 5fddef4

Please sign in to comment.