diff --git a/detector.py b/detector.py index 349f7a7..86be950 100644 --- a/detector.py +++ b/detector.py @@ -10,6 +10,7 @@ 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' @click.group() @@ -71,18 +72,31 @@ def build(path, db): @cli.command() -@click.argument('db', type=click.Path()) +@click.argument('fasta', type=click.Path()) +@click.argument('db') @click.argument('output', type=click.Path()) -def blast(db, output): +def blast(fasta, db, output): """ Runs Blast + + usage: detector blast FASTA DB OUTPUT + + Blasts (blastp) the file defined by FASTA against a database DB and stores the output in OUTPUT """ - pass + + click.secho("Running BLASTP... ", fg='green', bold=True) + + cmd = BUILD_DB_CMD % (fasta, db, output) + click.echo("Executing command: %s" % cmd) + subprocess.call(shlex.split(cmd)) + + # done + click.secho("All done!", fg='green', bold=True) @cli.command() @click.argument('input', type=click.Path()) -def analyze(intput): +def analyze(input): """ Analyzes blast output """