Skip to content

Commit

Permalink
added threads option to blast
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed May 11, 2017
1 parent 8e9c7fd commit bf86523
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import shlex


BLAST_MODULE = 'biotools/ncbi-blast-2.3.0+'

BUILD_DB_CMD = 'makeblastdb -dbtype prot -in %s -out %s'
RUN_BLAST_CMD = 'blastp -query %s -db %s -out %s -outfmt 6'
RUN_BLAST_CMD = 'blastp -query %s -db %s -out %s -outfmt 6 -num_threads %d'


def read_blast_line(line):
Expand Down Expand Up @@ -86,10 +84,11 @@ def build(path, db):


@cli.command()
@click.option('--threads', default=1)
@click.argument('fasta', type=click.Path())
@click.argument('db')
@click.argument('output', type=click.Path())
def blast(fasta, db, output):
def blast(fasta, db, output, threads):
"""
Runs Blast.
Expand All @@ -100,7 +99,7 @@ def blast(fasta, db, output):

click.secho("Running BLASTP... ", fg='green', bold=True)

cmd = RUN_BLAST_CMD % (fasta, db, output)
cmd = RUN_BLAST_CMD % (fasta, db, output, threads)
click.echo("Executing command: %s" % cmd)
subprocess.call(shlex.split(cmd))

Expand Down

0 comments on commit bf86523

Please sign in to comment.