Ranomics
Scientific research and computational biology
yeast displaylibrary designprotein engineeringcodon optimizationVHHnanobodyNGS

NNK vs NNS vs Trimer: Picking a Codon Scheme for a VHH Library

Codon scheme selection is one of the first cost versus coverage tradeoffs in any synthetic library. Choose wrong and you either over-spend on trimer synthesis or waste a measurable fraction of your displayed library on stop codons and disproportionately represented amino acids. For a VHH library diversifying CDR1, CDR2, and CDR3, the codon scheme sets the upper bound on what the downstream FACS sort can find. This post walks through how NNK, NNS, NNN, and trimer schemes differ in practice, how they interact with S. cerevisiae codon bias, and when each is the right choice for a yeast display campaign.

How Each Codon Scheme Works

Four codon schemes dominate VHH and scFv library design. Each makes a different tradeoff between coverage, redundancy, stop codon rate, and synthesis cost.

NNK uses N1 N2 K3, where K = G or T at the third position. That produces 32 codons encoding all 20 amino acids plus one stop (TAG). Stop codon frequency is roughly 3% per position. Amino acid coverage is complete but non-uniform: Leu, Ser, and Arg each get three codons, while Met, Trp, and several others get only one. This degeneracy maps directly onto library bias.

NNS uses N1 N2 S3, where S = G or C. Same 32 codons as NNK at the count level, same one stop (TAG), same ~3% stop frequency. The amino acid distribution is slightly different because the codon subset is not identical. In practice, NNK and NNS produce libraries with comparable information content and comparable hit rates. Groups that have optimized one tend to stay with it.

NNN is full randomization: all 64 codons, 20 amino acids, 3 stops (TAA, TAG, TGA). Stop codon frequency per position is roughly 5%. The higher stop rate is the main reason NNN is rarely used for yeast display libraries. At 6 diversified positions, the fraction of stop-free clones drops from ~83% (NNK) to ~73% (NNN). That is real library burned on truncated product.

Trimer mixes use 20 pre-synthesized trinucleotide codons, one per amino acid, pooled at defined ratios. No stop codons. No redundancy. Amino acid frequency is fully user-controlled. The cost is the main constraint: trimer synthesis typically runs two to three times the price of standard randomized oligo synthesis, and vendor turnaround is longer.

When to Pick NNK

NNK is the workhorse of first-round VHH and scFv library construction. Pick NNK when:

  • The library is naive or semi-naive and the goal is broad exploration of CDR sequence space.
  • You are diversifying fewer than about 10 positions and the stop codon tax is tolerable. For a 6-position NNK block the stop-free fraction is (31/32)^6 ~= 82.8%; for 9 positions it drops to ~75%; for 12 positions to ~68%. Past that point trimer starts to pay for itself.
  • Cost is a real constraint and the campaign has budget for one round of library construction, not three.
  • You are screening against a soluble target where FACS enrichment will sort through the stop codon noise in the first round anyway.

The practical ceiling for NNK in a standard yeast display campaign is around 8 to 10 fully randomized positions. Beyond that, the redundant codons for Leu, Ser, and Arg start to dominate and under-sample the smaller amino acids (Trp, Met, Cys).

When to Pick NNS

NNS is close enough to NNK in behavior that the decision between them is usually historical rather than principled. The amino acid distributions differ slightly at the third-position wobble: NNK over-represents a handful of amino acids that NNS under-represents, and vice versa.

Pick NNS when:

  • Your oligo vendor supplies NNS as standard and you want a drop-in substitution.
  • You have existing NNS protocols, NNS-designed primers, or NNS reference libraries and the downstream bioinformatics already accounts for that bias.
  • You are running a paired-library comparison where you want two slightly different bias profiles against the same target.

For most first-time VHH campaigns, NNK and NNS are interchangeable. The differences are visible in a deep NGS readout after sort, not in the first-round hit rate.

When to Pick Trimer

Trimer is the right choice when amino acid representation matters more than cost. Specifically:

  • High-diversity positions where uniform coverage is required. If you are randomizing 12 or more positions in a single CDR, the compounding effect of stop codons and codon redundancy in NNK or NNS degrades your effective library size enough that the extra synthesis cost is worth it.
  • Affinity maturation of a validated lead where you want every position to sample the same 20 amino acids at the same frequency. Controlled trimer mixes can exclude undesired amino acids entirely (for example, Cys for stability, Met for oxidation, Pro for conformational rigidity).
  • Focused alphabet sub-libraries. Trimer can encode any user-defined amino acid subset, which is hard to replicate with a single wobble position.
  • Campaigns where you have already validated the design concept with NNK and are scaling into a larger, more expensive maturation library.

Trimer requires earlier vendor coordination and adds one to three weeks of lead time compared to standard oligo synthesis. For campaigns on a tight timeline, that alone can be the deciding factor.

Codon Bias in S. cerevisiae

Picking a codon scheme at the DNA level does not fully determine what actually displays on the yeast surface. S. cerevisiae has measurable codon preferences. Rare codons translate more slowly and can reduce expression or induce ribosomal stalling, which reduces the effective display level of variants carrying them. Arg CGG, for example, is used at roughly 4% frequency in highly expressed yeast genes, compared to more than 20% for Arg AGA or AGG. A variant whose Arg is encoded by CGG displays at a lower level than a variant whose Arg is encoded by AGA, even if both cells carry functionally equivalent protein.

For NNK and NNS libraries, this matters because the redundant codons for Arg, Leu, and Ser are not all equally well-expressed in yeast. Some variants drop out of the sort not because they fold poorly or bind weakly, but because the yeast ribosome does not produce them efficiently. This is one source of the well-known bias against Arg and Leu variants in yeast display NGS readouts.

Trimer mixes sidestep this entirely. Each amino acid is encoded by a single yeast-preferred codon, chosen at synthesis time. The library that arrives is codon-optimized by construction. For a maturation library where every position matters, this is a real advantage.

NNK and NNS libraries can be partially corrected by codon-usage-aware oligo design, but not fully: the wobble position fundamentally constrains which codons are possible. The practical path is to accept the bias at the first round and use NGS to quantify which amino acids are under-represented in the post-sort population.

The Math for a VHH CDR3

A representative calculation makes the tradeoffs concrete. Consider a 6-position NNK randomization in VHH CDR3:

  • Theoretical DNA diversity: 32^6 = ~10^9 unique oligo sequences.
  • Theoretical amino acid diversity: 20^6 = ~6.4 * 10^7 distinct protein sequences.
  • Stop-free clones: (31/32)^6 ~= 83% of transformants encode full-length protein.
  • Yeast transformation ceiling: ~10^8 unique transformants with optimized electroporation.

At this scale, a well-transformed NNK library can theoretically sample the full 6.4 * 10^7 protein space with coverage, and FACS plus NGS can resolve enrichment across it. Push to 8 NNK positions and theoretical protein space is 20^8 = ~2.6 * 10^10, which exceeds the yeast ceiling by two to three orders of magnitude. At that point the library undersamples by construction and codon scheme choice can either reduce or amplify the undersampling.

The Yeast Display Library Planner runs this math against your scaffold and diversification pattern before you commit to synthesis. It flags cases where the theoretical diversity exceeds the yeast ceiling, where stop codon load reduces the effective library size below your screening depth, or where codon redundancy clusters the library around a small set of amino acids.

Putting It Together

For a first VHH campaign on a single target, NNK at 6 to 8 diversified positions per CDR, screened against a well-chosen hotspot, is a defensible starting point. For a maturation campaign on a validated lead, trimer at the positions that need uniform coverage is worth the cost difference. For paired libraries or method-comparison studies, NNS is a reasonable alternative to NNK with a slightly different bias profile. NNN is rarely the right choice for yeast display given the stop codon tax.

Codon scheme is downstream of three upstream decisions: the target affinity goal (naive discovery vs affinity maturation), the diversification footprint (how many positions, across how many CDRs), and the available budget for synthesis and screening. Get those right first and the codon scheme falls out of the specification.

Scoping a Campaign

If you want the math done for your specific scaffold and diversification pattern, the Yeast Display Library Planner takes a parent sequence, diversified positions, and target library size and returns a scoping-ready plan with codon scheme recommendations, stop codon load, theoretical and achievable diversity, and NGS read depth for each sort round.

For a full campaign scoped end to end, including display construct design, library construction, FACS or MACS selection, and NGS hit calling, the Yeast Display service page covers platform capabilities. To scope a specific project, use the contact form with the yeast display prefill and include the scaffold, target, and approximate diversification footprint.

Share

Ready to start a project?

Tell us about your protein engineering challenge. We will scope a program and get back to you within 24 hours.

Start a project →