darrowby385 / gcat

A simple script for counting nucleotides and codons in a gene sequence.
GNU General Public License v3.0
3 stars 1 forks source link

Recognise nucleic acid variety #1

Open darrowby385 opened 7 years ago

ch1c0t commented 7 years ago

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:

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.