Making an Animated GIF File with Protein Explorer (PE)

The big advantages of animated GIF movies are that they can be viewed in any web browser (not only Netscape and Internet Explorer) or even Powerpoint, on any platform (linux, unix, etc. as well as Windows and Macintosh PPC), without Chime.
(The term GIF is an acronym for Graphics Interchange Format. The GIF format is widely used for static images on web pages, along with the JPEG format.)

Animated GIF files (also called multi-GIF files) are true movies, that is, a series of static snapshots played in sequence. Once created, the animated GIF file can play only one "movie". In contrast, when an animation is played in PE, it can be rendered and colored in many different ways, and viewed from any rotated perspective.
Rotating multi-GIF
created with PDB2MGIF.
Animated GIF
created from
file 2BBN.
Morph multi-GIF
created with PE
(lac repressor
binding DNA

If you will be happy with simple rotation of a molecule, such as the example at the upper left, your animated GIF can be created relatively easily using Andreas Bohne's excellent PDB2MGIF website, where there is a Gallery. The example at right shows a morph between two conformations of an enzyme (resulting from binding of an inhibitor). Although the preparation of a morph PDB file is technically challenging, once obtained, PE can greatly simplify creating an animated GIF file from it, as explained below. If you don't have time to create your own morph, you may choose one that is already prepared from which to make an animated GIF.

Any multiple-model NMR PDB file can be animated in PE, and can be used to create an animated GIF such as the one at the lower left. Such animations simulate thermal motion. About 15% of the PDB files available at the Protein Data Bank are NMR files. The Experimental Technique field in their SearchFields form allows you to restrict your search to NMR results. This can also be achieved with a Method checkbox at the OCA Browser.

Overview of the method. PE can play animations in MDL Chime. It does this by automatically generating a script of commands that produces the animation in Chime. PE's animation script is designed to be playable in RasMol as well as Chime. When played in RasMol, it saves a series of separate GIF files, one per frame. These serve as input to GIF Animator software package (see below).

Chime's commands are a superset of RasMol's. When Chime was being developed at MDL by Tim Maffett, I forsaw the possibility of needing a single script to be able to execute properly in both Chime and RasMol. I requested that Tim implement two special features that made this possible, ## and #! (see the comment at the beginning of the animation script for more information). Maffett was kind enough to do this in 1996. The present procedure (created in 2002, six years later!) is the first use I have found for this capability, which is undocumented at MDL's Chime site.

Here are instructions for how to create an animated GIF:

  1. Obtain or prepare a multiple-model PDB file, where each model represents one frame in an animation. Examples are available at Animations in Protein Explorer. While viewing any such animation, save its multiple-model PDB file to your hard disk for use in later steps below. Methods for preparing such files are documented in Morphing Methods.

  2. You will need three software packages:

  3. View the animation in PE. (See Animations in Protein Explorer if you're not sure how to do this.)

  4. At PE's NMR Models/Animation control panel (available in Advanced Explorer), there are many options for rendering and coloring your animation, including customizing the animation master script provided in the form box. Use these to achieve an animation you wish to capture in an animated GIF.

  5. Create a new, empty working folder where you will save the files for creating your animated GIF.

  6. The orientation (rotated position) and zoom level (size) of the molecule viewed in PE is automatically preserved in PE's animation, but extra steps are needed to carry it into your animated gif. After you have decided on the orientation and zoom level, enter the command alias vsu into PE. Copy and save the script fragment that this displays in the message box. Save only the reset, zoom and rotate commands. In Windows, you must reverse the order of these commands so the sequence is reset, rotate z, y, x then zoom. (In Mac PPC they display in forward order.)

  7. When you are playing the animation you wish to capture in an animated GIF file, press the button at the upper left (just after the word Animate) to stop the animation. Then press the link Scripts. A window will open containing the RasMol script. Save the black portions of the scripts into a file in your working folder. The name of this file should end with .spt, for example, "animation1.spt". Important: whenever saving the script file, it must be saved as plain text (DOS text, ASCII text). In Windows, the easiest way to guarantee this is to use Notepad; in Macintosh, the shareware BBEdit does this.

  8. Put a copy of your multiple-model PDB file in the working folder.

  9. Insert into the very top of your script file the reset, rotation, and zoom commands you saved from the "vsu" command. Each command should be on a separate line. The commands should look something like this, but with different numeric values:
    rotate z -32.598
    rotate y -28.5319
    rotate x 62.8755
    zoom 195
    Windows users: make sure you have reversed the order into that shown here.

  10. Insert into the very top of your script file (before the "reset" command) the two commands (on two separate lines, in this order) "zap" and "load nmrpdb xxxx.pdb", where "xxxx.pdb" is the name of the multiple-model PDB file.

  11. Drag the RasMol program itself (.exe file on windows, application file on Mac PPC) into the working folder. Do not drag an alias or shortcut! They will not work properly! (There are other ways to do this that you may use if you know how. Dragging the program itself is easy and foolproof.)

  12. Run RasMol. If you are a RasMol novice, you need to know that RasMol has two windows. There is a black window for displaying the molecule, and a white window for entering commands. Arrange the windows so you can see both of them at once.

  13. Enter the command "script yyyy.spt", where "yyyy.spt" is the name of your script file. You should see your animation in the black window. Don't worry about it being too fast or too slow -- this can be adjusted later. In the white window, you will see the error message "Command disabled in script file!" after each "save gif ..." command in the script. This is OK. It means you haven't given RasMol permission to write the GIF files yet.

  14. Adjust the size of the black window to the final size you want for your animated GIF. Bear in mind that large animated GIF files can exceed a megabyte in size. The rotating example above is 0.7 megabytes, and the morph is 0.2 megabytes.

  15. Enter the command "set write on" into RasMol. This gives it permission to write the GIF files. Run your script again. One GIF file per frame should now have been created by RasMol in your working folder.

  16. Now use the GIF animation software package you have chosen to assemble the individual GIF frame files into an animated GIF. For the GIF Construction Set, it is easy:

Feedback to Eric Martz.