functions/cyclic_utils.py
NEW · ~440 LOC · 11 markers
Central module for all cyclization helpers. JAX helpers: cyclize_relpos, cyclic_bonded_edges, _dihedral_rad. Numpy/BioPython: build_cyclic_reses_mask, compute_cyclic_closure_metrics, cyclic_bond_conect_records. PyRosetta: declare_cyclic_bond, add_cyclic_constraints, enable_cyclic_scorefunction_terms, run_cyclic_validator. Geometry constants: TARGET_N_C_DISTANCE=1.33, TARGET_CA_CA_DISTANCE=3.80, TARGET_OMEGA_DEG=180.0.
functions/colabdesign_utils.py
MODIFIED · +190 LOC · 11 markers
NEW install_cyclic_relpos_patch() monkey-patches colabdesign's AF2 model with a "pre" callback. NEW add_cyclic_bond_loss() — 3-term harmonic penalty (N–C 1.33 Å, Cα–Cα 3.80 Å, ω 180°). binder_hallucination, predict_binder_complex, predict_binder_alone, mpnn_gen_sequence all thread the cyclic flag. plot_trajectory adds a cyclic_bond panel.
functions/pyrosetta_utils.py
MODIFIED · +70 LOC · 7 markers
pr_relax() signature extended with cyclic=False, binder_chain="B". When cyclic=True: calls declare_cyclic_bond + add_cyclic_constraints + enable_cyclic_scorefunction_terms before FastRelax; after FastRelax appends REMARK + CONECT records to the relaxed PDB. score_interface() computes and returns 3 new keys: Cyclic_NC_Distance, Cyclic_CACA_Distance, Cyclic_Omega.
functions/biopython_utils.py
MODIFIED · +45 LOC · 5 markers
calculate_clash_score() signature extended with cyclic=False, binder_chain="B"; pre-computes the {first_res, last_res} frozenset of the binder chain and skips their atom pairs in the inner clash loop (otherwise the 1.33 Å N–C amide bond always triggers a clash). validate_design_sequence() adds a "CYCLIC binder" note.
functions/generic_utils.py
MODIFIED · +130 LOC · 15 markers
NEW module-level _CLI_CYCLIC_OVERRIDE + set_cli_cyclic_override() to forward the CLI --cyclic flag into load_json_settings. clean_pdb() signature extended; preserves CONECT/REMARK/HEADER when cyclic=True. generate_dataframe_labels() appends 3 new columns. check_accepted_designs() tie-breaks by closure distance when cyclic.
bindcraft.py
MODIFIED · +80 LOC · 17 markers
NEW --cyclic and --cyclic_validator CLI flags. Cyclic-mode banner. Sanity-checks binder length (warns if <8 or >60). Threads cyclic=True through pr_relax, calculate_clash_score (4 call sites). Adds cyc_ prefix to design names. PyRosetta init appends -allow_peptide_bond_to_chain_termini true when cyclic.
functions/__init__.py
MODIFIED · +18 LOC · 1 marker
Re-exports cyclic_utils so from functions import * exposes all cyclization helpers.
peptide_cyclic_3stage.json
NEW · ~80 LOC preset
Derived from peptide_3stage_multimer.json. Sets cyclic=true, use_cyclic_bond_loss=true, cyclic_bond_weight=1.0, use_termini_distance_loss=false. Tighter MPNN sampling (num_seqs=20, sampling_temp=0.05). More iterations (100/50/20). Reduced helicity bias (0.5 vs 0.95). Lower acceptance_rate (0.05).
peptide_cyclic_filters.json
NEW · ~250 LOC filter set
Derived from peptide_filters.json. NEW cyclic closure filters: Average/1/2_Cyclic_NC_Distance (≤5.0 Å), Average/1/2_Cyclic_CACA_Distance (≤6.0 Å), Average/1/2_Cyclic_Omega (≥150°). Relaxed Binder_RMSD (2.5→3.5 Å) and Hotspot_RMSD (3.0→4.0 Å) because AF2 monomer is out-of-distribution for cyclic backbones. Tightened dG threshold (0→-10 kcal/mol).