[Bioperl-l] Bio::Tools::Run::StandAloneBlast

Mehta, Perdeep Perdeep.Mehta at stjude.org
Wed Nov 12 18:40:42 EST 2003


Hi,

I'm struggling to find the reason why my following test code to parse Blast output is not functioning. Just beginning to learn Bioperl and couldn't figure out what's missing.

#!/usr/bin/perl -w
#
use strict;

use Bio::Perl;
use Bio::Tools::Run::StandAloneBlast;
use Bio::SearchIO;

  # this script will only work with an internet connection
  # on the computer it is run on

  # Get the protein sequence
   my $seq_object = get_sequence('swissprot',"ROA1_HUMAN");

  # Set database to search against
   my $DB = "/refseqdb/complete/rs_rel2";

  # Create factory for stand alone Blast and search
   my @params = ('program'  => 'blastp','database' => $DB);
   my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
   my $blast_result = $factory->blastall($seq_object);

  # Parse Blast results
   my $in = new Bio::SearchIO(-format => 'blast',
                              -file   => $blast_result);
   while( my $result = $in->next_result ) {
      while( my $hit = $result->next_hit ) {
        while( my $hsp = $hit->next_hsp ) {
          if( $hsp->length('total') > 100 ) {
            if ( $hsp->percent_identity >= 75 ) {
                print "Hit= ",        $hit->name,
                      ",Length=",     $hsp->length('total'),
                      ",Percent_id=", $hsp->percent_identity, "\n";
           }
          }
        }
      }
   }

exit;

Blastall runs fine though. Error appears to be Blast result parsing related. Here is the error message that I get;
>test.pl
Can't locate object method "algorithm" via package "Bio::SearchIO::blast" (perhaps you for
got to load "Bio::SearchIO::blast"?) at /usr/local/lib/perl5/site_perl/5.6.1/Bio/SearchIO/
Writer/TextResultWriter.pm line 146, <STREAM> line 197.

Thank you in advance for any help.
perdeep

Perdeep K. Mehta, PhD
Hartwell Center for Bioinformatics & Biotechnology
St. Jude Children's Research Hospital
Memphis, TN 38105-2794
Tel: 901-495 3774
http://www.hartwellcenter.org





More information about the Bioperl-l mailing list