@@ -127,50 +127,13 @@ def write_faChecked(fa_file):
127
127
128
128
def check_fasta (args ):
129
129
""" Check fasta file in searchTaxa_dir and coreTaxa_dir """
130
- # taxon_list = []
131
- # for fd in general_fn.read_dir(checkDir):
132
- # taxon = fd
133
- # check_valid_folder_name('%s/%s' % (checkDir, taxon))
134
- # for file in listdir('%s/%s' % (checkDir, taxon)):
135
- # if file.endswith('.fa'):
136
- # fa_file = '%s/%s/%s' % (checkDir, taxon, file)
137
- # if os.path.islink(fa_file):
138
- # fa_file = os.path.realpath(fa_file)
139
- # general_fn.check_file_exist(fa_file)
140
- # checkfa_file = check_valid_fasta(fa_file)
141
- # taxon_list.append(taxon)
142
- # if not os.path.exists('%s.checked' % fa_file):
143
- # print(taxon)
144
- # if list(checkfa_file.keys())[0] == 'notFasta':
145
- # sys.exit('*** ERROR: %s does not look like a fasta file!' % fa_file)
146
- # elif list(checkfa_file.keys())[0] == 'longHeader':
147
- # sys.exit('*** ERROR: %s contains long headers! E.g. %s' % (fa_file, list(checkfa_file.values())[0]))
148
- # elif list(checkfa_file.keys())[0] == 'space':
149
- # sys.exit('*** ERROR: %s contains spaces/tabs!' % fa_file)
150
- # elif list(checkfa_file.keys())[0] == 'multiLine':
151
- # if not concat:
152
- # print('*** ERROR: %s contains multiple-line sequences!' % fa_file)
153
- # sys.exit('Please use "--concat" with "--replace" or "--delete" to join them into single lines')
154
- # else:
155
- # rewrite_seqs(fa_file, replace, delete)
156
- # elif list(checkfa_file.keys())[0] == 'ok':
157
- # if not (delete or replace):
158
- # check_valid_seqs(fa_file)
159
- # else:
160
- # rewrite_seqs(fa_file, replace, delete)
161
- # write_faChecked(fa_file)
162
- # if not os.path.exists('%s.fai' % fa_file):
163
- # fasta_fn.read_fasta(fa_file)
164
- # return(taxon_list)
165
130
(taxon , file , checkDir , replace , delete , concat ) = args
166
131
fa_file = '%s/%s/%s' % (checkDir , taxon , file )
167
132
if os .path .islink (fa_file ):
168
133
fa_file = os .path .realpath (fa_file )
169
134
general_fn .check_file_exist (fa_file )
170
135
checkfa_file = check_valid_fasta (fa_file )
171
- # taxon_list.append(taxon)
172
136
if not os .path .exists ('%s.checked' % fa_file ):
173
- print (taxon )
174
137
if list (checkfa_file .keys ())[0 ] == 'notFasta' :
175
138
sys .exit ('*** ERROR: %s does not look like a fasta file!' % fa_file )
176
139
elif list (checkfa_file .keys ())[0 ] == 'longHeader' :
0 commit comments