[MMTK] extract residues and copy to a new universe

Peter Schmidtke pschmidtke at mmb.pcb.ub.es
Fri Oct 23 18:26:55 UTC 2009


Dear mmtk Mailing list readers,

I am just starting with MMTK but basically I want to do the following.
Given a PDB structure coming from an Amber trajectory I would like to read
it, extract two residues and put them in an empty universe to calculate the
energy of this universe. I tried the following :



        from MMTK.PDB import PDBConfiguration 


        import MMTK as m 


        from MMTK.ForceFields import Amber99ForceField 


        configuration=m.PDB.PDBConfiguration("mysnapshot.pdb") 
        molecules = configuration.createAll() 
        u2 = m.InfiniteUniverse(Amber99ForceField()) 

        u2.addObject(m.copy(molecules[0][0][1])) # copy residue 2 of
molecules u2.addObject(m.copy(molecules[0][0][2])) # copy residue 3 of
molecules 


        u2.energy() 


this yields the following error after the energy command :

Traceback (most recent call last):
  File "test.py", line 25, in <module>
    u2.energy()
  File "/usr/local/lib64/python2.6/site-packages/MMTK/Universe.py", line
801, in energy
    eval = self.energyEvaluator(subset1, subset2)
  File "/usr/local/lib64/python2.6/site-packages/MMTK/Universe.py", line
780, in energyEvaluator
    threads, mpi_communicator)
  File
"/usr/local/lib64/python2.6/site-packages/MMTK/ForceFields/ForceField.py",
line 216, in __init__
    self.global_data)
  File
"/usr/local/lib64/python2.6/site-packages/MMTK/ForceFields/ForceField.py",
line 124, in evaluatorTerms
    global_data)
  File
"/usr/local/lib64/python2.6/site-packages/MMTK/ForceFields/BondedInteractions.py",
line 95, in evaluatorTerms
    global_data)
  File
"/usr/local/lib64/python2.6/site-packages/MMTK/ForceFields/MMForceField.py",
line 84, in evaluatorParameters
    global_data)
  File
"/usr/local/lib64/python2.6/site-packages/MMTK/ForceFields/BondedInteractions.py",
line 52, in evaluatorParameters
    for angle in bu.bonds.bondAngles():
AttributeError: 'list' object has no attribute 'bondAngles'

What does this mean. The residues I copy are standard residues (LYS and VAL
if I remember well). I suppose I do not have to copy residues like this,
but how then? I tried deep copy but it yielded other errors.

I would be greatful for any help.

Thanks in advance.

-- 

Peter Schmidtke

----------------------
PhD Student at the Molecular Modeling and Bioinformatics Group
Dep. Physical Chemistry
Faculty of Pharmacy
University of Barcelona




More information about the mmtk mailing list