File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 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 '''
3
3
4
4
def filter_length (queryfile , tmpdirname , N ):
5
5
import sys
6
6
import gzip
7
7
from os import path
8
8
from .fasta import fasta_iter
9
-
10
9
filtered_file = path .join (tmpdirname , "filtered.faa.gz" )
11
10
12
11
with gzip .open (filtered_file , 'wt' ,compresslevel = 1 ) as of :
13
- all_longer_flag = 1
14
-
12
+ all_longer_flag = True
15
13
for ID , seq in fasta_iter (queryfile ):
16
14
if len (seq ) < N :
17
- all_longer_flag = 0
15
+ all_longer_flag = False
18
16
of .write (f'>{ ID } \n { seq } \n ' )
19
-
17
+
20
18
if all_longer_flag :
21
19
sys .stderr .write (message_error )
22
20
sys .exit (1 )
23
-
24
21
return filtered_file
You can’t perform that action at this time.
0 commit comments