From: Axel Kohlmeyer (
Date: Thu Oct 13 2011 - 14:37:24 CDT

On Thu, 2011-10-13 at 13:48 -0400, Michael LeVine wrote:
> Hi all,
> I'm currently writing a script in which I need to select all the
> residues which have AT LEAST one atom within a distance of a
> designated protein. Using the following commands:
> set sel [atomselect top "resname X and within Y of Z"]

please try:

set sel [atomselect top "same residue as (resname X and within Y of Z)"]


> $sel set segname A
> This only sets the segname of the atoms within Y to A, rather than all
> the residues that have an atom within Y to A. This is probably
> obvious.
> Michael

Dr. Axel Kohlmeyer
College of Science and Technology,
Institute for Computational Molecular Science,
Temple University, Philadelphia PA, USA.