<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">To supplement Joel’s answer, there is an exact analog of Chimera’s “runCommand” in ChimeraX, named “run”.  To run the command “color red” from Python:<div class=""><br class=""></div><div class=""><i class="">from chimerax.core.commands import run</i></div><div class=""><i class="">run(session, “color red”)</i></div><div class=""><span style="font-style: normal;" class=""><br class=""></span></div><div class=""><span style="font-style: normal;" class="">You could also import the corresponding Python function, but using it would be more work in many </span>circumstances.  Nonetheless, since you had trouble finding the correct import statement (which isn’t 100% obvious), it is:</div><div class=""><br class=""></div><div class=""><i class="">from chimerax.std_commands.color import color</i></div><div class=""><span style="font-style: normal;" class=""><br class=""></span></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>UCSF Computer Graphics Lab</div></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 9, 2020, at 5:40 AM, Joel Meyerson <<a href="mailto:jrm2008@med.cornell.edu" class="">jrm2008@med.cornell.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Seowon,<br class="">You can create a cxc file in a text editor and then execute it at the ChimeraX command line using the "open script-name.cxc" command. Just be sure to provide the full path to the script, or change your working directory. There are some nice example scripts on the ChimeraX page which can help migrate from Chimera to ChimeraX.<br class=""><br class=""><a href="https://www.cgl.ucsf.edu/chimerax/gallery.html" class="">https://www.cgl.ucsf.edu/chimerax/gallery.html</a><br class=""><br class="">I hope that answers your question.<br class="">Best,<br class="">Joel<br class="">On 4/9/20, 1:26 AM, "ChimeraX-users on behalf of 이서원" <chimerax-users-bounces@cgl.ucsf.edu on behalf of selcia20@snu.ac.kr> wrote:<br class=""><br class="">    Hello,<br class=""><br class="">    I think I'm good at dealing with the previous Chimera command line,<br class="">    and I'm learning Python coding and ChimeraX little by little.<br class=""><br class="">    In Chimera, I was able to apply the Chimera command to a Python script<br class="">    using runCommand.<br class="">    So, I wrote some python scripts for Chimera, such as automatically<br class="">    coloring or cropping maps and/or models based on the target<br class="">    specification list in plain text.<br class=""><br class="">    However, I think there's no python modules like runCommand, and I<br class="">    don't know how to repetitively input specifications by .cxc files.<br class="">    (Do I have to make as many .cxc files as many as the number of the variables?)<br class="">    Also I tried to understand the ChimeraX developer tutorial, but I<br class="">    failed to import color functions on chimeraX Python Shell.<br class="">    (I didn't understand how to import experimental API)<br class=""><br class="">    Is there any fancy way to create a .cxc file that executes by<br class="">    sequentially inputting variables in the list?<br class="">    Or, How to import python modules such as color functions?<br class="">    (https://urldefense.proofpoint.com/v2/url?u=https-3A__www.cgl.ucsf.edu_chimerax_docs_devel_core_commands_user-5Fcommands.html&d=DwIGaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=JnYzuUa3E5p4u7qrfPzeZV8LIgMpwauz4WIvX7NJIi8&m=j7Tpmyo5XDVqMjqkGEuzR9uY2VhT76OIZl-yNu45ox0&s=kEjKLfMWQpeflIuqRONfyOB_NGRIqwqyxp73rpxs77c&e= )<br class=""><br class="">    Best regards, Seowon<br class="">    ______________________________________________________________________________________<br class="">    이 서 원        | Selcia Seowon Lee<br class="">    selcia20@snu.ac.kr<br class="">    Laboratory of Molecular Imaging , Ph.D. Candidate<br class="">    Department of Biological Sciences, College of Natural Sciences<br class="">    Seoul National University, Gwanak-gu Gwanak-ro 1, Bldg105 Rm109, Seoul<br class="">    08826, Korea<br class=""><br class="">    _______________________________________________<br class="">    ChimeraX-users mailing list<br class="">    ChimeraX-users@cgl.ucsf.edu<br class="">    Manage subscription:<br class="">    https://urldefense.proofpoint.com/v2/url?u=http-3A__plato.cgl.ucsf.edu_mailman_listinfo_chimerax-2Dusers&d=DwIGaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=JnYzuUa3E5p4u7qrfPzeZV8LIgMpwauz4WIvX7NJIi8&m=j7Tpmyo5XDVqMjqkGEuzR9uY2VhT76OIZl-yNu45ox0&s=C_8GYBsGzC9LRaFmXp0M3U5bvSGr7ngVpmMz7JnS9b8&e= <br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">ChimeraX-users mailing list<br class="">ChimeraX-users@cgl.ucsf.edu<br class="">Manage subscription:<br class="">http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>