[MMTK] Molecular Dynamics Problem
Matteo Memelli
ryu-jin@bigfoot.com
Tue, 17 Apr 2001 10:45:10 CEST
Hello, I'm trying to build a simple Molecular Dynamics simulation using The
Dna and ligand example in the MMTK2 Example directory. Here is the source
code:
from MMTK import *
from MMTK.PDB import PDBConfiguration
from MMTK.NucleicAcids import NucleotideChain
from MMTK.ForceFields import Amber94ForceField
from MMTK.Trajectory import Trajectory, TrajectoryOutput, \
StandardLogOutput
from MMTK.Dynamics import VelocityVerletIntegrator
# Load the PDB entry 110d. It contains a single DNA strand with a
# ligand (daunomycin).
configuration = PDBConfiguration('110d.pdb')
# Construct the nucleotide chain object. This also constructs positions
# for the missing hydrogens, using geometrical criteria.
chain = configuration.createNucleotideChains()[0]
# Construct the ligand. There is no definition of it in the database,
# so it can only be constructed as a collection of atoms. The second
# argument of createMolecules() is set to one in order to allow
# this use of an unknown residue.
ligand = configuration.createMolecules(['DM1'], 1)
# Put everyting in a universe and show it graphically.
universe = InfiniteUniverse(Amber94ForceField())
universe.addObject(chain)
universe.addObject(ligand)
universe.initializeVelocitiesToTemperature(300*Units.K)
# Create an integrator.
integrator = VelocityVerletIntegrator(universe)
# Generate a trajectory
trajectory = Trajectory(universe, "dna.nc", "w")
# Run the integrator for 50 steps of 1 fs, printing time and energy
# every fifth step and writing time, energy, temperature, and the positions
# of all atoms to the trajectory at each step.
integrator(delta_t = 1.*Units.fs, steps = 50, actions =
[StandardLogOutput(5), TrajectoryOutput(trajectory, ("time", "energy",
"thermodynamic", "configuration"), 0, None, 1)])
trajectory.close()
And Here is the error I get:
bash-2.03$ python dna_mdyn.py
Traceback (most recent call last):
File "dna_mdyn.py", line 38, in ?
integrator(delta_t = 1.*Units.fs, steps = 50, actions =
[StandardLogOutput(5), TrajectoryOutput(trajectory, ("time", "energy",
"thermodynamic", "configuration"), 0, None, 1)])
File "/usr/local/lib/python2.0/site-packages/MMTK/Dynamics.py", line 101,
in __call__
evaluator = self.universe.energyEvaluator().evaluator.CEvaluator()
File "/usr/local/lib/python2.0/site-packages/MMTK/Universe.py", line 416,
in energyEvaluator
subset1, subset2)
File
"/usr/local/lib/python2.0/site-packages/MMTK/ForceFields/ForceField.py",
line 212, in __init__
self.global_data)
File
"/usr/local/lib/python2.0/site-packages/MMTK/ForceFields/MMForceField.py",
line 331, in evaluator
self.collectAtomTypesAndIndices(universe, global_data)
File
"/usr/local/lib/python2.0/site-packages/MMTK/ForceFields/MMForceField.py",
line 48, in collectAtomTypesAndIndices
type[a] = o.getAtomProperty(a, self.dataset
File "/usr/local/lib/python2.0/site-packages/MMTK/ChemicalObjects.py",
line 227, in getAtomProperty
return levels[-1].getAtomProperty(atom, property, levels[:-1])
File "/usr/local/lib/python2.0/site-packages/MMTK/ChemicalObjects.py",
line 487, in getAtomProperty
return getattr(self, property)
File "/usr/local/lib/python2.0/site-packages/MMTK/ChemicalObjects.py",
line 52, in __getattr__
return getattr(self.type, attr)
AttributeError: 'AtomType' instance has no attribute 'amber_atom_type'
bash-2.03$
What am I missing?
Thx in advance for your help
Matteo Memelli