<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On May 16, 2011, at 10:49 AM, Daniel Gurnon wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>As I understand it, if the script is to work with any pdb structure, I will need two segments of python code:</div><div><br></div><div>1) custom residue labeling to display only 1-letter code and number, and</div><div>2) something that creates a separate tube for each chain in a model, without connecting one tube to the next.</div></span></blockquote><br></div><div>Hi Dan,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>It's actually easier to combine the two, something like this:</div><div><br></div><div>from chimera import openModels, Molecule, runCommand</div><div>from chimera.resCode import res3to1</div><div>for m in openModels.list(modelTypes=[Molecule]):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for chain in m.sequences():</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for r in chain.residues:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if not r:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># SEQRES sequence may include missing structure</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>continue</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>r.label = "%s %d" % (res3to1(r.type), r.id.position)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>runCommand("shape tube %s:.%s@ca radius 0.35 bandLength 2" % (m.oslIdent(), chain.chainID))</div><div><br></div><div>--Eric</div><div><br></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>