
Hi, Does anyone have any documentation on the chimera API? I want to familiarize myself more with the commands that can be used in the Chimera IDLE and python scripts. I have looked at the Example tutorials ( http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/), but aside from the commands used in the tutorial I do not know how to perform other actions on the molecule. One of the commands I would like to run is to rotate the molecule ("roll", in the command line) using IDLE commands. Thanks for your help, Chris

Hi Chris, You could just use a Chimera command script rather than python, but I guess you want to do some other python stuff like looping. If you know the Chimera command, it is relatively easy, e.g. from chimera import runCommand runCommand('open 1zik') runCommand('preset apply int 1') runCommand('roll y 3 60') I don't know python myself, but got the above by showing the Command History, clicking "Record..." and in the next dialog, choosing the option to Record as "Python commands." I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On May 23, 2009, at 10:54 AM, christopher lau wrote:
Hi, Does anyone have any documentation on the chimera API? I want to familiarize myself more with the commands that can be used in the Chimera IDLE and python scripts. I have looked at the Example tutorials (http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/ ), but aside from the commands used in the tutorial I do not know how to perform other actions on the molecule. One of the commands I would like to run is to rotate the molecule ("roll", in the command line) using IDLE commands.
Thanks for your help,
Chris

Hi Chris, There is not much documentation for the Chimera Python API. For the roll command the code is in the Midas module as are many other commands. Look at the Python file in your distribution chimera/share/Midas/__init__.py and search for "def roll" (around line 1978) to see the code that implements this. From Idle use import Midas Midas.roll('y') to roll about the y-axis. Some further examples of Chimera Python code are on the new Python scripts web page: http://socrates2.cgl.ucsf.edu/trac/chimera/wiki/Scripts Tom christopher lau wrote:
Hi,
Does anyone have any documentation on the chimera API? I want to familiarize myself more with the commands that can be used in the Chimera IDLE and python scripts. I have looked at the Example tutorials (http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/), but aside from the commands used in the tutorial I do not know how to perform other actions on the molecule. One of the commands I would like to run is to rotate the molecule ("roll", in the command line) using IDLE commands.
Thanks for your help,
Chris ------------------------------------------------------------------------
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
christopher lau
-
Elaine Meng
-
Tom Goddard