Hi Vincent, We're glad you like ChimeraX! Without resorting to python, you can do some looping by embedding your current commands in a perframe command. The level value in your volume command would be the $1 variable to gradually change in the loop. See perframe description and examples to see if it can do what you want (may take some experimentation, I usually have a few rounds of trial and error with this kind of thing myself): <https://rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 21, 2023, at 1:52 AM, Vincent Mallet via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
Thanks a lot for the awesome tool !
I have a question about how to use some commands that are not yet included in the python API : for instance "measure volume". I can run it using a cxc with : /usr/bin/chimerax --script measure.cxc --nogui --exit Where measure.cxc contains looks like : open test.mrc volume #1 level 0.42 measure volume #1
I don't understand how to do the same with a python script. Is there some way to use chimerax.tools(measure area/volume) to get this tool to work from within a python script ?
My use case is that I am running this measurement for different thresholds, and I would like those thresholds to depend on the value of previous thresholds, hence I need looping. For now, I am calling subprocess on the .cxc command above from a python script, but this means that I need to load the mrc every time...
Thanks in advance for your help !
Best, Vincent