[gmx-users] Selecting atom indices of residues whose centers of mass match a position range

Teemu Murtola teemu.murtola at cbr.su.se
Wed Jun 6 20:07:57 CEST 2012


On Wed, Jun 6, 2012 at 12:13 AM, Justin A. Lemkul <jalemkul at vt.edu> wrote:
> On 6/5/12 2:55 PM, Andrew DeYoung wrote:
>> I would like to use g_select_d to generate an index file containing the
>> atoms of BF4 residues whose centers of mass are in the range z<12.24 nm.
>> I have tried the following:
>> g_select -f traj.xtc -s topol.tpr -select 'resname BF4 and res_com and
>> z<12.24' -on output.ndx
>> But the selection syntax is incorrect.  Can you please help me?
> Is there a specific error you're getting?  I think the source of the problem
> (guessing that it's just a generic syntax error) is the incorrect use of the
> res_com keyword.  Referring to the examples in the g_select help, it should
> be used something like:

There are two possible uses for the res_com keyword and alike (see
"help positions" in the selection help). This is the first:

> 'res_com of resname BF4 and z<12.24'

This will create a selection that consists of centers of masses of BF4
residues whose any atom is in the selected range. As Justin says, this
is not suitable for writing an index group for atoms.

> Selecting based on a COM below a certain z coordinate value will be more
> complex, and I'm afraid I don't know the syntax to pull that off.

The correct syntax uses the other possible syntax for the position keywords:
    resname BF4 and res_com z < 12.24

- Teemu

More information about the gromacs.org_gmx-users mailing list