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
the NMR PDB
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
Andreas Bohne's excellent PDB2MGIF website, where there is
Gallery. The example at right shows a
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
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
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:
- 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
Methods for preparing such files are documented in
- You will need three software packages:
Protein Explorer (free). You can use PE on-line, or you can use a
downloaded copy. If your multiple-model PDB file is on your local hard
disk, at PE's FrontDoor, use the link to enter "Empty Explorer", and then at PE's
Load Molecule page, use the [Browse] button to load your PDB file.
- RasMol (free). This procedure has been tested with RasMol
version 2.6-beta-2a, downloadable for Windows and Macintosh
original RasMol Home Page. NOTE: We have not tested version
2.7, but it probably works fine.
- A GIF animation software package. There are several shareware
packages available (try shareware.com
or Google). The one I have used
with Windows is GIF Construction Set (inexpensive shareware) from
- View the animation in PE. (See
Animations in Protein Explorer
if you're not sure how to do this.)
- 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.
- Create a new, empty working folder where you will save the files
for creating your animated GIF.
- 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.)
- 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.
- Put a copy of your multiple-model PDB file in the working folder.
- Insert into the very top of your script file the
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
Windows users: make sure you have reversed the order into that shown here.
- 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.
- 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.)
- 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.
In Windows, the white window
starts minimized, so it is invisible.
In the taskbar, find "RasMol Command Line" and click to open the white window.
In Mac PPC, the white window may be hidden behind the black one.
- 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.
- If you get lots of "Unrecognized command" errors, maybe
you saved your script file as a formatted document instead
of plain text? Review the instructions above.
- If RasMol says "Cannot open script file ...", then either
(i) you gave the wrong script file name, or (ii) you did not
drag the RasMol application file into the working folder and run
it from that location.
- If no image appears, and you get an error message such as
"Unrecognized command", then maybe you copied more than
the black portions of PE's script into your script file.
Remove the portions that were not black in PE's animation script window.
- If still no image appears, enter the command "show info". If zero
atoms are reported, then your PDB file failed to load. Re-check
that the PDB file is in your working folder, contains data,
and that you gave the correct filename in the load command in your script.
Using filenames with embedded spaces is asking for trouble.
- 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.
- 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.
- 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:
- Use the File menu to start
the Animation Wizard. Accept the defaults except for "delay", use 10
hundredths. Select your files. (In my old version 1.0Q, you have to press Cancel
when you are finished selecting files.)
- Press the VIEW button to see your animation. (Esc to stop
- If you want
a faster or slower animation, re-run the Wizard, choosing a different
global delay value.
- If you want pauses at the beginning, middle, or end,
select the appropriate CONTROL (delay) command, press the EDIT button,
and change the delay for that one step.
- Finally, use File, Save As to save your animation to a new GIF
Feedback to Eric Martz.