Hi monks,
I'm trying to write a simple program that reads in a 50bp DNA sequence and splits it into pairs of two bases - e.g. ATCG would be AT, TC, CG ... with a counter moving along the sequence one base at a time. Anyway, my program does this but forgets about the last base, so with the above example it will find AT and TC but not CG.
Here's the code below, hope someone can spot the mistake.
Thanks :->
# @dna contains the sequence
foreach my $base (@dna) {
print "$base\n";
++$counter;
my $pair = @dna1[$counter-1];
print "$pair";
}