OpenStructure
Loading...
Searching...
No Matches
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.

1import math
2
3e=io.LoadEntity('../entity/sdh.pdb')
4c=e.FindChain('A')
5
6edi=e.EditICS(mol.EditMode.BUFFERED_EDIT)
7for 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
15edi.UpdateXCS()
16
17g=gfx.Entity('helix', e.Select('aname=CA,N,O,C,CB'))
18scene.Add(g)
19scene.SetCenter(g.GetCenter())
20
21
22