Skip to content

Commit 553cdaa

Browse files
committed
added check for invalid min-/maxDist; works with fasta36.3.8g
1 parent c756ab0 commit 553cdaa

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/github_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
fdog.run --seqFile infile.fa --jobName test --refspec HUMAN@9606@3 --fasOff
5252
mkdir seeds
5353
path=$(fdog.setup -d ./ --getSourcepath); a="1 2 3"; for i in ${a[@]}; do cp $path/data/infile.fa seeds/$i.fa; done
54-
echo "TEST fdog.run with only 2 search taxa"
54+
echo "TEST fdogs.run"
5555
fdogs.run --seqFolder seeds --jobName test_multi --refspec HUMAN@9606@3 --fasOff --searchTaxa PARTE@5888@3,THAPS@35128@3
5656
echo "TEST fdog.addTaxon"
5757
head /home/runner/work/fDOG/fDOG/dt/searchTaxa_dir/HUMAN@9606@3/HUMAN@[email protected] > hm.fa

fdog/libs/alignment.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,16 @@ def calc_aln_score(fa1, fa2, aln_strategy = 'local', debugCore = False):
140140
Return dictionary {gene_id:aln_score}
141141
"""
142142
fdog_path = os.path.realpath(__file__).replace('/libs/alignment.py','')
143-
if os.path.exists('fasta36_1.fa'):
144-
os.remove('fasta36_1.fa')
145-
if os.path.exists('fasta36_2.fa'):
146-
os.remove('fasta36_2.fa')
147-
os.symlink(fa1, 'fasta36_1.fa')
148-
os.symlink(fa2, 'fasta36_2.fa')
143+
fa1_filename = fa1.split('/')[-1]
144+
fa2_filename = fa1.split('/')[-1]
145+
if os.path.exists(fa1_filename):
146+
os.remove(fa1_filename)
147+
if os.path.exists(fa2_filename):
148+
os.remove(fa2_filename)
149+
os.symlink(fa1, fa1_filename)
150+
os.symlink(fa2, fa2_filename)
149151
# fasta36_options = '%s %s -s BP62 -m 9 -d 0 -z -1 -E 100' % (fa1, fa2)
150-
fasta36_options = 'fasta36_1.fa fasta36_2.fa -s BP62 -m 9 -d 0 -z -1 -E 100'
152+
fasta36_options = f'{fa1_filename} {fa2_filename} -s BP62 -m 9 -d 0 -z -1 -E 100'
151153
fdog_path = os.path.realpath(__file__).replace('/libs/alignment.py','')
152154
fasta36_bin = check_fasta36_executable(fdog_path)
153155
if aln_strategy == 'global':
@@ -180,6 +182,6 @@ def calc_aln_score(fa1, fa2, aln_strategy = 'local', debugCore = False):
180182
if re.search('\(\s+\d+\)', l):
181183
l = re.sub(r'\(\s+','(', l)
182184
aln_score[gene_id] = aln_score[gene_id] + int(l.split()[2])
183-
os.remove('fasta36_1.fa')
184-
os.remove('fasta36_2.fa')
185+
os.remove(fa1_filename)
186+
os.remove(fa2_filename)
185187
return(aln_score)

0 commit comments

Comments
 (0)