load { pdb "Insert path to your PA2 .cif file here" saxs "Insert path to your PA2 .dat file here" } symmetry p2 # Ensure the two bodies do not drift too far apart constrain { body1 b1s1 body2 b1 type attract distance 30 } # Save the initial state for comparison output output/rigidbody/symmetry/ save initial_state.pdb save trajectory.xyz # Set up the optimization scheme. # Since the symmetric partner is generated from the real body's _current_ position, # translating or rotating the real body does not change anything. So we disable both of those. parameter_strategy { iterations 500 translate 0 rotate 0 strategy symmetry_only } # Set up the optimization loop. loop optimize_once # Save the full trajectory for visualization. save full.xyz # When a better conformation is found, save it and print the improvement in the command window. on_improvement print { msg "{iteration}/{iterations_total}: Accepted with new chi2 {chi2_no_penalty}" colour green } save trajectory.xyz end end end save final_state.pdb