[Chimera-users] Problem in using BondRot
Eric Pettersen
pett at cgl.ucsf.edu
Sat Feb 8 18:14:06 PST 2014
Hi Amin,
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:
for res in mol.residues:
if res.phi is not None:
res.phi = -res.phi
--Eric
Eric Pettersen
UCSF Computer Graphics Lab
On Feb 8, 2014, at 11:03 AM, amin at imtech.res.in wrote:
> Dear Chimera users,
>
> 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 http://plato.cgl.ucsf.edu/pipermail/chimera-users/2005-September/000456.html . I am trying to invert the angles so I am multiplying the angles by -1. My code is
>
> import chimera
>
> from chimera import selection, UserError, BondRot, replyobj
>
> opened = chimera.openModels.open('fun.pdb')
> mol = opened[0]
> RES_LIST = mol.residues
> for res in mol.residues:
> b = str(res.phi)
> if b != 'None':
> c = -1*float(b)
> atomsMap = res.atomsMap
> N = atomsMap['N'][0]
> CA = atomsMap['CA'][0]
> C = atomsMap['C'][0]
> CAmap = CA.bondsMap
> phiBond = CAmap[N]
> psiBond = CAmap[C]
> phiAnchor = N
> psiAnchor = CA
> phi = BondRot(phiBond)
> phi.setAngle(c, phiAnchor)
>
> When I run this script i get the error
>
> phi.setAngle(c, phiAnchor)
> AttributeError: '_molecule.BondRot' object has no attribute 'setAngle'
>
>
> Can someone please help me with this?
>
> Warm regards.
>
> Amin.
>
>
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20140208/7e21f11e/attachment.html>
More information about the Chimera-users
mailing list