<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="">Hi Noe,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Chimera and ChimeraX are separate programs and have different Python APIs. The code you were trying to run is for Chimera. The equivalent in ChimeraX is:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>from chimerax.core.commands import run</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>run(session, "open" + "hERGts_compiled.pdb")</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>run(session, "color red")</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>run("surf")</div><div class=""><br class=""></div><div class="">However, if <i class="">all</i><span style="font-style: normal;" class=""> you are doing is running a set of commands on multiple files, consider using the "forEachFile" option of the ChimeraX </span><a href="https://www.cgl.ucsf.edu/chimerax/docs/user/commands/open.html" class="">open</a> command, which does exactly that.</div><div class=""><br class=""></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 Dec 6, 2022, at 1:52 AM, Noe Robert via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Good morning,<span class="Apple-converted-space"> </span><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">I'm tr</span><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">ying to use a python script for ChimeraX<span class="Apple-converted-space"> </span></span><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><span class="ContentPasted0" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255); display: inline !important;">version 1.5, to automate mutageneses on a specific protein.<span class="Apple-converted-space"> </span></span><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">As a first try, it looks like this :</span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-weight: normal; font-size: 14px; line-height: 19px;" class=""><span class=""><span class="ContentPasted1" style="color: rgb(197, 134, 192);">from</span><span class="ContentPasted1"> chimera<span class="Apple-converted-space"> </span></span><span class="ContentPasted1" style="color: rgb(197, 134, 192);">import</span><span class="ContentPasted1"> runCommand<span class="Apple-converted-space"> </span></span><span class="ContentPasted1" style="color: rgb(197, 134, 192);">as</span><span class="ContentPasted1"> rc</span></span><div class=""><span class="ContentPasted1">rc(</span><span class="ContentPasted1" style="color: rgb(206, 145, 120);">"open "</span><span class="ContentPasted1"> +<span class="Apple-converted-space"> </span></span><span class="ContentPasted1" style="color: rgb(206, 145, 120);">"hERGts_compiled.pdb"</span><span class="ContentPasted1">)</span></div><div class=""><span class="ContentPasted1">rc(</span><span class="ContentPasted1" style="color: rgb(206, 145, 120);">"color red"</span><span class="ContentPasted1">)</span></div><span class=""><span class="ContentPasted1">rc(</span><span class="ContentPasted1" style="color: rgb(206, 145, 120);">"surf"</span><span class="ContentPasted1">)</span><span class="ContentPasted1" style="color: rgb(244, 71, 71);">;</span></span></div><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">So it refers to the chimera module for the runCommand. I tried to install it on Python through the command pip but it failed :<span class="Apple-converted-space"> </span><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">################################# Example of my shell while trying to install chimera module #######################<br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">PS C:> python3 -m pip install chimera<div class="ContentPasted2">Collecting chimera</div><div class="ContentPasted2"> Using cached chimera-0.4.7.tar.gz (355 kB)</div><div class="ContentPasted2"> Preparing metadata (setup.py) ... error</div><div class="ContentPasted2"> error: subprocess-exited-with-error</div><div class="ContentPasted2"> <span class="Apple-converted-space"> </span></div><div class="ContentPasted2"> กม python setup.py egg_info did not run successfully.</div><div class="ContentPasted2"> ฉฆ exit code: 1</div><div class="ContentPasted2"> จtฉค> [9 lines of output]</div><div class="ContentPasted2"> Traceback (most recent call last):</div><div class="ContentPasted2"> File "<string>", line 2, in <module></div><div class="ContentPasted2"> File "<pip-setuptools-caller>", line 34, in <module></div><div class="ContentPasted2"> File "C:\Users\CE PC\AppData\Local\Temp\pip-install-cfq97mii\chimera_bd7187074876462a9782eded8cb3a816\setup.py", line 1, in <module></div><div class="ContentPasted2"> import ez_setup</div><div class="ContentPasted2"> File "C:\Users\CE PC\AppData\Local\Temp\pip-install-cfq97mii\chimera_bd7187074876462a9782eded8cb3a816\ez_setup.py", line 170</div><div class="ContentPasted2"> <span style="background-color: rgb(255, 255, 0);" class=""><span class="Apple-converted-space"> </span>print "Setuptools version",version,"or greater has been installed."</span></div><div class="ContentPasted2"> ^</div><div class="ContentPasted2"> [end of output]</div><div class=""><br class="ContentPasted2"></div><div class="ContentPasted2"> note: This error originates from a subprocess, and is likely not a problem with pip.</div><div class="ContentPasted2">error: metadata-generation-failed</div><div class=""><br class="ContentPasted2"></div><div class="ContentPasted2">กม Encountered error while generating package metadata.</div><div class="ContentPasted2">จtฉค> See above for output.</div><div class=""><br class="ContentPasted2"></div><div class="ContentPasted2">note: This is an issue with the package mentioned above, not pip.</div>hint: See above for details.</span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">######################################################################################################<br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">So it looks like the temporary file generated has an error that doesn't allow the installation of the module, and so I cannot use any command from my script as runCommand is not recognized. There seem to be no mention of this issue in the mail archive but one colleague encountered the same problem, which I find strange. Do you have an idea on how to solve this issue ?<span class="Apple-converted-space"> </span><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></span></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Thank you and have a great day,<br class=""></span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div id="Signature" class=""><div class=""><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Noจฆ Robert,</div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Fifth-year student in bioengineering, minor in Bioinformatics and Modelling, at engineering school Polytech Nice Sophia, France</div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Phone : +33 7 81 00 52 02</div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><i class="">"let's limit the use of our resources and lighten our mails"</i><br class=""></div></div></div></div><div class="elementToProof" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span class="ContentPasted2 elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></span></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Chimera-users mailing list:<span class="Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Chimera-users@cgl.ucsf.edu</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Manage subscription:<span class="Apple-converted-space"> </span></span><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users</a></div></blockquote></div><br class=""></div></body></html>