from xmlrpc.client import ServerProxy
from IPython.display import Image
cmd = ServerProxy(uri="http://localhost:9123/RPC2")
# Cпасительная ячейка
cmd.reinitialize()
# Загружаем pdp-файл и сделаем так чтобы он красиво выглядел
cmd.fetch('1LMP')
cmd.do("show cartoon")
cmd.color('rutherfordium')
# Теперь найдем лиганды и построим связи
cmd.select('ligand', '130/ | 131/ | 132/')
#cmd.do('''show sticks, ligand
#spectrum count,rainbow_rev, ligand
#dist hBounds, ligand, all, 3.5, 2
#''')
# Для мутации отберем только связи длиной 2.4 ангстрема
# И мутировать будем выделенный участок. ASP52
cmd.do('''
dist hBounds_precise, ligand, all, 2.5, 2
''')
cmd.select('to_mutate','/1LMP//A/ASP`52/')
cmd.color('white',"to_mutate")
cmd.do('''
zoom (ligand or to_mutate),3''')
После мутации получилось:
cmd.save('1lmp_mutated.pdb')
# movie
cmd.reinitialize()
cmd.do('''
load 1lmp.pdb
load 1lmp_mutated.pdb
hide nonbonded
show cartoon
color rutherfordium, 1lmp
color white, /1lmp//A/ASP`52
color rhodium, 1lmp_mutated
color tellurium, /1lmp_mutated//A/PRO`52
translate [150,0,0]
rotate y, 15, object=1lmp_mutated
orient 1lmp or 1lmp_mut
super 1lmp, 1lmp_mutated
mset 1 x100
frame 1
mview store
mview store, object=1lmp_mutated
mview store, object=1lmp
frame 50
python
cmd.madd("10 x10")
cmd.frame(100)
cmd.rotate("y", -15.8, object="1lmp_mutated")
cmd.rotate("z", -5, object="1lmp")
cmd.mview("store", object="1lmp_mutated")
cmd.mview("store")
cmd.mview("interpolate", object="1lmp_mutated")
cmd.mview("reinterpolate")
python end
frame 90
orient 1lmp
mview store
mview store, object=1lmp_mutated
mview store, object=1lmp
frame 1
mplay
''')
cmd.reinitialize()
cmd.load('/mnt/hgfs/BIO/Pymol/1lmp.pdb')
cmd.show('cartoon', '1lmp')
cmd.do('''
hide all
show cartoon
color rutherfordium
''')
cmd.select('residue1', '/1lmp//A/GLY`77/')
cmd.do('''
show sticks, residue1
''')
cmd.zoom('residue1', 40)
cmd.select('residue1_o', '/1lmp//A/GLY`77/o')
cmd.load('/mnt/hgfs/BIO/Pymol/tamra.sdf')
cmd.show('sticks', 'tamra')
cmd.select('tamra_c', 'tamra///UNK`/c')
cmd.fuse('residue1_o', 'tamra_c')
cmd.reinitialize()
cmd.do('''
frag ala
python
phi = -60
psi = -45
for i in range(2,101):
cmd.edit('/ala///{}/c'.format(str(i)))
editor.attach_amino_acid("pk1","ala")
cmd.edit("/ala///{}/N".format(str(i)),"/ala///{}/CA".format(str(i)))
cmd.torsion(phi)
cmd.edit("/ala///{}/CA".format(str(i)),"/ala///{}/C".format(str(i)))
cmd.torsion(psi)
python end
zoom resn ala
show sticks, ala''')
cmd.select('to_zoom','/ala///ALA`68/')
cmd.zoom('to_zoom', 20)