Skip to content

Add differentiable parametric backbone minimization#681

Open
everyday847 wants to merge 16 commits intoRosettaCommons:mainfrom
everyday847:differentiable-parametric
Open

Add differentiable parametric backbone minimization#681
everyday847 wants to merge 16 commits intoRosettaCommons:mainfrom
everyday847:differentiable-parametric

Conversation

@everyday847
Copy link
Copy Markdown
Member

Enables MinMover to co-optimize parametric DOFs (r0, omega0, delta_omega0, etc.) alongside standard atom-tree DOFs (chi angles, backbone torsions for non-parametric residues, jumps).

Components:

  • Analytical Crick equation derivatives (dXYZ/dParam) in numeric/crick_equations/BundleParams_derivatives for r0, omega0, delta_omega0, delta_omega1, and delta_t
  • MoveMap::set_parametric(true) flag to enable parametric DOFs
  • ParametricAtomTreeMultifunc: extends the DOF vector with parametric variables, computes gradients via Jacobian chain rule (dE/dParam = sum_atoms dE/dXYZ . dXYZ/dParam)
  • AtomTreeMinimizer dispatch: detects parametric poses and automatically excludes backbone torsions of parametric residues to prevent redundant DOF control
  • Integration test: 3-helix ELLKAIA bundle minimized with and without chi angle co-optimization

Enables MinMover to co-optimize parametric DOFs (r0, omega0,
delta_omega0, etc.) alongside standard atom-tree DOFs (chi angles,
backbone torsions for non-parametric residues, jumps).

Components:
- Analytical Crick equation derivatives (dXYZ/dParam) in
  numeric/crick_equations/BundleParams_derivatives for r0, omega0,
  delta_omega0, delta_omega1, and delta_t
- MoveMap::set_parametric(true) flag to enable parametric DOFs
- ParametricAtomTreeMultifunc: extends the DOF vector with parametric
  variables, computes gradients via Jacobian chain rule
  (dE/dParam = sum_atoms dE/dXYZ . dXYZ/dParam)
- AtomTreeMinimizer dispatch: detects parametric poses and
  automatically excludes backbone torsions of parametric residues
  to prevent redundant DOF control
- Integration test: 3-helix ELLKAIA bundle minimized with and
  without chi angle co-optimization
@vmullig
Copy link
Copy Markdown
Member

vmullig commented May 1, 2026 via email

watkina6 and others added 14 commits May 1, 2026 12:52
…ization

- Remove protocols/helical_bundle/util.hh include from core-level
  parametric_minimize_util.cc — core cannot depend on protocols
- Rewrite rebuild_parametric_backbone() to call
  numeric::crick_equations::XYZ_BUNDLE() directly and set atom
  coordinates via pose.set_xyz(), using only core/numeric dependencies
- Fix dofs scoping in AtomTreeMinimizer::run() (variable declared
  inside if/else branches but used after)
- All modified files pass g++ -fsyntax-only with no errors
The <Parametric enable="true"/> sub-element was not recognized by
the MoveMap XSD. Instead, add parametric as a top-level attribute
(like bb, chi, jump) on both MoveMapFactory and the legacy MoveMap:

  <MinMover ... bb="false" chi="true" parametric="true"/>

or in MoveMapFactory style:
  <MoveMap bb="false" chi="true" parametric="true"/>

Changes:
- MoveMapFactory: add all_parametric(bool), data members, parse
  in parse_my_tag(), apply in edit_movemap_given_pose()
- MoveMapFactory XSD: add "parametric" attribute
- Legacy MoveMap schema (rosetta_scripts/util.cc): add "parametric"
  attribute and parse in parse_movemap_tag()
- Integration test XMLs: use attribute form
MakeBundle builds poly-ALA; use SimpleThreadingMover to install
ELLKAIA heptad repeat (Glu/Leu/Lys/Ala/Ile — gives chi angles and
inter-helix packing). Add DumpPdb before minimization for comparison.
Sidechain fix: after setting backbone XYZ from Crick equations,
sync the atom tree's internal coordinates by reading phi/psi/omega
back from the new Cartesian positions and writing them as torsions.
Without this, the atom tree retains the old backbone frame and
sidechains don't follow the backbone when it moves.

Trajectory visualization: ParametricAtomTreeMultifunc can now dump
a PDB at each function evaluation via set_trajectory_dump(). Enabled
automatically when the AtomTreeMinimizer tracer is at Debug level
(-out:levels core.optimization.AtomTreeMinimizer:debug).
The previous approach (calling private/protected AtomTree methods)
didn't compile. Use public Pose::set_phi/set_psi/set_omega instead:
reading each backbone torsion from the new XYZ and writing it back
via set_torsion updates the atom tree's internal coordinates, which
triggers a coordinate rebuild that repositions all downstream atoms
including sidechains.
The previous approach (setting backbone XYZ then trying to sync the
atom tree) failed to correctly rebuild sidechain atoms. The fix:

- ParametricAtomTreeMultifunc now takes a RebuildCallback (std::function)
  that is called to rebuild the full pose from current parameter values
- MinMover::inner_run_minimizer() provides this callback — it creates a
  temporary BundleParametrizationCalculator and calls build_helix(),
  which correctly places ALL atoms (mainchain + sidechain) via the
  Crick equations + atom tree operations
- Parametric dispatch moved from AtomTreeMinimizer (core/) to MinMover
  (protocols/), respecting library layering
- AtomTreeMinimizer reverted to original non-parametric code
- Removed broken rebuild_parametric_backbone() from parametric_minimize_util
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants