Hi Eric,<br> The scripts is not working.. It is giving me following error message. Is it possible to call the minimization step inside the script so that i can use the bcc charges?<br>Thanks a lot for your help.<br><br>chimera --nogui x.mol2 script.py<br>
Sorry: IndentationError: ('expected
an indented block', ('script.py', 6, 8, 'residues =
m.residues\n'))Opening x.mol2...Compiling script.py...Compiling
script.py succeededExecuting script.py...<br>
Traceback (most recent call last):<br> File "/usr/local/chimera/share/_<div id="1fe0" class="ArwC7c ckChnd">_main__.py", line 59, in ?<br> value = chimeraInit.init(sys.argv)<br> File "CHIMERA/share/chimeraInit.py", line 350, in init<br>
chimera.openModels.open(a, prefixableType=1)<br> File "CHIMERA/share/chimera/__init__.py", line 1378, in open<br> File "CHIMERA/share/chimera/__init__.py", line 865, in _openPython<br>IndentationError: expected an indented block (script.py, line 6)<br>
Error while processing script.py:<br>IndentationError: expected an indented block (script.py, line 6)<br>(see reply log for Python traceback info)</div><br><br><div class="gmail_quote">On Mon, Feb 4, 2008 at 4:00 PM, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="">
Hi Snoze,<div><span style="white-space: pre;"> </span>I'm going to guess, like Elaine, that your purpose is to add partial charges. If your 1000 compounds are in one big mol2 file, here is a script that would do the job:</div>
<div><br></div><div>from chimera import openModels, Molecule</div><div>from AddCharge import addNonstandardResCharges, estimateFormalCharge, ChargeError</div><div>mols = openModels.list(modelTypes=[Molecule])</div><div>log = open("errlog", "w")</div>
<div>for m in mols:</div><div><span style="white-space: pre;"> </span>residues = m.residues</div><div><span style="white-space: pre;"> </span>atoms = [a for r in residues for a in r.atoms]<br></div><div><span style="white-space: pre;"> </span>fc = estimateFormalCharge(atoms)</div>
<div><span style="white-space: pre;"> </span>try:</div><div><span style="white-space: pre;"> </span>addNonstandardResCharges(m.residues, fc)</div><div><span style="white-space: pre;"> </span>except ChargeError:</div><div>
<span style="white-space: pre;"> </span>print>>log, "Charge estimate (%d) or protonation wrong for %s (%s)" % (</div><div><span style="white-space: pre;"> </span>fc, <a href="http://m.name" target="_blank">m.name</a>, m.oslIdent())</div>
<div>from WriteMol2 import writeMol2</div><div>writeMol2(mols, "output.mol2")</div><div>log.close()</div><div><br></div><div>If you save the above in a file named script.py and your 1000 compounds are in a file named input.mol2, then running:</div>
<div><br></div><div><span style="white-space: pre;"> </span>chimera --nogui input.mol2 script.py</div><div><br></div><div>will produce a file named output.mol2 with the charges included. Any problems it had charging particular compounds will be saved in a file named errlog.</div>
<div><br></div><div>--Eric</div><div><br><div> <span style="border-collapse: separate; border-spacing: 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-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><p style="margin: 0px;">
<font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> <span> </span></span>Eric Pettersen</font></p>
<p style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> <span> </span></span>UCSF Computer Graphics Lab</font></p>
<div class="Ih2E3d"><p style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> </span><a href="http://www.cgl.ucsf.edu" target="_blank">http://www.cgl.ucsf.edu</a></font></p>
<br></div></span> </div><br><div><div><div></div><div class="Wj3C7c"><div>On Feb 1, 2008, at 10:36 AM, Elaine Meng wrote:</div></div></div></div></div></div></blockquote></div><br>