Codon optimization: what it changes and when it helps

What a rewrite does to a gene, and what the experiments say about yield

17 min

The first 16 codons of human IL-2 before and after codon optimization for E. coli with the changed bases highlighted, above all 135 codons of the gene showing the 79 that changed.

Take the mature chain of human interleukin-2 and run it through the codon optimization tool for E. coli. The protein does not change by a single residue, yet the DNA changes at 79 of its 135 codons. Measured against E. coli ribosomal protein genes, its codon adaptation index climbs from 0.24 to 0.71, and the 14 codons E. coli rarely uses (AGA, AGG, CTA, ATA, CCC and GGA, the six that Rosetta strains carry extra tRNAs for) disappear.

Whether that gives more protein is a separate question. Kudla and colleagues built 154 synonymous versions of one GFP gene and found that protein levels varied 250-fold across them, while codon bias did not correlate with expression.[1] What explained more than half of the variation was how stable the mRNA folded near the ribosome binding site.

So codon optimization is a bundle of changes, and some of them help while others can hurt. The sections below separate them, score a real gene before and after, and set the experimental evidence beside the numbers.

One protein, many possible genes

The genetic code has 64 codons: 61 sense codons for 20 amino acids and three stop codons (how many codons are there). Methionine and tryptophan have one codon each. Nine amino acids have two, isoleucine has three, five have four, and leucine, serine and arginine have six.

Choices multiply along a sequence. The 133-residue mature chain of human interleukin-2, plus a start and a stop codon, can be encoded by roughly 3×10653 \times 10^{65} different DNA sequences, every one of which makes the same protein. DNA to protein goes from codons to amino acids and discards that choice; Protein to DNA goes the other way and has to put it back.

A natural gene uses one of those sequences, and not at random. Codon bias works as a second code that guides how efficiently a message is translated, how faithfully, and how long the mRNA lasts.[2] Synonymous codons are interchangeable for the protein sequence but not for the cell.

How codon usage differs between hosts

Hosts disagree about which synonym to prefer. Leucine's CTG makes up half of E. coli's leucine codons but 11% of yeast's. Arginine's AGA is 4% of E. coli's arginine codons and 48% of yeast's, and human and hamster sit near 20%.

Amino acidCodonE. coliS. cerevisiaeHumanChinese hamster
LeucineCTG0.500.110.400.39
LeucineTTA0.130.280.080.06
LeucineCTA0.040.140.070.08
ArginineCGT0.380.140.080.11
ArginineCGC0.400.060.180.18
ArginineAGA0.040.480.210.19
ArginineAGG0.020.210.210.19
IsoleucineATA0.070.270.170.14
ProlineCCC0.120.150.320.32
GlycineGGA0.110.220.250.25
SerineTCT0.150.260.190.22
SerineAGC0.280.110.240.22
Table 1. Share of each amino acid's codons that use the listed codon. Codons are written as DNA triplets, as in a gene sequence. E. coli, S. cerevisiae and human values come from the Kazusa Codon Usage Database through the python_codon_tables package; the Chinese hamster (Cricetulus griseus) table was fetched from the same database and rests on 331 coding sequences. Source: Kazusa DNA Research Institute.[3]

A human gene read in E. coli therefore meets codons the host seldom uses. AGA, AGG, CTA, ATA, CCC and GGA are the six that Rosetta strains supplement with extra tRNA genes, and the CodonPlus-RIL strain covers AGA and AGG, ATA and CTA.[5][6] Mammalian hosts are a gentler case. Human and hamster usage differ by at most 0.03 for every codon in Table 1, so a human gene has little to gain from a hamster-specific rewrite on codon choice alone.

Fath and colleagues, who work for a gene synthesis company, optimized 50 human genes for mammalian expression and saw reliable expression from all of them and higher expression from 86%, in HEK293T, CHO and insect cells.[7] Their design changed RNA features as well as codons, which is the usual pattern: tools rewrite several things at once.

Genome-wide usage is an average, and highly expressed genes are more biased than the rest. That observation is the basis of the codon adaptation index.

The codon adaptation index

Sharp and Li scored a gene against a reference set of highly expressed genes from one species.[4] For each amino acid, the codon used most often in the reference set gets a weight of 1, and every synonymous codon gets its count relative to that top codon:

wij=Xijmax⁡kXikw_{ij} = \frac{X_{ij}}{\max_k X_{ik}}

Here XijX_{ij} is how often codon jj of amino acid ii appears in the reference set. The index of a gene with LL codons is the geometric mean of the weights of the codons it uses:

CAI=(∏k=1Lwk)1/L=exp⁡ ⁣(1L∑k=1Lln⁡wk)\mathrm{CAI} = \left( \prod_{k=1}^{L} w_k \right)^{1/L} = \exp\!\left( \frac{1}{L} \sum_{k=1}^{L} \ln w_k \right)

Methionine, tryptophan and stop codons are left out, because they have no synonyms and always score 1. A codon that never appears in the reference set would give a weight of zero and send the whole product to zero, so the implementation we used, Biopython's, counts it as 0.5.

CAI runs from near 0 to 1, and a geometric mean punishes outliers. With the weights in Table 2, the peptide Leu-Arg-Pro-Lys written as CTG CGT CCG AAA scores 1.00, while the same peptide written CTA AGA CCC AAA scores 0.02. A single AGG in a 133-codon gene lowers the index by about 5% on its own.

CodonAmino acidWeight
CTGLeucine1.00
CTALeucine0.002
CGTArginine1.00
AGAArginine0.010
AGGArginine0.001
CCGProline1.00
CCCProline0.013
GGAGlycine0.012
ATCIsoleucine1.00
ATAIsoleucine0.003
Table 2. Relative adaptiveness of selected codons in E. coli highly expressed genes. We counted codons in the 54 ribosomal protein genes of E. coli K-12 MG1655 (7,182 codons) and divided each count by the top codon for its amino acid. The weights are specific to this reference set. Source: NCBI RefSeq NC_000913.3.[15]

The index is only as meaningful as its reference set. Computed from ribosomal protein genes or from genome-wide usage, the top codon differs for 11 of the 18 amino acids that have a choice, including glycine (GGT against GGC), isoleucine (ATC against ATT) and arginine (CGT against CGC). The same gene can therefore score 0.71 against one reference and 1.00 against the other, which the worked example below shows.

What a codon optimizer changes

An optimizer searches the huge space of synonymous sequences for one that scores well on several objectives while the protein stays fixed. The objectives are not all about codons.

ChangeReasonWhere it matters
Codon choice toward the host tableMatches the host's codon preferences and tRNA supply; CAI scores thisEvery host
GC contentKeeps the sequence near the host's composition and away from extremes that complicate synthesisEvery host
Restriction sitesA site inside the gene gets cut when the gene is cloned with that enzymeEvery host
Repeats and long single-base runsComplicate synthesis and cloning and can recombine or slipEvery host
Cryptic splice sitesA coding sequence expressed from DNA in a eukaryotic cell can contain sequences the spliceosome reads as splice sitesMammalian and other eukaryotic hosts
Internal Shine-Dalgarno-like sequencesPair with the ribosome's 16S RNA and pause translationBacterial hosts
mRNA structure near the start codonA tightly folded start hides the ribosome binding site and lowers initiationEvery host, strongest in bacteria
Table 3. What optimization tools commonly change. Not every tool changes every item; the end of this section says which ones ProteinIQ tools cover.

The reasoning for the last rows comes from experiments covered below. Redesign strategies in the literature include modifying translation initiation regions, altering mRNA structural elements and using different codon biases, and genes can also carry expression-limiting regulatory elements inside the coding sequence.[8]

ProteinIQ's codon optimization tool covers the first row. It runs the codon optimizer of DNA Chisel with the translation locked, so the protein cannot change.[9] You paste coding DNA, pick a host table (E. coli, B. subtilis, yeast, human, mouse and four other species are built in, and an NCBI taxonomy ID requests another, such as 10029 for Chinese hamster if its table is available) and choose a method.

Most frequent codon gives every residue the host's top synonym. Match codon usage picks synonyms so that their frequencies approximate the host table, and the result changes from run to run. Harmonization keeps each codon's relative preference from the original host, so rare codons stay relatively rare.

The tool does not constrain GC content, remove restriction sites or predict yield. Protein to DNA can avoid chosen restriction sites and long repeats when you start from a protein sequence, GC content measures composition, and RNAfold folds the start of the message.

Worked example: human interleukin-2 in E. coli

We took the human IL2 coding sequence from RefSeq NM_000586.4, dropped the 20-residue signal peptide, and added a start codon and a TAA stop codon, which gives the 133-residue mature chain as a 135-codon gene.[14] We then ran DNA Chisel's codon optimizer, the engine behind the tool, for E. coli with two methods. CAI is measured against the 54 ribosomal protein genes from Table 2, and also against the genome-wide table the optimizer itself targets.

NativeMost frequent codonMatch codon usage
Codons changed07941
CAI, ribosomal gene reference0.240.710.43
CAI, genome-wide table0.521.000.70
GC content37.5%47.9%43.5%
Rare codons1402
Longest run of one base575
Restriction sitesXbaInoneEcoRI
Start-region folding, kcal/mol−11.3−9.3−6.4
Table 4. Human IL-2 before and after optimization for E. coli. We computed every column from the three sequences. Rare codons are AGA, AGG, CTA, ATA, CCC and GGA. Sites checked: NdeI, NcoI, BamHI, EcoRI, HindIII, XhoI, XbaI and NotI on both strands. The folding window runs from 30 nt before to 40 nt after the A of AUG, with the T7 gene 10 leader as the 5′ context; energies are minimum free energies from ViennaRNA 2.7.2. Match codon usage is shown for seed 7.[16][17]

The first 16 codons show what the rewrite does to the sequence. Every change is synonymous, and most of them replace an A/T-rich codon with a G/C-rich one.

Text
Native    ATG GCA CCT ACT TCA AGT TCT ACA AAG AAA ACA CAG CTA CAA CTG GAG
Optimized ATG GCG CCG ACC AGC AGC AGC ACC AAA AAA ACC CAG CTG CAG CTG GAA
Protein    M   A   P   T   S   S   S   T   K   K   T   Q   L   Q   L   E

Most frequent codon reaches a CAI of exactly 1.00 against the genome-wide table, because that table defines its choices, but only 0.71 against the ribosomal genes. "Optimized" depends on what the score is measured against. The same run also stretched the longest single-base run from five to seven, at the AAA AAA ACC junction above.

Match codon usage reproduces host frequencies codon by codon, so its CAI and GC content are identical in every run. The sequence is not. Across 20 seeds we got 20 different DNA sequences, and 6 of them contained at least one of the eight common restriction sites. The folding energy of the start region ranged from −12.0 to −5.4 kcal/mol depending only on where the same codons landed.

None of the three designs folds tightly at the start in this context, so on this gene the start of the message is not an obvious problem. A swing of several kcal/mol from synonymous choices alone shows that the lever exists, and it is the reason to fold the start of your own design in your real vector context. We did not express any of these genes, and none of the numbers in Table 4 predicts yield. The script, sequences and results are public.

When optimization helps

The clearest case is a gene from a distant species with a different base composition, expressed in a host that reads it badly. Welch and colleagues synthesized 40 genes each for a DNA polymerase and a single-chain antibody that differed only in synonymous codons and expressed them in E. coli. Protein levels ranged from undetectable to 30% of cellular protein, and the amount depended strongly on the codons used for a subset of amino acids.[18]

Their winning codons were not the ones that are most frequent in highly expressed E. coli genes. Favorable codons were mostly those read by the tRNAs that stay most highly charged when amino acids run short.[18] A larger set of 6,348 expression experiments with T7 RNA polymerase in E. coli found the same kind of gap: the codon-influence metric that best predicted expression correlated only weakly with genomic codon-usage frequency.[19]

The same study found that codon content influenced expression more strongly than mRNA folding parameters, with folding dominating only the first 16 or so codons.[19]

Natively poorly translated sequences also showed much lower mRNA levels in cells, which suggests that codon content tips a competition between elongation and mRNA degradation.[19] That link is why codon choice can change the amount of message as well as the rate of translation; the guide to mRNA lifetime covers the decay side.

In mammalian cells the evidence is thinner, and Fath's 50-gene study, described above, is the main source of it.[7] If you start from a protein sequence rather than a natural gene, you must choose every codon anyway, and a deliberate choice for the host beats a random one.

Optimization does less when a gene already expresses well in its host or when yield is limited by something else, such as solubility, disulfide formation, toxicity or promoter strength.

When optimization backfires

The start of the message matters more than the average

Kudla's 154 GFP genes are the starting point: mRNA stability near the ribosome binding site explained more than half of the variation in protein levels, and codon bias did not correlate with expression.[1] Goodman and colleagues measured more than 14,000 synthetic reporters and found that rare codons at the N terminus instead of common ones raised expression about 14-fold (median 4-fold). The cause was reduced RNA structure, not codon rarity.[11]

Bentele and colleagues reached the same conclusion from the other direction: in bacteria, selection favors codons that reduce mRNA folding around the start, whether those codons are frequent or rare.[12]

A CAI-maximizing rewrite does the opposite, because it swaps A/T-rich rare codons in the first positions for G/C-rich frequent ones. The result can fold more tightly around the start codon. RNAfold shows whether it did, and the RNA secondary structure guide explains how to read the output.

Faster translation is not always better folding

Yu and colleagues showed in a Neurospora cell-free system that preferred codons speed elongation and non-optimal codons slow it, and that codon usage affects protein function through co-translational folding.[20] In E. coli, Spencer and colleagues found that harmonizing a sequence to mimic the ribosome movement of the original organism increased folding of the encoded protein.[13]

Rosano and Ceccarelli expressed eight plant proteins in E. coli with and without extra tRNAs for the AGA/AGG, ATA and CTA codons. Proteins whose sequences had more than 5% of such codons ended up mostly insoluble in the supplemented strain, and cells grew more slowly, which fits the idea that removing pauses can cause misfolding.[6]

Rare codons are also not always slow. Li and colleagues found by ribosome profiling in bacteria that codons read by rare tRNAs did not slow translation in nutrient-rich conditions, and that Shine-Dalgarno-like stretches inside coding sequences were the major cause of pausing.[10] A design that creates such a stretch adds a pause site.

A synonymous change is not always silent

A synonymous SNP in the human MDR1 gene produced P-glycoprotein with similar mRNA and protein levels but altered conformation and different drug and inhibitor interactions. The authors proposed that a rare codon changes the timing of co-translational folding.[21]

A later review argues that codon optimization can affect protein conformation and function, increase immunogenicity and reduce efficacy, and suggests reconsidering the approach for in vivo uses.[22] For a therapeutic, the protein from an optimized gene needs to be characterized, not assumed identical.

mRNA vaccines and therapeutics

For an mRNA drug the message is the product, so codon choice competes with other design goals. Karikó and colleagues showed that RNA containing pseudouridine and several other modified nucleosides activates innate immune cells far less than unmodified RNA.[23] N1-methylpseudouridine later outperformed pseudouridine, with up to 13-fold higher reporter expression in mice (the single-modified comparison) and lower immunogenicity.[24]

Structure matters as much as codons. Mauger and colleagues found that highly expressed mRNAs have highly structured coding sequences, and that structure acts through functional half-life independent of codon usage.[25] Leppek and colleagues found that in-cell stability drives protein output more than ribosome load does, and that highly structured "superfolder" mRNAs improve both stability and expression.[26]

LinearDesign optimizes structural stability and codon usage together, and improved antibody titers up to 128-fold in mice compared with a codon-optimization benchmark.[27] Xia's analysis of the Pfizer/BioNTech and Moderna vaccines makes the same point from the design side: the optimizations conflict, and N1-methylpseudouridine, which wobbles more freely than uridine, complicates some of them.[28] A codon-only optimizer is the wrong tool for this job.

A practical order of work

  1. If you start from a transcript or plasmid, use the ORF finder to locate the coding frame, then translate it with DNA to protein to confirm the protein.
  2. Choose the host table that matches the cells you will use.
  3. Optimize, and compare the result with the native sequence rather than replacing it blindly.
  4. Check GC content, restriction sites, repeats and the folding of the start region in your real vector context.
  5. Translate the final sequence back and confirm it matches the intended protein.
  6. When the experiment is expensive, order more than one design. Synonymous variants of one gene can differ by orders of magnitude, so a fully optimized version and a harmonized one are a hedge.

Codon optimization tools on ProteinIQ

The codon optimization tool rewrites coding DNA for a chosen host with the most frequent codon, match codon usage or harmonization method, and returns the optimized FASTA with its translation. The Protein to DNA converter reverse translates a protein, can avoid chosen restriction sites and long repeats, and lists CAI in its run log when a host table is used.

DNA to protein translates a coding sequence back, ORF finder locates reading frames, and GC content measures composition. RNAfold predicts the minimum free energy structure of the start region.

Frequently asked questions

Does a higher CAI mean more protein?

Not reliably. Across 154 GFP variants codon bias did not correlate with expression, and in a 6,348-experiment E. coli study the metric that best predicted expression correlated only weakly with genomic codon usage.[1][19] CAI describes how closely a gene matches a reference set, and a reference set is only an approximation of what the cell translates well.

What is a good CAI value?

There is no universal threshold, because the value depends on the reference set. The IL-2 example scores 0.24 before and 0.71 after against ribosomal genes, and 0.52 before and 1.00 after against genome-wide usage. Compare designs against the same reference rather than reading one number in isolation.

Can codon optimization change the protein?

The amino acid sequence stays the same, and the tool checks that the translation is unchanged. Folding and function can still differ, as the MDR1 case shows.[21]

Do I still need a Rosetta strain after optimizing?

If the optimized sequence has no AGA, AGG, CTA, ATA, CCC or GGA codons, the extra tRNAs in those strains have nothing left to decode. The IL-2 design above has none with the most frequent codon method and two with match codon usage.

Should I optimize for human or CHO cells?

Either works for codon choice. Human and Chinese hamster usage differ by at most 0.03 for the 12 codons in Table 1, though the hamster table covers only 331 coding sequences and describes the species, not any CHO cell line.

Can I optimize an amino acid sequence directly?

The codon optimization tool takes coding DNA. For a protein sequence, use Protein to DNA to reverse translate with a host preset, then check the result as in the workflow above.