OpenStructure
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.

1 import math
2 
3 e=io.LoadEntity('../entity/sdh.pdb')
4 c=e.FindChain('A')
5 
6 edi=e.EditICS(mol.EditMode.BUFFERED_EDIT)
7 for r in c.GetResidueList():
8  phi=r.GetPhiTorsion()
9  psi=r.GetPsiTorsion()
10  if phi.IsValid():
11  edi.SetTorsionAngle(phi, math.radians(-60))
12  if psi.IsValid():
13  edi.SetTorsionAngle(psi, math.radians(-45))
14 
15 edi.UpdateXCS()
16 
17 g=gfx.Entity('helix', e.Select('aname=CA,N,O,C,CB'))
18 scene.Add(g)
19 scene.SetCenter(g.GetCenter())
20 
21 
22