[MMTK] energy minimizing a small molecule

Robert Jorissen robjorissen at yahoo.com.au
Wed Sep 24 01:54:52 UTC 2008


To get an idea of reading in small molecules into MMTK, I started with heme, since this molecule has an entry in the Database/Molecules/ directory in the MMTK package. The following script successfully reads in a heme molecule and performs energy minimization.

#! /usr/bin/env python

from MMTK import *
from MMTK.ForceFields import Amber94ForceField
from MMTK.PDB import PDBConfiguration

universe = InfiniteUniverse(forcefield=Amber94ForceField())

configuration = PDBConfiguration('hemeH_in.pdb')
molecule = configuration.createMolecules(['HEM'], 1)


from MMTK.Minimization import ConjugateGradientMinimizer
from MMTK.Trajectory import StandardLogOutput

minimizer = ConjugateGradientMinimizer(universe,
minimizer(convergence = 1.e-4, steps = 500)


# from MMTK.Visualization import view
# view(universe)

However, this approach has not worked for other molecules. If I make copies of the heme PDB file and the heme Database/Molecules entry, and only change the PDB name from "HEM" to "HHH", and run the modified Python script, I get the following error message:

$ ./test_heme_alt.py
Traceback (most recent call last):
  File "./test_heme_alt.py", line 21, in <module>
    minimizer(convergence = 1.e-4, steps = 500)
  File "c:\Python25\lib\site-packages\MMTK\Minimization.py", line 195, in __call__
    evaluator = self.universe.energyEvaluator(threads=nt).CEvaluator()
  File "c:\Python25\lib\site-packages\MMTK\Universe.py", line 645, in energyEvaluator
    threads, mpi_communicator)
  File "c:\Python25\lib\site-packages\MMTK\ForceFields\ForceField.py", line 214, in __init__
  File "c:\Python25\lib\site-packages\MMTK\ForceFields\ForceField.py", line 121, in evaluatorTerms
  File "c:\Python25\lib\site-packages\MMTK\ForceFields\BondedInteractions.py", line 97, in evaluatorTerms
  File "c:\Python25\lib\site-packages\MMTK\ForceFields\MMForceField.py", line 82, in evaluatorParameters
    self.collectAtomTypesAndIndices(universe, global_data)
  File "c:\Python25\lib\site-packages\MMTK\ForceFields\MMForceField.py", line 48, in collectAtomTypesAndIndices
    type[a] = o.getAtomProperty(a, self.dataset
  File "c:\Python25\lib\site-packages\MMTK\ChemicalObjects.py", line 336, in getAtomProperty
    return levels[-1].getAtomProperty(atom, property, levels[:-1])
  File "c:\Python25\lib\site-packages\MMTK\ChemicalObjects.py", line 631, in getAtomProperty
    return getattr(self, property)
  File "c:\Python25\lib\site-packages\MMTK\ChemicalObjects.py", line 56, in __getattr__
    return getattr(self.type, attr)
AttributeError: AtomType instance has no attribute 'amber_atom_type'

However, I figure that I am using the same atoms, atom connectivities and atom types, so there should not be missing forcefield parameters. Clearly I am missing something. I would appreciate it if someone could fill me in about this. And is the approach I used even the best way to read in a small molecule using MMTK? Also, I do not see a provision for adding improper angles. Are these automatically generated in MMTK?

Thanks in advance,

Rob Jorissen
Ludwig Institute for Cancer Research, Melbourne branch

      Make the switch to the world&#39;s best email. Get Yahoo!7 Mail! http://au.yahoo.com/y7mail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hemeH_in.pdb
Type: application/download
Size: 6012 bytes
Desc: not available
URL: <http://starship.python.net/pipermail/mmtk/attachments/20080923/a52ea03c/attachment.bin>

More information about the mmtk mailing list