From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Feb 05 2007 - 14:45:44 CST

Rose,
  You can use $sel text to get the text from another selection,
and combine it with other selections using and/or/not etc..
There isn't a way to combine the atomselection object itself
(e.g. the actual selection name value returned from [atomselect top "all"])
in another selection. You can query the text though and use that.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Mon, Feb 05, 2007 at 09:30:48PM +0100, namd vmd wrote:
> Hi,
>
> Is it possible to use previous atom selections in making new ones ? For
> example, something like this does not work:
>
> set temp [atomselect top "protein and (z>0)"]
> set sel [atomselect top "$temp and name CA]
>
> I know the above can be done in a single selection, but the question is
> whether the $temp variable set in the first line can be used in future atom
> selections ?
>
> Thank you for the the help !
>
> -Rose Lee

-- 
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