<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal">I hope you are doing well.</p>
<p class="MsoNormal">I have a python script (myscript.py) as follows:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">from chimerax.core.commands import run</p>
<p class="MsoNormal">import os</p>
<p class="MsoNormal">os.chdir("C:\\Users\\Shubham\\Desktop")</p>
<p class="MsoNormal">run(session, "open C:\\Users\\Shubham\\Desktop\\PDB_Script\\1ebt.pdb") # location of my pdb file</p>
<p class="MsoNormal">run(session, "sel aromatic & protein") </p>
<p class="MsoNormal">run(session, "log clear")</p>
<p class="MsoNormal">run (session, "info residue sel")</p>
<p class="MsoNormal">run(session, "log save aromatic_list.html")</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am using the following prompt for calling chimerax from command prompt:
</p>
<p class="MsoNormal">Gui enabled: chimerax --script C:\\Users\\Shubham\\Desktop\\myscript.py</p>
<p class="MsoNormal">Gui disabled: chimerax --nogui --script C:\\Users\\Shubham\\Desktop\\myscript.py
</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With gui mode enabled, the html file, aromatic_list.html, is created.<o:p></o:p></p>
<p class="MsoNormal">However, when disabling gui, nothing is created. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I suspect this is because I am relying on the log which may not be functional when gui is disabled?</p>
<p class="MsoNormal">Is there a way of redirecting the output of certain commands (e.g info, distance, angle) to a desired text file when disabling gui?
</p>
<p class="MsoNormal">I tried with sys.stdout but it did not work (empty text files were created.).</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,</p>
<p class="MsoNormal">Shubham</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">
Mail</a> for Windows</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>