[Bioperl-l] Please help: upgraded to 1.2.3 and interfaces changed

Jason Stajich jason at cgt.duhs.duke.edu
Thu Dec 11 09:42:03 EST 2003


On Wed, 10 Dec 2003, David Trusty wrote:

> Hi,
>
> I am maintaining some code which uses Bioperl.  I had to upgrade our Bioperl
> version,
> and now the code which uses the Bioperl functions is not working.
>
> Here is a piece of code which is no longer working:
>        my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
>     my $blast_report = $factory->blastall($seqA);
>
>     print ERROR_LOG "BLAST HITS TABLE\n\n";
>     print ERROR_LOG $blast_report->table_labels_tiled();
>     print ERROR_LOG $blast_report->table_tiled;
>

This is particularly old stuff as it used Bio::Tools::Blast which has been
deprecated since 1.0.x I believe.

> I get this error:
>    Can't locate object method "table_labels_tiled" via package
> "Bio::SearchIO::blast" at exon.cgi line 511.
>
> And for this code
>
>     foreach $hit ($blast_report->hits) {
>
> I get this error:
>     Can't locate object method "hits" via package "Bio::SearchIO::blast" at
> exon.cgi line 534.
>
> Is there a replacement for table_labels_tiled?
>

You need to use Bio::SearchIO::Writer::HitTableWriter

> I think I need to ask the factory to give me a
> Bio::Search::Result::BlastResult object, and then a
> Bio::Search::Hit::BlastHit.  Do you agree?
>
> I've been looking for an example, but can't seem to find one.  How can I
> change the code to get a Bio::Search::Result::BlastResult and then a
> Bio::Search::Hit::BlastHit object?

while( my $r = $blast_report->next_result ) {
  # $r is a Result object
  while( my $hit = $r->next_hit ) {
   # $hit is a Hit object
  }
  # or if you prefer
#  for my $hit ( $r->hits ) {
#  }
}

I don't know what the table_labels_tiled looks like exactly but
if you look at Bio::SearchIO::Writer::HitTableWriter and
Bio::SearchIO::Writer::ResultTableWriter
there is a starting point.

you can also look at scripts/searchio and see a bunch of useable scripts -
I think some of the examples directory got rearranged after the 1.2.x
branch so a lot of things are in the scripts directory that are (post-1.2
branch) now in the examples directory.

>
> The web site mentions examples in a directory called examples/search-blast,
> but I can't find it.
> Is there an example I can look at?


>
> Thanks,
>
> David
>
> _________________________________________________________________
> Take advantage of our best MSN Dial-up offer of the year — six months
> @$9.95/month. Sign up now! http://join.msn.com/?page=dept/dialup
>
> _______________________________________________
> 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