[gmx-users] Atoms in radius of X nm (linking atoms in selection by AND not OR)

Marc Hoemberger hoemberg at brandeis.edu
Thu Mar 29 19:34:28 CEST 2018

I have been reading the manual (specifically gmx help selections  & gmx
select) and trying to apply the correct syntax in reading out water
molecules that satisfy a defined distance to all of my residues.
The manual states that boolean statements are evaluated left to right and
as soon as the first expression is true the next expressions are not
considered anymore. I would like to couple multiple boolean conditions
together but from the manual this seems to be not possible (unless I might
be misunderstanding something)

I have tried to use the following command:

gmx select -f TRJ.xtc -s TOP.tpr -n INDEX.ndx *-select 'group "OW_WATER"
and within 1.5 of resid 157 and within 1.5 of resid 50' *-os POS.xvg -oi
INDI.dat -on INDEX.ndx

which results in all water molecules around 1.5nm of each individual
residue, I would like to get this expressions to evaluate from left to
right completely so that I only get all those atoms that are within 1.5 of
all the mentioned residues (∧), i.e. not a shortcircuited version. Is this
at all possible, or should I try using other programs/scripts for such an

More information about the gromacs.org_gmx-users mailing list