
Hi Amin, That is a pretty old message; probably the name of something changed ... it may be simpler now (in later versions of Chimera) that peptide residues are automatically assigned attributes named "phi" and "psi" with the torsion values. If your script can get the current residue attribute value and multiply it by -1, it can then reset it to the new value. I can't advise on python, but you can use the Chimera setattr command to specify the value of some attribute directly, for example to set phi to -60 for residue 40 in chain A: setattr r phi -60 :40.a <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/setattr.html> Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Feb 8, 2014, at 11:03 AM, amin@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.