Skip to content

Commit

Permalink
Fix bug of checking output files
Browse files Browse the repository at this point in the history
  • Loading branch information
aakechin committed Sep 5, 2018
1 parent 107f1a7 commit f633732
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cutPrimers.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,19 @@ def trimPrimers(data):
print('ERROR! Could not create file:',args.trimmedReadsR1)
print('########')
exit(0)
if args.untrimmedReadsR1==args.trimmedReadsR1:
untrimmedReadsR1=trimmedReadsR1
else:
try:
if args.untrimmedReadsR1[-3:]!='.gz':
untrimmedReadsR1=open(args.untrimmedReadsR1,'w')
else:
untrimmedReadsR1=gzip.open(args.untrimmedReadsR1,'wt')
except FileNotFoundError:
print('########')
print('ERROR! Could not create file:',args.untrimmedReadsR1)
print('########')
exit(0)
if args.trimmedReadsR2:
try:
if args.trimmedReadsR2[-3:]!='.gz':
Expand All @@ -331,19 +344,6 @@ def trimPrimers(data):
print('ERROR! Could not create file:',args.trimmedReadsR2)
print('########')
exit(0)
if args.untrimmedReadsR1==args.trimmedReadsR1:
untrimmedReadsR1=trimmedReadsR1
else:
try:
if args.untrimmedReadsR1[-3:]!='.gz':
untrimmedReadsR1=open(args.untrimmedReadsR1,'w')
else:
untrimmedReadsR1=gzip.open(args.untrimmedReadsR1,'wt')
except FileNotFoundError:
print('########')
print('ERROR! Could not create file:',args.untrimmedReadsR1)
print('########')
exit(0)
if args.untrimmedReadsR2:
if args.untrimmedReadsR2==args.trimmedReadsR2:
untrimmedReadsR2=trimmedReadsR2
Expand Down

0 comments on commit f633732

Please sign in to comment.