roll_helix.py

Shows how to modify the internal coordinate system of a protein. The backtone torsion angles are all set to PHI=-60, PSI=-45; the protein is thus folded into a very long alpha helix.

import math

e=io.LoadEntity('../entity/sdh.pdb')
c=e.FindChain('A')

edi=e.EditICS(mol.EditMode.BUFFERED_EDIT)
for r in c.GetResidueList():
  phi=r.GetPhiTorsion()
  psi=r.GetPsiTorsion()
  if phi.IsValid(): 
    edi.SetTorsionAngle(phi, math.radians(-60))    
  if psi.IsValid(): 
    edi.SetTorsionAngle(psi, math.radians(-45))    
  
edi.UpdateXCS()

g=gfx.Entity('helix', e.Select('aname=CA,N,O,C,CB'))
scene.Add(g)
scene.SetCenter(g.GetCenter())



 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 20 Jun 2016 for OpenStructure by  doxygen 1.6.1