Bug #104

periodicity not handled correctly in trjconv when converting to pdb

Added by David Mobley about 14 years ago. Updated about 13 years ago.

Erik Lindahl
analysis tools
Target version:
Affected version - extra info:
Affected version:


I'm having problems generating a pdb file in 3.3 that handles periodicity
correctly. In particular, I've tried trjconv on my trajectory to generate a
multi-frame pdb file. g_dist indicates that the ligand remains at a stable
distance from some refernece atoms in the protein throughout the entire
trajectory (as does ngmx), but none of the different pbc options show this
behavior. "-pbc inbox" does keep the ligand in the same box, but it drifts
relative to the protein and jumps around, leading me to think that the wrapping
back into the simulation box isn't being handled correctly.

I have tried all of the different pbc options and can't get the desired
behavior (wrap the ligand -- which, for topology purposes, is part of the same
"molecule" as the protein -- into the same box as the protein CORRECTLY) to work
with any of them.

I am attaching a tpr and trr to reproduce the problem. This is in 3.3, although
the 3.3.1 patches version of trjconv appears to have the same problem.


test.tar.gz (10.2 MB) test.tar.gz files to reproduce problem David Mobley, 08/31/2006 12:56 AM


#1 Updated by David Mobley about 14 years ago

Created an attachment (id=71)
files to reproduce problem

tpr and trr to reproduce

#2 Updated by David van der Spoel about 14 years ago

Have you tried simultaneously centering the protein in the box?
Otherwise this not a real bug but rather an undesirable feature. In principle
the -pbc cluster option should fix this, but centering the protein may work better.

#3 Updated by David Mobley about 14 years ago


I'll give the center option a shot, as I haven't tried it.

However, I'd suggest you try the pbc inbox option: This is behaving mostly as
I'd like, except I think it is actually doing the wrapping into the box wrong -

that is, it must be making some errors as it wraps. The ligand seems to
translate with respect to the protein when I use the inbox option by a SMALL
distance, even though I know it's not doing so. This makes me think that the
routine that handles the periodicity has some kind of a bug.

#4 Updated by David van der Spoel about 14 years ago

How is this different from bug 97 in that case?

#5 Updated by David Mobley about 14 years ago

Bug 97 concerns pdb2gmx; this concerns trjconv. I actually don't see how they
are at all related. I did notice bug 99, but it still doesn't seem to be the
same issue.

#6 Updated by Berk Hess about 14 years ago

trjconv would never cause relative molecular motion of less than a box vector.

Could it be that one of your molecules is partially over a box edge?
trjconv -pbc inbox puts all atoms in the box and can therefore break molecules.
g_dist could then give the wrong center of mass if you did not supply
a tpr file.

I have just committed a fix for the 3.3 CVS version of trjconv.
If your molecules are broken the new -pbc mol option should solve your problem.


#7 Updated by David Mobley about 14 years ago

I'll have to try the changes out out, but could I perhaps suggest taking a look
at my trajectory? I DO use tpr's when I use g_dist; it seems to be working as I
expect -- the problem is just that the conversion to pdb gives "funny" results
as compared to g_dist (and, I might add, compared to ngmx).

#8 Updated by Berk Hess about 14 years ago

I overlooked your attachments.

I tried your files, but could not see any problems.
g_dist gives me the same distances with trr and pdb.

Could you tell me what distances you get between
which groups with trr and pdb?


#9 Updated by David van der Spoel about 13 years ago

Closing this one for lack of activity and since Berk could not reproduce the problems on last testing (a year ago). Feel free to reopen if there is a good example.

Also available in: Atom PDF