[MMTK] Potential Energy Calculation

Patrick Fleming pat.fleming at jhu.edu
Fri May 7 17:34:40 CEST 2004


Just missing an asterisk I believe.

182% more shirl.py
from MMTK import *
from MMTK.Proteins import Protein
from MMTK.ForceFields import Amber94ForceField

test = Protein('ala.pdb')
universe = InfiniteUniverse(Amber94ForceField())
universe.addObject(test)
print universe.energy()
print universe.energyTerms()['electrostatic']

183% python shirl.py
831.429585083
202.061362468

or if you don't want to hardwire the file name,

184% more mmtk_energy.py
from MMTK import *
from MMTK.Proteins import Protein
from MMTK.ForceFields import Amber94ForceField
import sys

universe = InfiniteUniverse(forcefield=Amber94ForceField())
molecule = Protein(sys.argv[1])
universe.addObject(molecule)
print universe.energy()
print universe.energyTerms()['electrostatic']

185% python mmtk_energy.py ala.pdb
831.429585083
202.061362468

Pat


Shirley Hui wrote:

> I would like to calculate the potential energy value of a conformation of a molecule according to a pdb file that I read in.
> I have tried out the example in the paper on page 3.
> 
>    K. Hinsen
>    The molecular modeling toolkit: A new approach to molecular simulations
>    J. Comp. Chem. 21(2), 79-85 (2000) 
> In which, a pdb file is read from the database and stored in the Protein object.  The Protein object is then stored in the universe and then the energy function is caled like the below:
> 
> from MMTK import
> 
> from MMTK.Proteins import Protein
> 
> test = Protein('110d.pdb')
> 
> from MMTK.ForceFields import Amber94ForceField
> 
> universe = InfiniteUniverse(Amber94ForceField())
> 
> universe.addObject(test)
> 
> print universe.energy()
> 
> When I run this code in python, the last line outputs 0.00.
> My expectation was that the energy of the molecule represented in 110d.pdb would be printed out.
> 
> I looked in the user manual, but it appears that all energy related functions are part of the universe object.
> 
> The questions I have are:
> 
> 1) Is it possible to read in a molecular conformation from a pdb file and then calculate it's potential energy value?
> 
> 2) If so, am I doing it correctly above?  If not, how can I do 1)??
> 
> Thank you,
> 
> shirley
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mmtk maillist  -  mmtk at starship.python.net
> http://starship.python.net/mailman/listinfo/mmtk

-- 
Patrick Fleming, Ph.D.
The Johns Hopkins University
Department of Biophysics
201 Jenkins Hall
3400 North Charles Street
Baltimore, MD 21218

Tel: 410-516-7654
Fax: 410-516-4118




More information about the mmtk mailing list