Работа с Pymol

In [1]:
from xmlrpclib import ServerProxy
from IPython.display import Image
import os, sys

Подключаем PyMol

In [2]:
import __main__
__main__.pymol_argv = [ 'pymol', '-cp' ]
import pymol
pymol.finish_launching()
from pymol import cmd

Сделаем возможность получать изображения:

In [3]:
from IPython.display import Image
In [4]:
cmd.delete('all')
cmd.fetch('1lmp')

Подгрузилась структура лизоцима с PDB-кодом 1lmp, далее хочется показать зону контакта с лигандом, нужно вписать параметры:

In [5]:
cmd.do('''
bg_color white
remove solvent
extract ligands,het
as surface, 1lmp
set transparency,0.5
as sticks, ligands
show stick, byres(1lmp w. 4 of ligands)
origin ligands
label (n. CA and byres(1lmp w. 4 of ligands)), (resn, resi)
set label_color, black
dist hbo,1lmp,ligands,3.2,mode=2
ray
png pic1.png
''')
In [6]:
Image(filename='pic1.png')
Out[6]:

Приседените флуорусцентную метку TAMRA к белку через сложноэфирную связь. Используйте команды fuse и torsion

In [160]:
cmd.do('''
reinitialize
load 1lmp
load CID_2762604, compound
bg_color black
as sticks, all
orient, all
show sticks
set valence, on
set valence_mode, 5
set stick_ball, on
set stick_ball_ratio, 2
set stick_radius, 0.12
set valence_mode, 2
set ray_trace_mode, 2
as cartoon, 1lmp
ray
show sticks, i. 119
as sticks, compound
fuse /compound///UNK`0/O, /1lmp/A/A/ASP`119/OD2, mode=1
ray 
zoom compound
png pic4.png
''')
In [145]:
%%bash
echo 'CN(C)C1=CC2=C(C=C1)C(=C3C=CC(=[N+](C)C)C=C3O2)C4=C(C=CC(=C4)C(=O)[O-])C(=O)O' > tamra.smi
In [146]:
%%bash
obgen tamra.smi > tamra.mol
In [156]:
cmd.delete('all')
cmd.load('tamra.mol')
In [157]:
cmd.refresh()
cmd.do('''
bg_color black
as sticks, all
orient, all
show sticks
set valence, on
set valence_mode, 3
set stick_ball, on
set stick_ball_ratio, 3
set stick_radius, 0.12
set valence_mode, 2
set ray_trace_mode, 3
rotate x, -10
ray
png tamra.png
''')
In [158]:
Image(filename='tamra.png')
Out[158]:
In [159]:
cmd.save('tamra.pdb')
In [161]:
Image(filename='pic4.png')
Out[161]:

Используя возможности babel строить третичную структуру вещества на основе SMILE нотации. Постройте структуру кубана.

In [1]:
%%bash
echo 'C12C3C4C1C5C2C3C45' > cubane.smi
In [2]:
%%bash
obgen cubane.smi > cubane.mol

A T O M   T Y P E S

IDX	TYPE
1	20
2	20
3	20
4	20
5	20
6	20
7	20
8	20
9	5
10	5
11	5
12	5
13	5
14	5
15	5
16	5

F O R M A L   C H A R G E S

IDX	CHARGE
1	0.000000
2	0.000000
3	0.000000
4	0.000000
5	0.000000
6	0.000000
7	0.000000
8	0.000000
9	0.000000
10	0.000000
11	0.000000
12	0.000000
13	0.000000
14	0.000000
15	0.000000
16	0.000000

P A R T I A L   C H A R G E S

IDX	CHARGE
1	0.000000
2	0.000000
3	0.000000
4	0.000000
5	0.000000
6	0.000000
7	0.000000
8	0.000000
9	0.000000
10	0.000000
11	0.000000
12	0.000000
13	0.000000
14	0.000000
15	0.000000
16	0.000000

S E T T I N G   U P   C A L C U L A T I O N S

SETTING UP BOND CALCULATIONS...
SETTING UP ANGLE & STRETCH-BEND CALCULATIONS...
SETTING UP TORSION CALCULATIONS...
SETTING UP OOP CALCULATIONS...
SETTING UP VAN DER WAALS CALCULATIONS...
SETTING UP ELECTROSTATIC CALCULATIONS...

S T E E P E S T   D E S C E N T

STEPS = 500

STEP n       E(n)         E(n-1)    
------------------------------------
    0     101.426      ----
   10    97.22536    97.24497
   20    97.15737    97.16000
   30    97.14417    97.14491
   40    97.14115    97.14141
    STEEPEST DESCENT HAS CONVERGED

W E I G H T E D   R O T O R   S E A R C H

  NUMBER OF ROTATABLE BONDS: 0
  NUMBER OF POSSIBLE ROTAMERS: 1
  GENERATED ONLY ONE CONFORMER


S T E E P E S T   D E S C E N T

STEPS = 500

STEP n       E(n)         E(n-1)    
------------------------------------
    0      97.140      ----
   10    97.14063    97.13970
   20    97.14010    97.13963
   30    97.13985    97.14037
   40    97.13972    97.13999
   50    97.13966    97.13979
   60    97.14069    97.13969
   70    97.14017    97.13964
   80    97.13990    97.14049
   90    97.13975    97.14007
  100    97.13967    97.13984
  110    97.13963    97.13972
  120    97.14032    97.13966
  130    97.13998    97.13962
  140    97.13980    97.14021
  150    97.13970    97.13992
  160    97.13965    97.13977
  170    97.14055    97.13968
  180    97.14011    97.13964
  190    97.13987    97.14042
  200    97.13974    97.14004
  210    97.13967    97.13983
  220    97.13963    97.13972
  230    97.14031    97.13966
  240    97.13998    97.13963
  250    97.13980    97.14021
  260    97.13971    97.13993
  270    97.13965    97.13978
  280    97.14059    97.13969
  290    97.14014    97.13964
  300    97.13989    97.14046
  310    97.13976    97.14007
  320    97.13968    97.13986
  330    97.13964    97.13974
  340    97.14037    97.13967
  350    97.14002    97.13963
  360    97.13983    97.14028
  370    97.13972    97.13997
  380    97.13966    97.13980
  390    97.13963    97.13971
  400    97.14022    97.13965
  410    97.13994    97.14059
  420    97.13978    97.14014
  430    97.13969    97.13990
  440    97.13965    97.13976
  450    97.14050    97.13968
  460    97.14010    97.13964
  470    97.13987    97.14040
  480    97.13975    97.14004
  490    97.13968    97.13984
  500    97.13964    97.13973

In [4]:
from xmlrpclib import ServerProxy
from IPython.display import Image
import os, sys
import scipy as sp
from scipy import constants
from scipy.constants import codata
import numpy as np
import __main__
__main__.pymol_argv = [ 'pymol', '-cp' ]
import pymol
pymol.finish_launching()
from pymol import cmd
In [69]:
cmd.delete('all')
cmd.load('cubane.mol')
In [70]:
cmd.refresh()
cmd.do('''
bg_color black
as sticks, all
orient, all
show sticks
set valence, on
set valence_mode, 3
set stick_ball, on
set stick_ball_ratio, 3
set stick_radius, 0.12
set valence_mode, 2
set ray_trace_mode, 3
ray
png pic5.png
''')
In [71]:
Image(filename='pic5.png')
Out[71]:

Напишите скрипт для построения поли-аланиновой ( Вы вольны использовать любую аминоксилоту) альфа спирали длинной 100 аминкислот

Попытался сделать это задание, но пишет, что ошибка