Translation turns DNA letters into a protein
A protein is a chain of amino acids, and a gene's DNA letters say which ones, three letters at a time. Translation is the step that reads those letters and builds the chain.
You will translate invented DNA with a dictionary and a loop, and see why the starting point matters.
By the end of this lesson
Note
I can translate a DNA sequence into a protein with a codon table.
Key words
| Word | What it means | Example |
|---|---|---|
| Codon | a group of three bases | GCT |
| Amino acid | one building block of a protein | |
| Start codon | the codon ATG, where translation begins | |
| Stop codon | a codon that ends translation | |
| Reading frame | where the first codon starts |
The cells students fill in are left blank in this preview.
A codon is three bases
DNA is read in groups of three bases. Each group is a codon, and a table says which amino acid it stands for. Amino acids have a one-letter code, such as M or K.
Some codons are stop codons. They mean the chain is finished. The full table has 64 codons. The one below is a short piece of it.
A cut-down codon table of 12 codons
| Codon | Letter | Codon | Letter |
|---|---|---|---|
| ATG | M (start) | TTT | F |
| GGC | G | GCT | A |
| AAA | K | GAA | E |
| CCC | P | CTG | L |
| TGG | W | TAA | stop |
| TAG | stop | TGA | stop |
The cells students fill in are left blank in this preview.
The reading frame decides where codons start
The same letters give different codons if you start in a different place. The reading frame is the position of the first codon. Frame 0 starts at the first letter, frame 1 at the second and frame 2 at the third.
A shift of one letter changes every codon after it, so the protein changes completely.
Worked example: ATGGCTAAATAG in three frames
| Frame | Codons | Protein |
|---|---|---|
| 0 | ATG GCT AAA TAG | M A K and a stop |
| 1 | TGG CTA AAT (AG left over) | W, then two codons not in the cut-down table |
| 2 | GGC TAA ATA (G left over) | G, a stop, then a codon not in the table |
The cells students fill in are left blank in this preview.
Read the same DNA in three frames
codons = {
"ATG": "M", "TTT": "F", "GGC": "G", "GCT": "A",
"AAA": "K", "GAA": "E", "CCC": "P", "CTG": "L",
"TGG": "W", "TAA": "*", "TAG": "*", "TGA": "*",
}
dna = "ATGGCTAAATAG"
for frame in [0, 1, 2]:
protein = ""
for start in range(frame, len(dna) - 2, 3):
codon = dna[start:start + 3]
if codon in codons:
protein = protein + codons[codon]
else:
protein = protein + "?"
print("frame", frame, protein)
# A ? means this cut-down table has no entry. A * is a stop codon.
Cut a DNA string into codons
docker exec jupyter python3 -c "s = 'ATGGCTAAATAG'; print([s[i:i + 3] for i in range(0, 12, 3)])"Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.
The command prints four codons
The command steps through the string three letters at a time, starting at 0. It prints a list of four codons: ['ATG', 'GCT', 'AAA', 'TAG'].
The last of them, TAG, is a stop codon.
Translation stops at the first stop codon
To translate, cut the DNA into codons from the chosen frame, look each one up and join the letters. When you meet a stop codon, you stop and leave it out.
Letters left over at the end, fewer than three, make no codon and are ignored.
Translate until the stop codon
codons = {
"ATG": "M", "TTT": "F", "GGC": "G", "GCT": "A",
"AAA": "K", "GAA": "E", "CCC": "P", "CTG": "L",
"TGG": "W", "TAA": "*", "TAG": "*", "TGA": "*",
}
dna = "ATGGCTAAATAGGAA"
protein = ""
for start in range(0, len(dna) - 2, 3):
amino = codons[dna[start:start + 3]]
if amino == "*":
break
protein = protein + amino
print(protein)
# Change dna to "ATGTTTGAA" and predict the protein.
A common mistake
Warning
Many people think a protein is read from the first letter of the DNA. Translation begins at a start codon, ATG, and the frame matters. Shift the start by one letter and you read different codons, so you get a different protein.