[gmx-users] gmx trjconv -center -boxcenter zero isn't amazing at putting the selection at (0, 0, 0), but I don't know why

Christopher Neale chris.neale at alum.utoronto.ca
Thu Jun 1 21:59:03 CEST 2017


Dear Users:

Using gmx 5.1.2, I find that centering a selection of the system at (0,0,0) works better via "editconf -c -center 0 0 0" than it does via "trjconv -center -boxcenter zero"

here's the comparison of the center of mass of the selection centered in these two different ways:
TRJCONV:
1000       -0.0356      -0.191707     -0.00163571
EDITCONF:
1000       0.000400002  -1.42837e-05  0.000364283

And that was generated by this script:

#!/bin/bash
. ~/.gmx5.1.2

echo -e "r_2-26_r_40-56_r_69-166_AND_C-alpha\nSystem\n" | gmx trjconv  -f fittedx.gro -s fittedx.gro -n angindex.ndx -o fitted_t.gro "
echo -e "r_2-26_r_40-56_r_69-166_AND_C-alpha\nSystem\n" | gmx editconf -f fittedx.gro -n angindex.ndx -o fitted_e.gro -c -center 0 0 0

echo "r_2-26_r_40-56_r_69-166_AND_C-alpha" | gmx traj -f fitted_t.gro -s fitted_t.gro -n angindex.ndx -com -ox coord_t.xvg
echo "r_2-26_r_40-56_r_69-166_AND_C-alpha" | gmx traj -f fitted_e.gro -s fitted_e.gro -n angindex.ndx -com -ox coord_e.xvg

echo "TRJCONV:"
tail -n 1 coord_t.xvg
echo ""
echo "EDITCONF:"
tail -n 1 coord_e.xvg

#####################

I get exactly the same values with a double precision compilation of gmx used for all steps in the script.

All atoms in the selection are protein c-alpha (and I checked the selection to be sure there was no strange junk in there) so it should not be an issue with mass weighting.

If I change the box size of the input fittedx.gro to be huge, it doesn't affect either result.

I get the same result with gmx 4.6.7

If I take the editconf-centered output .gro file and run it through trjconv centering then it gives the same results as shown above for trjconv centering at zero (the ones that are not quite right).

If I make the box 100,100,100 (exactly) and then use trjconv -boxcenter rect it puts the center of mass at 49.964 49.808 49.904 -- so pretty much the same offsets from the intended value as I reported above for -boxcenter zero.

I can reproduce the issue of trjconv doing a worse job at centering than editconf as long as I have >2 atoms in the centered selection, and that's true even when I use "System" as the selection to be centered for a .gro file with only 3 atoms (all of type CA).

Can anyone see what I am missing?

Thank you,
Chris.


More information about the gromacs.org_gmx-users mailing list