[Bioperl-l] BioPerl Parsing problems

David García Cortés davidg at lsi.upc.edu
Tue Dec 28 11:59:51 EST 2004


I'm trying to parse the results of a blast query, using BPLite. The problem is: I can't access the evalue of a HSP. For accessing the score, there are no problems: I only have to access the HSP's field "score. But... what with evalue? If I do the same using "evalue", there's an error: it can't find that field on the HSP.

Here you can see the main part of the code:

$factory = Bio::Tools::Run::StandAloneBlast->new(@pars); 
my $blst_rprt = $factory->blastall($seq);
my $exists_results = parse_blast($blst_rprt);

And the function parse_blast is this:

sub parse_blast {
my $blast_report = shift;

 while (my $result = $blast_report->nextSbjct) {
   while ( my $hsp = $result->nextHSP ) 
   my $score    = $hsp->score;
   my $evalue    = $hsp->evalue;


A different problem (although closely related with the one above) i'd like to ask is this:
I thought that maybe it'd be better to use SearchIO for the parsing, but then the problem is that when creating a SearchIO variable, you have to pass the name of the file where the blast result to parse is. But as you can see in the code, my blast result is in the variable $blst_rprt (or $blast_report), not in a file. So should I write the content of the $blast_report variable into a file, and pass this file to SearchIO? I don't like this solution; i would be grateful if you could give me an alternative one.

Thank you in advance.

David García Cortés
Instituto Nacional de Bioinformática (INB)
Nodo Computacional GNHC-2 UPC-CIRI
c/. Jordi Girona 1-3              
Modul C6-E201                   Tel.  : 934 011 650
E-08034 Barcelona              Fax   : 934 017 014
Catalunya (Spain)                e-mail: davidg at lsi.upc.edu

More information about the Bioperl-l mailing list