[gmx-users] Invalid selection near '&' syntax error -- easy way to avoid?

Teemu Murtola teemu.murtola at gmail.com
Sat May 21 05:33:47 CEST 2016


Hi,

On Sat, May 21, 2016 at 1:09 AM Christopher Neale <
chris.neale at alum.utoronto.ca> wrote:

> I find that gmx make_ndx will create groups with names that have
> ampersands in them and that this complicates piping the group name back
> into an analysis tool. I have included an example below. There is an
> obvious solution with sed to rename the group in the .ndx file after
> creation (this is what I am doing now). However, I'm thinking about posting
> a redmine feature request since ideally I think the tool will not require
> an external step for name-based selection and I wanted to ask here first
> just in case I am missing something.
>

Three points:

   - If you need to select a group with non-alphanumeric names in gmx rdf
   or other selection-enabled tools, you simply need to put the group name in
   double quotes.
   - There is no need to pipe the selections to gmx rdf. You can simply
   write "gmx rdf -ref '<group 1>' -sel '<group 2>'", which at least to me is
   much more obvious.
   - There can be cases where writing an intermediate index file is
   justified, but for one-off groups, it is easier to just specify them
   directly to gmx rdf or other tools as a static selection like "name A B and
   resname 1 to 64", passed directly to the command-line options. Or if you
   need to reuse the same selection multiple times, you can put it in a file
   and pass it using -sf (like -ref -sf myselection.txt, or even -ref -sel -sf
   myselection.txt, which reads both selections from the same file).

Best regards,
Teemu


More information about the gromacs.org_gmx-users mailing list