Select Commands in Chime and RasMol
by Eric Martz (4/27/98, revised 10/26/98)

Chime vs. RasMol
Select vs. Restrict
General form of the select command
Expressions Further Information

If you are reading a paper version of this document and have access to the web, you can follow the hyperlinks herein by going to

Chime vs. RasMol

In Chime, commands are typed into one slot, and Chime's replies ("messages") come back into a different slot or box. In contrast, in RasMol, there is a single command-line window which both accepts typed commands and displays RasMol's messages or replies.

With Chime, you can use the select commands described here only on web pages which have a command line slot. Most pages which have a command line slot will also have a separate message slot or box. (Most Chime pages on the web don't have a command line slot. However, Chime version 2, unlike RasMol, has an extensive set of select commands on its menu.)

RasMol always has a white command-line window. (On Windows systems, it starts out minimized -- look for it on the task bar in Win95 to open it.) Position the command line window so that even when RasMol's black graphics window is on top, you can see a few lines of the white window below the bottom of the black window. Make sure you can see the bottom of the command-line window since this is where the action occurs.

Select vs. Restrict

Select commands select atoms but do not display them. Pay attention to the report of "atoms selected" to see whether the command worked. After a select command, you need to apply a display representation (backbone, ball and stick, spacefill, etc.) in order to see the selected atoms. Often you will also want to apply a color or color scheme. Remember that all menu actions or commands (other than select or restrict commands) affect only the currently selected atoms. If nothing happens, you probably don't have the relevant atoms (or any atoms at all) selected!

Restrict commands select, but hide atoms not selected. All expressions which can be used in select commands can also be used in restrict commands. The command

restrict selected
hides everything not selected, without changing what is selected. (The expression "selected" is a predefined term.) Other commonly useful restrict commands are, for example,
restrict protein # hides everything except protein; selects all protein
restrict not water # hides water; selects all non-water atoms

General form of the select command

The most general form of the select command is, of course,
select expression
The expression represents a set of atoms, and can use terms of several types. Terms can be combined with parentheses and the Boolean operators and, or, not. Comma means the same as "or".


In the examples below, words in italics are comments -- do not type them!

Atom serial numbers. Every atom in PDB file has a serial number. To find out an atom's serial number, click on it. The serial number is the first number in the report. You can select, for example:

Remember to prefix each of the above expressions (and all examples below) with the word "select"!

Rarely, you may get a PDB file lacking atom serial numbers. This will cause bizzare behavior in RasMol and Chime! To fix this, load the PDB file, then save it back to disk from RasMol with the command "save pdb filename", or from Chime with the menu File, Save Molecule As. This will insert serial numbers, but unfortunately will lose all remarks and have other possibly unwanted effects. For complete details, and other methods for adding serial numbers, see the PDB Tools page.

Element names. Type the full element name, not the 2-character symbol. You can select, for example:

Atom PDB names. PDB files name each atom in a standardized way (up to 4 characters). Alpha-carbons are CA, beta-carbons CB, and so forth through CG, CD, CE, CZ, CH (gamma, delta, epsilon, zeta, eta). Other examples are N7 (7th nitrogen in a residue), O2P (second oxygen on a phosphorus), OE2 (second oxygen on an epsilon carbon), HD1 (1st hydrogen on a delta carbon). To find out an atom's PDB name, click on it. Its name is reported as the first word following "Atom:". You can select, for example:

Group/Residue names. RasMol uses the broad term group to designate residues or other chemical groups. Here, we'll use the terms group and residue interchangeably.

Each residue in the PDB file is given a name of 1-3 characters in length. All amino acids use the standard 3-letter abbreviations ALA, ASN, ASP, etc. DNA and RNA nucleotides are given residue names A, T, U, G, and C. Other common residue names are HOH (water), NAG (N-acetyl glucosamine), and so forth. Uncommon ligands or moieties may be given nonstandard 3-character residue names. To find out the name of a residue, click on it: the residue name is the word after "Group:" or "Hetero:" in the message report.

Some residue names may contain digits, such as SO3 or PO4. These must be enclosed in square brackets in order to be recognized in select commands, for example "select [so3]".

Calcium or other metals are commonly given 2-character residue names the same as their element symbols, e.g. CA, MN, MG, ZN, etc. Note that in the case of calcium, "select ca" (the "residue" calcium) gives different results from "select *.ca" (all alpha carbons plus calcium). Confusingly, the atom names for both are CA. So in this case, to select only alpha carbons, "select protein and *.ca".

You can select, for example:

Group/Residue numbers Each residue is give a residue number (not to be confused with the serial numbers of the atoms within the residue). Residues numbers are unique within each chain, and within hetero residues. Thus, "select 1" will select residue 1 in each chain plus hetero residue 1. To find out the number of a residue, click on it. The second number in the report is the residue number. You can select, for example:

Chains. Each polymer chain (polypeptide, nucleic acid, carbohydrate, etc.) has a single character name (letter or digit). In a select command, this character must be prefixed with a colon or an asterisk to signify that the letter represents a chain. Most ATOM records in the PDB file are members of a chain; sometimes all. Whether or not ligands of a chain are given the same letter as the chain to which they bind, a different chain letter, or no chain letter, varies. HETATM (hetero) atom records are considered to be a "chain" only in the sense that they are all assigned the same color by the "color chain" command. To find out what chain an atom belongs to, click on it. You could select:

Predefined terms. Chime and RasMol predefine the following terms which can be used in select commands. The Venn diagram below, kindly contributed by Kurt Giles, is an excellent overview. Below the diagram is a table listing all the terms, hyperlinked to the RasMol Reference Manual -- if you click on these, be patient, it will take while to download (it is 160K bytes). Below the table is a summary of the definitions of the terms which aren't obvious.

Charged Cyclic

Summary definitions of predefined terms (equivalent expressions understood by Chime/Rasmol are in regular print; explanations are in italics):

Acidic = Asp, Glu
Acyclic = amino and not cyclic
Aliphatic = Ala, Gly, Ile, Leu, Val
Alpha = alpha carbons (don't confuse with helix)
Amino = all atoms in amino acids
Aromatic = His, Phe, Trp, Tyr
Basic = Arg, His, Lys
Buried = amino and not surface
or Ala, Leu, Val, Ile, Phe, Cys, Met, Trp
or (Hydrophobic and not Pro) or Cys
Charged = acidic or basic
Cyclic = amino and (aromatic or Pro)
Hetero = all atoms designated HETATM in the PDB file;
all hetero atoms are classified as either solvent or ligand.
Hydrogen = hydrogen or deuterium,
same as elemno=1
Hydrophobic = Ala, Leu, Val, Ile, Pro, Phe, Met, Trp
Ions = phosphate, sulfate hetero atoms
Large = amino and not (small or medium)
or Leu, Ile, Phe, Met, Trp, Tyr, Glu, Gln, His, Lys, Arg
Ligands = hetero and not solvent
Medium = Val, Thr, Asp, Asn, Pro, Cys
Neutral = amino and not (acidic or basic)
Polar = amino and not hydrophobic
or Cys, Gly, Ser, Thr, Lys, Asp, Asn, Glu, Arg, Gln, Tyr, His
Small = Ala, Gly, Ser
Solvent = water or ions
Surface = amino and not buried
or Gly, Ser, Thr, Lys, Asp, Asn, Glu, Pro, Arg, Gln, Tyr, His
or (polar and not Cys) or Pro

User-defined terms. You can define arbitrary terms to represent groups of atoms, and then use the terms you have defined in select or restrict commands. The general form for the define command is:

define term expression
Typically, one selects the atoms desired, and then defines the term. For example, Once defined, you can use such terms in boolean expressions, for example (Backbone and hydrophobic are predefined terms.)

Within specified distance. The "select within" command is one of the most powerful in RasMol. The format is

select within(distance, expression)
Usually, one does not wish to select the atoms in the expression, in which case the command becomes something like this:
select within(distance, expression) and not expression
The distance must contain a decimal point or it is interpreted as a (not very useful) internal RasMol/Chime distance unit. Values containing a decimal point are interpreted as Angstroms.

The semi-automated Noncovalent Bond Finder exploits the select within command as its core operation.

Further Information

The above examples include the commonly needed cases, but not all cases recognized by Chime and RasMol. To learn more about the select commands and command language in RasMol and Chime, consult these documents: