Structural bionformatics. Homework №9

Elen Tevanyan

Зная, что мне предстоит копировать все файлы из папки на Ломоносов, все материалы я внесла в отдельную папку в моей директории. Т.к. ноутбук создан внутри него, дополнительно перезадавать директорию не нужно - все записывается ко мне в подпапку "hwtev".
Часть команд запускались отсюда; часть команд - из терминала, они указаны в текстовых ячейках

Подготовка к моделированию

In [49]:
import __main__
__main__.pymol_argv = ['pymol','-qc'] # Pymol: quiet and no GUI
from time import sleep
import time 
import pymol
import IPython.display
from IPython.display import display,display_svg,SVG,Image, HTML
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

pymol.finish_launching()

defaultImage = '/tmp/pymolimg.png'
def prepareImage(width=500, height=500, sleep=2, filename=defaultImage):
    ## To save the rendered image
    pymol.cmd.ray(width, height)
    pymol.cmd.png('/tmp/pymolimg.png')
    time.sleep(sleep)

Скачиваем файлы, указанные в задании:
https://kodomo.fbb.msu.ru/wiki/Main/Modelling/BioNanoPrac/SelfAss

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-21 19:24:06--  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%  316K=0.04s

2017-12-21 19:24:06 (316 KB/s) - `dppc.itp' saved [12772/12772]

--2017-12-21 19:24:06--  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% 29.5M=0.001s

2017-12-21 19:24:06 (29.5 MB/s) - `lipid.itp' saved [34337/34337]

--2017-12-21 19:24:06--  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%  192M=0s

2017-12-21 19:24:06 (192 MB/s) - `dppc.gro' saved [2329/2329]

--2017-12-21 19:24:06--  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.6M=0s

2017-12-21 19:24:06 (51.6 MB/s) - `b.top' saved [573/573]

--2017-12-21 19:24:06--  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%  136M=0s

2017-12-21 19:24:06 (136 MB/s) - `em.mdp' saved [1088/1088]

--2017-12-21 19:24:06--  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%  141M=0s

2017-12-21 19:24:06 (141 MB/s) - `pr.mdp' saved [1164/1164]

--2017-12-21 19:24:06--  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%  200M=0s

2017-12-21 19:24:06 (200 MB/s) - `md.mdp' saved [1277/1277]

In [2]:
%%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
Read 50 atoms
Volume: 1.5477 nm^3, corresponds to roughly 600 electrons
No velocities found
Read 3200 atoms
Volume: 99.0529 nm^3, corresponds to roughly 44500 electrons
No velocities found
                         :-)  G  R  O  M  A  C  S  (-:

                Gravel Rubs Often Many Awfully Cauterized Sores

                            :-)  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.

                               :-)  genconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       dppc.gro  Input        Structure file: gro g96 pdb tpr etc.
  -o       b_64.gro  Output       Structure file: gro g96 pdb etc.
-trj       traj.xtc  Input, Opt.  Trajectory: xtc trr trj gro g96 pdb cpt

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    0       Set the nicelevel
-nbox        vector 4 4 4   Number of boxes
-dist        vector 0 0 0   Distance between boxes
-seed        int    0       Random generator seed, if 0 generated from the
                            time
-[no]rot     bool   no      Randomly rotate conformations
-[no]shuffle bool   no      Random shuffling of molecules
-[no]sort    bool   no      Sort molecules on X coord
-block       int    1       Divide the box in blocks on this number of cpus
-nmolat      int    3       Number of atoms per molecule, assumed to start
                            from 0. If you set this wrong, it will screw up
                            your system!
-maxrot      vector 180 180 180  Maximum random rotation
-[no]renumber  bool yes     Renumber residues


gcq#330: "Go back to the rock from under which you came" (Fiona Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                Gravel Rubs Often Many Awfully Cauterized Sores

                            :-)  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.

                               :-)  editconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       dppc.gro  Input        Structure file: gro g96 pdb tpr etc.
  -n      index.ndx  Input, Opt.  Index file
  -o       dppc.pdb  Output, Opt! Structure file: gro g96 pdb etc.
-mead      mead.pqr  Output, Opt. Coordinate file for MEAD
 -bf      bfact.dat  Input, Opt.  Generic data 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    0       Set the nicelevel
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-[no]ndef    bool   no      Choose output from default index groups
-bt          enum   triclinic  Box type for -box and -d: triclinic, cubic,
                            dodecahedron or octahedron
-box         vector 0 0 0   Box vector lengths (a,b,c)
-angles      vector 90 90 90  Angles between the box vectors (bc,ac,ab)
-d           real   0       Distance between the solute and the box
-[no]c       bool   no      Center molecule in box (implied by -box and -d)
-center      vector 0 0 0   Coordinates of geometrical center
-aligncenter vector 0 0 0   Center of rotation for alignment
-align       vector 0 0 0   Align to target vector
-translate   vector 0 0 0   Translation
-rotate      vector 0 0 0   Rotation around the X, Y and Z axes in degrees
-[no]princ   bool   no      Orient molecule(s) along their principal axes
-scale       vector 1 1 1   Scaling factor
-density     real   1000    Density (g/L) of the output box achieved by
                            scaling
-[no]pbc     bool   no      Remove the periodicity (make molecule whole again)
-resnr       int    -1       Renumber residues starting from resnr
-[no]grasp   bool   no      Store the charge of the atom in the B-factor
                            field and the radius of the atom in the occupancy
                            field
-rvdw        real   0.12    Default Van der Waals radius (in nm) if one can
                            not be found in the database or if no parameters
                            are present in the topology file
-sig56       real   0       Use rmin/2 (minimum in the Van der Waals
                            potential) rather than sigma/2 
-[no]vdwread bool   no      Read the Van der Waals radii from the file
                            vdwradii.dat rather than computing the radii
                            based on the force field
-[no]atom    bool   no      Force B-factor attachment per atom
-[no]legend  bool   no      Make B-factor legend
-label       string A       Add chain label for all residues
-[no]conect  bool   no      Add CONECT records to a .pdb file when written.
                            Can only be done when a topology is present


gcq#330: "Go back to the rock from under which you came" (Fiona Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                Gravel Rubs Often Many Awfully Cauterized Sores

                            :-)  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.

                               :-)  editconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_64.gro  Input        Structure file: gro g96 pdb tpr etc.
  -n      index.ndx  Input, Opt.  Index file
  -o       b_64.pdb  Output, Opt! Structure file: gro g96 pdb etc.
-mead      mead.pqr  Output, Opt. Coordinate file for MEAD
 -bf      bfact.dat  Input, Opt.  Generic data 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    0       Set the nicelevel
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-[no]ndef    bool   no      Choose output from default index groups
-bt          enum   triclinic  Box type for -box and -d: triclinic, cubic,
                            dodecahedron or octahedron
-box         vector 0 0 0   Box vector lengths (a,b,c)
-angles      vector 90 90 90  Angles between the box vectors (bc,ac,ab)
-d           real   0       Distance between the solute and the box
-[no]c       bool   no      Center molecule in box (implied by -box and -d)
-center      vector 0 0 0   Coordinates of geometrical center
-aligncenter vector 0 0 0   Center of rotation for alignment
-align       vector 0 0 0   Align to target vector
-translate   vector 0 0 0   Translation
-rotate      vector 0 0 0   Rotation around the X, Y and Z axes in degrees
-[no]princ   bool   no      Orient molecule(s) along their principal axes
-scale       vector 1 1 1   Scaling factor
-density     real   1000    Density (g/L) of the output box achieved by
                            scaling
-[no]pbc     bool   no      Remove the periodicity (make molecule whole again)
-resnr       int    -1       Renumber residues starting from resnr
-[no]grasp   bool   no      Store the charge of the atom in the B-factor
                            field and the radius of the atom in the occupancy
                            field
-rvdw        real   0.12    Default Van der Waals radius (in nm) if one can
                            not be found in the database or if no parameters
                            are present in the topology file
-sig56       real   0       Use rmin/2 (minimum in the Van der Waals
                            potential) rather than sigma/2 
-[no]vdwread bool   no      Read the Van der Waals radii from the file
                            vdwradii.dat rather than computing the radii
                            based on the force field
-[no]atom    bool   no      Force B-factor attachment per atom
-[no]legend  bool   no      Make B-factor legend
-label       string A       Add chain label for all residues
-[no]conect  bool   no      Add CONECT records to a .pdb file when written.
                            Can only be done when a topology is present


gcq#330: "Go back to the rock from under which you came" (Fiona Apple)

In [51]:
pymol.cmd.reinitialize()
pymol.cmd.load('dppc.pdb')
pymol.cmd.zoom('dppc',5)
prepareImage()
Image(defaultImage)
Out[51]:
In [53]:
pymol.cmd.reinitialize()
pymol.cmd.load('b_64.pdb')
pymol.cmd.zoom('b_64',5)
prepareImage()
Image(defaultImage)
Out[53]:

Был один липид, создали ячейку с 64, что и видим на двух картинках выше.

В файле btop заменила число 34 на 64 и делаю небольшой отступ в ячейке от липидов, что бы добавить примерно 2500 молекул воды.

In [3]:
%%bash
editconf -f b_64.gro -o b_ec -d 0.5
Read 3200 atoms
Volume: 99.0529 nm^3, corresponds to roughly 44500 electrons
No velocities found
    system size :  5.260  3.443  4.778 (nm)
    center      :  2.730  1.822  2.490 (nm)
    box vectors :  5.460  3.643  4.979 (nm)
    box angles  :  90.00  90.00  90.00 (degrees)
    box volume  :  99.05               (nm^3)
    shift       :  0.400  0.400  0.399 (nm)
new center      :  3.130  2.222  2.889 (nm)
new box vectors :  6.260  4.443  5.778 (nm)
new box angles  :  90.00  90.00  90.00 (degrees)
new box volume  : 160.70               (nm^3)

WARNING: No boxtype specified - distance condition applied in each dimension.
If the molecule rotates the actual distance will be smaller. You might want
to use a cubic box instead, or why not try a dodecahedron today?
                         :-)  G  R  O  M  A  C  S  (-:

                               Grunge ROck MAChoS

                            :-)  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.

                               :-)  editconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_64.gro  Input        Structure file: gro g96 pdb tpr etc.
  -n      index.ndx  Input, Opt.  Index file
  -o       b_ec.gro  Output, Opt! Structure file: gro g96 pdb etc.
-mead      mead.pqr  Output, Opt. Coordinate file for MEAD
 -bf      bfact.dat  Input, Opt.  Generic data 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    0       Set the nicelevel
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-[no]ndef    bool   no      Choose output from default index groups
-bt          enum   triclinic  Box type for -box and -d: triclinic, cubic,
                            dodecahedron or octahedron
-box         vector 0 0 0   Box vector lengths (a,b,c)
-angles      vector 90 90 90  Angles between the box vectors (bc,ac,ab)
-d           real   0.5     Distance between the solute and the box
-[no]c       bool   no      Center molecule in box (implied by -box and -d)
-center      vector 0 0 0   Coordinates of geometrical center
-aligncenter vector 0 0 0   Center of rotation for alignment
-align       vector 0 0 0   Align to target vector
-translate   vector 0 0 0   Translation
-rotate      vector 0 0 0   Rotation around the X, Y and Z axes in degrees
-[no]princ   bool   no      Orient molecule(s) along their principal axes
-scale       vector 1 1 1   Scaling factor
-density     real   1000    Density (g/L) of the output box achieved by
                            scaling
-[no]pbc     bool   no      Remove the periodicity (make molecule whole again)
-resnr       int    -1       Renumber residues starting from resnr
-[no]grasp   bool   no      Store the charge of the atom in the B-factor
                            field and the radius of the atom in the occupancy
                            field
-rvdw        real   0.12    Default Van der Waals radius (in nm) if one can
                            not be found in the database or if no parameters
                            are present in the topology file
-sig56       real   0       Use rmin/2 (minimum in the Van der Waals
                            potential) rather than sigma/2 
-[no]vdwread bool   no      Read the Van der Waals radii from the file
                            vdwradii.dat rather than computing the radii
                            based on the force field
-[no]atom    bool   no      Force B-factor attachment per atom
-[no]legend  bool   no      Make B-factor legend
-label       string A       Add chain label for all residues
-[no]conect  bool   no      Add CONECT records to a .pdb file when written.
                            Can only be done when a topology is present


gcq#224: "Bad As This Shit Is, This Shit Ain't As Bad As You Think It Is." (Jackie Brown)

Запуск отсюда - довольно глупая затея, поэтому команды ниже запустила в терминале, где изменения силы хорошо видны.$$F_{max}^0 = 4.37970e+05$$ $$F_{max}^{fin} = 6.16887e+02$$

grompp -f em -c b_ec -p b -o b_em -maxwarn 2 mdrun -deffnm b_em -v

Следующую серию команд запускала также в терминале.

genbox -cp b_em -p b -cs spc216 -o b_s
grompp -f em -c b_s -p b -o b_empr -maxwarn 1
mdrun -deffnm b_empr -v
grompp -f pr -c b_empr -p b -o b_pr -maxwarn 1
mdrun -deffnm b_pr -v

In [4]:
%%bash
editconf -f b_pr.gro -o b_pr.pdb
editconf -f b_s.gro -o b_s.pdb
Read 11054 atoms
Volume: 160.705 nm^3, corresponds to roughly 72300 electrons
Velocities found
Read 11054 atoms
Volume: 160.705 nm^3, corresponds to roughly 72300 electrons
No velocities found
                         :-)  G  R  O  M  A  C  S  (-:

                  Gromacs Runs On Most of All Computer Systems

                            :-)  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.

                               :-)  editconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f       b_pr.gro  Input        Structure file: gro g96 pdb tpr etc.
  -n      index.ndx  Input, Opt.  Index file
  -o       b_pr.pdb  Output, Opt! Structure file: gro g96 pdb etc.
-mead      mead.pqr  Output, Opt. Coordinate file for MEAD
 -bf      bfact.dat  Input, Opt.  Generic data 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    0       Set the nicelevel
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-[no]ndef    bool   no      Choose output from default index groups
-bt          enum   triclinic  Box type for -box and -d: triclinic, cubic,
                            dodecahedron or octahedron
-box         vector 0 0 0   Box vector lengths (a,b,c)
-angles      vector 90 90 90  Angles between the box vectors (bc,ac,ab)
-d           real   0       Distance between the solute and the box
-[no]c       bool   no      Center molecule in box (implied by -box and -d)
-center      vector 0 0 0   Coordinates of geometrical center
-aligncenter vector 0 0 0   Center of rotation for alignment
-align       vector 0 0 0   Align to target vector
-translate   vector 0 0 0   Translation
-rotate      vector 0 0 0   Rotation around the X, Y and Z axes in degrees
-[no]princ   bool   no      Orient molecule(s) along their principal axes
-scale       vector 1 1 1   Scaling factor
-density     real   1000    Density (g/L) of the output box achieved by
                            scaling
-[no]pbc     bool   no      Remove the periodicity (make molecule whole again)
-resnr       int    -1       Renumber residues starting from resnr
-[no]grasp   bool   no      Store the charge of the atom in the B-factor
                            field and the radius of the atom in the occupancy
                            field
-rvdw        real   0.12    Default Van der Waals radius (in nm) if one can
                            not be found in the database or if no parameters
                            are present in the topology file
-sig56       real   0       Use rmin/2 (minimum in the Van der Waals
                            potential) rather than sigma/2 
-[no]vdwread bool   no      Read the Van der Waals radii from the file
                            vdwradii.dat rather than computing the radii
                            based on the force field
-[no]atom    bool   no      Force B-factor attachment per atom
-[no]legend  bool   no      Make B-factor legend
-label       string A       Add chain label for all residues
-[no]conect  bool   no      Add CONECT records to a .pdb file when written.
                            Can only be done when a topology is present


gcq#210: "Is That a Real Poncho ?" (F. Zappa)

                         :-)  G  R  O  M  A  C  S  (-:

                  Gromacs Runs On Most of All Computer Systems

                            :-)  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.

                               :-)  editconf  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f        b_s.gro  Input        Structure file: gro g96 pdb tpr etc.
  -n      index.ndx  Input, Opt.  Index file
  -o        b_s.pdb  Output, Opt! Structure file: gro g96 pdb etc.
-mead      mead.pqr  Output, Opt. Coordinate file for MEAD
 -bf      bfact.dat  Input, Opt.  Generic data 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    0       Set the nicelevel
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-[no]ndef    bool   no      Choose output from default index groups
-bt          enum   triclinic  Box type for -box and -d: triclinic, cubic,
                            dodecahedron or octahedron
-box         vector 0 0 0   Box vector lengths (a,b,c)
-angles      vector 90 90 90  Angles between the box vectors (bc,ac,ab)
-d           real   0       Distance between the solute and the box
-[no]c       bool   no      Center molecule in box (implied by -box and -d)
-center      vector 0 0 0   Coordinates of geometrical center
-aligncenter vector 0 0 0   Center of rotation for alignment
-align       vector 0 0 0   Align to target vector
-translate   vector 0 0 0   Translation
-rotate      vector 0 0 0   Rotation around the X, Y and Z axes in degrees
-[no]princ   bool   no      Orient molecule(s) along their principal axes
-scale       vector 1 1 1   Scaling factor
-density     real   1000    Density (g/L) of the output box achieved by
                            scaling
-[no]pbc     bool   no      Remove the periodicity (make molecule whole again)
-resnr       int    -1       Renumber residues starting from resnr
-[no]grasp   bool   no      Store the charge of the atom in the B-factor
                            field and the radius of the atom in the occupancy
                            field
-rvdw        real   0.12    Default Van der Waals radius (in nm) if one can
                            not be found in the database or if no parameters
                            are present in the topology file
-sig56       real   0       Use rmin/2 (minimum in the Van der Waals
                            potential) rather than sigma/2 
-[no]vdwread bool   no      Read the Van der Waals radii from the file
                            vdwradii.dat rather than computing the radii
                            based on the force field
-[no]atom    bool   no      Force B-factor attachment per atom
-[no]legend  bool   no      Make B-factor legend
-label       string A       Add chain label for all residues
-[no]conect  bool   no      Add CONECT records to a .pdb file when written.
                            Can only be done when a topology is present


gcq#210: "Is That a Real Poncho ?" (F. Zappa)

Визуализируем pdb-файл с добавленной водой.

In [55]:
pymol.cmd.reinitialize()
pymol.cmd.load('b_s.pdb')
pymol.cmd.zoom('b_s',5)
prepareImage()
Image(defaultImage)
Out[55]:
In [54]:
pymol.cmd.reinitialize()
pymol.cmd.load('b_pr.pdb')
pymol.cmd.zoom('b_pr',5)
prepareImage()
Image(defaultImage)
Out[54]:

На глаз не особо много что изменилось, но мы "тресли" воду, и можно заметить, что вода более равномерно и плотно расположилась внутри ячейки.

Моделирование

Перенос на суперкомпьютер
cd
scp -r ./hse/tevanyan/hwtev lom:_scratch/chem
Тестовое моделирование
ssh lom
cd _scratch/chem/hwtev
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

Основное моделирование : номер задачи 1653801
sbatch -N1 --ntasks-per-node=2 -e error-gpu.log -o output.log -t 350 -p gpu impi /opt/ccoe/gromacs-5.0.4/build/bin/gmx_mpi mdrun -testverlet -deffnm b_md -v

Копирование результатов : cd ./hse/tevanyan/hwtev
scp -r lom:_scratch/chem/hwtev ./

Анализ результатов

Визуализация

cd ./hse/tevanyan/hwtev
trjconv -f b_md.xtc -s b_md.tpr -o b_pbc_1.pdb -skip 20
trjconv -f b_md.xtc -s b_md.tpr -o b_pbc_1.pdb -skip 20 -pbc mol

Обнаружила, что первой командой выдается неадектваный результат, очень хаотичный итог получается, слои "смешиваются", поэтому запустила вторую команду.

In [7]:
pymol.cmd.reinitialize()
pymol.cmd.load('b_pbc_1.pdb')
prepareImage()
Image(defaultImage)
Out[7]:

Скачала файл к себе, записала видео с помощью десктопного PyMol и утилиты ffmpeg. Т.к. у меня образовались кадры всех моделирований, могла спокойно их рассмотреть.

In [8]:
import io
from base64 import b64encode
from IPython.core.display import HTML, display
video = io.open('bilip2.mp4', 'r+b').read()
video_encoded = b64encode(video)
html_code = '<video controls alt="PyMol Movie" src="data:video/mp4;base64,{}" type="video/mp4">'.format(video_encoded)
display(HTML(html_code))

Это финальная модель.

In [11]:
Image('mov0101.png')
Out[11]:

С 55 красиво собирались как гидрофобные хвосты, так и гидрофильные головки - ну, на мой вкус, конечно же. Это bilayer in water t= 27000.00000

In [12]:
Image('mov0055.png')
Out[12]:

Площадь липида

g_traj -f b_md.xtc -s b_md.tpr -ob box_1.xvg
В файле есть 24 некрасивые строчки. Планировала удалить командой sed, но она неудачно прошла для файла (выдавала совершенно пустой), поэтому стираю вручную, гружу файл и сортирую на 4 вектора: время, х-координата, y-координата, z-координата

In [9]:
b = np.loadtxt('box_1.xvg')
t = b[:,0]
x = b[:,1]
y = b[:,2]
z = b[:,3]

Определим нормаль к поверхности белка. Наблюдения из файла box_1.xvg - вариации координаты Х почти нет, в то время как Y и Z изменяются => Х будет нормалью к поверхности.

Соответственно, площадь считаем как произведение по осям Y и Z и нормируем на 32 (число липидов в слое)

In [40]:
S_yz = y*z/32
plt.plot(t,S_yz, label = 'Square of Y and Z')
plt.title('Square and Time Dependency')
plt.legend()
Out[40]:
<matplotlib.legend.Legend at 0x7f2bb3f14690>

Мы видим явно нисходящий тренд: со временем площадь липида уменьшается. Кажется, что это разумно - в процессе моделирования структура компактно собирается, приходя в оптимальное состояние. Также отмечу, что на прошлом шаге я отметила время t = 27000 как момент образования бислоя. Судя по графику, я почти права.

Изменение гидрофобной и гидрофильной поверхности

g_sas -f b_md.xtc -s b_md.tpr -o sas_b.xvg -dt 100
Опять неизящное изменение файла руками (удаление первых 22 строк), чтобы из нулевого столбца вытащить время, из первого - инфорацию о гидрофобных, из второго - о гидрофильных.

In [7]:
s = np.loadtxt('sas_b.xvg')
t_1 = s[:,0]
phob = s[:,1]
phil = s[:,2]
plt.plot(t_1,phob, label = 'Hydrophobic surface')
plt.plot(t_1,phil, label = 'Hydrophilic surface', color ='red')
plt.title('Surface Changes within Time')
plt.legend()
Out[7]:
<matplotlib.legend.Legend at 0x7f336dfa9490>

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

Мера порядка

http://kodomo.cmm.msu.ru/~golovin/bilayer/sn1.ndx

In [24]:
%%bash
wget http://kodomo.cmm.msu.ru/~golovin/bilayer/sn1.ndx
g_order -s b_md -f b_md.xtc -o ord_end.xvg -n sn1.ndx -b 45000 -d X
g_order -s b_md -f b_md.xtc -o ord_start.xvg -n sn1.ndx -e 5000 -d X
In [35]:
#    xaxis  label "Atom"
#    yaxis  label "S"
ord_end = np.loadtxt('ord_end.xvg')
atom = ord_end[:,0]
end = ord_end[:,3]

ord_start = np.loadtxt('ord_start.xvg')
start = ord_start[:,3]

plt.plot(atom,end, label = 'End')
plt.plot(atom,start, label = 'Start', color ='red')
plt.title('Order Parameter')
plt.legend()
Out[35]:
<matplotlib.legend.Legend at 0x7f336d8fa550>

В начале траектории все значения выше; к концу - ниже. Это значит, что молекулы в начале подвижнее, а в конце - менее, что логично, т.к. они образовали фосфолипидный бислой.

In [57]:
import subprocess
converted = subprocess.call(["jupyter-nbconvert", '--to', 'html',"SB. HW9. Tevanyan.ipynb"], shell=False)
if converted==0:
    print 'Your ipynb-file was sucessfully converted!'
else:
    print 'Smth went wrong. for instance, check the filename...'
show_link = '<a href="%s" target="_blank">You can download it here!</a>'%('SB. HW9. Tevanyan.html')
display(HTML(show_link))