how2 select named selections using command-line [chimera1.5.3]

dear chimera users, i can defined named selections and they work under the select menu. however, i canNOT use the command line to select them; e.g., i have 4 named selections 0a,0b,1a,1b dis 0a | 1a works sel 1a NOT working sel :1a NOT working (said selection cleared) i like to be able to select multiple named selections and further apply filters on them; e.g., "select 1a and 1b and atoms=side chain atoms" how do i accomplish this? as always thank you very much. fred

Hi Fred, It may be because your selection name starts with a number. The select command may be more finicky than others because it is overloaded with two different functions, activation of models for motion (indicated by model number without #) and selection of atoms (indicated by model number with # or other specification symbol such as : for residues or @ for atoms). Parsing the select command to try to identify the former case may interfere with recognizing your selection names. I tried making overlapping named selections: sel1a, sel1b and in that case you could accomplish your example with sel sel1a & sel1b & without CA/C1' (the last part means side chain atoms not including the CA/C1', could also use "with CA/C1' "; these are terminal entries under the Select... Structure menu, which can be used as command-line specifiers) I personally prefer to skip selections altogether and instead use the "alias" command in a similar manner. People may gravitate to using named selections because of Pymol terminology. If I understand correctly, Pymol named selections are more like Chimera aliases. For example: alias set1 :10-20.a alias set2 :15-35 sel set1 & set2 & ~ element.H ... see Built-In Classifications and Combinations ... <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html> alias command: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/alias.html> The aliases wouldn't appear in the menu, however, except for "function" aliases as described in the documentation above. I hope this helps, Elaine ---------- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Jan 31, 2012, at 12:27 PM, frederick lee wrote:
dear chimera users, i can defined named selections and they work under the select menu.
however, i canNOT use the command line to select them; e.g., i have 4 named selections 0a,0b,1a,1b
dis 0a | 1a works sel 1a NOT working sel :1a NOT working (said selection cleared)
i like to be able to select multiple named selections and further apply filters on them; e.g.,
"select 1a and 1b and atoms=side chain atoms"
how do i accomplish this? as always thank you very much. fred

hi elaine, thanks for the quick help. i tried using aliases just now. now i have 4 aliases: g0a, g0b, g1a, g1b. i can only sel all 4 groups by using
sel g0a | g0b | g1a | g1b
the & operator returns nothing as there are no intersection among the 4 groups. seemed the & is intersection and not plus here. when i used
sel g0a,g0b,g1a,g1b i got error.
given above, seemed like i need to do something like
sel (g0a | g0b | g1a | g1b) & without CA/C1' but parentheses are not legal here. how should i get around this? thanks again. fred
On 01/31/2012 12:46 PM, Elaine Meng wrote:
Hi Fred, It may be because your selection name starts with a number. The select command may be more finicky than others because it is overloaded with two different functions, activation of models for motion (indicated by model number without #) and selection of atoms (indicated by model number with # or other specification symbol such as : for residues or @ for atoms). Parsing the select command to try to identify the former case may interfere with recognizing your selection names.
I tried making overlapping named selections: sel1a, sel1b and in that case you could accomplish your example with
sel sel1a & sel1b & without CA/C1'
(the last part means side chain atoms not including the CA/C1', could also use "with CA/C1' "; these are terminal entries under the Select... Structure menu, which can be used as command-line specifiers)
I personally prefer to skip selections altogether and instead use the "alias" command in a similar manner. People may gravitate to using named selections because of Pymol terminology. If I understand correctly, Pymol named selections are more like Chimera aliases. For example:
alias set1 :10-20.a alias set2 :15-35 sel set1 & set2 & ~ element.H
... see Built-In Classifications and Combinations ... <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html>
alias command: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/alias.html>
The aliases wouldn't appear in the menu, however, except for "function" aliases as described in the documentation above. I hope this helps, Elaine ---------- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco
On Jan 31, 2012, at 12:27 PM, frederick lee wrote:
dear chimera users, i can defined named selections and they work under the select menu.
however, i canNOT use the command line to select them; e.g., i have 4 named selections 0a,0b,1a,1b
dis 0a | 1a works sel 1a NOT working sel :1a NOT working (said selection cleared)
i like to be able to select multiple named selections and further apply filters on them; e.g.,
"select 1a and 1b and atoms=side chain atoms"
how do i accomplish this? as always thank you very much. fred

Hi Fred, I've committed a change to both the daily build and the 1.6 release candidate that will cause the "sel" command to treat your old selectors as wanting to do atom selection rather than model activation (namely, if the argument to the "sel" commands contains any characters that are illegal in the model-activation mode [anything but dash, comma, period or digits] then it will try to do atom selection). On Jan 31, 2012, at 1:34 PM, frederick lee wrote:
hi elaine, thanks for the quick help. i tried using aliases just now. now i have 4 aliases: g0a, g0b, g1a, g1b.
i can only sel all 4 groups by using
sel g0a | g0b | g1a | g1b
the & operator returns nothing as there are no intersection among the 4 groups.
Right. You said "and" in your original mail and in English that can be ambiguous whether that corresponds to "and" or "or" in boolean logic. As you figured out, you actually wanted the boolean or ("|").
seemed the & is intersection and not plus here. when i used
sel g0a,g0b,g1a,g1b i got error.
given above, seemed like i need to do something like
sel (g0a | g0b | g1a | g1b) & without CA/C1' but parentheses are not legal here. how should i get around this? thanks again.
For a complication selection like this it's probably easiest to do it in two steps: sel g0a | g0b | g1a | g1b ; sel sel & without CA/C1' --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
frederick lee