I would like to know how to compute each single-residue and pairwise energy gradients for side chain minimization. Moreover I would like to have gradients with respect to dihedral angles (e.g. not in terms of atom placement). By looking at MinPackMover I believe this is do-able but I need a little guidance on the data structures involved. Another comlication is that I would like to evaluate these gradients for a set of side chain angles at each residue (e.g. for pairwise terms I need the gradient at each combination of side chain angles in the sets for the pair of residues).
I currently have code which computes all single-residue and pairwise energies (not gradients) via interaction graphs. In particular I construct a PrecomputedPairEnergiesInteractionGraph object, then for each node/edge in the graph I call get_one_body_.energy_.. or get_two_body_energy_... functions. There does not seem to be a similar interface for getting the gradient terms.
Looking at MinPackMover it seems like I may need to go through a MinimizationGraph. If so is there a simple way to convert an InteractionGraph to a MinimizationGraph so my energy and gradient evaluations don't become disjoint? Or would I need to rewrite the energy evaluation code to utilyze a MinimizationGraph? The most direct solution (I think) is to use ScoreFunction directly, iterate through the energy terms, and call their respective gradient functions, but I'm hoping there is a higher-level interface I can utilize instead.