[MMTK] Creation of a protein from a sequence

Ben Cornett acornet@emory.edu
Mon, 6 Aug 2001 10:56:43 -0400


On Mon, Aug 06, 2001 at 04:42:28PM +0200, Berit Hinnemann wrote:
> 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
> __init__
>     self.translateTo(properties['position'])
>   File "/usr/lib/python1.5/site-packages/MMTK/Collection.py", line 226,
> in translateTo
>     self.translateBy(position-self.centerOfMass())
>   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?
> 
> Thanks,
> Berit

I don't have an answer for you, but since

>>> print chain[0].atoms[0].position()
None

I would say that your problem is that since you haven't specified any atomic
coordinates for the residues yet, MMTK is having a hard time calculating a
center of mass.

Ben