[Chimera-users] batch production of images

Benjamin SCHWARZ schwarz.ben at gmail.com
Tue Apr 23 02:08:06 PDT 2013

>  There are no variables in the Chimera command language.  So how do you know what model numbers to use in a script?  The first model open is #0, then the next one is #1.  When you open a new model it assigns the lowest integer model number that is not being used.  You can also tell it to use some other model number with the open command, for example, "open 3 1abc.pdb" opens the PDB as model #3.  Assigning the model number with the open command doesn't happen to work with marker sets.  That is a bug.  In your case you have a marker file containing more than one marker set.  If you don't know how many marker sets are in the file (or you want a script that works with files containing different numbers of marker sets) that can create a problem knowing what model id numbers to use in commands.  If the marker set is the last model opened you can refer to all models beyond a specified model number, for example, "delete #5-" will delete model 5 and higher model numbers.

Thanks a lot for these answers.

>  If you need something more complex then the above then you need a Python script.  Then you can do everything.  The equivalent of the Chimera command "open markers.cmm" is
> 	from chimera import openModels
> 	models = openModels.open('markers.cmm')
> Then you have a variable with the list of models.  To delete those models
> 	openModels.close(models)

Perfect, you spare me quite some speleo-coding :)

> The difficulty with using Python scripts is that we don't have documentation for the available functions.  But as a start you can look at the Chimera Python scripts page for examples.
> 	http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts

Yes, the absence of a doc is clearly a critical point here. My personal experience is that, thanks to code introspection in the IDLE interpreter I was able to guess quite quickly what to use and how to adapt it to my purposes. My biggest problem was the "entry point" in the maze (what modules to import, and what are the main classes). For that, I think that a very basic Doxygen-type documentation would do, for a start.


More information about the Chimera-users mailing list