1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
use Bio::SearchIO;
use strict;
my $searchio=new Bio::SearchIO(-format =>'blastxml',-file =>'mon_blast.xml');
my $result;
my $hit;
my $query;
my $length;
my $description;
my $database_name;
my $algorithm_type;
while( $result = $searchio->next_result() )
{
$query=$result->query_name;
$database_name=$result->database_name;
$algorithm_type=$result->algorithm;
while (my $hit=$result->next_hit())
{
$length=$result->query_length;
my $accession=$hit->accession;
my $score=$hit->score;
$description=$hit->description;
print $description."\n";
while (my $hsp=$hit->next_hsp())
{
my $start_hit=$hsp->start('hit');
my $end_hit=$hsp->end('hit');
print "$database_name\t$algorithm_type\t$query\t$accession\t$start_hit\t",
$hsp->percent_identity,"\t",$hsp->length('total'),"\t$end_hit\t$length\t$description\t
$score\t",$hsp->evalue,"\n\n\n";
}
}
} |
Partager