[gmx-users] g_select syntax

Teemu Murtola teemu.murtola at gmail.com
Sat Sep 6 11:21:14 CEST 2014


On Sep 3, 2014 11:32 PM, "Bin Liu" <fdusuperstring at gmail.com> wrote:
> Thank you for your explanation. Now I understand why the first selection
> gives more residues as it's simply a superset of the second selection. I
> just realized to accomplish what I initially want, i.e., to obtain the
> residue index list of LIPID whose center of mass is within 1.0 nm of the
> surface of protein, I just need
> group "LIPID" and res_com within 1.0 of group "PROTEIN"
> and
>  g_select -sf selection.dat -f traj.trr -s traj.tpr -n system.ndx  -oi
> index.dat -seltype res_com -selrpos atom

Good to hear the explanation was useful.

> Again, I am a bit confused by that it seems the sole function of -seltype
> res_com is outputting residue index instead of atom index.

For g_select, it has no other effect, but for other tools using selections
(which exist in 5.0), it has a more intuitive meaning to influence the type
of positions that will be used for analysis.

> If I use
> -seltype atom instead, g_select will return all the corresponding atoms in
> the residues selected by the selection just above. What frustrates me most
> is I can't find a flag to be used in selection.dat to let g_select output
> residue index, not atom index.

-seltype res_com is exactly equivalent to prefixing every selection with
"res_com of". The -seltype flag just provides a shorthand for doing this in
case there are many selections. Similarly, -selrpos res_com is just a
convenient alternative to specifying using res_com everywhere it is
applicable (like "res_com x" and "res_com within ...").

Hope this helps,

More information about the gromacs.org_gmx-users mailing list