[Chimera-users] Change selection mode programatically

Elaine Meng meng at cgl.ucsf.edu
Sat Feb 7 13:51:21 PST 2015


Hi Mario,
In command-line specifications there are operator symbols that often (but not always) allow you to specify what you want: the vertical bar “|” is for union, the ampersand “&” is for intersection, and tilde “~” is for negation.  Unfortunately there are no parentheses, which can be limiting.  Sometimes it also requires a bit of experimentation to verify which operations are taking priority. See “combinations” in the atom-spec docs, and also examples in the Quick Ref PDF.

<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html>
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/quickref.pdf>

If you are actually working with selection as opposed to simply specification, you can subtract from a selection created in an earlier command with a subsequent “~select” command.
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/select.html#newer>

For example, commands:

select protein & ligand z<5
~select :trp

… would first select protein residues (amino acids) within 5 angstroms of residues classified as ligand, then deselect any tryptophans.

Further, you can add to an existing selection using the union operator, for example:

select sel | solvent

… would add all residues classified as solvent to the existing selection.

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 Feb 7, 2015, at 1:34 PM, Mario J. Borgnia <mborgnia at nih.gov> wrote:

> Hi,
> I am trying to find a way to split a complex selection pattern among a
> number of lines in a script. I was expecting that this would be an
> option to the select command, but apparently it is not. I know that I
> can combine "select" commands by changing the selection mode to "append"
> in the GUI, but I am struggling to find the way of doing this from
> command line or from a script.
> 
> Is there a way to change the selection mode to "append" without using
> the GUI?
> Thanks
> Mario




More information about the Chimera-users mailing list