[Bioperl-l] Using Bio::SearchIO was: StandAloneBlast returning Bio::SearchIO::blast

Jason Stajich jason at cgt.mc.duke.edu
Fri Feb 14 08:29:39 EST 2003


A $report is a Bio::SearchIO object, write_result wants a result
Bio::Search::Result::ResultI object.

You want to do
while( my $result = $report->next_result ) {
 $writer->write_result($result);
}
On Fri, 14 Feb 2003, Dan Kortschak wrote:

> OK I think I'm getting there, however using the lines below (essentially)
> I get the follwoing errors back and no HTML:
>
> Can't locate object method "algorithm" via package "Bio::SearchIO::blast" (perhaps you forgot to load "Bio::SearchIO::blast"?) at
> /usr/local/share/perl/5.6.1/Bio/SearchIO/Writer/TextResultWriter.pm line 146.
> 	(in cleanup) Can't use string ("STDOUT") as a symbol ref while "strict refs" in use at
> /usr/local/share/perl/5.6.1/Bio/Root/IO.pm line 391.
>
> I have looked through Bio::SearchIO::blast and find no method `algorith'
> so I'm not sure where to go from there and secondly (probably more dimly)
> I'm trying to output to STOUT since this script is trying to be part of a
> web based blast server.
>
> The output section of the script:
>
> my $output=new Bio::SearchIO(-output_format=>'blast',-fh=>STDOUT);
>
> my $report=$blastfactory->blastall(@query);
> $output->write_result($report);
>
>
> thanks for your help
> Dan
>
> On Thu, 13 Feb 2003, Ewan Birney wrote:
>
> >
> > Got it:
> >
> >     my $output = Bio::SearchIO->new( -output_format => 'blast', -file =>
> > $filename);
> >
> >     $output->write_result($blast);
> >
> >
> > s/blast/html/ in the output_format, and voila... html
>
>

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


More information about the Bioperl-l mailing list