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
    
    
    
      open 9my3 9my4
      hide atoms
      show cartoon    
    
      matchmaker #2 to #1    
    
       
      Video  | 
      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.
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
    
    
      close #3
      morph #1, 2
    
       
      Video  | 
      color #3/B,D,F,H yellow
      color #3/A,C,E,G skyblue
      light soft
 
      # Press red circle button to record movie.
      
    
      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
    
      open 48725 from emdb
    
    
      color bfactor #1
    
       
      Video  | 
      color zone #4 near #1 distance 10
    
      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
    
       
      Video  | 
      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
    
      hbonds sel reveal true restrict cross interModel false select true
      label sel
    
      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  | 
      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
    
       
      Video  | 
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
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
    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