[Bioperl-l] getting top blast hit

Sean Davis sdavis2 at mail.nih.gov
Tue Mar 30 18:41:19 EST 2004


Nandita,

You can do something like (from Bio::SearchIO):

   use Bio::SearchIO;
   # format can be 'fasta', 'blast', 'exonerate', ...
   my $searchio = new Bio::SearchIO( -format => 'blastxml',
                                     -file   => 'blastout.xml' );
   while ( my $result = $searchio->next_result() ) {
       #get first hit and do something with it.
       my $top_hit = $result->next_hit;
       #do some stuff such as saving a it in a hash
       #move on to next result (next query)
   }

Sean

On 3/30/04 6:19 PM, "Nandita Mullapudi" <nandita at uga.edu> wrote:

> I am currently using  Bio::SearchIO to parse tons of blast files by
> setting limits on E- value, % identity etc. I now want to parse a
> huge blast job, by getting just the top hit out of each file.
> (Assuming blast was run and hits were returned with hit with lowest E
> value first)
> Is there a quick way to do this?
> thanks,
> -Nandita
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list