import sys
sys.path.append('/usr/lib/modeller9v7/modlib/')
sys.path.append('/usr/lib/modeller9.12/lib/x86_64-intel8/python2.5/')
#управляющий скрипт
from modeller.automodel import *
class mymodel(automodel):
def special_restraints(self, aln):
rsr = self.restraints
for ids in (('OE2:32', 'O6C:121'),
('O:102', 'N2B:121'),
('OH:60', 'O6B:121')):
atoms = [self.atoms[i] for i in ids]
rsr.add(forms.upper_bound(group=physical.upper_distance,
feature=features.distance(*atoms), mean=3.5, stdev=0.1))
env = environ()
env.io.hetatm = True
a = mymodel(env, alnfile='al_mod.pir', knowns=('1lmp'), sequence='seq')
a.starting_model = 1
a.ending_model = 5
a.make()
%%bash
echo "from modeller.automodel import *
class mymodel(automodel):
def special_restraints(self, aln):
rsr = self.restraints
for ids in (('OE2:32', 'O6C:121'),
('O:102', 'N2B:121'),
('OH:60', 'O6B:121')):
atoms = [self.atoms[i] for i in ids]
rsr.add(forms.upper_bound(group=physical.upper_distance,
feature=features.distance(*atoms), mean=3.5, stdev=0.1))
env = environ()
env.io.hetatm = True
a = mymodel(env, alnfile='al_mod.pir', knowns=('1lmp'), sequence='seq')
a.starting_model = 1
a.ending_model = 5
a.make()
" > lys.py
%%bash
mod9v7 lys.py
from xmlrpclib import ServerProxy
from IPython.display import Image
import os, sys, time
# pymol launching
import __main__
__main__.pymol_argv = [ 'pymol', '-cp' ]
# __main__.pymol_argv = [ 'pymol', '-x' ] # for GUI
import pymol
from pymol import cmd
pymol.finish_launching()
defaultImage = 'pymolimg.png'
def prepareImage(width=300, height=300, sleep=5, filename=defaultImage):
## To save the rendered image
cmd.ray(width, height)
cmd.png('pymolimg.png')
time.sleep(sleep)
# Define some shortcuts
def focus(x):
cmd.center(x)
cmd.zoom(x)
cmd.do('''
delete all
bg white
show cartoon
load seq.B99990001.pdb
load seq.B99990002.pdb
load seq.B99990003.pdb
load seq.B99990004.pdb
load seq.B99990005.pdb
load 1lmp_now.ent
super 1lmp, seq.B99990001
center 1lmp
ray
png pic1.png
''')
Image(filename='pic1.png')
#4 модель работает лучше всего