Why cyclization improves binders, how RFpeptide made it
computationally tractable in ~50 lines, and why we ported it into
BindCraft rather than wrapping the full RFdiffusion rfpeptides branch.
Definition
What is a head-to-tail cyclic peptide?
A head-to-tail cyclic peptide is a linear peptide in which the N-terminal amine of residue 1 and the C-terminal carboxyl carbon of residue L form a peptide (amide) bond:
The closing amide bond is chemically identical to every other amide bond in the chain (1.33 Å N–C bond length, planar, ω dihedral ≈ 180° in the trans configuration). There are no free termini.
The reaction is performed in solution after Fmoc SPPS synthesis of the linear protected peptide, typically with PyAOP/DIEA in DMF at 1 mM concentration (high dilution suppresses dimerization). It can also be performed on-resin via side-chain anchoring.
Four mechanisms
Why cyclic binders win.
Four mechanisms, all well-established in the peptide-drug literature:
Protease resistance
Exopeptidases (aminopeptidases, carboxypeptidases) require a free N- or C-terminus. A cyclic peptide has neither. Endopeptidases still cleave internal amide bonds, but the ring rigidity reduces the conformational freedom needed to fit a protease active site. Cyclic peptides often show 10–100× longer half-lives in human serum.
Membrane permeability
Linear peptides >5 residues rarely cross lipid bilayers because their termini and backbone NH groups H-bond with water. Cyclization reduces solvent-exposed polar surface and can promote intramolecular H-bonding (the "chameleonic" conformer). Cyclosporin A — 11-aa cyclic peptide — is the canonical example: orally bioavailable.
Conformational preorganization
A linear peptide in solution samples an ensemble; on binding, it adopts a single conformer, paying T·ΔS_conf ≈ 1–3 kcal/mol for a 15-aa peptide. A cyclic peptide's conformational space is sharply reduced by ring closure, so the entropic cost of binding is smaller — apparent K_D improves by 1–3 orders of magnitude.
Entropic binding advantage
For ordered binders, ΔG = ΔH − T·ΔS. Reducing |T·ΔS_unfavorable| directly improves ΔG. This is the same principle as "preorganization" in host–guest chemistry and is the main driver of cyclic peptide affinity.
Comparison
Cyclization strategies compared.
Six common strategies. Head-to-tail is Cyclic BindCraft's default; the others are either supported with extra configuration or on the future-work list.
Strategy
Bond type
Cyclic-BindCraft supports?
Notes
Head-to-tail amide (this work)
N(1)–C(L) peptide bond
Yes — default
Most common; preserves sidechain chemistry; works for any 12–60-aa peptide
Disulfide
Cys–Cys thiol bridge
Not by default; remove C from omit_AAs + set cyclic_binder: false
Easy to synthesize; reduction-sensitive (cellular environment cleaves)
Lactam (sidechain-sidechain)
Glu/Asp–Lys amide
Not currently
Used for stapled α-helices
Stapled (hydrocarbon)
α,α-disubstituted olefin metathesis
Not currently
Requires non-canonical residues; best for helical binders
Thioether (lanthionine)
Cys–dehydroalanine
Not currently
Found in lantibiotics; specialized chemistry
Bicyclic
Two independent bridges
Not currently
Would require multiple DeclareBond calls; future work
D-amino acid inclusion
Backbone chirality flip
Yes
Set d_chains: "B" and use a D-enabled Rosetta scorefunction; AF2/MPNN predictions less reliable on D-backbones
Head-to-tail was chosen as the default because (a) it is the simplest chemistry; (b) it preserves the canonical backbone amide bonds AF2/MPNN were trained on; (c) RFpeptide proved that a single cyclic encoding handles it elegantly.
The problem
The computational challenge.
AlphaFold2 and ESMFold see a protein as a 1-D sequence of residues with a learned 2-D pairwise relative-position embedding. The structure module iteratively refines residue coordinates using these embeddings plus an MSA (or single-sequence) representation.
For a linear peptide of length L, the relative-position embedding for pair (i, j) is roughly bucketize(j − i). For (i=1, j=L), the value is L − 1, which falls outside the trained bucket range [−32, +32] once L > 33. AF2's structure module therefore treats residues 1 and L as "very far apart" — which is correct for a linear chain but wrong for a cyclic chain, where 1 and L are bonded neighbors.
Two consequences:
Hallucination fails. If you ask AF2 to design a cyclic peptide by hallucination, it has no signal that 1 and L should be close. The termini drift apart by 10–30 Å.
Validation fails. If you give AF2 a cyclic backbone as input and ask it to predict the structure from sequence alone, it will predict a linear structure with two floppy termini. The pLDDT around residues 1 and L will be poor, and the predicted structure will not match the true cyclic geometry.
The same applies to ESMFold, OmegaFold, and any other structure predictor trained on linear sequences.
The trick
RFpeptide's elegant solution.
The RFpeptide paper (Rettie, Juergens, Adebomi et al., Nat. Chem. Biol. 21, 1948–1956, 2025) introduces a strikingly simple fix: wrap the relative-position encoding for residues on the cyclic chain.
5.1 The cyclic 2D relative positional encoding
For any pair (i, j) on a cyclic chain of length N, the shortest path around the ring is min(|j − i|, N − |j − i|). RFpeptide implements this by:
RFpeptide cyclic wrap (paraphrased)
seqsep = j - i # raw separation
if seqsep > N / 2: seqsep -= N # going the other way around is shorter
if seqsep < -N / 2: seqsep += N
After this wrap, residues 1 and L on a 33-mer have seqsep = ±1, identical to a normal i, i+1 pair. AF2's structure module sees them as sequence-adjacent, and the trained priors (3.8 Å Cα–Cα distance, planar amide geometry) naturally kick in.
5.2 The cyclic bonded edge
RFpeptide adds a second feature: in the SE(3) graph's "bonded neighbor" matrix, the entry for (L, 1) is set to +1 (and (1, L) to -1), identical to what a real bonded pair would have. This tells the SE(3) transformer that those two residues are covalently connected — even though there is no explicit linker or chain break in the input.
5.3 Total cyclization code: ~50 lines
The entire cyclization machinery in the rfpeptides branch of RFdiffusion is:
Embeddings.py::PositionalEncoding2D.forward (lines 25–56): wrap seqsep for cyclic-chain pairs. ~30 lines.
util_module.py::get_seqsep (lines 101–133): add the bonded edge between first and last residue. ~20 lines.
inference/model_runners.py (lines 284–303): build the cyclic_reses mask from cyc_chains. ~15 lines.
Key insight
No chain break is inserted. No glycine linker is added. No coordinate constraint is used during diffusion. The cyclic topology is purely a pairwise positional bias. The chemical N–C amide bond is added at synthesis time by Fmoc SPPS + PyAOP/DIEA.
This is the key insight: the trained network already knows what a peptide bond looks like (every adjacent residue pair in training data has one). All you have to do is tell it that residues 1 and L are adjacent.
The Cyclic BindCraft port
Our cyclize_relpos in functions/cyclic_utils.py is a direct JAX port of RFpeptide's PositionalEncoding2D.forward:
Keep BindCraft's AF2-hallucination backbone. Port RFpeptide's cyclize_relpos and cyclic_bonded_edges into ColabDesign's AF2 model. Replace the soft add_termini_distance_loss with a hard cyclic encoding + N–C bond loss. Add a constrained FastRelax. Ship new JSON presets.
No heavyweight dependency (no SE(3)-Transformer, no e3nn, no OpenFold weights, no +12 GB)
~3 min/trajectory on an A100 (BindCraft's AF2 vs. RFdiffusion's ~30 s + 4 MPNN rounds)
The add_termini_distance_loss hook is already there — a ~30-line replacement
Algorithmic minimalism — the encoding is the entire trick
Alternative considered
Option B — Wrap RFdiffusion
Wrap the full RFdiffusion rfpeptides branch as a sub-tool inside BindCraft. Replace binder_hallucination with a call to run_inference.py with inference.cyclic=True. Keep BindCraft's MPNN/AF2/FastRelax/filter pipeline downstream.
Option B remains available for users who want maximum fidelity: install RFdiffusion's rfpeptides branch, generate cyclic backbones externally, and feed them into BindCraft's MPNN+FastRelax+filter pipeline. The Cyclic BindCraft patch is structured so this is a drop-in replacement at Stage 2 (binder_hallucination).
Enforced geometry
The amide bond geometry we enforce.
The closing amide bond is a normal peptide bond, so we enforce the canonical geometry:
Property
Target
Tolerance
How enforced
N(1)–C(L) bond length
1.33 Å
±0.05 Å
BondLengthConstraint in pr_relax_cyclic; harmonic in add_cyclic_bond_loss
Cα(1)–Cα(L) distance
3.80 Å
±0.30 Å
Harmonic term in add_cyclic_bond_loss; checked by cyclic_CACA_distance filter
ω dihedral (Cα(L)–C(L)–N(1)–Cα(1))
180° (trans)
±30°
DihedralConstraint in pr_relax_cyclic; checked by cyclic_omega filter
Bond angle Cα(L)–C(L)–N(1)
116°
±5°
BondAngleConstraint in pr_relax_cyclic
Bond angle C(L)–N(1)–Cα(1)
123°
±5°
BondAngleConstraint in pr_relax_cyclic
These numbers are the same ones used by Rosetta's fa_standard residue parameter set for the canonical peptide bond, so the constraints do not fight the scorefunction during FastRelax.
Cis vs. trans
The cis amide (ω = 0°) is disfavored by ~2–3 kcal/mol in canonical peptides and is rare in designed proteins; we enforce trans by default. If you want a cis-proline-like closing bond (rare), set cyclic_bond_target_omega: 0.0 in your preset.
Honest assessment
Known limitations & future work.
8.1 Linear iteration order
The cyclic relpos wrap modifies the pairwise embedding but not the residue index itself. AF2's structure module still iterates over residues 1, 2, 3, …, L in order; it does not see residue L as immediately preceding residue 1. The cyclic bond loss + cyclic relpos is still sufficient to drive the binder into a cyclic geometry, but the predictive confidence (pLDDT) of the binder alone is often slightly underestimated for cyclic designs.
8.2 Second-pass validator recommended
For designs you intend to synthesize, run AfCycDesign or RF2-cyclic as an independent cyclic-aware predictor. These networks were trained for prediction (not hallucination) and provide a more reliable iPAE estimate. If both BindCraft's AF2-with-cyclic-relpos and AfCycDesign agree the design is well-folded, you have high confidence.
8.3 Length ceiling at ~60 aa
The cyclic relpos wrap assumes the chain is roughly the same length on both paths around the ring. For very long binders (60+ residues), the cyclic encoding becomes less informative (the "shortest path" assumption breaks down because both paths are long). Keep binder length in the 25–55 residue range for cyclic designs.
Open questions
Open scientific questions & future work.
Cyclic-aware MPNN. ProteinMPNN treats the binder as a linear sequence. A cyclic-aware inverse folder (e.g. an MPNN retrained on cyclic backbones, or a graph neural network that takes the cyclic adjacency matrix as input) might produce better sequences. The RFpeptide paper does not modify MPNN; neither do we. Future work.
Bicyclic and sidechain-bridged topologies. Currently only head-to-tail is supported. Extending to bicyclic (two DeclareBond calls + two cyclic wraps) or stapled (lactam) is conceptually straightforward but requires careful constraint bookkeeping.
D-amino acid inclusion. The pipeline can already accept D-amino acids if you swap in a D-enabled PyRosetta scorefunction and flip the relevant Cα coordinates. AF2's confidence on D-backbones is unreliable because it was not trained on them; AfCycDesign has the same limitation.
Length-aware cyclic encoding. The current cyclize_relpos divides by N/2 to decide when to wrap. For very short peptides (N < 10), the wrap is degenerate (every pair wraps). For very long (N > 60), the encoding loses discrimination. A length-adaptive wrap (e.g. learnable per-length) might help.
Oral bioavailability prediction. Cyclic BindCraft optimizes for binding affinity and structural closure. A filter that predicts oral bioavailability (e.g. via the chameleonicity score from the CycPeptMPDB benchmark) would be a useful addition.
These are research directions; for now, the cyclic-AF2 + constrained FastRelax + cyclic-aware filter pipeline is sufficient to produce synthesis-ready cyclic binders in a few hours per target.