This is a 2D constraint-satisfaction analogue of "motif scaffolding": instead of a trained diffusion model, a real simulated-annealing / gradient-descent optimizer folds a chain of connected residues so that a handful of them land on a fixed target catalytic geometry, while the rest of the chain stays a plausible connected, clash-free backbone.
E(p) = k_cat · Σ_k |p[a_k] − T_k|² (motif pull)
+ k_bond · Σ_i (|p_i+1 − p_i| − L0)² (connectivity)
+ k_bend · Σ_i |p_i − mid(p_i-1,p_i+1)|² (persistence)
+ k_rep · Σ_|i-j|≥3, d<Dc (Dc − d)² (steric clash)
p_i ← p_i − η·∇E + T(step)·ξ, T(step) = T0·e^(−λ·step)
Every animation frame runs several of these gradient-descent steps plus a shrinking random thermal kick T(step) — the simulated-annealing part, which lets the chain escape early tangles before settling. The guidance strength plays the same role as in the 3D diffusion version: at generation time each target point T_k is offset from the true ideal motif position T_k* by a fixed random residual scaled by (1 − guidance), so the optimizer still converges — but converges onto a geometry that is off from the true active site whenever guidance is below 100%. The constraint-satisfaction error readout is the RMSD between each catalytic residue's current position and the true ideal motif point T_k* (not the offset target), so it exposes exactly that gap.
- Preset — swaps the target catalytic geometry: a 3-residue triad, a 3-ligand metal-coordination site, or a 2-residue dyad, drawn as the dashed fixed anchor triangle/segment.
- Scaffold length — how many residues fold around the fixed motif; longer chains need more connective loop.
- Guidance strength — how tightly the optimizer's target pins the catalytic residues to the true ideal geometry; watch the constraint-satisfaction error floor rise as it drops.
- Backbone clashes — non-adjacent residue pairs (|i−j| ≥ 3) closer than the clash radius, a simplified steric term.
- Generate new sample — re-scatters the chain as a random unfolded coil and restarts the annealing schedule from T0, exactly like re-running the optimizer for a fresh design candidate.