Skip to content

Commit

Permalink
debugging issue with HISAT2 QC
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Jul 25, 2017
1 parent b290bfa commit 2940d4c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pipeline/check/quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ def check_hisat2(filename, cutoff=0, log=None):

with open(filename, 'r') as f:
lines = '\t'.join(f.readlines())
hits = re_mapped.search(lines[-1])
if hits:
value = float(hits.group(1))
print(value)
if value >= cutoff:
return True
else:
if log is not None:
print('WARNING:', filename, 'didn\'t pass alignment check!', value, 'reads mapped. Cutoff,',
cutoff, file=log)
for l in lines:
if "overall alignment" in l:
hits = re_mapped.search(l)
print(hits)
if hits:
value = float(hits.group(1))
print(value)
if value >= cutoff:
return True
else:
if log is not None:
print('WARNING:', filename, 'didn\'t pass alignment check!', value, 'reads mapped. Cutoff,',
cutoff, file=log)


return False
Expand Down

0 comments on commit 2940d4c

Please sign in to comment.