<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p>Dear Dr. Pettersen and Dr. Meng,</p>
<p>Thanks for the suggestion. I tried the simpler scripts and they work. But I am not sure that what atoms are moved when I set res.phi = -res.phi. The earlier script had set anchor residues to solve this problem. Can you please guide me on how to use anchor residues on newer versions of chimera?</p>
<p>Warm Regards.</p>
<p>Amin.</p>
<p> </p>
<p>On 2014-02-09 07:44, Eric Pettersen wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->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> </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> </div>
<div>--Eric</div>
<div> </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" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">
<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>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> </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</blockquote>
</div>
</div>
</blockquote>
<p> </p>
<div> </div>
</body></html>