<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Amin,<div><span class="Apple-tab-span" style="white-space:pre"> </span>As Elaine alluded to, the code for changing phi/psi is a lot simpler than what was necessary in 2005. In particular you can just assign a value to the phi or psi attribute to change it. Therefore in your script, the loop would just be:</div><div><br></div><div>for res in mol.residues:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if res.phi is not None:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>res.phi = -res.phi</div><div><br></div><div>--Eric</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div><div><br><div><div>On Feb 8, 2014, at 11:03 AM, <a href="mailto:amin@imtech.res.in">amin@imtech.res.in</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div style="font-family: Verdana,Geneva,sans-serif"><p>Dear Chimera users,</p><p>I am trying to write a script to change the phi and psi angle of a peptide. I am trying to adapt the code from <a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2005-September/000456.html">http://plato.cgl.ucsf.edu/pipermail/chimera-users/2005-September/000456.html</a> . I am trying to invert the angles so I am multiplying the angles by -1. My code is </p><p>import chimera</p><p><span style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">from chimera import selection, UserError, BondRot, replyobj</span></p><p>opened = chimera.openModels.open('fun.pdb')<br>mol = opened[0]<br>RES_LIST = mol.residues<br>for res in mol.residues:<br> b = str(res.phi)<br> if b != 'None':<br> c = -1*float(b) <br> atomsMap = res.atomsMap<br> N = atomsMap['N'][0]<br> CA = atomsMap['CA'][0]<br> C = atomsMap['C'][0]<br> CAmap = CA.bondsMap<br> phiBond = CAmap[N]<br> psiBond = CAmap[C]<br> phiAnchor = N<br> psiAnchor = CA<br> phi = BondRot(phiBond)<br> phi.setAngle(c, phiAnchor)</p><p>When I run this script i get the error </p><p>phi.setAngle(c, phiAnchor)<br>AttributeError: '_molecule.BondRot' object has no attribute 'setAngle'</p><div> <br class="webkit-block-placeholder"></div><p>Can someone please help me with this?</p><p>Warm regards.</p><p>Amin.</p>
<div> </div>
</div>
_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></blockquote></div><br></div></body></html>