From: John Stone (
Date: Tue Jun 06 2006 - 13:14:42 CDT

  For problems like the one you describe, it may be necessary to iterate over
your index set, only accepting atoms which are true for all atoms in your set.

Try the example script I wrote for you below:

# first find all atoms within d of the specified set
set sel [atomselect top "protein within $d of index $set"]
set curlist [$sel list]
$sel delete

# now iterate over the atoms in the set, dropping off atoms from our
# curlist selection when they are too far away
foreach ind $set {
  set sel [atomselect top "(index $curlist) and within $d of index $ind"]
  set curlist [$sel list]
  $sel delete

  John Stone

On Mon, Jun 05, 2006 at 08:36:37PM +0000, wrote:
> Hi,
> I have a preselected set of atoms. If I apply, e.g.
> "atomselect top "protein within $d of index $set",
> I will get the list of atoms on the "loose" criteria: atom will be added to the selection if it is within the distance from any atom in my atom set $set (let me know if I am wrong...).
> Is there any smart way of "tight" selection, when I want to select or find atom, which abeys the distance criteria for ALL atoms in my $set ?
> With best
> Arturas

NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email:                 Phone: 217-244-3349
  WWW:      Fax: 217-244-6078