From: Axel Kohlmeyer (
Date: Tue Sep 06 2011 - 05:11:00 CDT

On Sep 6, 2011, at 5:05 AM, Filip Persson <> wrote:

I am trying to define a cavity in a protein using the atom selection command
in VMD. I tried using

*water and within 3 of (residue X and residue Y)*

this will always evaluate to no atoms

in the 'selected atoms-field' in the graphical representations window, but
nothing happens. Changing the distance does not help, so obviously I must be
doing something wrong here. Is it possible to define cavities in a way
similar to the command above, or should I use any other type of selection

The problem lies in your way of using "and". Each expression in the
selection syntax evaluates into some atoms and those are then combined with
a "logical and" or a "logical or" to form the respective intersection or
union of those selected atoms. So "residue X and residue Y" will evaluate to
"no atoms" and there are no waters within nothing. What you want is
something like "(water within 3 of residue X) and (water within 3 of residue
Y)" and you probably want to prefix that kind of selection with a " same
fragment as ( ... )" to select entire water molecules and not just the
individual atoms that fit the selection.