В этом задании мы моделируем самосборку липидного слоя. Моделирование состоит из частей:

  • Забрать с Kodomo разнообразные файлы топологий, координат и параметров
  • Создать ячейку с N=64 липидами
    • Преобразовать файлы ячеек в формат pdb с помощью editconf
    • Скачать их и посмотреть в PyMol
  • Оптимизировать систему, дабы сила контактов между молекулами была не экстремальной (?)
    • Отметить максимальную силу контактов до и после оптимизации.
  • Добавить в систему воды и «утрясти»
    • Снова преобразовать в pdb и посмотреть на отличия
  • Отправиться на Ломоносов и запустить там моделирование.
    • Сначала тестовое, на 5 минут; если всё пошло хорошо — полноценное, на 350 минут.

Поехали.

Мы уже в правильной папке (Task9_mrkun). Грузим файлы.

In [1]:
%%bash
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/dppc.itp
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/lipid.itp
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/dppc.gro
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/b.top
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/em.mdp
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/pr.mdp
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/md.mdp
--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/dppc.itp
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12772 (12K)
Saving to: `dppc.itp'

     0K .......... ..                                         100%  109M=0s

2017-12-15 16:22:54 (109 MB/s) - `dppc.itp' saved [12772/12772]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/lipid.itp
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34337 (34K)
Saving to: `lipid.itp'

     0K .......... .......... .......... ...                  100% 94.1M=0s

2017-12-15 16:22:54 (94.1 MB/s) - `lipid.itp' saved [34337/34337]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/dppc.gro
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2329 (2.3K)
Saving to: `dppc.gro'

     0K ..                                                    100%  275M=0s

2017-12-15 16:22:54 (275 MB/s) - `dppc.gro' saved [2329/2329]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/b.top
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 573
Saving to: `b.top'

     0K                                                       100% 51.0M=0s

2017-12-15 16:22:54 (51.0 MB/s) - `b.top' saved [573/573]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/em.mdp
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1088 (1.1K)
Saving to: `em.mdp'

     0K .                                                     100%  142M=0s

2017-12-15 16:22:54 (142 MB/s) - `em.mdp' saved [1088/1088]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/pr.mdp
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1164 (1.1K)
Saving to: `pr.mdp'

     0K .                                                     100%  229M=0s

2017-12-15 16:22:54 (229 MB/s) - `pr.mdp' saved [1164/1164]

--2017-12-15 16:22:54--  http://kodomo.cmm.msu.ru/~golovin/bilayer/md.mdp
Resolving kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)... 93.180.63.127
Connecting to kodomo.cmm.msu.ru (kodomo.cmm.msu.ru)|93.180.63.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1277 (1.2K)
Saving to: `md.mdp'

     0K .                                                     100%  160M=0s

2017-12-15 16:22:54 (160 MB/s) - `md.mdp' saved [1277/1277]

Создаём липидную ячейку и конвертируем её в pdb.
(Вывод GROMACS неинформативен, поэтому его мы опустим.)

In [ ]:
%%bash
genconf -f dppc.gro -o b_64.gro -nbox 4 4 4 
editconf -f dppc.gro -o dppc.pdb 
editconf -f b_64.gro -o b_64.pdb

Смотрим на файлы в PyMolnglview:
(А он умеет читать в том числе файлы .gro! Convenient.)

In [2]:
import nglview
import ipywidgets
from IPython.display import Image
In [3]:
view1 = nglview.show_structure_file('dppc.gro')
view1.clear_representations()
view1.add_representation(repr_type="licorice")
view1.center_view()
view1
In [4]:
#view1.download_image("dppc.png")
Image("dppc.png")
Out[4]:
In [86]:
view2 = nglview.show_structure_file('b_64.gro')
view2.clear_representations()
view2.add_representation(repr_type="licorice")
view2.center_view()
view2
In [5]:
#view2.download_image("b_64.png")
Image("b_64.png")
Out[5]:

Отредактировали b.top: там было указание на 34, а не 64 молекулы.

Отступаем от собственно липидов, чтобы добавлять воду не прямо в них, а на отдалении.

In [ ]:
!editconf -f b_64.gro -o b_ec -d 0.5 

Чиним плохие контакты:

In [ ]:
!grompp -f em -c b_ec -p b -o b_em -maxwarn 2
In [ ]:
!mdrun -deffnm b_em -v

Стартовая максимальная сила: Fmax = 4.37970e+05
Конечная максимальная сила: Fmax = 6.16887e+02
И это хорошо.

Добавляем воду, «трясём» её до базового состояния:

In [ ]:
%%bash
genbox -cp b_em -p b -cs spc216 -o b_s
grompp -f pr -c b_s -p b -o b_pr -maxwarn 1
mdrun -deffnm b_pr -v

Всё прошло хорошо, система не пошла вразнос.

Конвертируем b_pr.gro и b_s.gro в pdb.

In [ ]:
!editconf -f b_pr.gro -o b_pr.pdb
!editconf -f b_s.gro -o b_s.pdb

Смотрим в nglview:

In [8]:
view3 = nglview.show_structure_file('b_s.gro')
view3.clear_representations()
view3.add_representation(repr_type="licorice")
view3.center_view()
view3
In [6]:
#view3.download_image("b_s.png")
Image("b_s.png")
Out[6]:
In [90]:
view4 = nglview.show_structure_file('b_pr.gro')
view4.clear_representations()
view4.add_representation(repr_type="licorice")
view4.center_view()
view4
In [7]:
#view4.download_image("b_pr.png")
Image("b_pr.png")
Out[7]:

Отправляемся на суперкомпьютер.

In [ ]:
%%bash
cd ..
scp -r ./Task9_mrkun lom:_scratch/chem

Запускаем тестовое моделирование.

In [ ]:
%%bash
ssh lom
cd _scratch/chem/Task9_mrkun
cp /home/users/golovin/progs/share/gromacs/top/residuetypes.dat .
grompp -f md -c b_pr -p b -o b_md -maxwarn 1
sbatch -n 4 -e error.log -o output.log -t 5 -p test \
impi opt/ccoe/gromacs-5.0.4/build/bin/gmx_mpi \
mdrun -testverlet -deffnm b_md -v

Запускаем полное моделирование.

In [ ]:
sbatch -N1 --ntasks-per-node=2 -e error_full.log -o output_full.log \
-t 350 -p gpu impi /opt/ccoe/gromacs-5.0.4/build/bin/gmx_mpi \
mdrun -testverlet -deffnm  b_md -v

Номер полной задачи на gpu: 1643189

Анализ

In [21]:
!echo 2 | trjconv -f b_md.xtc -s b_md.tpr -o b_pbc_1.pdb -skip 20 -pbc mol
                         :-)  G  R  O  M  A  C  S  (-:

                       Great Red Owns Many ACres of Sand 

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                               :-)  trjconv  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_md.xtc  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -o    b_pbc_1.pdb  Output       Trajectory: xtc trr trj gro g96 pdb
  -s       b_md.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -n      index.ndx  Input, Opt.  Index file
 -fr     frames.ndx  Input, Opt.  Index file
-sub    cluster.ndx  Input, Opt.  Index file
-drop      drop.xvg  Input, Opt.  xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-tu          enum   ps      Time unit: fs, ps, ns, us, ms or s
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   xmgrace  xvg plot formatting: xmgrace, xmgr or none
-skip        int    20      Only write every nr-th frame
-dt          time   0       Only write frame when t MOD dt = first time (ps)
-[no]round   bool   no      Round measurements to nearest picosecond
-dump        time   -1      Dump frame nearest specified time (ps)
-t0          time   0       Starting time (ps) (default: don't change)
-timestep    time   0       Change time step between input frames (ps)
-pbc         enum   mol     PBC treatment (see help text for full
                            description): none, mol, res, atom, nojump,
                            cluster or whole
-ur          enum   rect    Unit-cell representation: rect, tric or compact
-[no]center  bool   no      Center atoms in box
-boxcenter   enum   tric    Center for -pbc and -center: tric, rect or zero
-box         vector 0 0 0   Size for new cubic box (default: read from input)
-clustercenter vector 0 0 0   Optional starting point for pbc cluster option
-trans       vector 0 0 0   All coordinates will be translated by trans. This
                            can advantageously be combined with -pbc mol -ur
                            compact.
-shift       vector 0 0 0   All coordinates will be shifted by framenr*shift
-fit         enum   none    Fit molecule to ref structure in the structure
                            file: none, rot+trans, rotxy+transxy,
                            translation, transxy or progressive
-ndec        int    3       Precision for .xtc and .gro writing in number of
                            decimal places
-[no]vel     bool   yes     Read and write velocities if possible
-[no]force   bool   no      Read and write forces if possible
-trunc       time   -1      Truncate input trajectory file after this time
                            (ps)
-exec        string         Execute command for every output frame with the
                            frame number as argument
-[no]app     bool   no      Append output
-split       time   0       Start writing new file when t MOD split = first
                            time (ps)
-[no]sep     bool   no      Write each frame to a separate .gro, .g96 or .pdb
                            file
-nzero       int    0       If the -sep flag is set, use these many digits
                            for the file numbers and prepend zeros as needed
-dropunder   real   0       Drop all frames below this value
-dropover    real   0       Drop all frames above this value
-[no]conect  bool   no      Add conect records when writing .pdb files.
                            Useful for visualization of non-standard
                            molecules, e.g. coarse grained ones

Will write pdb: Protein data bank file
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Select group for output
Group     0 (         System) has 11054 elements
Group     1 (          Other) has  3200 elements
Group     2 (           DPPC) has  3200 elements
Group     3 (          Water) has  7854 elements
Group     4 (            SOL) has  7854 elements
Group     5 (      non-Water) has  3200 elements
Select a group: Selected 2: 'DPPC'
Reading frame       0 time    0.000   
Precision of b_md.xtc is 0.001 (nm)

Back Off! I just backed up b_pbc_1.pdb to ./#b_pbc_1.pdb.1#
Last frame       2000 time 50000.000    ->  frame    100 time 50000.000      


gcq#268: "As Always Your Logic Is Impeccable" (Tuvok)

Посмотрим на образование бислоя глазами.

In [14]:
import pytraj
In [33]:
view5 = nglview.show_pytraj(pytraj.load("b_pbc_1.pdb"))
view5.clear_representations()
view5.add_representation(repr_type="licorice")
view5.center_view()
view5

Всё начинается с исходной регулярной структуры:

In [44]:
view5.render_image(frame=0)
In [45]:
view5._display_image()
Out[45]:

Исходная структура быстро разрушается; уже к 20-30 кадру возникает гидрофобное ядро:

In [55]:
view5.render_image(frame=25)
In [56]:
view5._display_image()
Out[56]:

К 50 кадру гидрофобное ядро отчётливо разделяется в бислой:

In [57]:
view5.render_image(frame=50)
In [58]:
view5._display_image()
Out[58]:

Бислой сохраняется до конца моделирования, но около 70 кадра от него отделяется неспаренный фрагмент:

In [61]:
view5.render_image(frame=75)
In [62]:
view5._display_image()
Out[62]:
In [63]:
view5.render_image(frame=100)
In [64]:
view5._display_image()
Out[64]:

Посчитаем площадь, занимаемую одним липидом.

In [67]:
!echo 2 | g_traj -f b_md.xtc -s b_md.tpr -ob box_1.xvg
                         :-)  G  R  O  M  A  C  S  (-:

               GRoups of Organic Molecules in ACtion for Science

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_traj  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_md.xtc  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -s       b_md.tpr  Input        Structure+mass(db): tpr tpb tpa gro g96 pdb
  -n      index.ndx  Input, Opt.  Index file
 -ox      coord.xvg  Output, Opt. xvgr/xmgr file
-oxt      coord.xtc  Output, Opt. Trajectory: xtc trr trj gro g96 pdb cpt
 -ov      veloc.xvg  Output, Opt. xvgr/xmgr file
 -of      force.xvg  Output, Opt. xvgr/xmgr file
 -ob      box_1.xvg  Output, Opt! xvgr/xmgr file
 -ot       temp.xvg  Output, Opt. xvgr/xmgr file
-ekt    ektrans.xvg  Output, Opt. xvgr/xmgr file
-ekr      ekrot.xvg  Output, Opt. xvgr/xmgr file
 -vd    veldist.xvg  Output, Opt. xvgr/xmgr file
 -cv      veloc.pdb  Output, Opt. Protein data bank file
 -cf      force.pdb  Output, Opt. Protein data bank file
 -av  all_veloc.xvg  Output, Opt. xvgr/xmgr file
 -af  all_force.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-tu          enum   ps      Time unit: fs, ps, ns, us, ms or s
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   xmgrace  xvg plot formatting: xmgrace, xmgr or none
-[no]com     bool   no      Plot data for the com of each group
-[no]pbc     bool   yes     Make molecules whole for COM
-[no]mol     bool   no      Index contains molecule numbers iso atom numbers
-[no]nojump  bool   no      Remove jumps of atoms across the box
-[no]x       bool   yes     Plot X-component
-[no]y       bool   yes     Plot Y-component
-[no]z       bool   yes     Plot Z-component
-ng          int    1       Number of groups to consider
-[no]len     bool   no      Plot vector length
-[no]fp      bool   no      Full precision output
-bin         real   1       Binwidth for velocity histogram (nm/ps)
-ctime       real   -1      Use frame at this time for x in -cv and -cf
                            instead of the average x
-scale       real   0       Scale factor for .pdb output, 0 is autoscale

Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Group     0 (         System) has 11054 elements
Group     1 (          Other) has  3200 elements
Group     2 (           DPPC) has  3200 elements
Group     3 (          Water) has  7854 elements
Group     4 (            SOL) has  7854 elements
Group     5 (      non-Water) has  3200 elements
Select a group: Selected 2: 'DPPC'
Last frame       2000 time 50000.000   

gcq#0: "If You Want Something Done You Have to Do It Yourself" (Highlander II)

In [88]:
import matplotlib
from matplotlib import pyplot as plt
%matplotlib inline
import numpy as np
from __future__ import division
In [86]:
dims = np.loadtxt("box_1.xvg", skiprows=24)
dims[:6, :4]
Out[86]:
array([[   0.     ,    6.26   ,    4.443  ,    5.778  ],
       [  25.     ,    6.23297,    4.42382,    5.82376],
       [  50.     ,    6.20235,    4.40208,    5.86176],
       [  75.     ,    6.18369,    4.38884,    5.90833],
       [ 100.     ,    6.16228,    4.37364,    5.96339],
       [ 125.     ,    6.14911,    4.36429,    5.99321]])
In [109]:
plt.figure(figsize=(10,6))

# We want to compute per pair of lipids in a bilayer, 
# so denominator is 32, not 64.
area = dims[:,2]*dims[:,3]/(4**3/2)
plt.plot(dims[:,0], area);
plt.show()
for stat in ("max", "mean", "median", "min", ):
    print("{} area: {:f}".format(stat, getattr(np, stat)(area)))
max area: 0.822573
mean area: 0.616261
median area: 0.599726
min area: 0.530501

Не сказать, что липиды укладываются стремительно, но зато укладываются хорошо: почти вдвое от стартового хаотичного состояния.

Посмотрим на площадь доступных гидрофильной и гидрофобной поверхностей.

In [112]:
!echo 2 2 | g_sas -f b_md.xtc -s b_md.tpr -o sas_b.xvg -dt 100
                         :-)  G  R  O  M  A  C  S  (-:

                       Great Red Owns Many ACres of Sand 

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_sas  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_md.xtc  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -s       b_md.tpr  Input        Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o      sas_b.xvg  Output       xvgr/xmgr file
 -or    resarea.xvg  Output, Opt. xvgr/xmgr file
 -oa   atomarea.xvg  Output, Opt. xvgr/xmgr file
 -tv     volume.xvg  Output, Opt. xvgr/xmgr file
  -q   connelly.pdb  Output, Opt. Protein data bank file
  -n      index.ndx  Input, Opt.  Index file
  -i     surfat.itp  Output, Opt. Include file for topology

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   100     Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   xmgrace  xvg plot formatting: xmgrace, xmgr or none
-probe       real   0.14    Radius of the solvent probe (nm)
-ndots       int    24      Number of dots per sphere, more dots means more
                            accuracy
-qmax        real   0.2     The maximum charge (e, absolute value) of a
                            hydrophobic atom
-[no]f_index bool   no      Determine from a group in the index file what are
                            the hydrophobic atoms rather than from the charge
-minarea     real   0.5     The minimum area (nm^2) to count an atom as a
                            surface atom when writing a position restraint
                            file  (see help)
-[no]pbc     bool   yes     Take periodicity into account
-[no]prot    bool   yes     Output the protein to the Connelly .pdb file too
-dgs         real   0       Default value for solvation free energy per area
                            (kJ/mol/nm^2)


++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++
Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and
Michael Scharf
The Double Cube Lattice Method: Efficient Approaches to Numerical Integration
of Surface Area and Volume and to Dot Surface Contouring of Molecular
Assemblies
J. Comp. Chem. 16 (1995) pp. 273-284
-------- -------- --- Thank You --- -------- --------

Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
In case you use free energy of solvation predictions:

++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++
D. Eisenberg and A. D. McLachlan
Solvation energy in protein folding and binding
Nature 319 (1986) pp. 199-203
-------- -------- --- Thank You --- -------- --------

Reading frame       0 time    0.000   Select a group for calculation of surface and a group for output:
Group     0 (         System) has 11054 elements
Group     1 (          Other) has  3200 elements
Group     2 (           DPPC) has  3200 elements
Group     3 (          Water) has  7854 elements
Group     4 (            SOL) has  7854 elements
Group     5 (      non-Water) has  3200 elements
Select a group: Selected 2: 'DPPC'
Select a group: Selected 2: 'DPPC'

WARNING: masses and atomic (Van der Waals) radii will be determined
         based on residue and atom names. These numbers can deviate
         from the correct mass and radius of the atom type.

WARNING: could not find a Van der Waals radius for 64 atoms
1920 out of 3200 atoms were classified as hydrophobic
Last frame       2000 time 50000.000   


gcq#9: "Don't Push Me, Cause I'm Close to the Edge" (Grandmaster Flash)

In [131]:
hydro_areas = np.loadtxt("sas_b.xvg", skiprows=22)
hydro_areas[:6]
Out[131]:
array([[   0.   ,  202.648,  131.232,  333.88 ,    0.   ],
       [ 100.   ,  192.608,  141.58 ,  334.188,    0.   ],
       [ 200.   ,  165.89 ,  152.546,  318.436,    0.   ],
       [ 300.   ,  152.68 ,  161.202,  313.881,    0.   ],
       [ 400.   ,  132.633,  157.156,  289.789,    0.   ],
       [ 500.   ,  134.912,  160.776,  295.688,    0.   ]])
In [132]:
plt.figure(figsize=(10,6))

plt.plot(hydro_areas[:,0], hydro_areas[:,1], 
         color="red", label="Hydrophobic");
plt.plot(hydro_areas[:,0], hydro_areas[:,2], 
         color="blue", label="Hydrophilic");
plt.legend()
plt.show()

Площадь доступной гидрофобной поверхности стремительно снижается в первые ~5000 шагов, что соответствует увиденному выше образованию гидрофобного ядра. Это логично: упаковка гидрофобной поверхности в ядро существенно снижает энергию системы. В дальнейшем обе площади поверхностей продолжают снижаться, хотя и менее интенсивно: ядро обращается в бислой, в котором ещё меньше места для контактов с растворителем.

Считаем меру порядка бислоя в начале и в конце моделирования.

In [121]:
!g_order -s b_md -f b_md.xtc -o ord_start.xvg -n sn1.ndx -e 5000 -d X
                         :-)  G  R  O  M  A  C  S  (-:

        Getting the Right Output Means no Artefacts in Calculating Stuff

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                               :-)  g_order  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_md.xtc  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n        sn1.ndx  Input        Index file
 -nr      index.ndx  Input        Index file
  -s       b_md.tpr  Input        Run input file: tpr tpb tpa
  -o  ord_start.xvg  Output       xvgr/xmgr file
 -od     deuter.xvg  Output       xvgr/xmgr file
 -ob      eiwit.pdb  Output       Protein data bank file
 -os     sliced.xvg  Output       xvgr/xmgr file
 -Sg     sg-ang.xvg  Output, Opt. xvgr/xmgr file
 -Sk    sk-dist.xvg  Output, Opt. xvgr/xmgr file
-Sgsl sg-ang-slice.xvg  Output, Opt. xvgr/xmgr file
-Sksl sk-dist-slice.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   5000    Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   xmgrace  xvg plot formatting: xmgrace, xmgr or none
-d           enum   x       Direction of the normal on the membrane: z, x or y
-sl          int    1       Calculate order parameter as function of box
                            length, dividing the box in #nr slices.
-[no]szonly  bool   no      Only give Sz element of order tensor. (axis can
                            be specified with -d)
-[no]unsat   bool   no      Calculate order parameters for unsaturated
                            carbons. Note that this cannot be mixed with
                            normal order parameters.
-[no]permolecule bool   no      Compute per-molecule Scd order parameters
-[no]radial  bool   no      Compute a radial membrane normal
-[no]calcdist  bool no      Compute distance from a reference (currently
                            defined only for radial and permolecule)

Taking x axis as normal to the membrane
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Using following groups: 
Groupname: C34 First atomname: C34 First atomnr 33
Groupname: C36 First atomname: C36 First atomnr 35
Groupname: C37 First atomname: C37 First atomnr 36
Groupname: C38 First atomname: C38 First atomnr 37
Groupname: C39 First atomname: C39 First atomnr 38
Groupname: C40 First atomname: C40 First atomnr 39
Groupname: C41 First atomname: C41 First atomnr 40
Groupname: C42 First atomname: C42 First atomnr 41
Groupname: C43 First atomname: C43 First atomnr 42
Groupname: C44 First atomname: C44 First atomnr 43
Groupname: C45 First atomname: C45 First atomnr 44
Groupname: C46 First atomname: C46 First atomnr 45
Groupname: C47 First atomname: C47 First atomnr 46
Groupname: C48 First atomname: C48 First atomnr 47
Groupname: C49 First atomname: C49 First atomnr 48
Groupname: C50 First atomname: C50 First atomnr 49

Reading frame       0 time    0.000   Number of elements in first group: 64
Last frame        200 time 5000.000   

Read trajectory. Printing parameters to file
Atom 1 Tensor: x=-0.000576371 , y=-0.0073302, z=0.00790662
Atom 2 Tensor: x=-0.0117652 , y=-0.00493252, z=0.0166978
Atom 3 Tensor: x=-0.0126931 , y=-0.00768824, z=0.0203814
Atom 4 Tensor: x=-0.0184108 , y=-0.00630051, z=0.0247113
Atom 5 Tensor: x=-0.0277576 , y=-0.00180495, z=0.0295626
Atom 6 Tensor: x=-0.0278283 , y=-0.0182447, z=0.046073
Atom 7 Tensor: x=-0.0203751 , y=-0.0169752, z=0.0373503
Atom 8 Tensor: x=-0.0248225 , y=-0.0148866, z=0.0397091
Atom 9 Tensor: x=-0.018042 , y=-0.0125469, z=0.030589
Atom 10 Tensor: x=-0.0093745 , y=-0.0185237, z=0.0278982
Atom 11 Tensor: x=-0.00485998 , y=-0.00687132, z=0.0117313
Atom 12 Tensor: x=-0.00276808 , y=-0.00442948, z=0.0071976
Atom 13 Tensor: x=-0.00369555 , y=-0.00182695, z=0.00552254
Atom 14 Tensor: x=-0.00413566 , y=-0.00195933, z=0.00609503

Back Off! I just backed up deuter.xvg to ./#deuter.xvg.2#

gcq#88: "I Don't Want to Catch Anybody Not Drinking." (Monty Python)

In [120]:
!g_order -s b_md -f b_md.xtc -o ord_end.xvg -n sn1.ndx -b 45000 -d X
                         :-)  G  R  O  M  A  C  S  (-:

        Getting the Right Output Means no Artefacts in Calculating Stuff

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                               :-)  g_order  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_md.xtc  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n        sn1.ndx  Input        Index file
 -nr      index.ndx  Input        Index file
  -s       b_md.tpr  Input        Run input file: tpr tpb tpa
  -o    ord_end.xvg  Output       xvgr/xmgr file
 -od     deuter.xvg  Output       xvgr/xmgr file
 -ob      eiwit.pdb  Output       Protein data bank file
 -os     sliced.xvg  Output       xvgr/xmgr file
 -Sg     sg-ang.xvg  Output, Opt. xvgr/xmgr file
 -Sk    sk-dist.xvg  Output, Opt. xvgr/xmgr file
-Sgsl sg-ang-slice.xvg  Output, Opt. xvgr/xmgr file
-Sksl sk-dist-slice.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   45000   First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   xmgrace  xvg plot formatting: xmgrace, xmgr or none
-d           enum   x       Direction of the normal on the membrane: z, x or y
-sl          int    1       Calculate order parameter as function of box
                            length, dividing the box in #nr slices.
-[no]szonly  bool   no      Only give Sz element of order tensor. (axis can
                            be specified with -d)
-[no]unsat   bool   no      Calculate order parameters for unsaturated
                            carbons. Note that this cannot be mixed with
                            normal order parameters.
-[no]permolecule bool   no      Compute per-molecule Scd order parameters
-[no]radial  bool   no      Compute a radial membrane normal
-[no]calcdist  bool no      Compute distance from a reference (currently
                            defined only for radial and permolecule)

Taking x axis as normal to the membrane
Reading file b_md.tpr, VERSION 4.5.4 (single precision)
Using following groups: 
Groupname: C34 First atomname: C34 First atomnr 33
Groupname: C36 First atomname: C36 First atomnr 35
Groupname: C37 First atomname: C37 First atomnr 36
Groupname: C38 First atomname: C38 First atomnr 37
Groupname: C39 First atomname: C39 First atomnr 38
Groupname: C40 First atomname: C40 First atomnr 39
Groupname: C41 First atomname: C41 First atomnr 40
Groupname: C42 First atomname: C42 First atomnr 41
Groupname: C43 First atomname: C43 First atomnr 42
Groupname: C44 First atomname: C44 First atomnr 43
Groupname: C45 First atomname: C45 First atomnr 44
Groupname: C46 First atomname: C46 First atomnr 45
Groupname: C47 First atomname: C47 First atomnr 46
Groupname: C48 First atomname: C48 First atomnr 47
Groupname: C49 First atomname: C49 First atomnr 48
Groupname: C50 First atomname: C50 First atomnr 49

Reading frame       0 time 45000.000   Number of elements in first group: 64
Last frame        200 time 50000.000   

Read trajectory. Printing parameters to file
Atom 1 Tensor: x=-0.0630603 , y=-0.0513525, z=0.114413
Atom 2 Tensor: x=-0.0872264 , y=-0.0738485, z=0.161075
Atom 3 Tensor: x=-0.0875254 , y=-0.0884807, z=0.176006
Atom 4 Tensor: x=-0.106739 , y=-0.0905871, z=0.197326
Atom 5 Tensor: x=-0.108306 , y=-0.0943054, z=0.202611
Atom 6 Tensor: x=-0.118567 , y=-0.100016, z=0.218582
Atom 7 Tensor: x=-0.119953 , y=-0.10645, z=0.226403
Atom 8 Tensor: x=-0.125521 , y=-0.10772, z=0.233241
Atom 9 Tensor: x=-0.114906 , y=-0.10689, z=0.221796
Atom 10 Tensor: x=-0.118104 , y=-0.101941, z=0.220045
Atom 11 Tensor: x=-0.11182 , y=-0.0974679, z=0.209288
Atom 12 Tensor: x=-0.10236 , y=-0.086502, z=0.188862
Atom 13 Tensor: x=-0.0904561 , y=-0.0725604, z=0.163017
Atom 14 Tensor: x=-0.0767024 , y=-0.0553443, z=0.132047

Back Off! I just backed up ord_end.xvg to ./#ord_end.xvg.1#

Back Off! I just backed up deuter.xvg to ./#deuter.xvg.1#

gcq#351: "The time for theory is over" (J. Hajdu)

In [135]:
order_start = np.loadtxt("ord_start.xvg", skiprows=12)
order_end = np.loadtxt("ord_end.xvg", skiprows=12)
order_end[:6]
Out[135]:
array([[ 1.       , -0.0630603, -0.0513525,  0.114413 ],
       [ 2.       , -0.0872264, -0.0738485,  0.161075 ],
       [ 3.       , -0.0875254, -0.0884807,  0.176006 ],
       [ 4.       , -0.106739 , -0.0905871,  0.197326 ],
       [ 5.       , -0.108306 , -0.0943054,  0.202611 ],
       [ 6.       , -0.118567 , -0.100016 ,  0.218582 ]])
In [139]:
plt.figure(figsize=(10,6))

plt.plot(order_start[:,0], order_start[:,3], 
         color="green", label="start");
plt.plot(order_end[:,0], order_end[:,3], 
         color="blue", label="end");
plt.legend()
plt.show()

Как и ожидалось, к концу моделирования билипидный слой существенно упорядоченнее, чем вскоре после начала.