<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p>Thanks Dr. Pettersen. This helped me figure out most of the things. The last problem I had was with rotation of prolines. I found this thread regarding the problem http://plato.cgl.ucsf.edu/pipermail/chimera-users/2011-November/006938.html which I hope will solve everything. Thanks for the help.</p>
<p>Amin.</p>
<p> </p>
<p>On 2014-02-12 06:42, 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 -->I guess I didn't completely answer your question. If you want strict control over which side of the phi/psi moves, then you are going to have to set up the bond rotation yourself rather than use res.phi/res/psi. You do this by finding the bond you want to rotate and then using the BondRotMgr module:
<div> </div>
<div>from BondRotMgr import bondRotMgr</div>
<div>rot = bondRotMgr.rotationForBond(bond)</div>
<div>rot.anchorSide = anchor_atom</div>
<div> </div>
<div>then you'll have to measure the current phi/psi (which you could get via res.phi/res.psi) and use:</div>
<div> </div>
<div>rot.increment(angle_diff)</div>
<div> </div>
<div>to get to the desired value. When you are completely done adjusting the bond rotation, call:</div>
<div> </div>
<div>rot.destroy()</div>
<div> </div>
<div>--Eric</div>
<div><br />
<div>
<div>On Feb 11, 2014, at 4:57 PM, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</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="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>I'm not sure why you care which side moves, but by default the "smaller" side moves. So if the residue is near the N terminus then the N-terminal part will move, if it's near the C terminus then the C-terminal side will move. Unless these changes are relative to some other structure, it shouldn't matter which side "moves"; the resulting conformation is the same either way.</div>
<div> </div>
<div>--Eric</div>
<br />
<div> Eric Pettersen<br /> UCSF Computer Graphics Lab<br /> <a href="http://www.cgl.ucsf.edu/">http://www.cgl.ucsf.edu</a><br /><br /></div>
<div><br />
<div>
<div>On Feb 8, 2014, at 8:33 PM, amin 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 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>
<div> </div>
<p>On 2014-02-09 07:44, Eric Pettersen wrote:</p>
<blockquote style="padding-left: 5px; border-left: #1010ff 2px solid; margin-left: 5px;"><!-- node type 8 --><!-- node type 8 --><!-- node type 8 -->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 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 /><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></blockquote>
</div>
</div>
</blockquote>
<div> </div>
<div> </div>
</div>
</blockquote>
</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>