From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Tue Jul 17 2007 - 21:05:31 CDT

Arneh,
it should work if you define a macro and then use it:

vmd > atomselect macro prot {protein}
vmd > set sel [atomselect top "prot and name ND1"]
atomselect3
vmd > $sel get resname
HIS
vmd >

Peter

Arneh Babakhani wrote:
> No, I think you had it right the first time, it doesn't parse out if
> you do "prot and name NE1". But your original suggestion works, check
> it out:
>
> >Main< 181 % set Peptide [atomselect top "protein"]
> atomselect18070
> >Main< 182 % $Peptide get name
> N H CA CB CG CD1 HD1 CD2 NE1 HE1 CE2 CE3 HE3 CZ2 HZ2 CZ3 HZ3 CH2 HH2 C
> O N H CA CB CG CD1 CD2 C O N H CA CB CG CD1 CD2 C O N H CA CB CG CD1
> CD2 C O N H CA CB CG CD1 CD2 C O N H CA CB CG CD1 CD2 C O
> >Main< 183 % set IndoleNitrogen [atomselect top "[$Peptide text] and
> name NE1"]
> atomselect18071
> >Main< 184 % $IndoleNitrogen get name
> NE1
>
>
> Peter Freddolino wrote:
>> Erm, please forgive me, the second line of the second example should
>> read
>> set IndoleNitrogen [atomselect top "prot and name NE1"]
>>
>> Peter Freddolino wrote:
>>
>>> Hi Arneh,
>>> there are three ways to do this:
>>>
>>> -make a compound selection:
>>> set IndoleNitrogen [atomselect top "protein and name NE1"]
>>>
>>> -Define an atomselect macro:
>>> atomselect macro prot {protein}
>>> set IndoleNitrogen [atomselect top "protein and name NE1"]
>>>
>>> -Access the text of a previous selection in a new selection:
>>> set prot [atomselect top protein]
>>> set IndoleNitrogen [atomselect top "[$prot text] and name NE1"]
>>>
>>> All should be equivalent. The last may be closest to what you were
>>> looking for.
>>>
>>> Best,
>>> Peter
>>>
>>> Arneh Babakhani wrote:
>>>
>>>> Once I've made a selection, how do I use the name of that selection in
>>>> making another selection??? Here's what I mean:
>>>>
>>>>
>>>>> Main< 137 % set Peptide [atomselect top "all protein"]
>>>>>
>>>> atomselect17053
>>>>
>>>>> Main< 139 % set IndoleNitrogen [atomselect top "$Peptide and name
>>>>>
>>>> NE1"]
>>>> atomselect: cannot parse selection text: atomselect17053 and name NE1
>>>>
>>>>> Main< 140 % set IndoleNitrogen [atomselect top "@Peptide and name
>>>>>
>>>> NE1"]
>>>> atomselect: cannot parse selection text: @Peptide and name NE1
>>>>
>>>>
>>>>
>>>> How do I get it to parse the 'Peptide' selection??? Do I need
>>>> brackets somewhere?
>>>> Thanks,
>>>>
>>>> Arneh
>>>>
>>>
>>
>>