<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi Snoze,<div><span class="Apple-tab-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 class="webkit-block-placeholder"></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 class="Apple-tab-span" style="white-space:pre"> </span>residues = m.residues</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>atoms = [a for r in residues for a in r.atoms]<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fc = estimateFormalCharge(atoms)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>try:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>addNonstandardResCharges(m.residues, fc)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>except ChargeError:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>print>>log, "Charge estimate (%d) or protonation wrong for %s (%s)" % (</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fc, m.name, m.oslIdent())</div><div>from WriteMol2 import writeMol2</div><div>writeMol2(mols, "output.mol2")</div><div>log.close()</div><div><br class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>chimera --nogui input.mol2 script.py</div><div><br class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></div><div>--Eric</div><div><br><div> <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; "><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"></span> </div><br><div><div>On Feb 1, 2008, at 10:36 AM, Elaine Meng wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi Snoze,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">One of the main<span class="Apple-converted-space"> </span>uses of the ZINC database is to generate ligand sets <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for DOCK; I believe you can download mol2 format directly from ZINC, <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and that the molecules already have hydrogens and charges.<span class="Apple-converted-space"> </span>See <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://zinc.docking.org">http://zinc.docking.org</a>/</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">But maybe you wanted to use Antechamber inside of Chimera to get <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">different charges.<span class="Apple-converted-space"> </span>If so, somebody else will have to answer the <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">scripting part of your question!</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Best</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Elaine</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-----</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Elaine C. Meng, Ph.D.<span class="Apple-converted-space"> </span><a href="mailto:meng@cgl.ucsf.edu">meng@cgl.ucsf.edu</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">UCSF Computer Graphics Lab and Babbitt Lab</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Department of Pharmaceutical Chemistry</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">University of California, San Francisco</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu/home/meng/index.html">http://www.cgl.ucsf.edu/home/meng/index.html</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Feb 1, 2008, at 9:47 AM, snoze pa wrote:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dear Chimera Users,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>How can I use chimera in --nogui mode to screen 1000 compunds from <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ZINC database and save them in to mol2 format.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Is there any script so that I can convert preselected 1000 compound <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">from ZINC database and convert them<span class="Apple-converted-space"> </span>t o mol2 format so that I can <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">use them in DOCK program.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">thanks in advance</div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Chimera-users mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div> </blockquote></div><br></div></body></html>