in reply to DNA that is a JAPH
perl dna TGAATCTTTGACTCGA
Hope I transcribed that correctly. I just hacked the following out of your code. Ugly, but does the job
#!/usr/bin/perl # Run as dnareader.pl TCCCTCATTGAATCCAAACC # You'll get a ++ from me if you can make it say "perl" # instead. for my $g1 ( 'A', 'C', 'T', 'G' ) { for my $g2 ( 'A', 'C', 'T', 'G' ) { for my $g3 ( 'A', 'C', 'T', 'G' ) { for my $g4 ( 'A', 'C', 'T', 'G' ) { print( "$g1$g2$g3$g4 - " ); letter( "$g1$g2$g3$g4" ); print "\n"; }}}} sub letter { $"='ATCG'; foreach (split '', shift) { $;++;$,=$,<<2|index $",$_; next if $;&3;$,=print chr $,;$,--; } }
From there it's a simple matter of working backwards...
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DNA that is a JAPH
by theorbtwo (Prior) on Jan 15, 2002 at 00:09 UTC | |
by patgas (Friar) on Jan 15, 2002 at 02:44 UTC |