[Bioperl-l] Problem with remote BLAST

Dr. med. Peter Robinson peter.robinson at charite.de
Tue Jan 10 05:15:25 EST 2006


Dear BioPerl,

I am having difficulties with the BioPerl scripts for remote BLASTing.
Using an adaptation of one of the example scripts, an error occurs. I have
seen various mails reporting similar problems from 2002-2003, but I was
not able to find a solution to the problem. Any help greatly appreciated!

The stack trace and the code are below. I am using BioPerl 1.5 on a
up-to-date debian linux system.

Thanks, Peter


[Tue Jan 10 11:02:12 2006] longestORF.pl:
[Tue Jan 10 11:02:12 2006] longestORF.pl: ------------- EXCEPTION 
-------------
[Tue Jan 10 11:02:12 2006] longestORF.pl: MSG: no data for midline Query 
246   CTGCTAGTTTGTTGTGATATAGGTAAGAATTTTGC-TTTAAAGTGTGGTATTATTACTTT  304
[Tue Jan 10 11:02:12 2006] longestORF.pl: STACK
Bio::SearchIO::blast::next_result
/usr/local/share/perl/5.8.4/Bio/SearchIO/blast.pm:1151
[Tue Jan 10 11:02:12 2006] longestORF.pl: STACK main::remoteBLAST
longestORF.pl:81
[Tue Jan 10 11:02:12 2006] longestORF.pl: STACK toplevel longestORF.pl:28
[Tue Jan 10 11:02:12 2006] longestORF.pl:
[Tue Jan 10 11:02:12 2006] longestORF.pl:
--------------------------------------


The function is:


##
## 2) Call this function to print out results of remote
##    BLAST. For instance, can be set into a <pre> element
##    in an HTML page.

sub remoteBLAST
  {
    my $input = $_[0];  # a BioPerl Seq object
    my $fh    = $_[1];  # a file handle
    my $v = 1;          #  'verbose';
    my $prog = 'blastn';
    my $db   = 'nr';
    my $e_val= '1e-2';

    my @params = ( -prog => $prog,
		   -data => $db,
		   -expect => $e_val,
		   -readmethod => 'SearchIO',
		   -report_type => 'blastn',
		   -m => '3');

    my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
    my $r = $factory->submit_blast($input);
    print $fh $r->table();

    print STDERR "waiting..." if( $v > 0 );

    while ( my @rids = $factory->each_rid ) {
      foreach my $rid ( @rids ) {
	my $rc = $factory->retrieve_blast($rid);
	if( !ref($rc) ) {
	  if( $rc < 0 ) {
	    $factory->remove_rid($rid);
	  }
	  print STDERR "." if ( $v > 0 );
	  sleep 10;
	} else {
	  my $result = $rc->next_result();

	  $factory->remove_rid($rid);
	  print $fh "\nQuery: ", $result->query_name(), "\t",
	  $result->query_description(),"\n";
	  while ( my $hit = $result->next_hit ) {

	    print $fh "\thit:", $hit->name, "\t",
	      $hit->accession(), "\t", $hit->description(),"\t";

	    while( my $hsp = $hit->next_hsp ) {
	      print $fh "\te-val is ", $hsp->evalue, "\n";
	      last;  ## Just print most significant e value
	    }
	  }
	}
      }
    }
  }





More information about the Bioperl-l mailing list