Skip to content

Commit c5ca07c

Browse files
committed
fixed output filename for muscle5
1 parent b014157 commit c5ca07c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

fdog/libs/addtaxon.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,16 @@ def create_genome(args):
158158
if len(id_dict) > 0:
159159
mapping_file = '%s.mapping' % genome_file
160160
with open(mapping_file, 'w') as mp:
161-
for o,n in id_dict.items():
162-
mp.write('%s\t%s\n' % (o,n))
161+
for id in in_seq:
162+
if id in id_dict:
163+
mp.write(f'{id}\t{id_dict[id]}\n')
164+
else:
165+
mp.write(f'{id}\t{id}\n')
163166
if pipe == 1:
164167
print('\033[94mWARNING: Sequence IDs contain pipe(s). They will be replaced by "_"!\033[0m')
165168
if long_id == 'yes':
166-
print('\033[94mWARNING: Some headers longer than 80 characters have been automatically shortened. Please check the %s.mapping file for details!\033[0m' % genome_file)
167-
if pipe == 1:
168-
print('\033[94mWARNING: Please check the %s file for details!\033[0m' % mapping_file)
169+
print('\033[94mWARNING: Some headers longer than 80 characters have been automatically shortened.\033[0m')
170+
print('\033[94mPlease check the %s file for details!\033[0m' % mapping_file)
169171
else:
170172
print(genome_path + '/' + spec_name + '.fa already exists!')
171173
return(genome_file)

fdog/libs/alignment.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def do_align(aligner, fa_file):
6767
input_fa = SeqIO.to_dict((SeqIO.parse(open(fa_file), 'fasta')))
6868
if len(input_fa) == 1:
6969
return(input_fa)
70-
out_file = fa_file.replace('@', '_')
70+
# parse output file name (otherwise cause troubles for muscle_v5)
71+
out_file = fa_file.split('/')[-1].replace('@', '_')
72+
# check muscle version
7173
if aligner == 'muscle':
7274
if get_muscle_version(aligner) == 'v3':
7375
if fasta_fn.check_long_seq(fa_file) == 1:
@@ -76,7 +78,7 @@ def do_align(aligner, fa_file):
7678
aligner = 'muscle_v3'
7779
else:
7880
aligner = 'muscle_v5'
79-
81+
# create alignment command and run
8082
align_cline = ''
8183
if aligner == 'muscle_v3':
8284
align_cline = 'muscle -in %s' % fa_file

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="fdog",
29-
version="0.1.13",
29+
version="0.1.14",
3030
python_requires='>=3.7.0',
3131
description="Feature-aware Directed OrtholoG search tool",
3232
long_description=long_description,

0 commit comments

Comments
 (0)