[Bioperl-l] HitTableWriter.pm and HSPTableWriter.pm

Linda Sperling sperling@cgm.cnrs-gif.fr
Sun, 3 Nov 2002 12:27:05 +0100


Hello,

I have a problem (maybe a bug?), but I could not find it in the bug 
reports.

Bioperl 1.0

I want to use HSPTableWriter.pm to parse blast results.

ResultTableWriter works as it should with the code appended below if     
s/HSP/Result/g

however, both HitTableWriter and HSPTableWriter give me this at run time:

Can't locate object method "hits" via package 
"Bio::Search::Result::GenericResult" at 
/Library/Perl/Bio/SearchIO/Writer/HitTableWriter.pm line 252, <GEN1> 
line 20396.

Can't locate object method "hits" via package 
"Bio::Search::Result::GenericResult" at 
/Library/Perl/Bio/SearchIO/Writer/HSPTableWriter.pm line 237, <GEN1> 
line 20396.

I am just trying to run the default code in the perldoc of each module 
to test things :

(Actually, I changed the code since it also couldn't find report_count!)

What's wrong?


Here is my poor little script:
== script
#!/usr/bin/perl

#
# bpwriter.pl uses HSPTableWriter bioperl module to parse blast output
#

use Bio::SearchIO;
use Bio::SearchIO::Writer::HSPTableWriter;

my $blast_report = shift || die "Usage: bpwriter.pl blast_report_file\n";

my $in = Bio::SearchIO->new( -format => 'blast', -file => 
$blast_report );

my $writer = Bio::SearchIO::Writer::HSPTableWriter->new();

$blast_report .= ".tbl";

my $out = Bio::SearchIO->new( -writer => $writer,
                               -file   => ">$blast_report" );

while ( my $result = $in->next_result() ) {
         $out->write_result($result);
#      $out->write_result($result, ($in->report_count - 1 ? 0 : 1) );
}

== end of script

Thankyou for any help you can provide, or for reporting the bug if there 
is one.


Linda Sperling
Centre de Génétique Moléculaire
CNRS
91198 Gif-sur-Yvette

tel +33 (0)1 69 82 32 09
fax +33 (0)1 69 82 31 50
sperling@cgm.cnrs-gif.fr
http://paramecium.cgm.cnrs-gif.fr