Hi,
I have a question regards of how Bio::SearchIO calculate the percent identity in an alignment. I have this tabular output (called blasttest2 and its just a minimal fraction of a very large output) from a local blast generated with outfmt 6 option:
A B 44.00 150 76 4 1852 1994 673 821 1e-25 116
A B 44.34 557 235 21 1082 1600 46 565 7e-126 427
A C 56.77 155 58 3 1451 1600 1719 1869 5e-48 191
A C 65.85 82 25 2 1913 1991 2126 2207 8e-26 118
When I use the following code to print the output using Bio::SearchIO, the percent identity obtained are different from the original output. Im missing something on the code?
#!use/bin/perl
use strict;
use warnings;
use Bio::SearchIO;
use Bio::SeqIO;
my $blastin = Bio::SearchIO->new(
-file => "blasttest2",
-format => 'blasttable'
);
while ( my $result = $blastin->next_result ) {
while ( my $hit = $result->next_hit ) {
while ( my $hsp = $hit->next_hsp ) {
print "Query=", $result->query_name,"\tHit=",
$hit->name,"\tpident=",$hsp->percent_identity,"\n";
}
}
}
The output for this is:
Query=MDOMV2T00051 Hit=Phy000TMB5_AEDAE pident=46.6666666666667
Query=MDOMV2T00051 Hit=Phy000TMB5_AEDAE pident=54.0394973070018
Query=MDOMV2T00051 Hit=Phy003Y4FA_AEDAE pident=60.6451612903226
Query=MDOMV2T00051 Hit=Phy003Y4FA_AEDAE pident=67.0731707317073
Thanks for the help.
Ok, got the point.
Thanks very much!