[Bioperl-l] While loop - SearchIO for BioPerl

Mark A. Jensen maj at fortinbras.us
Wed Jul 8 21:00:19 EDT 2009


My guess would be you have multiple query sequences (27, to be exact)
that hit the same subject, viz. 12277
MAJ

----- Original Message ----- 
From: "Rytsareva, Inna (I)" <IRytsareva at dow.com>
To: <bioperl-l at lists.open-bio.org>
Sent: Wednesday, July 08, 2009 3:42 PM
Subject: [Bioperl-l] While loop - SearchIO for BioPerl


> Hello,
> 
> I have a follow script to parse the BLAST  report:
> 
> my $in = Bio::SearchIO->new (  -file =>$out_file,
> -format =>'blast') or die $!;
> 
> while (my $result = $in->next_result) {
> while (my $hit = $result->next_hit)
> {
> while (my $hsp = $hit->next_hsp) {
> $qhit = $hit->name;
> $start = $hsp->hit->start;
> $end = $hsp->hit->end;
> }
> 
> 
> } print "Hit= ", $qhit,
> ",Start = ", $start,
> ",End = ", $end,"\n"; 
> }
> 
> Usually, the report has a number of the same hsp for each hit.
> Using "print" command it gives me a hit name, start and end positions
> for each hit, except last on. For last one it prints all the hsps.
> Something like this:
> 
> Hit= gnl|DAS|22386,Start = 7578,End = 7601
> Hit= gnl|DAS|25627,Start = 2824,End = 2863
> Hit= gnl|DAS|25328,Start = 8864,End = 8887
> Hit= gnl|DAS|4890,Start = 1896,End = 1919
> Hit= gnl|DAS|12191,Start = 1898,End = 1921
> Hit= gnl|DAS|4276,Start = 557,End = 580
> Hit= gnl|DAS|12959,Start = 801,End = 824
> Hit= gnl|DAS|4092,Start = 2266,End = 2304
> Hit= gnl|DAS|19740,Start = 13572,End = 13610
> Hit= gnl|DAS|12393,Start = 3901,End = 3924
> Hit= gnl|DAS|25687,Start = 10415,End = 10438
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> Hit= gnl|DAS|12277,Start = 7410,End = 7433
> 
> Where Hit= gnl|DAS|12277,Start = 7410,End = 7433 is the last one.
> I don't need these duplicates.
> How can I fix that?
> 
> Thanks,
> Inna Rytsareva
> Discovery Information Management
> Dow AgroSciences
> Indianapolis, IN 
> 317-337-4716
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
>


More information about the Bioperl-l mailing list