require 'bio'
table = Bio::CodonTable[1]
table['ttg'] #=> 'L'
# another way
codon = Bio::Sequence::NA.new 'uug'
codon.translate #=> 'L'
Of course, it is not necessary to depend on bio. You can create your own abstraction better suited for your purposes, but giving bio a look might be helpful.
Would you like any help with this? I was just passing by and microbiology is one of the topics that interest me.
It looks like some kind of a codon table will be needed here. Similar to this: https://github.com/bioruby/bioruby/blob/146fd66b3a14972bcfd0e9bf8ec007d38c55ac39/lib/bio/data/codontable.rb https://github.com/bioruby/bioruby/blob/146fd66b3a14972bcfd0e9bf8ec007d38c55ac39/sample/demo_codontable.rb
It allows to model translation process:
Of course, it is not necessary to depend on
bio
. You can create your own abstraction better suited for your purposes, but givingbio
a look might be helpful.