Implement reverse translation (AminoAcid -> Codon)
BeastyBlacksmith opened this issue · 6 comments
I am thinking about where a good place for the codon and aminoacid tables would be in julia and wanted to ask if it would fit in here.
Expected Behavior
convert(Vector{RNAMer{3}}, AA_A) == RNAMer{3}.(["GCU", "GCA", "GCC", "GCG"])
convert(AminoAcid, RNAMer{3}("GCU")) == AA_A
Maybe have an extra type alias const Codon = RNAMer{3}
Possible Solution / Implementation
Add two lookup tables.
Context
Could go alternatively in a separate package.
All of this is already implemented in BioSequences.jl:
julia> using BioSequences
julia> DNACodon
Mer{DNAAlphabet{2}, 3}
julia> RNACodon
Mer{RNAAlphabet{2}, 3}
See also https://biojulia.net/BioSequences.jl/stable/transforms/#Translation-1
Closing as resolved - if there are any features you'd want to add, you are free to comment and I'll re-open
Indeed this works in the Codon -> AminoAcid direction, but not in the reverse direction.
I get that this is not unique and thus I'd like to get all Codons representing an amino acid.
Furthermore I'd like to do this with single codons without having to convert them to LongRNASeq
Translation of single DNA codons is a feature in the upcoming v3, already implemented. There is no such thing as reverse translation in BioSequences
. We could add that
I added an implementation here https://github.com/jakobnissen/play/blob/master/revtrans.jl (also see the accompanying blog post).
The plan now is to wait for BioSequences v3 where kmers are moved to another repo, and then implement reverse translation in that repo.
This issue is now tracked here: BioJulia/Kmers.jl#19