Run-blast.pl

From Bioinformatikpedia
Revision as of 23:26, 5 May 2013 by Weish (talk | contribs) (Created page with "This script was used for performing blast search. == Source == <source lang="perl"> #!/usr/bin/perl -w # File: run-blast.pl # Description: # run blast for given query sequence …")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This script was used for performing blast search.

Source

<source lang="perl">

  1. !/usr/bin/perl -w
  2. File: run-blast.pl
  3. Description:
  4. run blast for given query sequence over big_80 database
  5. result will be printed out
  6. Usage:
  7. run-blast.pl query.fasta [blastp|psiblast]

use strict;

use constant DATABASE => '/mnt/project/pracstrucfunc13/data/big/big_80';

my ($query, $program, $output_type) = ($ARGV[0], undef, undef);

  1. parse command line

while ( (my $param = shift @ARGV) ) { if ($param eq '-p') { $program = shift @ARGV; next; }

if ($param eq '-m') { $output_type = shift; next; } } !$program && ($program = 'blastp');

  1. TSV output format, without alignment strings

!defined($output_type) && ($output_type = 9);

  1. warn "Query:\t$query\n";
  2. warn "Program:\t$program\n";
  3. warn "Output:\t$output_type\n";
  1. call blastall with given parameters. -b 200000 means maximal number of database
  2. sequence to be shown

if ($query && -f $query) { exec "blastall -p $program -d ".DATABASE." -i $query -m $output_type -b 200000"; } else { #query file is missing, print warning message and show help info warn "Error: Query file is missing!\n"; warn "Run blast for given query file against big_80 protein sequence database Usage: run-blast <query.fasta> -p [blastp|psiblast] -m [0-11] Parameters: -p Program to be used for blast (blastp or psiblast) -m Output format (0 - 11, default is 9). Please consult manual for blastall for details.\n"; exit 1; }

__END__

=head1 run-blast.pl

Run blast for given query file against big_80 protein sequence database

=head2 Usage

run-blast <query.fasta> -p [blastp|psiblast] -m [0-11]

=head2 Parameters

=over 4

=item -p Program to be used for blast (blastp or psiblast)

=item -m Output format (0 - 11, default is 9). Please consult manual for blastall for details.

=back </source>