Step 4
The program to generate a MM model is very simple. It recovers the system created in Step 3, applies an OPLS MM model (with the "protein" parameter set), and then resaves the system for later use:
# . Set up a MM model.
mmmodel = MMModelOPLS ( "protein" )
# . Get the system.
system = Unpickle ( "../step3/step3.pkl" )
# . Add the energy model.
system.DefineMMModel ( mmmodel )
# . Save the system.
mmmodel.ClearModelBuildingData ( )
Pickle ( "step4.pkl", system )
The statement mmmodel.ClearModelBuildingData is unnecessary for the program to work but serves to reduce the size of the file step4.pkl by eliminating irrelevant model-building data from the instance variable mmmodel.
This step will fail if there are definitions or parameters missing from the OPLS parameter set. Generation of force field parameters is a complex topic in its own right and will not be covered in this tutorial. However, Step 4a describes how to create a parameter set or to augment an existing one if the appropriate definitions are at hand.