Paste: A Perl snippet
Author: | dmpk2k |
Mode: | perl |
Date: | Wed, 3 Jun 2009 07:42:33 |
Plain Text |
use POSIX;
$/ = '>';
<STDIN>;
while (<STDIN>) {
s/^(.*?)\n//;
print ">", $1, "\n";
tr{wsatugcyrkmbdhvnATUGCYRKMBDHVN\n>}
{WSTAACGRYMKVHDBNTAACGRYMKVHDBN}d;
my $sequence = reverse;
my $iterations = ceil(length($sequence) / 60) - 1;
for my $count (0 .. $iterations) {
print substr($sequence, $count * 60, 60), "\n"
}
}
Author: | dmpk2k |
Mode: | perl |
Date: | Wed, 3 Jun 2009 07:54:53 |
Plain Text |
use 5.010;
use POSIX;
$/ = '>';
<STDIN>;
while (<STDIN>) {
s/^(.*?)\n//;
say ">", $1;
tr{wsatugcyrkmbdhvnATUGCYRKMBDHVN\n>}
{WSTAACGRYMKVHDBNTAACGRYMKVHDBN}d;
my $sequence = reverse;
my $iterations = ceil(length($sequence) / 60) - 1;
for my $count (0 .. $iterations) {
say substr($sequence, $count * 60, 60);
}
}
New Annotation