<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Shyamala,<div><span class="Apple-tab-span" style="white-space:pre"> </span>If you know how to do something using the Chimera command line, you can do the exact same thing in Python by using Chimera's runCommand() function, <i>e.g.</i>:</div><div><br></div><div>from chimera import runCommand</div><div>runCommand("pdbrun conect cat > " + fname + ".pdb")</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>You only need to use the pdbrun command above if you need to write out CONECT records for both standard and non-standard residues for some reason. The normal command for saving PDBs ("write") will output CONECT records for non-standard residues.<br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>As for programming resources, there are some but not as many/much as we would like. First there is the <a href="http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html">Chimera Programmer's Guide</a> which has examples and an FAQ. Second is to look at modules in <your chimera>/share that perform functions similar to what you want to do. Third is to search chimera-users for scripts that have been posted to see how they work. We want to put up a wiki page of scripts but haven't gotten to that yet. Last but not least is if you get stuck, post questions on the chimera-dev mailing list -- they should be answered quickly.</div><div><br></div><div>--Eric</div><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><div><div>On Mar 13, 2009, at 3:08 PM, shyamala wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Chimera users,<br><br>I am sure there is a simple way to do this, but I need some help.<br>I want to add CONECT records to a pdb file, given that the input file <br>contains all necessary atom coordinate information.<br>I need to do this within my shell script and I want to start chimera using <br>the nongui option.<br>Now, doing some google seach brought up this solution to add CONECT <br>records (in the command line within CHIMERA gui)<br>pdbrun nouser conect cat > filename.pdb<br><br>where filename.pdb is the name of the output file with CONECT records <br>added.<br><br>the above mentioned command works when I pull up the file on GUI CHIMERA<br><br>My question is then how would I use such a command when I want to use it <br>in the nogui option. I have multiple files (>100) for which I need to <br>add CONECT records and I want to do it with a script.<br><br>Also, if someone could point me to a good resource for writing python <br>scripts that can be then passed on to chimera, I would be grateful.<br><br>Thanks,<br><br>Shyamala<br><br>Shyamala Iyer<br>Graduate Student<br>Department of Microbiology<br>PO BOX 357242<br>University of Washington<br>Seattle, WA, 98195<br><br>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></div></blockquote></div><br></div></body></html>