<p>I don't quite get the question but here's the answer and the code</p>
<pre><code>#!/usr/bin/env python3
from Bio.Seq import Seq

for dna in ['CCAAGUACAGAGAUUAAC','CCAAGAACAGAUAUCAAU', 'CCACGUACUGAAAUUAAC','CCGAGGACCGAAAUCAAC']:
    print(Seq(dna).translate())
    
</code></pre>
<blockquote>
<p>PSTEIN PRTDIN PRTEIN PRTEIN</p>
</blockquote>

CC BY-SA 4.0
2022-08-02T13:41:34.560Z
may I know where is the API code documentation for `.translate()` function call ?
kevin
CC BY-SA 4.0
2022-08-02T13:42:34.647Z
Its Biopython part of the Bio package. Its not an API its a Python package
M__
CC BY-SA 4.0
2022-08-02T13:47:04.033Z
https://biopython.org/docs/1.75/api/Bio.Seq.html#Bio.Seq.Seq.translate
kevin
CC BY-SA 4.0
2022-08-02T13:53:32.240Z
what is the opposite of `.translate()` function calls ?  I mean let's say I am given an amino acid string `CYCLIC`, how do I obtain all the possible combination of DNA strings before the translation process ?
kevin
CC BY-SA 4.0
2022-08-02T13:54:05.883Z
Thats a separate question because it will involve degeneracy.
M__
CC BY-SA 4.0
2022-08-02T13:59:33.260Z
ok, let me ask in a separate question thread
kevin
CC BY-SA 4.0
2022-08-02T14:05:37.043Z
https://bioinformatics.stackexchange.com/questions/19498/reverse-translation-from-amino-acid-string-to-dna-strings
kevin
CC BY-SA 4.0
2022-08-24T21:22:07.000Z
Minor note: A sequence containing `U` usually means it is an RNA sequence, while `T` would hint at it being a DNA sequence. In eukaryotes, the DNA sequence is often not directly translated into the corresponding RNA sequence, because of effects like alternative splicing.
Robert Haas
CC BY-SA 4.0
2022-08-24T21:30:50.033Z
Thanks @RobertHass. Could be a virus?
M__
CC BY-SA 4.0
2022-08-02T13:39:45.837Z
2022-08-02T13:39:45.837Z
M__
<p>Here's how you can do the translation yourself, using the genetic code in form of a dictionary from Biopython:</p>
<pre><code>import Bio

# Load the genetic code (a mapping from RNA triplet to amino acid)
d = Bio.Data.CodonTable.standard_rna_table.forward_table
print('Genetic code:', d)
print()

# Use it to translate an RNA sequence into an amino acid sequence
s = 'CCAAGUACAGAGAUUAAC'
for triplet in (s[i:i+3] for i in range(0, len(s), 3)):
    print(triplet, '-&gt;', d[triplet])
</code></pre>
<p>Printed result:</p>
<pre><code>Genetic code: {'UUU': 'F', 'UUC': 'F', 'UUA': 'L', 'UUG': 'L', 'UCU': 'S', 'UCC': 'S', 'UCA': 'S', 'UCG': 'S', 'UAU': 'Y', 'UAC': 'Y', 'UGU': 'C', 'UGC': 'C', 'UGG': 'W', 'CUU': 'L', 'CUC': 'L', 'CUA': 'L', 'CUG': 'L', 'CCU': 'P', 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', 'CAU': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 'CGU': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'AUU': 'I', 'AUC': 'I', 'AUA': 'I', 'AUG': 'M', 'ACU': 'T', 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAU': 'N', 'AAC': 'N', 'AAA': 'K', 'AAG': 'K', 'AGU': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 'GUU': 'V', 'GUC': 'V', 'GUA': 'V', 'GUG': 'V', 'GCU': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAU': 'D', 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGU': 'G', 'GGC': 'G', 'GGA': 'G', 'GGG': 'G'}

CCA -&gt; P
AGU -&gt; S
ACA -&gt; T
GAG -&gt; E
AUU -&gt; I
AAC -&gt; N
</code></pre>
<p>Note that the same RNA sequence can also be translated into another sequence of amino acids by shifting the reading frame 1 or 2 positions. For example, the RNA sequence <code>'CCAAGUACAGAGAUUAAC'</code> can be split into different triplets:</p>
<ol>
<li><code>'CCA', 'AGU', 'ACA', ...</code></li>
<li><code>'CAA', 'GUA', 'CAG', ...</code></li>
<li><code>'AAG', 'UAC', 'AGA', ...</code></li>
</ol>
<p>In biological systems, an mRNA would have a <a href="https://en.wikipedia.org/wiki/Start_codon" rel="nofollow noreferrer">start codon</a> that marks the beginning of an open reading frame, which is often the triplet <code>AUG</code>.</p>

CC BY-SA 4.0
2022-08-24T21:18:42.353Z
2022-08-24T21:18:42.353Z
Robert Haas
<p>Which of the following RNA strings could translate into the amino acid string PRTEIN? (Select all that apply.)</p>
<p>I am not sure if the following mass of amino acid is relevant to the question.</p>
<p><a href="https://i.sstatic.net/gMKna.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gMKna.png" alt="mass" /></a></p>
<pre><code>CCAAGUACAGAGAUUAAC

CCAAGAACAGAUAUCAAU

CCACGUACUGAAAUUAAC

CCGAGGACCGAAAUCAAC
</code></pre>

<python><phylogenetics><phylogeny><rna>
RNA strings and amino acid string
# RNA strings and amino acid string

(Asked by: username_0 on 2022-08-02)

Which of the following RNA strings could translate into the amino acid string PRTEIN? (Select all that apply.)
I am not sure if the following mass of amino acid is relevant to the question.

CCAAGUACAGAGAUUAAC

CCAAGAACAGAUAUCAAU

CCACGUACUGAAAUUAAC

CCGAGGACCGAAAUCAAC

**Tags:** python, phylogenetics, phylogeny, rna

---

## 2 answers

### Answer by username_1 on 2022-08-02. Score: 3

I don't quite get the question but here's the answer and the code
#!/usr/bin/env python3
from Bio.Seq import Seq

for dna in ['CCAAGUACAGAGAUUAAC','CCAAGAACAGAUAUCAAU', 'CCACGUACUGAAAUUAAC','CCGAGGACCGAAAUCAAC']:
    print(Seq(dna).translate())
    


PSTEIN PRTDIN PRTEIN PRTEIN

> **Comments:**
> **username_0**: may I know where is the API code documentation for `.translate()` function call ?  
> **username_1**: Its Biopython part of the Bio package. Its not an API its a Python package  
> **username_0**: https://biopython.org/docs/1.75/api/Bio.Seq.html#Bio.Seq.Seq.translate  
> **username_0**: what is the opposite of `.translate()` function calls ?  I mean let's say I am given an amino acid string `CYCLIC`, how do I obtain all the possible combination of DNA strings before the translation process ?  
> **username_1**: Thats a separate question because it will involve degeneracy.  
> **username_0**: ok, let me ask in a separate question thread  
> **username_0**: https://bioinformatics.stackexchange.com/questions/19498/reverse-translation-from-amino-acid-string-to-dna-strings  
> **username_2**: Minor note: A sequence containing `U` usually means it is an RNA sequence, while `T` would hint at it being a DNA sequence. In eukaryotes, the DNA sequence is often not directly translated into the corresponding RNA sequence, because of effects like alternative splicing.  
> **username_1**: Thanks @RobertHass. Could be a virus?  

---

### Answer by username_2 on 2022-08-24. Score: 0

Here's how you can do the translation yourself, using the genetic code in form of a dictionary from Biopython:
import Bio

# Load the genetic code (a mapping from RNA triplet to amino acid)
d = Bio.Data.CodonTable.standard_rna_table.forward_table
print('Genetic code:', d)
print()

# Use it to translate an RNA sequence into an amino acid sequence
s = 'CCAAGUACAGAGAUUAAC'
for triplet in (s[i:i+3] for i in range(0, len(s), 3)):
    print(triplet, '->', d[triplet])

Printed result:
Genetic code: {'UUU': 'F', 'UUC': 'F', 'UUA': 'L', 'UUG': 'L', 'UCU': 'S', 'UCC': 'S', 'UCA': 'S', 'UCG': 'S', 'UAU': 'Y', 'UAC': 'Y', 'UGU': 'C', 'UGC': 'C', 'UGG': 'W', 'CUU': 'L', 'CUC': 'L', 'CUA': 'L', 'CUG': 'L', 'CCU': 'P', 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', 'CAU': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 'CGU': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'AUU': 'I', 'AUC': 'I', 'AUA': 'I', 'AUG': 'M', 'ACU': 'T', 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAU': 'N', 'AAC': 'N', 'AAA': 'K', 'AAG': 'K', 'AGU': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 'GUU': 'V', 'GUC': 'V', 'GUA': 'V', 'GUG': 'V', 'GCU': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAU': 'D', 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGU': 'G', 'GGC': 'G', 'GGA': 'G', 'GGG': 'G'}

CCA -> P
AGU -> S
ACA -> T
GAG -> E
AUU -> I
AAC -> N

Note that the same RNA sequence can also be translated into another sequence of amino acids by shifting the reading frame 1 or 2 positions. For example, the RNA sequence 'CCAAGUACAGAGAUUAAC' can be split into different triplets:

'CCA', 'AGU', 'ACA', ...
'CAA', 'GUA', 'CAG', ...
'AAG', 'UAC', 'AGA', ...

In biological systems, an mRNA would have a start codon that marks the beginning of an open reading frame, which is often the triplet AUG.


---

