[Bioperl-l] Pattern search with gap
Tamas Horvath
hotafin at gmail.com
Wed Jun 22 10:26:52 EDT 2005
And a slightly different code for multiple recognition:
my $seqstring ="--------------------CAAAATAAATAGGTTATACAGAAACA---------------------AGATAAAAATTACA--CAAG-AT-A----";
my $qseq = "CAAGATA";
my @qqq = split (//,$qseq);
my $pat = join('-*', at qqq);
my $pat_rege = qr/$pat/;
while ($seqstring =~ /$pat_rege/g) {
my $before = $`;
my $match_seq = $&;
my $before_length = length $before;
my $mseq_length = length $match_seq;
my $start = 1 + $before_length;
my $end = $before_length + $mseq_length;
print "Start:$start End:$end\n";
}
#Start:45 End:72
#Start:84 End:92
More information about the Bioperl-l
mailing list