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

Jason Stajich jason at cgt.duhs.duke.edu
Wed Nov 12 19:18:13 EST 2003


Are you SURE you're running the same script which giving that error - you
must be missing the write_blast() call in your code.

The problem seems to be whereever you are calling write_blast, you are
passing in $in (A Bio::SearchIO::blast object) NOT $result (A
Bio::Search::Result::ResultI object).


-jason

On Wed, 12 Nov 2003, Mehta, Perdeep wrote:

> 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
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list