From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Fri Mar 07 2014 - 14:19:02 CST

Hi Antonio,

You are the second person in a month to ask this question, so
fortunately I remember my answer. The short answer is no, that is
currently not implemented (although it would be cool!), and any strictly
atomselection solution doesn't work. The solution is to determine the
atomlist that such a selection *would* give you using a tcl 1-liner, and
feed that into an atomselection using the indexes that come out. This is
the one liner:

lsort -unique -increasing -integer [join [measure contacts 2 [atomselect
top "name X"]]]

Good luck!
-Josh

On 03/07/2014 10:41 AM, Antonio Tilocca wrote:
>
> I would like to use VMD to visualize all atoms X within 2A from
> another X.
>
> Now, the command:
>
> name X and within 2.0 of (name X)
>
> always selects ALL X atoms in the system (not just those near to
> another X) because, I guess, it always finds that the n-th atom of
> species X is located at R=0A from itself.
>
> I was wondering if there is an easy way to exclude from the distance
> search the "self-interaction" between an atom and itself?
>
> Thanks
> Antonio