Reputation: 23
Source code:
$Bo2l = 'TGYTCM';
%amb = ( Y => "[CT]", M => "[TG]", D => "[AGT]", N => "[AGCT]");
foreach $key_amb(keys%amb){
$Bo2l =~ s/$key_amb/$amb{$key_amb}/g;
}
$sequence = 'AAAAAATGATTGCTCATTTGCTCTGCTCGCAAAAAAAAATGATTATTTTTT';
for($i=0; $i<length($sequence)-5; $i++){
$cutseq = substr($sequence, $i, 6);
if($cutseq =~ m/$Bo2l/){
$pos = $i+1;
print "Bo2l\t$pos\t$cutseq\n";
}
}
I can understand the $sequence
, but I can't understand what those square brackets do.
Upvotes: 0
Views: 276
Reputation: 3231
The square brackets are "character class" delimiters. so "[CT]"
means "match either a C
or a T
".
Upvotes: 1