<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 27, 2010, at 3:14 PM, Scott Classen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi all,<br>I have a number of PDB files that I would like to open, run a buriedArea calculation, save the results to a file, and exit<br><br>I can put a bunch of commands in a file and launch it from a terminal shell<br><br>chimera --nogui --nostatus --script calculate_buriedArea.com > results.txt<br><br>the calculate_buriedArea.com file looks like this:<br><br>open my.pdb<br>measure buriedArea #0:.A #0:B<br><br><br>This works, but is a bit cumbersome. I would like to make a python script so I can call my calculation with the name of the PDB file on the command line like this:<br><br>chimera --nogui --nostatus --script calculate_buriedArea.py -- my.pdb<br><br>.... so can someone please get me started here?<br><br>import chimera<br>myfile = chemera.somefunctiontoopenaPDBfile($1)</div></blockquote><br></div><div>Hi Scott,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>For the relatively simple scripting you're describing I don't think you really need the --script argument. You can basically run Chimera like this:</div><div><br></div><div>chimera --nogui --nostatus my.pdb calculate_buriedArea.py</div><div><br></div><div>Chimera will open the PDB file normally and then run your script. You only really need to use --script when you need to pass arguments to the script that Chimera <i>shouldn't</i> process. So, with above command line the PDB file will be open when your script runs. In fact, it doesn't seem like you actually need a Python script. You could just use your .com script (minus the "open" command):</div><div><br></div><div>chimera --nogui --nostatus my.pdb calculate_buriedArea.com > results.txt</div><div><br></div><div>or some such.</div><div><br></div><div>--Eric</div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></div></span> </div><br></body></html>