Skip to content

Commit e728252

Browse files
committed
fix path to refspec fa; add amino to hmmbuild
1 parent f984b26 commit e728252

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

fdog/checkData.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -127,50 +127,13 @@ def write_faChecked(fa_file):
127127

128128
def check_fasta(args):
129129
""" 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)
165130
(taxon, file, checkDir, replace, delete, concat) = args
166131
fa_file = '%s/%s/%s' % (checkDir, taxon, file)
167132
if os.path.islink(fa_file):
168133
fa_file = os.path.realpath(fa_file)
169134
general_fn.check_file_exist(fa_file)
170135
checkfa_file = check_valid_fasta(fa_file)
171-
# taxon_list.append(taxon)
172136
if not os.path.exists('%s.checked' % fa_file):
173-
print(taxon)
174137
if list(checkfa_file.keys())[0] == 'notFasta':
175138
sys.exit('*** ERROR: %s does not look like a fasta file!' % fa_file)
176139
elif list(checkfa_file.keys())[0] == 'longHeader':

fdog/libs/hmm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
def create_hmm(aln_file, out_file):
2727
""" Create hmm file for an alinment file """
28-
hmmbuild_cmd = 'hmmbuild %s %s' % (out_file, aln_file)
28+
hmmbuild_cmd = 'hmmbuild --amino %s %s' % (out_file, aln_file)
2929
try:
3030
subprocess.run(
3131
[hmmbuild_cmd], shell = True,

fdog/libs/orthosearch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def hamstr(args):
4646
### (00) Parse input files
4747
hmm_file = '%s/%s/hmm_dir/%s.hmm' % (hmmpath, seqName, seqName)
4848
refspec_db = '%s/%s/%s' % (corepath, refspec, refspec)
49-
refspec_fa = '%s/%s/%s.fa' % (searchpath, refspec, refspec)
49+
refspec_fa = '%s/%s/%s.fa' % (corepath, refspec, refspec)
5050
search_fa = '%s/%s/%s.fa' % (searchpath, search_taxon, search_taxon)
5151
### (000) Adapt parameters
5252
if rbh == True:
@@ -260,7 +260,7 @@ def run_hamstr(args):
260260
hamstr_out = {**hamstr_out, **_}
261261

262262
### Get seed seq
263-
refspec_fa = '%s/%s/%s.fa' % (searchpath, refspec, refspec)
263+
refspec_fa = '%s/%s/%s.fa' % (corepath, refspec, refspec)
264264
refspec_seqs = fasta_fn.read_fasta(refspec_fa)
265265
seed_id_mod = '%s|%s|%s|1' % (seqName, refspec, seed_id)
266266
seed_seq = refspec_seqs.fetch(seed_id)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the Free Software Foundation, either version 3 of the License, or
1010
# (at your option) any later version.
1111
#
12-
# hamstr1s is distributed in the hope that it will be useful,
12+
# fdog is distributed in the hope that it will be useful,
1313
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
# GNU General Public License for more details.

0 commit comments

Comments
 (0)