[Chimera-users] Using the modeldisp command

Forbes J. Burkowski fjburkow at plg.uwaterloo.ca
Mon Feb 6 19:10:53 PST 2012


I have given my students a little problem that involves producing an
"animation" with each step in the animation being a PDB model within an
NMR generated file.  The solution to the problem is more complicated than
what is shown in the script below involving as it does the calculation of
RMSDs to get smoother transitions between successive displays of the

My answer script is not working as expected due to an issue that I have
recreated in a shorter script that follows next:

import chimera
from chimera import runCommand
import time

numCycles = 10

# ID's to try: 1BMR, 1DW5, 1QDP, 1D1H, 1N4N, 1IJC, 1PFD, 2LI3, 1AH1
prot_L = chimera.openModels.open("1AH1", type="PDB")
numModels = len(prot_L)


for ic in range(numCycles):
    for aix in range(numModels):
        subIDstr = str(prot_L[aix].subid)
        command = "modeldisp #0" + "." + subIDstr
        command = "~modeldisp #0" + "." + subIDstr
        # The following print command seems to be necessary to get
        # the animation!
        print command

This script runs just fine and does exactly what I wanted it to do.  Here
is the problem: If I remove the print statement, initially there for
debugging, the script does not work!  It seems weird that printing the
argument for the runCommand would have any effect on the execution of the
runCommand statement.  Am I missing some vital point here????

I am running the latest version of Chimera: (version 1.6 build 35398)
under Windows 7 Professional.  Prior to each run I have being doing

File... Close Session

to eliminate any models that were brought in on a previous run.

Forbes Burkowski

More information about the Chimera-users mailing list