How to make Molecular Animations in ChimeraX

Tom Goddard
October 29, 2025
SLAC cryoEM workshop

Let's look at how to make animations for supplementary material in journal articles that include morphing atomic structures, showing cryoEM density, and using text labels. This tutorial uses ChimeraX version 1.10.1 except for the last part using Scenes which are available in ChimeraX daily builds from October 2025 or newer.

If this tutorial is opened in ChimeraX then the command links will execute in ChimeraX, saving you some typing. Open it using menu Help / Tutorials or with ChimeraX command

      open https://www.rbvi.ucsf.edu/chimerax/data/slac-workshop-oct2025/animations_oct2025.html

We'll look at a voltage-gated potassium ion channel important for repolarization after heart muscle contraction. cryoEM structures of Xenopus active and intermediate states are described in this October 2025 article

A physiologically-relevant intermediate state structure of a voltage-gated potassium channel
Efthimios Kyriakis, Daniel Sastre, Jodene Eldstrom, Agnese Roscioni, Sophia Russo, Fariba Ataei, Ying Dou, Magnus Chan, Steven Molinarolo, Luca Maragliano, Filip Van Petegem & David Fedida
Nature Communications | (2025) 16:8814

Show channel active and intermediate states

The intermediate state 9my4 has two mutations that stabilize that state E150R and R221E.
      open 9my3 9my4
      hide atoms
      show cartoon

Align the two structures

      matchmaker #2 to #1

Video

Morph from active to intermediate state

      morph #1, 2

Note the crazy motion of some of the molecules. The morph command pairs the proteins in the two states with matching chain identifiers. The wild motion indicates that the superimposed chains are not using the same chain identifiers.

Make chain identifiers in the two structures match

To fix it we will rename some of the chains of the active state. Hover the mouse over the different chains to see the chain identifiers shown C and G are swapped and D and H are swapped.

      changechains #1 C,G,D,H G,C,H,D

Recompute the morph

Close the incorrect morph and recompute it
      close #3
      morph #1, 2

Video

Color, tube helices, and record movie

      color #3/B,D,F,H yellow
      color #3/A,C,E,G skyblue
      light soft
 
      # Press red circle button to record movie.
      

Make the movie loop 3 times

The slider does not have loop options. Here is the command to play the morph and loop. Simple lighting will make it play faster in ChimeraX.
      light simple
      coordset #3 1,51 bounce true loop 3
Then to record this in a movie (video)
      movie record ; coordset #3 1,51 bounce true loop 3 ; wait 310 ; movie encode morph3.mp4

cryoEM map colored by B-factor

Let's show the cryoEM map for 9my3 and color it by the atom B-factors, and make a movie rocking it. The map is 75 Mbytes compressed so may be slow to open from the EMDB in England, so you can instead get a smaller version trimmed_maps.zip (22 MB) where I trimmed down the box removing the large unoccupied volume.
      open 48725 from emdb

Color active state atoms by B-factor

      color bfactor #1

Video

Color map to match atoms

      color zone #4 near #1 distance 10

Rock the map and record a movie

      rock angle 90 cycle 600 frames 600
To record a movie use the movie record and encode commands.
      movie record ; rock angle 90 center #4 cycle 600 frames 600 ; wait 600 ; movie encode map_bfactor.mp4

Close-up of voltage sensor helix S4


Video
Now let's make a close-up animation of the key voltage sensor helix S4, residues 217-232 with cryoEM map and residue labels.
      hide #3 model
      show #1 model
      hide #1 cartoon
      select #1/A:217-232
      show sel
      style #1 stick
      color #1 tan
      color #1 byhet
      volume zone #4 nearAtoms sel range 3
      volume #4 style mesh
      transparency #4 50
      label sel bgcolor black

Show hydrogen bonds to S4 helix

      hbonds sel reveal true restrict cross interModel false select true
      label sel

Spin 360 degrees and record movie

Test spin
      roll y 1 360 center #4
Now add the movie recording
      movie record ; roll y 1 360 center #4 ; wait 360 ; movie encode s4_spin.mp4

Video

Morph the S4 helix to the intermediate state

The S4 helix rotates between active and intermediate states. Is this a structure threading error?
      hide #1,4 model
      show #3 model
      hide #3 atoms, ribbon
      select #3/A:217-232
      show sel atoms,ribbon
      style #3 stick
      color sel byhet
      label sel bgcolor yellow
      select clear
Play the morph
      coordset #3 1,51 bounce true loop 1 pause 3
Then to record this in a movie
      movie record ; coordset #3 1,51 bounce true loop 1 pause 3 ; wait 310 ; movie encode s4_morph.mp4

Additional steps for S4 helix movie


Video
To improve the S4 helix morph movie we could To add these elements I make a ChimeraX session s4_fancy.cxs with all the data shown how I want it: colors, styles, labels, map zones. Then I write a command script s4_fancy.cxc that shows and hides the maps and structures and plays the morph.

Fancy movie command script

The script includes the movie crossfade command to fade models in and out gradually.

# Start with active state and map
hide #2,3,5 models
show #1,4 models

# Set morph to show first frame
coordset #3 1

# Start movie recording
movie record

# Pause for 2 seconds (50 frames at 25 per second)
wait 50

# Spin 360
roll y 1 360 center #4
wait 360

# Hide 9my3 and show morph which makes hydrogen bonded residues vanish
movie crossfade 50
show #3 model
hide #1 model

# Pause a few seconds then fade out map
wait 50
movie crossfade 50

# Hide the active state map
hide #4 model

# Pause a second
wait 25

# Play the morph to the intermediate state
coordset #3 1,51
wait 51

# Pause a second
wait 25

# Fade in the intermediate state map
movie crossfade 50
show #5 model

# Pause a few seconds
wait 50

# Fade out the morph and show 9my4 with hydrogen bonds
movie crossfade 50
hide #3 model
show #2 model

# Pause a second
wait 25

# Spin 360
roll y 1 360 center #5
wait 360

# Pause a few seconds
wait 50

# Encode movie recording
movie encode s4_fancy.mp4

Use scene snapshots for each movie transition

We can simplify the S4 movie script by saving scenes for the 5 transition points in the movie. Scenes are new in ChimeraX daily builds (not in ChimeraX 1.10.1) and do not yet handle all depictions (atomic models and maps but not molecular surfaces). Use ChimeraX menu entry

      Tools / Depiction / Scenes
Show the models for each transition and save scenes.
    # Start with active state and map
    hide #2,3,5 models
    show #1,4 models
    scene save 1

    # Hide 9my3 and show morph which makes hydrogen bonded residues vanish
    show #3 model
    hide #1 model
    scene save 2

    # Hide the active state map
    hide #4 model
    scene save 3

    # Go to the end of the morph showing intermediate state
    coordset #3 51
    scene save 4

    # Show the intermediate state map
    show model #5
    scene save 5

    # Hide the morph and show 9my4 with hydrogen bonds
    hide #3 model
    show #2 model
    scene save 6

    # Save a session so we can refine the movie later.
    save s4_scenes.cxs

Movie recording script using the scenes

Now we can use a simpler movie recording command script s4_scenes.cxc that just shows the scenes, crossfades between them, and rolls and morphs to produce the motions.

If we want to change the movie later we can use ChimeraX session containing the scenes s4_scenes.cxs, for instance, to change the background color to black, or to record at higher resolution.

# Start with active state and map
scene restore 1

# Start movie recording
movie record

# Pause for 2 seconds (50 frames at 25 per second)
wait 50

# Spin 360
roll y 1 360 center #4
wait 360

# Hide 9my3 and show morph which makes hydrogen bonded residues vanish
movie crossfade 50
scene restore 2

# Pause a few seconds then fade out map
wait 50
movie crossfade 50
scene restore 3

# Pause a second
wait 25

# Play the morph to the intermediate state
coordset #3 1,51
wait 51

# Pause a second
wait 25

# Fade in the intermediate state map
movie crossfade 50
scene restore 5

# Pause a few seconds
wait 50

# Fade out the morph and show 9my4 with hydrogen bonds
movie crossfade 50
scene restore 6

# Pause a second
wait 25

# Spin 360
roll y 1 360 center #5
wait 360

# Pause a few seconds
wait 50

# Encode movie recording
movie encode s4_scenes.mp4

New animation time-line tool

We are working on a new user interface animation time-line panel. You drag and drop scenes on a time-line instead of writing a command script. It is in the ChimeraX daily builds (menu Tools / General / Animations) but currently it does not do rolls, morphs or fades. We expect it to do these things in our Spring 2026 ChimeraX release.