# Chimera Movie Making

Tom Goddard
October 3, 2012

This tutorial shows how to make animations using Chimera for use on web sites, in journal articles, and talks. We will use maltotriose binding protein, PDB 2gha, and Chimera 1.7 snapshot version from September 2012 for our examples.

## Topics

- Spinning a molecule.
- Special effects: silhouette edges, shadows, background color.
- Movies with several motions. Command scripts.
- What to show in an animation. Morphing example.
- Saving your work. Use a session file to setup the initial scene.
- Optional: How to put an animation in a web page.

## Spinning a molecule

Open 2GHA.pdb. Delete chain B. Select / Chain / B and Actions / Atoms / Delete Color ribbon. Preset / Interactive ribbons Highlight ligand. Select / Structure / Ligand and Actions / Atoms / Sphere Rotate 360 degrees. Favorites / Command-Line turn y 1 360 Record "spin" movie. movie record ; turn y 1 360 ; wait ; movie encode Semicolons separate commands on one line. movie record starts capturing images. wait prevents going to the next command until motion finishes. movie encode writes the images to a movie file. | Your browser does not support the video tag.

## Special effects: silhouette edges, shadows, background color

Background white. Command set bg white. Silhouette edges. Tools / Viewing Controls / Effects. Enable shadows. Background gradient. Favorites / Preferences, category Background, background method gradient Gray gradient. Click background gradient color well. Set window size. Command windowsize 640 480. Record movie, 2 degree steps, supersample to smooth edges. movie record supersample 3 ; turn y 2 180 ; wait ; movie encode | Your browser does not support the video tag.

## Movies with Several Motions: Command scripts

- To make more complex movies put commands in a plain text file and run it.
- Try this using Text Edit on Mac, or Note Pad on Windows, or any text editor.

    movie record
    turn y 2 180
    wait
    movie encode

- Zoom in on ligand and do second spin.
- Interactively try this command: scale 1.02 80
- Make rotation about center of ligand. Select central ligand atom. Actons / Set Pivot

    movie record
    turn y 2 180
    wait
    scale 1.02 80
    wait
    turn y 2 180
    wait
    movie encode ~/Desktop/spin3.mp4
| Your browser does not support the video tag.

- Fade out ribbon so it does not block view of ligand.
- Interactively try this command: transp 80,r
- Turn off silhouettes to deemphasize ribbon.
- To make duller transparency try: set flat
- To smoothly fade to transparent ribbon use: movie crossfade 25

    movie record
    turn y 2 180
    wait
    scale 1.02 80
    wait
    movie crossfade 25
    transp 80,r ; set flat
    turn y 2 180
    wait
    movie encode ~/Desktop/spin5.mp4
| Your browser does not support the video tag.

## What to show in an animation. Morphing example

Many of the commands useful in making movies are demonstrated on the Movie Examples page on Chimera web site under Documentation.

Morphing is one of the most useful kinds of animation, making it easier to see differences between two conformations of a molecule.

- Open 2ghb.pdb, no maltotriose ligand bound.
- Delete chains B and C.
- Use MatchMaker to align 2ghb to 2gha. Tools / Structure Comparison
- Color 2gha ribbon pink. Command color pink,r #0
- Morph using Tools / Structure Comparison / Morph Conformations
- Hide original structures with Favorites / Model Panel
- Show ligand from 2gha: ~ribbon #0 ; ~display #0 ; display ligand
- Show morph residues near ligand: disp #2 & ligand zr<5
- Use MD Movie dialog File / Record Movie...
- To use morph in a command script: coordset #2 1,41

| Your browser does not support the video tag.
Structure superposition. | Morph movie.

## Saving your work. Use a Session File to Setup the Initial Scene

To save your movie making work, save a Chimera session that sets up the scene, and use a command script that records the movie.

- Save session with calculated morph. File / Save Session As...
- Save command script that records the movie.

      movie record
      coordset #2 1,41
      wait
      movie encode

- For each movie you make keep 3 files: the Chimera session, the command script, and the movie (morph.py, morph.cmd, morph.mp4).
- This allows you to later improve the movie, change its size, etc. with little effort.

## A Fancier Movie Example

Includes titling (2dlabel), ligand fly in (savepos / reset), hydrogen bond display (hbond), surface display (surf).

Your browser does not support the video tag.

Other example animations are on the Chimera Animation Gallery web page.

## How to put an animation in a web page

- Use HTML5 video tag to embed a movie in a web page.

    <html>
    <body>

    <video width="640" height="480" controls="controls">
      <source src="movie.mp4" type="video/mp4" />
      Your browser does not support the video tag.
    </video>

    </body>
    </html>

Your browser does not support the video tag.

- Chimera records movies in H.264 format by default.
- Safari and Chrome and Internet Explorer 9 web browsers will play this.
- Firefox does not play H.264. Encode a second format (Ogg Theora) to play in Firefox without plug-ins.