Skip to content

Commit c32b38f

Browse files
committed
MIN Fix whitespace in warning message
Also, use booleans instead of 0/1
1 parent 9ee6f1e commit c32b38f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

gmsc_mapper/filter_length.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
message_error = '''GMSC-mapper Error: Input sequences are all more than 303nt or 100aa,which will be filtered.
2-
Please check if your input consist of contigs, which should use -i not --nt-genes or --aa-genes as input.\n'''
1+
message_error = '''GMSC-mapper Error: Input sequences are all more than 303nt or 100aa,which will be filtered.
2+
Please check if your input consist of contigs, which should use -i not --nt-genes or --aa-genes as input.\n'''
33

44
def filter_length(queryfile, tmpdirname, N):
55
import sys
66
import gzip
77
from os import path
88
from .fasta import fasta_iter
9-
109
filtered_file = path.join(tmpdirname, "filtered.faa.gz")
1110

1211
with gzip.open(filtered_file, 'wt',compresslevel=1) as of:
13-
all_longer_flag = 1
14-
12+
all_longer_flag = True
1513
for ID, seq in fasta_iter(queryfile):
1614
if len(seq) < N:
17-
all_longer_flag = 0
15+
all_longer_flag = False
1816
of.write(f'>{ID}\n{seq}\n')
19-
17+
2018
if all_longer_flag:
2119
sys.stderr.write(message_error)
2220
sys.exit(1)
23-
2421
return filtered_file

0 commit comments

Comments
 (0)