<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Shubham,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>It seems like a deficiency of the 'info' command that it can't put the information directly into a file. We will look into rectifying that -- and yes, the problem is that the Log does not exist in nogui mode. However, since you are using a Python script for this (rather than a Chimera command script), you can save the information directly to a file yourself.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Replace:</div><div class=""><br class=""></div><div class="">run(session, "info residue sel")<br class="">run(session, "log save aromatic_list.html")</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>with:</div><div class=""><br class=""></div><div class="">from chimerax.atomic import selected_residues</div><div class="">with open("where-I-want-to-save.txt", "w") as f:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>for r in selected_residues(session):</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>print(r, file=f)</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>You can do similar things with distances and angles because the commands return the distance/angle values, <i class="">e.g.</i><span style="font-style: normal;" class="">:</span></div><div class=""><span style="font-style: normal;" class=""><br class=""></span></div><div class="">d = run(session, "distance <i class="">atom1 atom2</i><span style="font-style: normal;" class="">")</span></div><div class=""><i class="">write/append d to a file</i></div><div class=""><i class=""><br class=""></i></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=""><span style="font-style: normal;" class=""><br class=""></span></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 10, 2022, at 3:29 AM, Shubham Devesh Ramgoolam via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; 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;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi,</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I hope you are doing well.</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I have a python script (myscript.py) as follows:</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">from chimerax.core.commands import run</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">import os</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">os.chdir("C:\\Users\\Shubham\\Desktop")</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run(session, "open C:\\Users\\Shubham\\Desktop\\PDB_Script\\1ebt.pdb") # location of my pdb file</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run(session, "sel aromatic & protein") </div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run(session, "log clear")</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run (session, "info residue sel")</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">run(session, "log save aromatic_list.html")</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I am using the following prompt for calling chimerax from command prompt:</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Gui enabled: chimerax --script C:\\Users\\Shubham\\Desktop\\myscript.py</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Gui disabled: chimerax --nogui --script C:\\Users\\Shubham\\Desktop\\myscript.py</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">With gui mode enabled, the html file, aromatic_list.html, is created.<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">However, when disabling gui, nothing is created.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I suspect this is because I am relying on the log which may not be functional when gui is disabled?</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Is there a way of redirecting the output of certain commands (e.g info, distance, angle) to a desired text file when disabling gui?</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I tried with sys.stdout but it did not work (empty text files were created.).</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Regards,</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Shubham</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Sent from<span class="Apple-converted-space"> </span><a href="https://go.microsoft.com/fwlink/?LinkId=550986" style="color: blue; text-decoration: underline;" class="">Mail</a><span class="Apple-converted-space"> </span>for Windows</div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></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="">ChimeraX-users mailing list</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=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" style="color: blue; text-decoration: underline; 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="">ChimeraX-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><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=""><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" style="color: blue; text-decoration: underline; 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/chimerax-users</a></div></blockquote></div><br class=""></div></body></html>