[Bioperl-l] BLASTing with a seqio/seq object...

Sendu Bala bix at sendu.me.uk
Fri Dec 1 09:00:18 UTC 2006


Samantha Thompson wrote:

You missed a step...


> use strict;
> use Bio::Perl;
> use Bio::Seq;
> use Bio::SeqIO;
> 
> use Bio::Tools::Run::RemoteBlast;
> use Bio::SearchIO;
> 
> #seq bit
> 
> #$seq_obj = Bio::Seq->new(-format => 'fasta');
> 
> my $seqio_obj = Bio::SeqIO->new(-file => 
> "/biol/people/mres/st537/MalEfasta.txt", -format => 'fasta');
> 
> my $seq_obj = $seqio_obj->next_seq;
> 
> 
> 
> #blast bit
> 
> my $remote_blast = Bio::Tools::Run::RemoteBlast->new (
>          -prog => 'blastp', -db => 'nr', -expect => '1e-15' );
> 
> my $blast_report = $remote_blast->submit_blast($seq_obj);

Go back to the Bptutorial:
http://www.bioperl.org/wiki/Bptutorial.pl#Running_BLAST_.28using_RemoteBlast.pm.29

And you'll see that submit_blast doesn't return a SearchIO object.

For a complete working example see the synopsis for RemoteBlast:
http://doc.bioperl.org/bioperl-live/Bio/Tools/Run/RemoteBlast.html


> #new part for SearchIO...
> 
> while( my $result = $blast_report->next_result ) {
>   while( my $hit = $result->next_hit ) {
>    while( my $hsp = $hit->next_hsp ) {
>     if( $hsp->length('total') > 100 ) {
>      if ( $hsp->percent_identity >= 75 ) {
>       print "Hit= ",       $hit->name,
>             ",Length=",     $hsp->length('total'),
>             ",Percent_id=", $hsp->percent_identity, "\n";
>      }
>     }
>    } 
>   }
> }



More information about the Bioperl-l mailing list