The at the bottom of the toolbar will let you write scripts to JSmol. Simply enter a script in JSmol's scripting language and hit enter to apply it. Let's start with some basic commands:
This same sequence of commands could be written in one line using semicolons (;) to separate each command, as such: select protein; color blue; select nucleic; color green; select hetero; color orange;.
With the cursor in the text box, use the arrow keys to cycle through previously applied commands. The up arrow will traverse backward in history; the down arrow will traverse forward (more recent). If you write a command incorrectly, the web page will display an error alert with more details.
The depth of JSmol's scripting capabilities can be overwhelming. I will try to focus on commands that you may find useful while exploring the material on this site.
To isolate an atom, or group of atoms, you can use display. It is most intuitive to use display on a selection. First, let's select the atoms we want to isolate, in this case, Chain A: select *:A;.
The asterisk (*) is a wild-card selector; we are telling JSmol to select all atoms that are part of chain A (:A).
Now write display selected; center displayed;. Only the A chain should be visible, and it should be in the center of the JSmol window.
Now let's change the display mode. Unlike display options from the toolbar, display modes written from a script can be combined with one another. Create a ball-and-stick model by writing select *; wireframe 0.15; spacefill 23%;.
Try writing this:
select backbone; cartoons only; color structure;
select sidechain; color amino;. You may remember this problem from the previous page: all of the sidechains appear to float. Let's fix that by writing:
select alpha, sidechain and connected(alpha);. A comma is the same as writing or. This command is selecting all alpha carbons, as well as any sidechain atoms that are directly connected to the alpha carbons. If you want to see what is selected, write selectionHalos on;.
wireframe 0.15;. This will draw the bond between the selected atoms (which should be the alpha carbon and beta carbon).
Are you starting to get a feel for it? Why not load a new model and play around!
There are numerous databases from which to load molecular models into JSmol. JSmol has a shorthand for some of the largest and most popular:
Please visit some of the sites, pick a molecule of your liking, and load it into JSmol using the load command. For example, load =1J6Z; will load the structure of an actin monomer from RCSB. You can also load files from your local computer by specifying the file directory in quotes, as such: load "C:\Users\BRobinson\Desktop\Jmol\1bw7.pdb".
I hope this brief tutorial has whet your appetite for more JSmol. Advance to the next page to begin with the subject material for BC401.