homology model![]() High-resolution version of the image Shown here is an example of a homology model taken from CASP9, a community-wide protein structure prediction experiment. import ost.bindings.tmtools as tm
from ost.bindings import dssp
from ost import seq
if scene:
scene.RemoveAll()
modelSM=io.LoadPDB('model324.pdb')
target=io.LoadPDB('target.pdb')
scene.Add(gfx.Entity('target',target.Select('rnum>4')))
scene.Add(gfx.Entity('modelSM',modelSM))
# select C-alpha atoms only
vmodel=modelSM.Select('aname=CA')
vtarget=target.Select('aname=CA')
print vmodel.residue_count,vtarget.residue_count
print vmodel.atom_count,vtarget.atom_count
os.environ['DSSP_EXECUTABLE']='./DSSP.EXE'
hs_model=dssp.AssignDSSP(scene['modelSM'].view,tmp_dir='.')
hs_jto=dssp.AssignDSSP(scene['target'].view,tmp_dir='.')
scene['modelSM'].UpdateView()
scene['target'].UpdateView()
scene.SetBackground(gfx.WHITE)
scene.SetFog(1)
scene['target'].SetColor(gfx.Color(0.996094,0.738281,0.417969,1))
scene['target'].SetRenderMode(gfx.TUBE)
scene['target'].tube_options.SetTubeRadius(0.25)
scene['target'].tube_options.SetArcDetail(10)
scene['target'].tube_options.SetSplineDetail(12)
scene['modelSM'].cartoon_options.SetTubeRadius(0.3)
scene['modelSM'].cartoon_options.SetArcDetail(10)
scene['modelSM'].cartoon_options.SetSplineDetail(12)
scene['modelSM'].SetRenderMode(gfx.HSC)
scene.CenterOn(scene['modelSM'])
aln=io.LoadAlignment('t.aln',format='fasta')
aln.AttachView(0,vtarget)
aln.AttachView(1,vmodel)
last_idx=0
for i in vmodel.residues:
#default value
i.SetFloatProp("dist", 2.5)
for i,col in enumerate(aln):
if str(col).find('-')!=-1:
#only consider residues present in both target and template
continue
pos1=vmodel.atoms[aln.GetResidueIndex(1,i)].pos
pos2=vtarget.atoms[aln.GetResidueIndex(0,i)].pos
d=geom.Length(pos1-pos2)
# setting the distance between model and template as FloatProp
vmodel.residues[aln.GetResidueIndex(1,i)].SetFloatProp("dist", d)
last_idx=aln.GetResidueIndex(1,i)
grad=gfx.Gradient()
grad.SetColorAt(0.0, gfx.BLUE)
grad.SetColorAt(0.5, gfx.WHITE)
grad.SetColorAt(1.0, gfx.RED)
scene['modelSM'].ColorBy('dist',grad,0,5,mol.Prop.Level.RESIDUE)
#switching on outline rendering
scene['modelSM'].SetOutline(1)
scene['modelSM'].SetOutlineMode(2)
scene['modelSM'].SetOutlineWidth(6)
scene['target'].SetOutline(1)
scene['target'].SetOutlineMode(2)
scene['target'].SetOutlineWidth(6)
scene.CenterOn('target')
#scene.Export('test.png',2000,2000)
|
Do you have a nice picture?And would like to share it? Just let us know and we will add it to the gallery. |