Table of Contents
The scripting engine has been completely rewritten for Jmol Release 6. As of this writing it should be considered *alpha test* code. Please supply feedback in case of bugs and/or unexpected behavior and/or with feature requests. You can do this through the jmol home page jmol.sourceforge.net
Jmol supports the RasMol scripting language defined by RasMol. Information about RasMol can be found at www.openrasmol.org The current URL for full RasMol documentation is: www.openrasmol.org/doc/rasmol.htm.
The Chime web browser plug-in was based upon the RasMol source code. Various extensions were added, including additional scripting commands. Information about Chime can be found at www.mdlchime.com The current URL for extended chime scripting commands is: www.mdlchime.com/chime/chimerasmol.html.
Jmol currently supports many of RasMol/Chime scripting commands. Our goal is to eventually provide full script support. This will provide a migration path for those who wish to move to an open source solution that supports a larger number of file formats on a wider variety of hardware platforms.
In this release most movement, selection, atom expression and color commands are operational.
Things that explicitly do *not* work are protein rendering formats such as ribbons, cartoons, strands, etc. Jmol does not perform lighting and surface rendering on the fly, so settings such as ambient, shadows, specular and specpower are not available. Finally, Jmol does not have a true 3D graphics engine, so renderings of intersecting surfaces are not handled properly. This occurs when Atoms are rendered with larger vanderWaals percentages (such as 50% or more).
Please give us feedback on what features you would use and would like to see. This will help us prioritize future development.
This documentation is autogenerated form the content on this website: http://www.stolaf.edu/people/hansonr/jmol/docs/.
Sets selected animation parameters or turns animation on or off. Note that there are four distinct animation types that can be employed using Jmol: (1) files may contain multiple stuctures that are "played" sequencially, (2) Gaussian output files may contain vibrational modes that can be animated, (3) scripts may be run through with delays and loops, and (4) the model may spin or move in a predefined way. The "animation" command only refers to method (1).
Examples
Sets the animation direction to be first frame to last frame.
Sets the animation direction to be from last frame to first frame.
Sets the animation frames per second.
Specifies which frame to go to.
Sets the animation mode to restart the sequence automatically when the last frame has played.
Allows for a time delay at the start and end of the loop.
Sets the animation to play once through and then stop (the default mode).
Sets the animation to play forward and back endlessly.
Allows for a time delay at the start and end of the palindrome.
Turns on or off animation.
Definitions
is the animation rate -- (integer)
is a frame option: -- (integer), "next", "nextwrap", "none", "play", "prev", "prevwrap", "revplay", "rewind"
is the time in seconds to pause on the first frame -- (integer|decimal)[>=0]
is the time in seconds to pause on the last frame -- (integer|decimal)[>=0]
Shows the backbone of a protein or nucleic acid macromolecule by connecting the alpha carbons. Backbone radius can be specified in angstroms using a decimal number (1.0, 2.0, etc.)
Examples
Definitions
is the radius of the backbone -- (decimal)[<=40]
Sets color of the background. See Color Specification.
Examples
Sets the background for the pop-up label box that appears when the mouse "hovers" over an atom.
Sets the background of the atom labels that appear with the "label" command
Definitions
is a name of a color or a color triple, eg [255,0,255] -- (color)
"Cartoons" are the classic shapes the are used to depict alpha helices and beta-pleated sheets.
Examples
Definitions
is the radius of the cartoon elements -- (decimal)[<=40]
Sets the center of rotation to be the center of the set of atoms defined by the expression. This is calculated as the mean value of the coordinates of the selected atoms along each of the respective axes. If no atoms are selected then the center is set to the center of the bounding box (the default).
Examples
Definitions
is any expression that evaluates to a set of atoms -- (atom-expression)
Colors the object with the specified color. If no object is given then atom is assumed, and the currently selected atoms are colored.
Examples
Sets the color of the specified Rasmol object based on a color scheme.
Sets the color of atom-related objects based on a previously selected atom set to a specific color, a color scheme, or back to its default color (NONE).
Color atoms based on a crystallographic B-factor or "temperature" scale. Colors range from blue (least positional variability within the crystal) through white to red (most positional variability). Using a fixed scale (parameter "fixedTemperature") allows direct comparison between two structures. Using a relative scale (parameter "temperture" or "relativeTemperature") sets the blue-red range to match the range of varibility in the model itself.
Sets the selected atom set to a color based on a particular color scheme.
Sets the color of various objects.
Sets selected atom colors to the default "cpk" color scheme (either Jmol or Rasmol).
Sets the color of the molecular surface dots.
Colors hydrogen bonds specifically in proteins based on how many residues one end is from the other. Note that to get this effect, one must first execute "hbonds ON" and then issue "color hbonds TYPE". The colors assigned are based on the number of basepairs between the interacting H atoms. This TENDS to indicate secondary structure, but is not perfect.The correlation between color and offset are as follows:ColorOffsetgreen-4cyan-3white+2magenta+3 (turns)red+4 (alpha-helix)orange+5yellowother (e.g. beta-pleated sheet)
Definitions
is an object related to an atom -- atom, bond, label, hbonds, monitor, ssbonds, vectors
is to color based on a scheme -- (color), amino, chain, formalCharge, partialCharge, monomer, shapely, structure, NONE
is atom, backbone, cartoon, mesh, ribbon, rocket, strands, trace
is a name of a color or a color triple, eg [255,0,255] -- (color)
is axes, echo, hover, label, monitor, unitcell
is "fixedTemperature" or "relativeTemperature"
Renders selected atoms as shaded spheres. A boolean value renders the spheres with the vanderWaals radius. A decimal value specifies the sphere radius in Angstroms. An integer followed by "%" specifies sphere radius as a percentage of the Van der Waals radius.
Examples
Generates a sphere for each atom according to an approximation of its ionic radius.
Generates a sphere for eah atom according to its crystallographic B-factor
Definitions
is a (decimal)[<=3]
is as a percent of the Van der Waals radius -- (integer)[-100 to -1]
is in 1/250ths of an Angstrom (deprecated) -- (integer)[1 to 749]
Defines the specified variable to the the atoms selected by the expression/
Examples
Definitions
is a (string)
is any expression that evaluates to a set of atoms -- (atom-expression)
Causes the screen to refresh and the script to stop executing for the specified number of seconds.
Examples
Definitions
is in seconds -- (integer|decimal)[>=0]
Slab and Depth together control the percentage of the molecule to be displayed based on clipping planes. "slab on" turns slab/depth on. "depth 50" shows the front 50% of the molecule. "depth 25" show the front 25% of the molecule.
Examples
Definitions
is an (integer)[0 to 100]
Echos a string of text to the window at the location predefined by the "set echo" command as well as to the Java Console. "echo" by itself deletes the text at the selected position (top, middle, or bottom).
Examples
Stops execution of the script current script. In the case of a script that is running as a "child" (for example, from a "source" command, execution continues with the parent.
Examples
Sets font size and information in labels and other text-bearing elements.
Examples
Definitions
is axes, echo, hover, label, monitor, unitcell
is approximately the same as Rasmol -- (integer)[6 to 63]
is SERIF, SANSSERIF, or MONOSPACED
is PLAIN, BOLD, ITALIC, or BOLDITALIC
Sets the current animation frame.
Examples
Definitions
is a frame option: -- (integer), "next", "nextwrap", "none", "play", "prev", "prevwrap", "revplay", "rewind"
Hydrogen bonds can be turned on or off, colored, and given custom width in angstroms.
Examples
Definitions
is a (decimal)[<2]
is in 1/250ths of an Angstrom (deprecated) -- (integer)[<500]
Turns on and off pop-up labels that appear when the user "hovers" the mouse over the atom. If a string is given, it is used as the label. Special characters include: %a (atom name), %b (protein B-Factor), %c %s (protein chain and residue), %e (element symbol), %i (sequential number), %m (single letter amino acid code), %n (3-letter residue name), %r (PDB residue number), %U (same as %e %i). For a full list, see the example HTML page.
Examples
Definitions
is on, off, or a string -- on, off, (string)
Turns on and off atom labels based on a previous selection. If a string is given, it is used as the label. Special characters include: %a (atom name), %b (protein B-Factor), %c %s (protein chain and residue), %e (element symbol), %i (sequential number), %m (single letter amino acid code), %n (3-letter residue name), %r (PDB residue number), %U (same as %e %i). For a full list, see the example HTML page.
Examples
Definitions
is on, off, or a string -- on, off, (string)
Loads the specified file or URL. Jmol automatically determines file type based upon the contents of the file. Therefore, the format parameter is ignored. It is allowed for backward compatibility with RasMol/Chime.
Examples
Definitions
is a model filename or URL -- (string)
is for Rasmol/chime compatibility; ignored -- (string)
Causes the script to restart at the beginning, with an optional time delay.
Examples
Definitions
is in seconds -- (integer|decimal)[>=0]
A mesh is similar to a strand, but is more the quality of a loosely woven fabric.
Examples
Definitions
is the overall radius of the mesh -- (decimal)[<=40]
Renders a measurement between the specified atoms.
Examples
Two atoms specify a distance measurement.
Three atoms specify an angle measurement.
Four atoms specify a dihedral angle measurement.
Definitions
is the sequential number assigned to the atom -- (integer)
The moveto command rotates the molecule to a predefined orientation. The first parameter specifies the number of seconds during which the molecule should rotate smoothly from the current orientation to the new orientation. A 0 for this first parameter specifies an instantaneous reorientation. The next three parameters (x, y, and z) define the axis relative to the default orientation about which the molecule should be rotated. The fifth parameter defines the counterclockwise (right-hand) rotation in degrees about this axis. "moveto 0 0 0 0 0" rotates the model to the default orientation (equivalent to "reset"). If the fifth parameter is 0 but any one of x, y, or z is nonzero, then no reorientation occurs (because the axis has been specified, but the rotation is 0 degrees). In conjunction with "show orientation" this command allows reading and restoring specific user-specified orientations.
Examples
Definitions
is in (seconds)
is a (decimal)
is a (decimal)
The move command provides powerful animation capabilities. It allows you to specify rotations, zooming, and translations to be performed in a specified period of time. xRot, yRot, and zRot are rotations about the cartesian axes in degrees. Zoom specifies a zoom factor (there is a good chance this is not currently implemented properly) xTrans, yTrans, and zTrans are translations in the range -100 to 100. If you do not know what slab is, just put in a zero. see the slab command for more information.
Examples
Definitions
is the degrees of rotation about x -- (integer)
is the degrees of rotation about y -- (integer)
is the degrees of rotation about z -- (integer)
is a scaling factor -- (integer)
is the distance offset along x -- (integer)
is the distance offset along y -- (integer)
is the distance offset along z -- (integer)
is the cutoff for the slab display -- (integer)
is the amount of time to wait -- (decimal)
is the frames per second to move -- (integer)
is the maximum acceleration -- (integer)
In the current release of Jmol, quit is synonymous with exit. This is inconsistent with RasMol, where quit means to exit the program.
Examples
Forces a screen repaint during script execution. (Unnecessary, and thus deprecated.)
Examples
Resets molecule to its original position: zoom 100; center; translate x 0; translate y 0;
Examples
Selects the atoms identified by expression and hides all atoms and bonds which are outside the selection set.
Examples
Definitions
is any expression that evaluates to a set of atoms -- (atom-expression)
Ribbons offer a representation the protein backbone or nucleic acid helix using a flat band that smoothly traces the midpoints of adjacent alpha carbon atoms (or phosphorus atoms in nucleotide chains). The ribbon is perpendicular to the peptide plane.
Examples
Normally, ribbons vary in width according to the amino acid atom positions. This command sets the width of the ribbon to be a connstant value (a decimal, in Angstroms).
Definitions
is half of the overall width of the ribbon -- (decimal)[<=40]
Creates a "rocket" cartoon.
Examples
Rotates the model the specified angle about the specified axis. Integer values specify degrees.
Examples
Definitions
is x, y, z
is the number of degrees -- (integer)
Loads and executes the specified script file/url. The hash/pound/sharp character (#) character marks a comment to the end of the line. The semicolon character (;) separates multiple statements on the same line. A script file may load another script file, up to 10 deep.
Examples
Definitions
is any valid filename or URL -- (string)
Selects the atoms identified by the expression. If no expression is given then all atoms are selected.
Examples
Definitions
is any expression that evaluates to a set of atoms -- (atom-expression)
This group of commands sets the appearance of various optional bond effects for the model.
Examples
When script commands affect a set of atoms, BOTH atoms must be in the set for the bonds between them to also be affected.
When script commands affect a set of atoms, EITHER atom may be in the set for the bonds also to be affected.
In some file formats (.mol files, for example) the connection data may indicate the bond type--single, double, triple, or quadruple. The bonds flag determines whether or not multiple bonds are displayed. Set this flag off if you want all bonds to appear as single bonds.
Hydrogen bonds between protein amino acid residues or nucleic acid base pairs are displayed as lines. These lines can be displayed whether or not the H atoms are present in the file, and can be drawn either between the two non-hydrogen atoms involved in the bond (O or N, typically, the default) or, alternatively, between the two backbone alpha-carbon atoms, depending upon the desired effect.
Sulfur-sulfur bonds in cysteine bridges of proteins are displayed as lines. These lines can either be between the two sidechain sulfur atoms (the default) or between the two backbone alpha-carbon atoms, depending upon the desired effect.
Sets the default color scheme to be the traditional Rasmol scheme or the newer, more subtle, Jmol scheme. This command does not actually change the display unless the default color scheme ("CPK") is currently displayed.
Examples
This command group allows for annotation and highlighting of atoms in terms of labels and "halos."
Examples
Turns on and off debugging (going to a JavaScript message callback).
Turns off selection halos
Sets the option ON to dispay a "halo" around atoms when they are or become selected as a way of highlighting specific atoms.
Turns off all three echo texts.
Selects which of the three possible echo positions (top, middle, or bottom) will be written to by the next "echo" command and, optionally, sets the horizontal position of that text to left, center, or right.
Sets the font size (for what?)
Determines whether or not "Jmol" is indicated in the bottom right corner of the window.
Sets the label offset relative to the atom being labeled.
Definitions
is approximately the same as Rasmol -- (integer)[6 to 63]
is the x-offset -- (integer)
is the y-offset -- (integer)
is one of the following: -- "top", "middle", "bottom"
is one of the following: -- "left", "center", "middle"
This commands in this group determine the overall lighting effects, size, and rotation for the model.
Examples
Sets the amount of "ambient" light filling the shadows created by the apparent light source. An ambient value of 0 creates an effect of a spotlight on a stage; a value of 100 removes the shadow entirely, creating a flat, nonrealistic effect.
Sets the amount of "diffuse" light apparently emanating from the spotlight, but not hitting and reflecting off the model directly. Setting the diffuse value to 0 turns this effect off; giving the effect of the model in a black-walled room where no light reflection is possible, effectively turning off all shadows.
Sets perspective depth on or off. OFF is required for proper function of absolute scale (set scale3d x).
Sets the absolute scale of the model by setting the viewing distance from the user to the model in arbitrary units. The actual scale will depend upon the sizes of both the applet window and the screen.
Sets the density of dots in the specular reflection.
Sets the size of the apparent reflection from a light source. set specular 0 turns off this effect.
Sets the spin axis and rate. Note that the axes referred to are the fixed axes of the window, not the cartesian axes of the molecular coordinates. Thus, regardless of how the molecule has been rotated by the user or using the move command, x is always the horizontal axis, y is always the vertical axis, and z is always the axis directed toward the user. The spin rate, in degrees per second, determines how fast the model rotates; the number of frames per second determines how smoothly the model rotates. No actual spinning occurs until the spin ON command is issued or the user turns spinning on using the mouse menu.
Definitions
is an (integer)[0 to 100]
is an (integer)
is an (integer)[0 to 100]
is an (integer)[0 to 100]
is the apparent distance from the model to the user in arbitrary units -- (integer), (decimal)
is x, y, z
is an (integer)
is an (integer)
The set picking command determines the response to clicking of atoms by the user.
Examples
Turns picking on and returns atom identities and angle involving three atoms.
When the user clicks an atom, the selection of that atom is toggled on or off.
When the user clicks an atom, that atom is set to be the center of rotation.
When the user clicks an atom, the selection of the chain associated with that atom is toggled on or off.
Turns picking on and returns atom identities and distance between two atoms.
When the user clicks an atom, the selection of the group associated with that atom is toggled on or off.
When the user clicks an atom, the label of that atom is toggled on or off.
Turns picking on and returns atom identities and torsion angle (dihedral angle) involving four atoms.
Turns picking on and off. When turned ON, picking information is sent both to the status line and to the pickcallback function, if defined. Additional information may be sent to the messagecallback function.
This command group turns on or off specific sets of atoms and axes/cell-related options.
Examples
Turns on or off displayed axes, and determines their line style and line width (as a decimal number, in Angstroms).
Turns on or off a wire-frame box that contains the model, and determines the line style and line width (as a decimal number, in Angstroms) of that box.
Turns on and off display of non-hydrogen atoms.
Turns on and off display of hydrogen atoms.
Sets the width of the monitor line in pixels.
Turns on and off the distance, angle, dihedral measurement monitor.
Sets the radius of the solvent "ball" that would run around the structure defining its outline.
Turns on and off display of solvent atoms and solvent "probe" that can be displayed using dots.
Sets the number of strands to display.
Turns on or off the unit cell for crystal structures, and determines its line style and line width (as a decimal number, in Angstroms).
Definitions
is an (integer)
is the number of strands -- (integer)[0 to 20]
is a (decimal)
is in 1/250ths of an Angstrom (deprecated) -- (integer)[<500]
is a line width or type for a drawing object -- on, off, (integer)[1 to 19], (decimal)[<2], dotted
"show" sends information about the model to the messageCallback function and to the Java Console
Examples
Delivers the coordinates of the center coordinate and a directional vector defining a box just perfectly enclosing the model. The vector is determined by taking the min and max values for the atom along each cartesian axis. The center is the geometric center of the model, not the default center of rotation (which is the mean atom position). The eight corners of the boundbox are found by adding the center point to the vector, with all possible combinations of +/- component cectors. The length of a side of the boundbox is determined by doubling the appropriate component of the vector. So, for example, the length of the boundbox along the x-axis is (2*vectorX). Units are in Angstroms. Output is in the form boundbox: (centerX, centerY, centerZ) (vectorX, vectorY, vectorZ)
Delivers the coordinates of the center of the model. Units are in Angstroms. Output is in the form center: (centerX, centerY, centerZ)
Delivers the entire contents of the file for the current model.
Delivers the entire contents of the specified file on the server from which the applet was loaded. The filename must be relative to the current page (not necessarily the directory containing the applet) and must be enclosed in quotation marks.
Delivers properties associated with the currently loaded model. Output includes information about all of the models in the set. This command is still in development. The exact form and content of the output is subject to change (and suggestion).
Delivers the orientation of the model. Output consists of both a "moveTo" command and an alternative sequence of "reset; rotate z; rotate y; rotate z" commands that would result in the current orientation. Thus, this command allows reading and restoring specific user-specified orientations.
Delivers the PDB file header.
Delivers the current 3x3 transformation matrix (rotation only).
Delivers the current zoom setting. Output is in the form of the zoom command: "zoom n" where "n" is an integer percent of "normal" zoom.
Slab and Depth together control the percentage of the molecule to be displayed based on clipping planes. "slab on" turns slab/depth on. "slab 50" shows the back 50% of the molecule. "slab 25" show the back 25% of the molecule.
Examples
Definitions
is an (integer)[0 to 100]
Cisteine disulfide bonds can be turned on or off, colored, and given customized widths in Angstroms.
Examples
Definitions
is a (decimal)[<2]
is in 1/250ths of an Angstrom (deprecated) -- (integer)[<500]
Strands offer a representation the protein backbone or nucleic acid helix using lines. For proteins, control points are chosen midway between adjacent alpha carbons (or phosphorus atoms in nucleic acids). The strands are arranged perpendicular to the peptide plane. A hermite cubic curve is used to smoothly connect the points.
Examples
Normally, strands vary in width according to the amino acid atom positions. This command sets the radius of the set of strands to be a constant value (a decimal, in Angstroms).
Definitions
is half of the overall width of the set of strands -- (decimal)[<=40]
A "trace" is a smooth curve through the center of the carbonyl carbon-alpha carbon bonds of a peptide or the ribose 1-O-P bond.
Examples
Definitions
is the radius of the trace -- (decimal)[<=40]
Moves the molecule along the specified axes according to the amount specified by value. Value ranges from -100 to 100, and represents the percentage of the display window. Negative values move to the left (for the x axis) and down (for the y axis). A value of 100 will move the molecule completely out of the window. A value of 50 will move the center of the molecule to the edge of the window.
Examples
Definitions
is x, y, z
is an (integer)[-100 to 100]
Draws vectors arising from vibrational mode data.
Examples
Adjusts the scale of the vector independently of the vibration.
Definitions
is a scaling factor -- (integer)[1 to 19]
is a (decimal)[<=3]
is a (decimal)[-10 to 10]
Adjusts the scale of the vibration independently of the vector.
Examples
Definitions
is a (decimal)[-10 to 10]
Wireframe refers to the bonds drawn between the atoms. A boolean value of ON draws the selected bonds as lines. Alternatively, a numeric value may be used to specify the radius of the bonds. A decimal value such as 0.2 or 0.4 specifies Angstroms.
Examples
Definitions
is a (decimal)[<=3]
is in 1/250ths of an Angstrom (deprecated) -- (integer)[1 to 749]
Clears the currently loaded molecule. RasMol forces you to zap prior to loading a new molecule. Jmol currently does not have this restriction and does not enforce it.
Examples
Allows enlarging or shrinking of the displayed model. A percentage value specifies the zoom relative to 100, the default value, which in Jmol is calculated so that all atoms are completely visible on the screen through all rotations using the default vanderWaals rendering percentage. The command "zoom OFF" disables mouse-based zooming and zooms to 100. The command "zoom ON" re-enables zooming at the current zoom setting. If the zoom has been turned off, setting the the zoom using, for example, "zoom 50," though it sets the "current zoom setting," has no effect until the next "zoom ON" command is given.
Examples
Definitions
is an (integer)[5 to 2000]