Skip to content

Commit

Permalink
implemented blast
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed May 10, 2017
1 parent 15be96e commit 3ac173d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
"""
Expand Down

0 comments on commit 3ac173d

Please sign in to comment.