diff --git a/detector.py b/detector.py index f67d2b2..c95d25a 100644 --- a/detector.py +++ b/detector.py @@ -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): @@ -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. @@ -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))