Yet another one:
my $seq = 'ACTGACTGATGCATGCATGCATGCCGTACGTACGTACGT'; my @groups = unpack "(A3)*", $seq;
(But before you generalize this method, note that pre-5.10.0, unpack's "A" template would unpack bytes, not characters... which would make a difference when unicode is involved. This is irrelevant in this particular case, though.)
In reply to Re: split a squence by 3 letters
by almut
in thread split a squence by 3 letters
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |