occ.set_weight(1.5) occ.write_distances('') rmf_restraints.append(occ) output_objects.append(occ) print('nuisances:', occ.get_particles_to_sample()) dof.get_nuisances_from_restraint(occ) socc = occ.get_output() print(socc) ############################## # Shuffle ############################## IMP.pmi.tools.shuffle_configuration(hier, max_translation=50) dof.optimize_flexible_beads(200) ############################# SAMPLING ############################## # Run replica exchange Monte Carlo sampling num_frames = 50000 if '--mmcif' in sys.argv or '--test' in sys.argv: num_frames = 5 rex = IMP.pmi.macros.ReplicaExchange0( mdl, root_hier=hier, crosslink_restraints=rmf_restraints, monte_carlo_sample_objects=dof.get_movers(), replica_exchange_maximum_temperature=3.0, global_output_directory="output/",
cr = IMP.pmi.restraints.stereochemistry.ConnectivityRestraint(mol) cr.add_to_model() output_objects.append(cr) crs.append(cr) # Excluded volume - automatically more efficient due to rigid bodies evr = IMP.pmi.restraints.stereochemistry.ExcludedVolumeSphere(included_objects = mols) evr.add_to_model() output_objects.append(evr) ###################### SAMPLING ##################### # First shuffle the system IMP.pmi.tools.shuffle_configuration(root_hier, max_translation=30) # Quickly move all flexible beads into place dof.optimize_flexible_beads(100) # Run replica exchange Monte Carlo sampling rex=IMP.pmi.macros.ReplicaExchange0(mdl, root_hier=root_hier, # pass the root hierarchy crosslink_restraints=crs, # will display like XLs monte_carlo_sample_objects=dof.get_movers(), # pass MC movers global_output_directory='multiscale_output/', output_objects=output_objects, monte_carlo_steps=10, number_of_best_scoring_models=0, # set >0 to store best PDB files (but this is slow to do online) number_of_frames=1) # increase number of frames to get better results! rex.execute_macro()