in reply to DNA that is a JAPH
I was just looking back on this code, much, much later, and found the matching "dnawriter.pl". It's past the readme below:
foreach $letter ( split //, shift @ARGV ) { @digits = (); $num = ord $letter; while ( $num ) { unshift @digits, $num % 4; $num = int $num / 4; } unshift @digits, 0 while @digits < 4; $base4 = join '', @digits; $base4 =~ tr/0123/ATCG/; $string .= $base4; } print $string;
|
|---|