Add differentiable parametric backbone minimization#681
Open
everyday847 wants to merge 16 commits intoRosettaCommons:mainfrom
Open
Add differentiable parametric backbone minimization#681everyday847 wants to merge 16 commits intoRosettaCommons:mainfrom
everyday847 wants to merge 16 commits intoRosettaCommons:mainfrom
Conversation
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
Member
…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
…differentiable-parametric
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: