- Fix crash when YAML combines residue_constraints with file entities
(missing res_aa_constraint_mask concatenation for CIF-loaded chains)
- Add CPU-only unit tests for constraint parsing (30 tests, no GPU needed)
- Add residue_constraints_test.yaml example
- Update showcase YAML with residue_constraints demo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add YAML-based per-residue amino acid constraints that allow users to
force or exclude specific amino acids at exact positions during inverse
folding. This extends the existing global --inverse_fold_avoid flag with
position-level precision.
YAML syntax:
residue_constraints:
- position: 5
allowed: C # Force cysteine
- position: 10..15
disallowed: CMW # Exclude oxidation-prone residues
Implementation:
- Parse constraints in schema.py into (chain_length, 20) mask
- Flow mask through full pipeline: tokenizer -> featurizer -> masker
- Apply as -inf logit bias during autoregressive decoding
- Combine additively with global --inverse_fold_avoid
- Safety checks for fully-blocked positions and shape mismatches
- Save/load constraints in NPZ metadata for multi-step protocols
- Backward compatible: old YAMLs and NPZ files work unchanged
Closes#172 (partial: extends global avoid to per-position control)
Quality checked by: Claude Opus 4.6
Add symmetric_group support for coordinating variable-length insertions and inverse folding across symmetric chains
Add protein-redesign protocol for redesigning existing proteins
Add use_design_mask_for_target parameter for correct metric computation for protein-redesign
Surface other whole-complex metrics for scoring redesigns
Add design_residue_iptm metric and use it to score redesigns
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add symmetric_group support for coordinating variable-length insertions and inverse folding across symmetric chains
Add protein-redesign protocol for redesigning existing proteins
Add use_design_mask_for_target parameter for correct metric computation for protein-redesign
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add _create_gemmi_model() helper function to handle breaking API change
in gemmi 0.7.0 where Model constructor changed from string to int
- Loosen gemmi version constraint from ==0.6.5 to >=0.6.5
Fixes#164