Skip to content
Snippets Groups Projects
Commit edb95a98 authored by marco's avatar marco
Browse files

added appnote example

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2396 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 7b009741
Branches
Tags
No related merge requests found
from ost.seq import alg
#-------------------------------------------------------------------------------
# Loading structure and alignment
#-------------------------------------------------------------------------------
m=io.LoadPDB('sh2.pdb')
mp=m.Select('ishetatm=false')
aln=io.LoadAlignment('sh2.aln')
aln.AttachView(0, mp)
#-------------------------------------------------------------------------------
# Calculate conservation of alignment
#-------------------------------------------------------------------------------
for r in m.residues:
r.SetFloatProp('cons', 0)
alg.Conservation(aln)
#-------------------------------------------------------------------------------
# Setup Graphical Objects for Rendering
#-------------------------------------------------------------------------------
g=gfx.Entity('SH2', m)
s=io.LoadSurface('sh2.vert')
gs=gfx.Surface('SH2-surf', s)
scene.Add(gs)
scene.Add(g)
scene.CenterOn(g)
s.Attach(mp.Select('ishetatm=false'), 5.0)
gr=gfx.Gradient()
gr.SetColorAt(0.0, gfx.BLUE)
gr.SetColorAt(0.5, gfx.WHITE)
gr.SetColorAt(1.0, gfx.RED)
gs.ColorBy('cons', gr, 0.8, 1.0,
mol.Prop.Level.RESIDUE)
g.SetRenderMode(gfx.HSC,
m.Select('ishetatm=false'))
g.SetRenderMode(gfx.CUSTOM,
m.Select('ishetatm=true'))
g.SetColor(gfx.YELLOW, 'ishetatm=true')
seq_viewer=gui.SequenceViewer()
seq_viewer.AddAlignment(aln)
seq_viewer.Show()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment