# [gmx-users] Analysis programs and PBC.

Tsjerk Wassenaar tsjerkw at gmail.com
Mon Feb 27 10:41:09 CET 2006

```Hi,

Do note how the jumps are removed. First of all, this is done atom-wise. For
the first frame, the position of each atom is checked against the position
in the given reference, and if there's a distance between them larger than
half the box vector, it is shifted back over the lattice. For each
successive frame, the positions are checked against the positions in the
foregoing frame (already reset). Therefore, giving a reference structure
which is different from the first frame can give weird results.

The only thing which can really screw the stuff, is when you already
pretreated your trajectory using a procedure which changes orientations of
the system; typically fitting. Now this could be dealt with properly iff
fitting (notably the rotation of the system) was also applied on the box
vectors, which are also stored in the .xtc/.trr/.gro/.pdb trajectory file.
In addition, before removing jumps, the rotation should be taken into
account explicitly... That way (provided that the reference structure
corresponds to the first frame) you'd get pretty robust behaviour. Besides
(though maybe this should be on the developers list) the removal of jumps
could be done according to:

transpose(fr.box, S);
m_inv(S, T);
for (i=0; i<natoms; i++) {
mvmul(T, fr.x[i], fr.x[i]);
mvmul(T, xp[i], xp[i]);
fr.x[i][0] += round(xp[i][0] - fr.x[i][0]);
fr.x[i][1] += round(xp[i][1] - fr.x[i][1]);
fr.x[i][2] += round(xp[i][2] - fr.x[i][2]);
mvmul(S, fr.x[i], fr.x[i]);
mvmul(S, xp[i], xp[i]);
}

which works for all possible triclinic boxes, whatever the orientation, and
avoids shifting iteratively.

Ciao!

Tsjerk

--

Tsjerk A. Wassenaar, M.Sc.
Groningen Biomolecular Sciences and Biotechnology Institute (GBB)
Dept. of Biophysical Chemistry
University of Groningen
Nijenborgh 4
9747AG Groningen, The Netherlands
+31 50 363 4336
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20060227/ac87a10f/attachment.html>
```