Saving and Opening your Files in Jmol

This Jmol Training Guide was created with funding from NIH Grant #1 R25 RR022749-01 and NSF-DUE #1323414 using the Jmol e-Poster Creator from the MSOE Center for BioMolecular Modeling

version 1.0
Saving and Opening your Files in Jmol

Saving an Image in Jmol

If you want to create a JPEG image of your molecule from Jmol (to use in a poster, for example), click the "File" menu located on the top left of the Display Window. In the dropdown menu, select "Export" and then "Export Image".

Saving a JPEG in Jmol

Save the image in the same folder as the PDB file that accompanies this image. Now, this image is like any other JPEG on your computer and can be opened without Jmol.

Note: Your JPEG image will appear exactly as it is displayed in the Jmol Display Window on your screen. The larger the size of your Display Window on the screen, the higher the resolution of the JPEG that is exported.

Opening an Image in Jmol

Click and drag the JPEG into an open Jmol window (exactly the way you open a PDB file). This will bring your saved work back up in Jmol.

Note: Your JPEG and PDB file MUST be in the same folder on your computer, otherwise the JPEG will NOT open.

Saving a Script in Jmol

Saving a JPEG of your model design is useful, but it doesn't save a record of the commands you used to obtain the design. Scripts allow you to create an exact record of your model design. This information will be helpful if you decide to create an electronic poster or Proteopedia page to accompany a model.

After you have completed your model design, click "history" on the Jmol Console. This will generate a list of all the commands you entered – without the $ prompt or any of the Jmol messages. Copy and paste this history into a word processor or text editor.

  • For PC users: Use CtrlC to copy and CtrlV to paste (right-clicking to copy and paste in Jmol will NOT work).
  • For Mac users: Select the script, then drag and drop into a word processor.

Be sure to include the following information in your Word document before saving:

  • Date
  • PDB file name
  • Name of file(s) containing your model design – and the path to the files (folder name, etc.)
  • Information about the features that are displayed in this particular model

Editing a Script in Jmol

These next steps "clean up" your script and make it easier for you (and others) to interpret your script.

Editing a History

Taking a few minutes to edit your history immediately after completing a design will make it much easier to "read" the script at a later date.

  • Remove the first three lines or so of your script, starting with zap, load file, etc.
  • Remove any typos that occurred while you were designing your model.
  • Remove any "blind alleys" that you took in your model design...and later decided to remove. For example, if you changed your backbone color multiple times, you no longer need the previous "color backbone" commands for the colors you didn't like. You'll only need the final "color backbone" command that has the actual color of your model.

Annotating a Script

  • Any line that begins with the symbol # is ignored by Jmol, so you can add comments to your script.
  • Insert comments throughout your script.
  • Use comments to indicate what features you are depicting in each of the blocks of commands. (We call these blocks "cassettes".)

Here is a sample script before and after annotating.

Testing a Script

After annotating your script, you should always run the script to make sure there aren't any errors. See the sections below on opening and running a script.

Opening a Script in Jmol

Once you have your script, run it as follows:

  • Open Jmol.
  • Drag and drop your PDB file into Jmol.
  • On the Jmol Console, click "editor".
  • On the Editor Box that pops up, click "script" then click 'clear' so you have an empty window.
  • Copy and paste your script into the editor window.
  • Make sure there are no extra lines or spaces at the end of the script - these will prevent the script from executing properly.
  • Click "run".
  • If the script doesn't execute, look in the console for error messages; the console should direct to you the location of your error. Correct the script as needed.
  • If you can't find the error, you can click on "step" instead of "run" to execute the script line by line. Note that you will need to click the step button to execute each individual line.
  • Alternately, you can quickly narrow your search by removing the last half of the script, then running the first half. If the first part runs without problems, you can add additional chunks of script and run again. If the first part doesn't work, break it down into smaller chunks to isolate the problem.

After you've made a change to your script and want to test out the change, run the script on a "fresh" PDB file. Either reload the PDB file in Jmol, or simply click "undo" on the Jmol Console to revert your model to its original form (in the cartoon format), and then run the script again. Now, you can easily see the changes that you made in your script.

You can make changes to your script in the "script" box of Jmol, and rerun the script to view the change, rather than typing it into the Jmol Console. Be sure you save your final revised script into a text editor or word processor.

Naming Conventions

As you are exploring your molecule and developing your molecular story, you will probably go through several iterations of your model design. We recommend that you save your designs early and often. We suggest that you save each design as a new file, and that you number the designs consecutively. It is not a good idea to save over your earlier designs! Once you are satisfied with your final designs, you may wish to delete the unnecessary files.