[Bioperl-l] HTMLResultWriter

Lorenzo Carretero-Paulet lpaulet at ual.es
Mon Jan 25 15:25:55 EST 2010


Hi all,

I'm trying to generate a subroutine that performs a BLAST search and 
returns the corresponding reports in txt, xml and html format. I´m 
experiencing problems with the latter, as the program returns the 
following error message:

"Can't call method "next_result" without a package or object reference 
at..."

sub blasting    {
my ($query, $E_value) = @_;
my ($outputfilenameB, $outputfilenameX, $outputfilenameH);
$outputfilenameB=$query.".BLAST.txt";
$outputfilenameX=$query.".BLAST.xml";
$outputfilenameH=$query.".BLAST.html";
#legacy_blast.pl blastall -i query -d nr -o blast.out --path /opt/blast/bin
print qx(du -s /tmp);
my _$blast_report _=qx/$blast -p blastp -d $database -i $query -e 
$E_value -b 20000 -o $outputfilenameB/;
my $XMLblast_report =qx/$blast -p blastp -d $database -i $query -e 
$E_value -m 7 -b 20000 -o $outputfilenameX/;

my $writerhtml = new Bio::SearchIO::Writer::HTMLResultWriter();
my $outhtml = new Bio::SearchIO(-writer => $writerhtml,
                                 -file   => ">$outputfilenameH");
while( my $result = _$blast_report_->next_result ) { # get a result from 
Bio::SearchIO parsing or build it up in memory
$outhtml->write_result($result);
}
}

Can anyone  see where the problem is?
Cheers!
Lorenzo


More information about the Bioperl-l mailing list