The Selector Construction Panel is opened when Select... Construct Selector is chosen from the menu. This panel is used to construct custom selectors, either for immediate use or for later invocation from the Select menu.
Whatever is selected in the main Chimera window is always available as the special selector named "Existing selection".
To facilitate constructing new selectors, the selector panel has the concept of a "current" selector and a "workbench" selector. The current selector is chosen via the "Selector list" menu button just below the menubar. The workbench selector is a scratch selector that can be edited textually or operated upon with boolean operators (with the current selector as the other operand). The workbench selector can be saved into the selector list as desired.
The leftmost menu in the menubar that spans the top of the selector panel is the "Selector" menu. The items of the menu are used to move or delete selectors. Only selectors created by you can be moved or deleted. The items are:
The middle menu in the menubar is the "Workbench" menu. The items of the menu are used to perform actions on/with the workbench selector. The items are:
The rightmost menu in the menubar is the "Panels" menu. The items of the menu are checkbuttons that control whether the contents of the workbench and current selectors are displayed. If displayed, they will be shown in their own individual panels. A selector's content is typically Python code. The content can instead be an OSL string, but there is rarely any call for this, since OSL selectors are more restrictive than the "Midas atom specifier" selector. The workbench selector panel is editable. See the Python Selectors section for details of how Python-code selectors work.
Directly below the menubar is a menu of all available selectors. Related selectors may be grouped together and made available as a submenu of the selectors menu. The menu button shows the currently chosen selector. If the current selector is in a submenu, only the non-submenu component is shown on the menu button. The full menu path of the selector is always shown in the Status area near the bottom of the selector panel. The selector "Existing selection" always contains whatever is currently selected in the main Chimera window.
One of the selectors in the main list is "Midas atom specifier". Choosing this will bring up a panel in which a Midas atom specifier can be entered. Once an atom spec is entered, this selector is used the same as any other selector for purposes of workbench construction and so forth. Note that it isn't the same as the "Midas atom specifier" menu item/panel in the Chimera "Select" menu; entering an atom spec in one panel has no effect on the other.
Below the selectors menu button is the "Select" area. Buttons in this area are used to select items in the main Chimera window. The "Current" button uses the current selector to select items whereas the "Workbench" button uses the workbench selector. The "Internal bonds" button adds to the selection any bonds that have both endpoint atoms selected.
Below the Select area is the "Workbench" area. Buttons in this area perform operations on the workbench selector.
The "Zone..." button brings up a dialog in which to specify a "selection zone". This selection zone is specified as an angstrom distance from the atoms/bonds currently selected by the workbench selector. The zone may be specified either as all atoms/bonds further away than the distance or (the more frequent case) closer than the distance. The end result is that the workbench selector selects atoms/bonds in the selection zone. If the zone is of the "further away" type, the selection won't include the atoms upon which the zone definition was originally based.
The "Clear" button clears the workbench.
The "Operations" button brings up a menu for performing various operations on the workbench selector. The menu contains:
The status area displays the name of the current selector.
Python Selectors
This section assumes you are familiar with the basics of writing Python code. If you are not, consult the Python tutorial.
When the Python code of a selector is executed, certain useful local variables are "pre-set" for use in the selector. They are: