[Bioperl-l] blastxml to table

Chris Fields cjfields at illinois.edu
Tue Jun 1 21:47:48 UTC 2010


That's a bug; it appears the iteration method is being called w/o checking whether the specific Hit class has implemented it.  Can you report this?  I can't get to it (going out of town until Friday).

chris

On Jun 1, 2010, at 3:23 PM, Robson de Souza wrote:

> Hello!
> 
> I'm trying to convert BLAST XML output to a BLAST table which should
> be identical to a BLAST output generated using "-m 8".
> In the script below, if $type is "BLAST", the script works if $writer
> is TextResultWriter but when I try to generate BLAST compatible (i.e.
> like "-m 8") tables using $writer = "HSPTableWriter" it fails with the
> message
> 
> Using default column map.
> 
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Trouble in ResultTableWriter::_set_row_data_func() eval: Can't
> locate object method "iteration" via package
> "Bio::Search::Hit::GenericHit" at (eval 58) line 1, <GEN50> line 3020.
> 
> STACK: Error::throw
> STACK: Bio::Root::Root::throw
> /panfs/pan1/proteinworld/tools/perl/lib/site_perl/5.8.8/Bio/Root/Root.pm:368
> STACK: try{} block
> /panfs/pan1/proteinworld/tools/perl/lib/site_perl/5.8.8/Bio/SearchIO/Writer/ResultTableWriter.pm:339
> STACK: Bio::SearchIO::Writer::HSPTableWriter::to_string
> /panfs/pan1/proteinworld/tools/perl/lib/site_perl/5.8.8/Bio/SearchIO/Writer/HSPTableWriter.pm:263
> STACK: Bio::SearchIO::write_result
> /panfs/pan1/proteinworld/tools/perl/lib/site_perl/5.8.8/Bio/SearchIO.pm:344
> STACK: /home/desouza/projects/mytools/bin/blastxml2blast:22
> -----------------------------------------------------------
> 
> Is there a way to fix this? Or should I use another approach to get
> "-m 8" compatible tables?
> Thanks,
> Robson
> 
> #!/usr/bin/env perl
> #====================
> 
> use strict;
> use warnings;
> use Bio::SearchIO;
> use Getopt::Long;
> 
> my $writer = "TextResultWriter";
> my $type = "PSIBLAST";
> GetOptions("w=s"=>\$writer,
>                 "t=s" => \$type);
> 
> # Load writer
> use Module::Load;
> my $writer = "Bio::SearchIO::Writer::".$writer;
> load $writer;
> $writer = $writer->new();
> 
> # Open and convert input
> my $out = Bio::SearchIO->new(-writer => $writer);
> foreach my $file (@ARGV) {
>   my $in = Bio::SearchIO->new(-format => "blastxml",
> 				-file   => "<$file");
>   $in->blasttype($type);
>   while( my $r = $in->next_result) {
> 	$out->write_result($r);
>   }
> }
> 
> exit 0;
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list