Skip to content

Commit 4aa2602

Browse files
author
Jon Palmer
committed
push @atiweb changes in #384 and copy/delete in annotate for logfile
1 parent d62736c commit 4aa2602

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

funannotate/annotate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,9 @@ def __init__(self, prog):
14021402
if os.path.isfile(log_name):
14031403
if not os.path.isdir(os.path.join(outputdir, 'logfiles')):
14041404
os.makedirs(os.path.join(outputdir, 'logfiles'))
1405-
os.rename(log_name, os.path.join(
1405+
shutil.copyfile(log_name, os.path.join(
14061406
outputdir, 'logfiles', 'funannotate-annotate.log'))
1407+
os.remove(log_name)
14071408

14081409

14091410
if __name__ == "__main__":

funannotate/compare.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import shutil
99
import argparse
10+
import io
1011
from datetime import datetime
1112
from goatools import obo_parser
1213
from Bio import SeqIO
@@ -373,13 +374,13 @@ def __init__(self, prog):
373374
pfam_desc.append(PFAM.get(i))
374375
pfamdf2['descriptions'] = pfam_desc
375376
# write to file
376-
pfamdf2.to_csv(os.path.join(args.out, 'pfam', 'pfam.results.csv'))
377+
pfamdf2.to_csv(os.path.join(args.out, 'pfam', 'pfam.results.csv'), encoding='utf-8')
377378
pfamdf2.reset_index(inplace=True)
378379
pfamdf2.rename(columns={'index': 'PFAM'}, inplace=True)
379380
pfamdf2['PFAM'] = '<a target="_blank" href="http://pfam.xfam.org/family/' + \
380381
pfamdf2['PFAM'].astype(str)+'">'+pfamdf2['PFAM']+'</a>'
381382
# create html output
382-
with open(os.path.join(args.out, 'pfam.html'), 'w') as output:
383+
with io.open(os.path.join(args.out, 'pfam.html'), 'w', encoding='utf-8') as output:
383384
pd.set_option('display.max_colwidth', -1)
384385
output.write(lib.HEADER)
385386
output.write(lib.PFAM)

funannotate/library.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7041,6 +7041,7 @@ def dictFlipLookup(input, lookup):
70417041
result = k+': '+lookup.get(k)
70427042
else:
70437043
result = k+': No description'
7044+
result = result.encode('utf-8')
70447045
for i in v:
70457046
if i in outDict:
70467047
outDict[i].append(str(result))

0 commit comments

Comments
 (0)