OK, now I know why.... it's centering (max-min)/2 and not the center of mass or 
center of geometry. I knew this 6 years ago but appear to have forgotten 😉


https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2011-June/062239.html


I'll hack the code in gmx_trjconv.c to get the behaviour I need.


Thank you,

Chris.

________________________________
From: gromacs.org_gmx-users-boun...@maillist.sys.kth.se 
<gromacs.org_gmx-users-boun...@maillist.sys.kth.se> on behalf of Christopher 
Neale <chris.ne...@alum.utoronto.ca>
Sent: 01 June 2017 15:58:58
To: Discussion list for GROMACS users
Subject: [gmx-users] gmx trjconv -center -boxcenter zero isn't amazing at 
putting the selection at (0, 0, 0), but I don't know why

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.
--
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.

Reply via email to