[MMTK] Distance atoms, trajectory, and current configuration

Konrad Hinsen research at khinsen.fastmail.net
Thu Feb 11 17:43:45 UTC 2010

On 11 Feb 2010, at 10:47, acevedo at mpi-muelheim.mpg.de wrote:

> Checking the basisVectors of the cell universe (CubicPeriodicUniverse)
> I´ve gotten something like this: [Vector(100, 0, 0), Vector(0, 100,  
> 0),
> Vector(0, 0, 100)].

An edge length of 100 nm seems huge for a molecular simulation!

> the centerOfMass of my universe along the trajectory
> is about Vector(0.9, 1.47, -3.212). It looks like my protein is a  
> little
> out of this cell.

Not at all, the cell is centered around the origin, so coordinates can  
range from -50 to +50.

> This could be making trouble when I try to get the distances.

No. If you use universe.distance(), you should get the right answer no  
matter where your atoms are situated. However,  it is crucial to have  
the correct box size parameters.

> Do you know any way to center the cell box right in the
> centerOfMass of my protein?

cm = protein.centerOfMass()

This will move all molecules such that the center of mass of the  
protein is at the origin. But again, this shouldn't be necessary.

> Anyway, I also tried to create a infiniteUniverse when I import the  
> trajectory and using the following code I could get only the same  
> value
> for every step in the trajectory (0.13 nm for the covalent bond).

Did you check that your DCD trajectory is correct? How did you do the  
conversion DCD -> nc?

> I checked the nc trajectory in VMD and in fact it is not bond-length
> constrained, and the length value given before correspond to the last
> configuration or conformer of my trajectory.

If the nc trajectory looks right in VMD, then it should indeed contain  
reasonable configurations. But VMD does not use the box parameters if  
I remember correctly, so if these are wrong you can still get wrong  
results in MMTK.

> Also for non-periodic universe the following sequence gave me errors:
> for a in trajectory.configuration:
>  universe.distance(atom1, atom2, a)
> in distanceVector
> cell = self._fixCellParameters(conf.cell_parameters)
> AttributeError: 'InfiniteUniverse' object has no attribute
> '_fixCellParameters'

That is indeed a bug in MMTK, which I just fixed by moving the generic  
method _fixCellParameters (the one that fixes nothing) from  
Periodic3DUniverse to Universe.

Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: research at  khinsen dot fastmail dot net

More information about the mmtk mailing list