R
Rita
Hi All,
I am making 1 subroutine and it is working too but it doesn't giving me
all the values just giving me first value .
my subroutinr is-
sub Sequence {
my ($filename1)=@_;
my $in2 = Bio::SearchIO ->new(-format => 'blast',
-file => $filename1);
while( my $result2 = $in2->next_result){
while(my $hit2 = $result2->next_hit ){
while(my $hsp2 = $hit2->next_hsp){
#Print Sequence 1Name and Start of End Point where it is matching:
my $query2= $result2->query_name;
print "QUERY = $query2\t\t";
my ($query_beg1, $query_end1) = $hsp2->range('query');
print "(Start,End)=($query_beg1,$query_end1)\n";
#Print Sequence2 Name and Start of End Point where it is matching:
my $hit_name2= $hit2->name;
print "Hit =$hit_name2\t\t ";
my ($hit_beg1, $hit_end1) = $hsp2->range('hit2');
print "(Start,End)=($hit_beg1,$hit_end1)\n";
#Print Matching Sequence:
my $str2 = $hsp2->seq_str('match');
return ($str2);
}
}
}
}
and my main program's code is
my $filename1='xyz.blast';
my $str =Sequence($filename1);
print ("Match SEQUENCE-\n $str\n\n");
I tried while loop but that giving me same value all time in loop.
can i doing any mistake somewhere?
Thanks.
I am making 1 subroutine and it is working too but it doesn't giving me
all the values just giving me first value .
my subroutinr is-
sub Sequence {
my ($filename1)=@_;
my $in2 = Bio::SearchIO ->new(-format => 'blast',
-file => $filename1);
while( my $result2 = $in2->next_result){
while(my $hit2 = $result2->next_hit ){
while(my $hsp2 = $hit2->next_hsp){
#Print Sequence 1Name and Start of End Point where it is matching:
my $query2= $result2->query_name;
print "QUERY = $query2\t\t";
my ($query_beg1, $query_end1) = $hsp2->range('query');
print "(Start,End)=($query_beg1,$query_end1)\n";
#Print Sequence2 Name and Start of End Point where it is matching:
my $hit_name2= $hit2->name;
print "Hit =$hit_name2\t\t ";
my ($hit_beg1, $hit_end1) = $hsp2->range('hit2');
print "(Start,End)=($hit_beg1,$hit_end1)\n";
#Print Matching Sequence:
my $str2 = $hsp2->seq_str('match');
return ($str2);
}
}
}
}
and my main program's code is
my $filename1='xyz.blast';
my $str =Sequence($filename1);
print ("Match SEQUENCE-\n $str\n\n");
I tried while loop but that giving me same value all time in loop.
can i doing any mistake somewhere?
Thanks.