molecule
pDynamo

Molecular Mechanical Methods

pDynamo implements a number of MM techniques as alternatives or complements to its QC potentials. The following program, Example7.py, employs the OPLS-AA force field to calculate the potential energy and dipole moment of various conformations of the bALA molecule:

        # . Define the list of structures.
        xyzfiles = [ "bala_alpha.xyz", "bala_c5.xyz", "bala_c7ax.xyz", "bala_c7eq.xyz" ]

        # . Define the MM and NB models.
        mmmodel = MMModelOPLS ( "bookSmallExamples" )
        nbmodel = NBModelFull ( )

        # . Generate the molecule.
        molecule = MOLFile_ToSystem ( os.path.join ( molpath, "bala_c7eq.mol" ) )
        molecule.DefineMMModel ( mmmodel )
        molecule.DefineNBModel ( nbmodel )
        molecule.Summary ( )

        # . Loop over the structures in the xyz files.
        results = []
        for xyzfile in xyzfiles:
            molecule.coordinates3 = XYZFile_ToCoordinates3 ( os.path.join ( xyzpath, xyzfile ) )
            energy = molecule.Energy ( )
            dipole = molecule.DipoleMoment  ( )
            results.append ( ( xyzfile[5:-4], energy, dipole.Norm2 ( ) ) )

        # . Output the results.
        table = logfile.GetTable ( columns = [ 20, 20, 20 ] )
        table.Start  ( )
        table.Title  ( "Energy Model Results for bALA" )
        table.Heading ( "Conformation" )
        table.Heading ( "Energy" )
        table.Heading ( "Dipole" )
        for ( label, energy, dipole ) in results:
            table.Entry ( label )
            table.Entry ( "%.1f" % ( energy, ) )
            table.Entry ( "%.3f" % ( dipole, ) )
        table.Stop ( )
        

Initially the program defines the list of structures, contained in XYZ files, whose energies are to be determined. This is followed by a series of statements that define the MM and non-bonding (NB) models to use in the calculation and set up the bALA molecule given a MOL file representation. It is to be noted that the system's MM model is defined before its NB model. The energy and dipole moment of each structure are then determined and the program terminates by outputting the computed results to a table.

Exercises

Valid XHTML 1.0 Strict
Last modification time (GMT): Tue Jul 13 14:26:56 2010
Copyright © 2007–2010 Martin J. Field