From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jun 12 2007 - 10:36:02 CDT

Richard,
  Probably the easiest way to implement this currently would be to
use the "within" selection to search by increasing radius. We don't
have anything like the "nearest" command you suggest presently, but the
returning a specified quantile from the full set can be implemented by
looping over an increasing radius r until you get a non-empty selection
result, at which point you can simply loop over the selected candidates
and pick the members of the quantile you're interested in (in this case 1).
If people would find this sort of thing very useful, it would be pretty easy
to implement it as a new "measure" command, but that only makes sense if
enough people would use it.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Mon, Jun 11, 2007 at 09:23:57AM -0600, Richard Swenson wrote:
> Hi All,
>
> I am wondering if anyone knows of an efficient way to select the closest
> atom of a given type to a reference atom. Something like this would be
> great:
>
> atomselect top "name P and nearest index 4000"
>
> where the keyword nearest selects the phosphorus atom (P) closest to the
> atom with the index 4000.
>
> Thanks for you help,
> Richard

-- 
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: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078