[Bioperl-l] bitscore and rawscore for blast reports
Jason Stajich
jason.stajich at duke.edu
Wed Dec 15 16:42:14 EST 2004
On Dec 15, 2004, at 4:20 PM, Razi Khaja wrote:
> Sorry for my previous incomplete posting ...
>
> Im am parsing BLASTN reports using the Bio::SearchIO system, and have
> run
> into some problems in obtaining bit score and raw score data.
>
> I need to be able to get the bit score and raw score for *each* of the
> hsps, but HSPI provides no methods to get this data.
>
uh, yes it does.
$hsp->bits
$hsp->score
Try the SearchIO HOWTO as Marc said.
> The HitI object provides methods raw_score() and bits() to get this
> data,
> however these only return the raw score and bit score of the
> first/best hsp
> in the blast report. I need this data not only for the first/best hsp
> but
> for each of them.
>
or sometimes it is a summary score not the best score depending on how
you have run WU-BLAST.
> Any input would be appreciated.
> Thanks
> Razi
>
>
> ==== Partial BLAST Report =====
>> chrX
> Length = 153692391
>
> Score = 682 bits (344), Expect = 0.0
> Identities = 354/356 (99%), Gaps = 1/356 (0%)
> Strand = Plus / Minus
>
>
>
> Query: 17 aaaatga ...
> |||||||
> Sbjct: 107395915 aaaaaga ...
>
>
> .
> .
> .
>
> Score = 172 bits (87), Expect = 2e-40
> Identities = 120/131 (91%)
> Strand = Plus / Minus
>
>
>
> Query: 490 ctctctctctctctct ...
> ||||||||||||||||
> Sbjct: 52902264 ctctctctctctctct ...
>
> ===== Code Snippet =====
> #!/usr/bin/perl
> use strict;
> use Bio::SearchIO;
> my( $blastFile ) = @ARGV;
> my $searchio = new Bio::SearchIO( -file=>$blastFile, -format=>'blast'
> );
> while( my $result = $searchio->next_result() ){
> while( my $hit = $result->next_hit() ) {
> while( my $hsp = $hit->next_hsp() ) {
> # Want to collect bit score and raw score data here
print $hsp->bits, " ", $hsp->score, "\n"; # for each HSP
> }
> }
> }
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/
More information about the Bioperl-l
mailing list