Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculate codon number
sub codon_sequence {
my ($self, $n) = @_;
my ( $r, @s );
for my $i ( 0 .. 2 ) {
$r = $n % 4;
$n = $n >> 2;
unshift( @s, $nucleotides[$r] );
}
return join( '', @s );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.