Skip to content

Commit

Permalink
Revamp on run_rpsblast
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Mar 27, 2020
1 parent 55430fd commit 4536919
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ def download_resources(database_directory):
annotated file with CDD IDs
'''
def run_rpsblast(fasta, output, cog, threads = '0', max_target_seqs = '1'):
bashCommand = 'rpsblast -query {} -db "{}" -out {} -outfmt 6 -num_threads {} -max_target_seqs {}'.format(
fasta, cog, output, threads, max_target_seqs)
open('command.bash', 'w').write(bashCommand + '\n') # subprocess was not handling well running this command, so an intermediate file is written with the command to run # TODO - check if this problem persists
print(bashCommand)
run_command('bash command.bash', print_command = False)
os.remove('command.bash')
bashCommand = ['rpsblast', '-query', fasta, '-db', cog, '-out', output,
'-outfmt', '6', '-num_threads', threads, '-max_target_seqs',
max_target_seqs]
print(' '.join(bashCommand))
subprocess.run(bashCommand)

'''
Input:
Expand Down

0 comments on commit 4536919

Please sign in to comment.