[MMTK] Creation of a protein from a sequence

Berit Hinnemann Berit.Hinnemann@fysik.dtu.dk
Mon, 06 Aug 2001 16:42:28 +0200

Hi all,

I am trying to create a protein by specifying the chain sequence and the
position of the center of mass. I am using the following commands

from MMTK import *
from MMTK.Proteins import PeptideChain, Protein
from MMTK.ForceFields import Amber94ForceField

universe = InfiniteUniverse(Amber94ForceField())

chain = PeptideChain('GG')
universe.protein = Protein(chain,position=Vector(1.0,0.0,0.0))

and I get the following error message

Traceback (innermost last):
  File "gly_center.py", line 10, in ?
    universe.protein = Protein(chain,position=Vector(1.0,0.0,0.0))
  File "/usr/lib/python1.5/site-packages/MMTK/Proteins.py", line 612, in
  File "/usr/lib/python1.5/site-packages/MMTK/Collection.py", line 226,
in translateTo
  File "/usr/lib/python1.5/site-packages/MMTK/Collection.py", line 86,
in centerOfMass
    mr = mr + a._mass * a.position(conf)
TypeError: number coercion failed

Does anybody have an idea what I am doing wrong here?


Berit Hinnemann, Dipl.-Phys.
Center for Atomic-Scale Materials Physics (CAMP)
Dept. of Physics, Technical University of Denmark
Building 307, DK-2800 Lyngby, Denmark 
Phone: +45 4525 3209, Fax: +45 4593 2399