Gmx traj for center of mass

GROMACS version: 2018
GROMACS modification: No

Dear all,
I wonder how to extract the center of mass of individual molecules of a specific group along the trajectory? I am looking for something similar to what “gmx traj -ox” gives out for a group (contains several molecules) of selection, but rather to have COM(x y z) of each molecule print out instead of position of individual atoms of the molecules. A file likes:

t_0 com_x_mol1 com_y_mol1 com_z_mol1 com_x_mol2 com_y_mol2 com_z_mol2 com_x_mol3 com_y_mol3 com_z_mol3

t_1 com_x_mol1 com_y_mol1 com_z_mol1 com_x_mol2 com_y_mol2 com_z_mol2 com_x_mol3 com_y_mol3 com_z_mol3

Of course one option is to have each individual single molecule as a group in index file and then “gmx traj -com -ox” can offer a file for each molecule which needs then to paste the files beside each other, but that is a really tedious when several hundreds of molecules are involved.

I also tried to consider the -mol flag likes “gmx traj -com -mol -ox”, but some weird numbers got printed out. I am not just sure if the -mol flag is meant to do what I want!

Kind regards
Alex

Hi Alex,

You should be able to leverage the selection syntax in gmx trajectory (not gmx traj) to give you what you want by specifying com of ATOM_EXPR [pbc] (didn’t try myself though)

Have a look here:

Thanks Cblau,
My attempt to assign a right selection in “gmx trajectory -select … -n index.ndx …” to produce what I need is unsuccessful.

In my index file I have a group called [ A ] where A contains 1000 molecules. What I need is to print out the xyz_COM of each of those 1000 molecule versus simulation time in a single file.
The -select ‘com of ATOM_A’ does not work in gmx trajectory.
Would you please let me know how that selection should be?

Thank you.