Hi everyone,
Here is this week's easy perl problem
Write a program which opens up a BLAST output file and spits out the name of the query sequence, the top hit, and how many hits there were.
Thankyou
Teja
Subscribe to:
Post Comments (Atom)
check out my blog to find weekly problems in perl and new bioinformatics posts
use Bio::Perl;
ReplyDeleteuse Bio::SearchIO;
$filename='input/adk_.blast.0';
my $searchio=new Bio::SearchIO(-format=>'blast',-file=>$filename);
while(my $result=$searchio->next_result()){
my $topHit=$result->next_hit->name;
my $numHits=$result->num_hits;
print $result->query_name."\n";
print " Top result: $topHit\n";
print " Num hits: $numHits\n";
}