[Bioperl-l] parsing blast XML reports with Bio::SearchIO

Chris Fields cjfields at illinois.edu
Thu Aug 13 22:08:37 UTC 2009


You should update to bioperl 1.6; I believe I fixed this issue after  
the 1.5.2 release.

chris

On Aug 13, 2009, at 2:41 PM, Jonathan Flowers wrote:

> Hi,
>
> I am trying to parse BLAST reports written in XML using  
> Bio::SearchIO. When
> running the following code on a set of reports (multiple query  
> results in a
> single file), I only get one ResultI object.  I tried running the  
> same code
> on a file in 'blast' format and obtained the expected results (ie one
> ResultI object for each query), suggesting that the issue is with  
> blastxml.
> I found an old thread on this listserv where someone had had a similar
> problem, but could not find how it was resolved.
>
> I am using Bioperl 1.5.2 and the XML reports were generated using  
> blastall
> with the -m7 option.
>
> my $in = new Bio::SearchIO(-format => 'blastxml',  -file   =>
> 'blastreport.xml' );
> while( my $result = $in->next_result ) {
>            print $result->query_name,"\n";
>      while( my $hit = $result->next_hit ) {
>              while( my $hsp = $hit->next_hsp ) {
>                     #do something with hsp
>              }
>      }
> }
>
> Thanks
>
> Jonathan
> _______________________________________________
> 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