[Bioperl-l] Sort blast file result according to evalues

Sendu Bala bix at sendu.me.uk
Fri Oct 6 15:27:14 UTC 2006


Chris Fields wrote:
> The evalue for the hit is retrieved by the BlastHit::signifiance()  
> method, if I remember correctly.  So if $hit is a  
> Bio::Search::Hit::BlastHit object, you use $hit->significance.  If  
> you want individual HSP evalues, you would use $hsp->evalue for the  
> individual HSP objects.
> 
> The output is normally sorted by the order they appear in the  
> alignments and table, which is typically by increasing evalue or  
> decreasing bits (score).  So they are already sorted.

Concur.


> If you wanted to run a sort yourself you could use a sort block using
> '{$a->significance() <=> $b->significance()} @hits'

Actually, it is best to use the sort_hits() method of the result object 
prior to asking for any hits. (As this allows for potential optimization 
in the parser.)

->significance is still the thing you need to sort on though.



More information about the Bioperl-l mailing list