[Bioperl-l] Fw: about the remote blast problem

Wiepert, Mathieu Wiepert.Mathieu at mayo.edu
Thu Feb 13 08:56:32 EST 2003


Hi,

Are you up to date with all the latest builds of bioperl (at least 1.2)

I tried out your code, had to slightly modify it (no proxy for me, and used a protein sequence from amino.fa file, from the test directory).

I invoked like 
~/code $ perl -I /home/mxw02/bioperl_latest/lib/site_perl/5.6.1 magicfang.pl amino.fa test.out

And test.out ended up containing the blast output from the second blast (amino.fa has two sequences)

Can you tell me more about the exception you are getting?

-Mat

-----Original Message-----
From: Magic Fang [mailto:fangl at genomics.org.cn]
Sent: Wednesday, February 12, 2003 6:48 PM
To: bioperl-l at bioperl.org
Subject: [Bioperl-l] Fw: about the remote blast problem


Why Bio::Tools::Run::RemoteBlast throw a can not invoke save_output
exception. my codes are:
#!/usr/bin/perl
#Remote-blast "factory object" creation and blast-parameter initialization
use Bio::Tools::Run::RemoteBlast;
use strict;
my $prog = 'blastn';
my $db   = 'nr';
my $e_val= '1e-10';
my @params = ( '-prog' => $prog,'-data' => $db,'-expect' =>
$e_val,'-readmethod' => 'SearchIO');
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
my $proxy=$factory->proxy(['http','ftp'], 'http://192.168.4.7:80');
#change a paramter
$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens
[ORGN]';
#remove a parameter
delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'};
my $v = 0;
#$v is just to turn on and off the messages
my $str = Bio::SeqIO->new(-file=>$ARGV[0] , '-format' => 'fasta' );
while (my $input = $str->next_seq()){
 #Blast a sequence against a database:
 #Alternatively, you could  pass in a file with many
 #sequences rather than loop through sequence one at a time
 #Remove the loop starting 'while (my $input = $str->next_seq())'
 #and swap the two lines below for an example of that.
 my $r = $factory->submit_blast($input);
 #my $r = $factory->submit_blast('amino.fa');
 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 5;
   } else {
    my $result = $rc->next_result();
    #save the output
    my $filename = $ARGV[1];
    $factory->save_output($filename);
    $factory->remove_rid($rid);
    print "\nQuery Name: ",
    $result->query_name(), "\n";
    while ( my $hit = $result->next_hit ) {
     next unless ( $v > 0);
     print "\thit name is ", $hit->name, "\n";
     while( my $hsp = $hit->next_hsp ) {
      print "\t\tscore is ", $hsp->score, "\n";
     }
    }
   }
  }
 }
}
# This example shows how to change a CGI parameter:
$Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'BLOSUM25';
# And this is how to delete a CGI parameter:
delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'};

_______________________________________________
Bioperl-l mailing list
Bioperl-l at bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-l


More information about the Bioperl-l mailing list