[gmx-users] g_select position variables

Teemu Murtola teemu.murtola at gmail.com
Thu Jul 31 19:49:08 CEST 2014


On Tue, Jul 29, 2014 at 6:18 AM, Cara Kreck <cara_a_k at hotmail.com> wrote:

> Is it possible to use a position variable in conjunction with x,y,z
> keywords in g_select?

Unfortunately, this is currently not possible.

I'm trying to select all molecules within a channel embedded in a membrane.
> In case the protein and/or membrane moves around I want to use position
> variables instead of numerical values to define the z range. I've tried
> this in my selection.dat file:
> solution = resname SOL or resname CL;
> top = res_com of resnr 1181;
> bottom = res_com of resnr 55;
> cavity = solution and z bottom to top;
> cavity;
> and
> cavity = solution and z<top and z>bottom;
> cavity;
> But I get an invalid selection error. However, if I substitute top and
> bottom with numbers, it does work. Is there something wrong with my syntax
> or am I just trying to do the impossible?

Yes, this is as expected. There is currently no way to generate single
numbers from position-valued expressions like "top" and "bottom" above. It
may be difficult to implement either of the above syntaxes, but what could
be relatively easy is that one could write "z of top" to extract a number
which could then be used in comparisons. But it may take time before I get
around to implementing anything like this.

Best regards,

More information about the gromacs.org_gmx-users mailing list