Wednesday, June 17, 2009

PERL PROBLEM 6 ( EASY)

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

1 comment:

  1. use Bio::Perl;
    use 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";
    }

    ReplyDelete