bebop / poly

A Go package for engineering organisms.
https://pkg.go.dev/github.com/bebop/poly
MIT License
671 stars 73 forks source link

Translate should have a setting to set first codon to M #305

Closed Koeng101 closed 1 year ago

Koeng101 commented 1 year ago

testTranslation, _ := codon.Translate(gfpDnaSequence, codon.GetCodonTable(11))

This fails in the case of gfpDnaSequence := "TTGGCT...TAA", which is perfectly valid for a start codon.

carreter commented 1 year ago

Should this be a toggleable setting, or just default behavior? Or maybe this is information that should live in the codon table?

From what I see according to NCBI:

The initiator codon - whether it is AUG, CTG, TTG or something else, - is by default translated as methionine (Met, M). The possible intiator codons are marked as 'M' in the second ('Starts') row of the translation tables.

However, it seems like cryptic Leu-tRNA mediated initiation is also a thing that happens.

My proposal: modify the Table interface such that instead of returning a []string of start codons, it returns a map[string]rune of start codons to the associated amino acid. We can have this be always map to 'M' for our default codon tables, which means a user could make an implementation that corrects this behavior.

Working on this now.

carreter commented 1 year ago

Ended up going a slightly different route of adding GetStartCodonTable method to Table interface to prefer extension of interface over modification.