To get position of a molecule without jump

GROMACS version: 2020.2
GROMACS modification: No

I had run a simulation of 100 ns including 1 molecule of A and 2000 molecule of B in a box size of 5 nm with NPT equilibration run and NVT production run with pbc on and generated nvt.xtc file. The box size after equilibration stabilize around 4 nm.
Now I want to generate a file containing real position of center of mass of molecule A from initial to 3 ns without pbc (i.e. to find real coordinates of A) so that the coordinates would not have jump due to pbc. And I had tried the following gmx codes in order to generate the same:

  1. gmx trajectory -f nvt.xtc -s nvt.tpr -b 0 -e 3 -tu ns -seltype mol_com -ox position_A.xvg
  2. gmx trajectory -f nvt.xtc -s nvt.tpr -b 0 -e 3 -tu ns -seltype mol_com -nopbc -ox position_A_nopbc.xvg
  3. gmx trajectory -f nvt.xtc -s nvt.tpr -b 0 -e 3 -tu ns -seltype mol_com -pbc no -ox position_A_pbcno.xvg
  4. gmx trajectory -f nvt.xtc -s nvt.tpr -b 0 -e 3 -tu ns -seltype mol_com -pbc yes -ox position_A_pbcyes.xvg

But when I viewed these all 4 xvg files I found no any differences in the coordinates. The pbc effect was unable to nullified by (-nopbc) and (-pbc no) extensions and everytime either x or y or z coordinate reaches near to 3.931nm (box size), the coordinate suddenly jumps around 0 nm in next frame where in maximum case each coordinate shift, after every successive frame, is less than about 0.1 nm. I am stuck in this problem.
Help me to figure out my problem.
Thanks in advance.


You can first post-process the trajectory file xtc using gmx trjconv
(see some workflow Terminology — GROMACS 2021 documentation) to remove the jump, (then visualize the trajectory to see how it looks like), then use gmx traj or gmx trajectory to extract from the previuos obtained xtc file the position of A.

Best regards

Hi alevilla, your suggestion now solves my issue. I would write here so that it would be helpful if someone stuck with same problem.
I had used following gromacs codes in order to get the coordinates of molecule A without pbc or jump:

  1. gmx trjconv -f nvt.xtc -s nvt.tpr -pbc no jump -o nvt_nojump.xtc -tu ns
  2. gmx trajectory -f nvt_nojump.xtc -s nvt.tpr -ox position_moleculeA.xvg -seltype mol_com
1 Like