<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 23, 2015, at 8:42 AM, Repic Matej <<a href="mailto:matej.repic@epfl.ch">matej.repic@epfl.ch</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Hello,</div>
<div><br>
</div>
<div>I wonder if it is possible to construct a composite residue from two existing residues in Chimera?</div>
<div><br>
</div>
<div>What I would like to do is concatenate residues ALA100 (mid chain) and GLY200 (end of chain) to make a composite residue AGL100.</div>
<div><br>
</div>
<div>Chimera won't let me set the same residue number via the "resrenumber" command. Preferably, the composite residue would have all the atoms listed where ALA100 was in the original pdb. </div>
<div><br>
</div>
<div>While I realize there are trivial text editor-based workarounds I would like to know if there is a native way.</div></div></blockquote><br></div><div>Hi Matej,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>This is kind of an unusual request, and I don't think there's any way to do it with the standard tools or commands. Nonetheless, almost anything is possible via Chimera's Python interface, so I believe this Python code will do what you want:</div><div><br></div><div># find the two residues; assumes they're in chain A and that only one structure is open</div><div>from chimera import openModels, Molecule</div><div>mol = openModels.list(modelTypes=[Molecule])[0]</div><div>for r in mol.residues:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if r.id.chainId == 'A' and r.id.position == 100:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>a100 = r</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if r.id.chainId == 'A' and r.id.position == 200:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>g200 = r</div><div><br></div><div># transfer the GLY200 atoms into ALA100</div><div>for a in g200.atoms:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>g200.removeAtom(a)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>a100.addAtom(a)</div><div><br></div><div># delete the now empty GLY200 residue, which would otherwise be problematic</div><div>mol.deleteResidue(g200)</div><div><br></div><div># change the combined residue's type to "AGL"</div><div>a100.type = "AGL"</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>So if you put the above in a file that ends with '.py' then you can run it simply by opening it (either with File->Open or with the "open" command). I hope this helps somehow. :-)</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; "><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></body></html>