Skip to content
Snippets Groups Projects
Commit 4270b88a authored by Marco Biasini's avatar Marco Biasini
Browse files

use 'ligand' property in the conservation example

parent a29098fb
Branches
Tags
Loading
from ost.seq import alg
scene.RemoveAll() scene.RemoveAll()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Loading structure and alignment # Loading structure and alignment
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
m=io.LoadPDB('data/sh2.pdb') m=io.LoadPDB('data/sh2.pdb')
mp=m.Select('ishetatm=false') mp=m.Select('ligand=false')
aln=io.LoadAlignment('data/sh2.aln') aln=io.LoadAlignment('data/sh2.aln')
aln.AttachView(0, mp) aln.AttachView(0, mp)
aln.SetSequenceOffset(0, 1) aln.SetSequenceOffset(0, 1)
...@@ -13,7 +12,7 @@ aln.SetSequenceOffset(0, 1) ...@@ -13,7 +12,7 @@ aln.SetSequenceOffset(0, 1)
# First we set all properties to zero, then let alg.Conservation assign the # First we set all properties to zero, then let alg.Conservation assign the
# conservation scores to the residues # conservation scores to the residues
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
alg.Conservation(aln) seq.alg.Conservation(aln)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Setup Graphical Objects for Rendering # Setup Graphical Objects for Rendering
...@@ -25,7 +24,7 @@ scene.Add(gs) ...@@ -25,7 +24,7 @@ scene.Add(gs)
scene.Add(g) scene.Add(g)
scene.CenterOn(g) scene.CenterOn(g)
s.Attach(mp.Select('ishetatm=false'), 8.0) s.Attach(mp.Select('ligand=false'), 8.0)
gr=gfx.Gradient() gr=gfx.Gradient()
gr.SetColorAt(0.0, gfx.Color(0.1, 0.1, 0.8)) gr.SetColorAt(0.0, gfx.Color(0.1, 0.1, 0.8))
...@@ -34,10 +33,10 @@ gr.SetColorAt(1.0, gfx.Color(0.8, 0.1, 0.1)) ...@@ -34,10 +33,10 @@ gr.SetColorAt(1.0, gfx.Color(0.8, 0.1, 0.1))
gs.ColorBy('cons', gr, 0.8, 1.0, gs.ColorBy('cons', gr, 0.8, 1.0,
mol.Prop.Level.RESIDUE) mol.Prop.Level.RESIDUE)
g.SetRenderMode(gfx.HSC, g.SetRenderMode(gfx.HSC,
m.Select('ishetatm=false')) m.Select('ligand=false'))
g.SetRenderMode(gfx.CUSTOM, g.SetRenderMode(gfx.CUSTOM,
m.Select('ishetatm=true')) m.Select('ligand=true'))
g.SetColor(gfx.YELLOW, 'ishetatm=true') g.SetColor(gfx.YELLOW, 'ligand=true')
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Create alignment viewer and show it on the screen # Create alignment viewer and show it on the screen
......
HET AYI A 1 37
HELIX 1 1 PRO A 66 LYS A 76 1 11 HELIX 1 1 PRO A 66 LYS A 76 1 11
HELIX 2 2 SER A 127 HIS A 135 1 9 HELIX 2 2 SER A 127 HIS A 135 1 9
SHEET 1 A 4 PHE A 83 GLU A 87 0 SHEET 1 A 4 PHE A 83 GLU A 87 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment