This is a read-only mirror of


From PyMOL Wiki
Jump to navigation Jump to search


Selection-expressions stand for lists of atoms in arguments that are subject to PyMOL commands. You can name the selections to facilitate their re-use, or you can specify them anonymously (without names). Object and selection names may include the upper or lower case characters A/a to Z/z, numerals 0 to 9, and the underscore character (_). Characters to avoid include:

! @ # $ % ^ &* ( ) ' " [ ] { } \ | ~ ` <> . ? /

Selection-expressions describe the class of atoms you are referencing. Most of them require identifiers to complete the specification. For example, the selector resi references biopolymer residues by sequence number, and the identifier gives the number. The selector name references atoms according to the names described in the PDB, and the identifier gives the name (ca for alpha carbons, cb for beta carbons, etc). A handful of selection-expressions don't require identifiers, but most do.

PyMOL uses several logical operators to increase the generality or specificity of selection-expressions. Logical combinations of selectors can get complex, so PyMOL accepts short forms and macros that express them with a minimum of keystrokes. This section describes named-selections, and then gives the syntax for making selections in a progression from simple one-word selectors to complex combinations of selectors, using macros and short forms.