I. IntroductionJmol, a Java applet used to view molecules in web pages, can read scripts that are contained in Jmol buttons. These scripts are used to change the rendering of the molecule to illustrate important structural features. This exhibit provides example Jmol scripts that can be copied and pasted into the javascript tags for buttons. Each section starts with a discussion of the uses of various renderings and ends with a table that includes a list of buttons (left column - ) containing sample scripts (right column). These evoke particular renderings of the molecules displayed in the left frame. If you are new to Jmol scripting, it is suggested that you spend time going through the exhibit in its entirety, reading the scripts to see how they can be employed in your own web pages. return to beginning of the exhibit [Introduction]
[II. Display] [III.
Loading and Positioning] [IV. Selecting and Labeling]
II. DisplayJmol uses two different units of measurement that can be used with display commands. One is the standard, atomic-resolution unit, the Angstrom (Å); 1 Å = 10-10 meters. Chime also uses a novel unit, the RasMol unit; 1 RasMol unit = 1/250 Å. The display codes (see below) can be modified to specify dimensions in either RasMol units or Angstroms by adding a numerical value after the name of a command. Angstroms are indicated by a decimal in the numerical value and RasMol units are used as a default when no decimals are employed. For example, a 'wireframe 125' script specifies a wireframe display in 125 RasMol Units. This is equivalent to the script "wireframe 0.5" (0.5 Å). The default display for most pdbs is wireframe, as shown at left. Wireframe is very useful because it clearly shows the covalent bonds (except S-S bonds) between all atoms of a molecule. Varying the thickness of wireframe displays can provide useful alternatives in illustrating points. Spacefill is another commonly used display. Spacefill rendering displays the Van der Waals radius of each atom as a solid sphere by default. Spacefill radii can be altered by a numerical specification (see below). Different "ball and stick" representations can be achieved by varying the thickness of wireframe and the radii of spacefill. Dots is a display similar to spacefill in that the diameter of the spheres formed are equal to that of the Van der Waals radius. Dots combines easily with other display commands to provide useful effects. Combining wireframe and dots displays can show Van der Waals surfaces clearly for a loop or secondary structure. So far, we have considered displays that affect all atoms of a molecule, unless particular atoms are selected (see below, The Select Command). Sometimes showing only the backbone of a molecule is desired. There are several displays that illustrate the backbone conformation of a molecule:
Lighting effects can be employed to change the appearance of a molecular display. For example:
It is sometimes useful to display the surfaces of molecules. For example, the shapes of ligand binding pockets or catalytic sites are often illuminated is a surface view. To learn about Jmol suface displays, consult our SURFACES page. Sample Display Commands
return to beginning of exhibit [Introduction]
[II. Display] [III.
Loading and Positioning] [IV. Selecting and Labeling]
III. Loading and Positioning
N.B.: When constructing a Jmol script for a button in a molecular exhibit, it is helpful to incorporate a series of default commands that turn off any previous scripts invoked by other buttons. We recommend the following set of commands be used upon loading: "set frank off; select all; hbonds off; spin off; wireframe off; spacefill off; trace off; set ambient 40; set specpower 40; slab off; ribbons off; cartoons off; label off; monitor off". This "blank state" can then be modified by subsequent commands in the script. Once a pdb is loaded it is often useful to orient the molecule in 3-D by rotating it around the X,Y, or Z axes. Rotation commands are expressed in degrees so a rotation of 360 around a particular axis will show no change in the orientation of the molecule.
A molecule can
also be translated along any of the axes without rotation: Rotation, translation, and zoom commands to effect a desired view can be incorporated in the initial loading of a pdb. There are other, smoother ways to move, rotate, and zoom molecules that will be discussed later, in the Animation section. Sample Loading and Positioning Commands
return to beginning of exhibit [Introduction]
[II. Display] [III.
Loading and Positioning] [IV. Selecting and Labeling]
IV. Selecting and LabelingFor the display commands already discussed, and for coloring and bond options to be addressed later, it is often desirable to limit rendering changes to particular atoms or sets of atoms. The select command is used to specify what atoms of a molecular file will be affected by subsequent rendering commands (e.g spacefill, cartoons, etc.). There are a number of predefined sets of atoms such as "all", "backbone", "protein", "ligand", "hetero", "helix", "sheet", "sidechain", etc.. "Select all" selects all atoms. "Select protein" or "select amino" both select all of the amino acids. "Select nucleic" selects all nucleic acid atoms, but "select dna" or "select rna" works on specified nucleic acid residues (DNA=a,t,g,c; RNA=a,u,g,c). "Select hetero" will select all heterogeneous atoms, including water, ions, and ligands. "Select water" or "select hoh" will select only the water molecules (usually only oxygen atoms of water are present in a pdb file), and "select ligand" will select only a ligand. "Select helix" and "select sheet" are used to select alpha helices and beta sheets, respectively. "Select backbone" and "select sidechain" are used to select backbone or sidechain atoms, respectively. The select command can also be used to select a specific chain in a molecular file, a single amino acid, or even a single atom (useful!). In selecting atoms or residues, it is possible to discriminate between chains in a file that contains multiple molecules. For example, let's say that you wish to select a single residue (#10) on one chain of a pdb file with a dimeric protein bound to DNA (four chains). Each chain will likely have a residue # 10. If the command "select 10" were used, four residues would be selected, one on each of the protein chains and one on each strand of DNA. Instead, if the desired residue (#10) is on chain A, then the script "select :a and 10" or "select 10:a" would select only residue #10 on chain A, ignoring the residue #10s on other chains. Define is a command that is very useful when dealing with a group of atoms that do not belong to a predefined set, such as a phosphate on a ligand or the tail of an ATP molecule. The atoms of interest can be associated under one atom expression that can then be selected with ease. The format of the script for defining a group of atoms is "define 'name of group' 'atoms to be grouped' ". Another type of selection is the restrict command. "Restrict" limits the display to those atoms specified in the restrict script. Selected atoms can be labeled using the label command. Labels can be colored, and the fontsize height set (in pixels) using appropriate commands. The default label color is the selected atom's color and the default fontsize is 8 pixels. The position of the label can be altered by setting the label offset. Sample Selecting and Labeling Commands
return to beginning of exhibit [Introduction]
[II. Display] [III.
Loading and Positioning] [IV. Selecting and Labeling]
V. Coloring and Coloring SchemesColoring atoms, sets of atoms, or other selections is quite useful in crafting quality molecular exhibits. Explanatory text can be co-colored with specified structural features. Jmol is quite versatile in recognizing the names of prespecified colors, HTML binhex color codes, and RGB triplet codes. Jmol recognizes the RasMol defined color set and an extensive list of Javascript colors. Recognized colors include: blue, deepskyblue, cornflowerblue, cadetblue, turquoise, cyan, yellow, gold, green, greenblue, chartreuse, mediumspringgreen, aquamarine, deeppink, magenta, purple, darkmagenta, blueviolet, violet, orange, red, redorange, indianred, lightsalmon, tan, burlywood, sienna, gray, white, and black. HTML binhex and RGB triplet codes are similar in that the colors are made up of alphanumerical values for red green and blue. For binhex, the highest value is FF and the lowest is 00 (zeros, not O's). For RGB, the highest value is 255 and the lowest is 0. The format for binhex in Jmol is [x(Red)(Green)(Blue)], e.g. "color [xFF0088]". The format for RGB triplet codes in Jmol is [(Red),(Green),(Blue)], e.g. "color [255,0,255]". Default coloration is CPK (Corey, Pauling, Kultun), based on atom identity. Carbon is colored light gray, oxygen red, hydrogen white, nitrogen light blue, sulfur yellow, phosphorous orange, chlorine green, zinc brown, sodium blue, iron purple, calcium or metals dark gray, and unknown deep pink. In addition to CPK, Jmol has access to some additional predefined color schemes (not all schemes are discussed here):
"Amino" is a scheme that assigns colors to amino acids based on their chemical properties, e.g. acidic, basic, hydrophobic, or polar. The colors are ASP, GLU, CYS, MET, LYS, ARG, SER, THR, PHE, TYR, ASN, GLN, GLY, LEU, VAL, ILE, ALA, TRP, HIS and PRO. Nucleic acids are colored tan in the "amino" scheme. "Chain" is a scheme that colors each different chain in a multiple molecule pdb file a different color."Group" is a scheme that colors protein chains differentially in the amino-carboxy direction. "Group" colors nucleic acid chains differentially in the 5'>3' direction. "Temperature" is a scheme that colors atoms according to their anisotropic temperatures, as stored as a beta value in a pdb file. Anisotropic temperature is indicative of of an atom's mobility or uncertainty of position. The more mobile, "warmer" segments are colored red, progressing to more immobile blue fragments. "Structure" is a very useful color scheme in that it differentially colors a protein's secondary structure (a-helices and b-sheets). It is best to use a display command that illustrates secondary structure when using the structure color scheme (e.g. ribbons, cartoon, backbone, trace, or strands - see Display section). It is quite effective to use consistent color schemes to show some molecular features. DRuMS is a set of seven color schemes that provides a uniform standard for coloration in molecular exhibits. The colors used in the basic DRuMS scheme are: protein, DNA, RNA, a-helix and b-sheet. For amino acids the DRuMS colors are: hydrophobic amino acids, polar acidic amino acids, polar basic amino acids, and polar uncharged amino acids. See the DRuMS website for further information: It is sometimes necessary to go beyond the DRuMS schemes to illustrate important structural features. For example, it may be useful to distinguish between several pairs of chemically similar amino acids engaged in ionic bonding. In this case, custom colors must be used to indicate molecular identity. Fortunately, it is easy to instruct Jmol to read any user-specified color code. More information on color options is available on the Jmol colors page. Sample Coloring Commands
return to beginning of exhibit [Introduction]
[II. Display] [III.
Loading and Positioning] [IV. Selecting and Labeling]
VI. Illustrating BondsJmol recognizes by default the standard covalent bonds linking atoms in a molecule. Disulfide (S-S) bonds can also be displayed in Jmol by the use of the "ssbonds" command. The color of the bond is that of the two linked atoms, but it can be changed with the "color ssbonds" command. Similarly, "hbonds" and "color hbonds" tells Chime to show and color hydrogen bonds that are identified by Jmol. You may wish to illustrate a connection or bond that is not specified in a pdb file or read by Jmol. Although not ideal, such arbitrary bonds can be indicated using the "monitor" command. "Monitor" forms a dashed line between any two specified atoms and indicates the distance (in Å) between them. The distance display can be removed by "set monitor off," and the color and thickness of the displayed bond can be varied. The Jmol development team has recently added superior capabilities to illustrate bonds between any desired atoms using the "select" and "connect" commands. Also added is the capability to designate the bond order (single, double, etc.) with, e.g., "connect double". It is now possible to delete bonds between any chosen atoms using "connect delete". Sample Bond Commands
|