Skip to content

Commit b7ec6fa

Browse files
committed
fixed worrking with old fasta36
1 parent 553cdaa commit b7ec6fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fdog/libs/alignment.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import re
2323
from Bio import SeqIO
2424
from io import StringIO
25+
import random
2526

2627
import fdog.libs.fasta as fasta_fn
2728
import fdog.libs.output as output_fn
@@ -140,8 +141,9 @@ def calc_aln_score(fa1, fa2, aln_strategy = 'local', debugCore = False):
140141
Return dictionary {gene_id:aln_score}
141142
"""
142143
fdog_path = os.path.realpath(__file__).replace('/libs/alignment.py','')
143-
fa1_filename = fa1.split('/')[-1]
144-
fa2_filename = fa1.split('/')[-1]
144+
prefix = random.randint(0,99999)
145+
fa1_filename = f'{prefix}_{fa1.split("/")[-1]}'
146+
fa2_filename = f'{prefix}_{fa1.split("/")[-1]}'
145147
if os.path.exists(fa1_filename):
146148
os.remove(fa1_filename)
147149
if os.path.exists(fa2_filename):

0 commit comments

Comments
 (0)