#!/usr/bin/perl
use warnings;
use strict;
my $str;
{ local $/ = '';
while ( <DATA> ) {
tr/\n//s;
tr/\n/,/;
$str .= $_;
}
chop $str;
}
print "str is '$str'\n";
__DATA__
Start -34
End -267
Start -1068
End -1248
Start -824
End -917
No you all are giving me code for store data in 1 string or whatever
but my question is not for that, You guys are considering that i
already have value of start and end but I am getting that value from
loop and i want to store in different variable .
as you all know that in my all programm i have 2 sequences
like
$seq1="AACTGACGACTTTATATACACTAAACTACAATTAAATGGAAGACAGATAATTTAAGAGAAAAAGATTCTTCATATGCATTCTAATTTAGGCAATTTAACATCTAGATCTCGACATAGAGATTGAC";
and
$seq2="CGAGCTGGCAGAGTTCACATGGACAAACAAGGATGCCTGGTTTCTTCATATGCATTCTTGCTGCCCTATACTGTTCAATCCATTCTGCTCAAACCACTATCGTCGACATAGAGATTGACT";
I write both sequences in temperary file called temp1 and temp 2 then
I aligned both sequence using Blast program then i use this code
my $in = Bio::SearchIO ->new(-format => 'blast',
-file => 'temp.blast');
#Print Starting and Ending Point of 1 Hsps-
my $result=$in->next_result;
my $hit =$result->next_hit;
my $hsp1 =$hit->next_hsp;
my$start1=$hsp1->query->start;
my $end1=$hsp1->query->end;
print "start First Hsp ",$start1,"\n";
print "End First Hsp ",$end1,"\n\n";
#Print Starting and Ending Point of 2 Hsps-
my $hsp2 =$hit->next_hsp;
my$start2=$hsp2->query->start;
my $end2=$hsp2->query->end;
print "start Second Hsp ",$start2,"\n";
print "End Second Hsp ",$end2,"\n\n";
#Print Gap Sequence
print "Gap Sequence- ",$seq1->subseq($end1+1,$start2-1);
This program is working and giving me output what i want
output is
Start First Hsp 66
End First Hsp 82
Start Second Hsp 109
End Second Hsp 125
Gap Sequence- AATTTAGGCAATTTAACATCTAGATC
But now i generalized that program and in this program I am giving file
name it's taking all sequences from this file and Aligning it but some
sequences has no gap some has 2 gap some has 3....and my code is good
for finding 1 gap Sequences.
that's why i want to store all values in different variable so then i
can use that in subseq function .
Hope now it will give you clear look.
Thanks