In [2]:
from bs4 import BeautifulSoup
import requests

url = "http://kodomo.fbb.msu.ru/~golovin/cg/"

def list_files(url):
    page = requests.get(url).text
    soup = BeautifulSoup(page, "html.parser")
    return [url + "/" + node.get("href") for node in soup.find_all("a")]

for file in list_files(url): print (file)
http://kodomo.fbb.msu.ru/~golovin/cg//?C=N;O=D
http://kodomo.fbb.msu.ru/~golovin/cg//?C=M;O=A
http://kodomo.fbb.msu.ru/~golovin/cg//?C=S;O=A
http://kodomo.fbb.msu.ru/~golovin/cg//?C=D;O=A
http://kodomo.fbb.msu.ru/~golovin/cg///~golovin/
http://kodomo.fbb.msu.ru/~golovin/cg//dppc.gro
http://kodomo.fbb.msu.ru/~golovin/cg//dynamic.mdp
http://kodomo.fbb.msu.ru/~golovin/cg//kalp.pdb
http://kodomo.fbb.msu.ru/~golovin/cg//martini_v2.0_DPPC_01.itp
http://kodomo.fbb.msu.ru/~golovin/cg//martini_v2.2.itp
http://kodomo.fbb.msu.ru/~golovin/cg//martinize.py
http://kodomo.fbb.msu.ru/~golovin/cg//minimization.mdp
http://kodomo.fbb.msu.ru/~golovin/cg//water.gro

11.0 Let's look at kalp.pdb.

In [6]:
import __main__
__main__.pymol_argv = [ 'pymol', '-x' ]

import pymol
import os
pymol.finish_launching()
from pymol import cmd
In [ ]:
import IPython
cmd.load("files/kalp.pdb")
cmd.orient()
cmd.bg_color('white')
cmd.color("silver","kalp")
cmd.set('ray_trace_mode', 1)
cmd.png(os.path.join("files",'kalp.png'), '1200', '720', ray=1)
In [43]:
IPython.display.Image(os.path.join("files",'kalp.png'), retina=True)
Out[43]:

11.1 Go to martini site and read a tutorial.

11.2 After fetching .pdb file, you will need to convert it into a coarse-grained structure(a.k.a. conf.pdb) and to prepare a Martini topology (a.k.a. topo.top) for it.

Note: coarse-grained structure can be minimized, solvated and simulated!

In [7]:
import subprocess

def com_exec(command):
    rt = subprocess.run(command, shell=True, stderr=subprocess.PIPE)
    return print(rt.stderr.decode('utf-8'))
In [9]:
subprocess.run("sudo chmod +x files/martinize.py", shell=True)
rt_0 = subprocess.run("echo password_here | sudo -S ./files/martinize.py -f files/kalp.pdb -o files/topo.top -x files/conf.pdb -n files/cg", 
                    shell=True, stderr=subprocess.PIPE)
subprocess.run("mv Protein_A.itp files/Protein_A.itp", shell=True)
Out[9]:
CompletedProcess(args='mv Protein_A.itp files/Protein_A.itp', returncode=0)
In [10]:
print(rt_0.stderr.decode('utf-8'))
[sudo] password for emir: INFO       MARTINIZE, script version 2.6
INFO       If you use this script please cite:
INFO       de Jong et al., J. Chem. Theory Comput., 2013, DOI:10.1021/ct300646g
INFO       Chain termini will be charged
INFO       Residues at chain brakes will not be charged
INFO       The martini22 forcefield will be used.
INFO       Local elastic bonds will be used for extended regions.
INFO       Read input structure from file.
INFO       Input structure is a PDB file.
INFO       Found 1 chains:
INFO          1:   A (Protein), 358 atoms in 23 residues.
INFO       Total size of the system: 23 residues.
WARNING    No secondary structure or determination method speficied. Protein chains will be set to 'COIL'.
INFO       Writing coarse grained structure.
INFO       Writing index file.
INFO       (Average) Secondary structure has been determined (see head of .itp-file).
INFO       Created coarsegrained topology
INFO       Written 1 ITP file
INFO       Output contains 1 molecules:
INFO          1->  Protein_A (chain  A)
INFO       Written topology files
INFO       Note: Cysteine bonds are 0.24 nm constraints, instead of the published 0.39nm/5000kJ/mol.

In [11]:
com_exec("ln -s files/martini_v2.2.itp files/martini.itp")

11.4 Setting box dimensions.

In [12]:
com_exec("gmx editconf -f files/conf.pdb -box 7 7 7 -c -o files/ec")
                     :-) GROMACS - gmx editconf, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx editconf, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx editconf -f files/conf.pdb -box 7 7 7 -c -o files/ec


GROMACS reminds you: "Those people who think they know everything are a great annoyance to those of us who do." (Isaac Asimov)


11.5 Adding 128 DPPC.

In [13]:
com_exec("gmx insert-molecules -f files/ec -ci files/dppc.gro  -o files/s -nmol 128")
                 :-) GROMACS - gmx insert-molecules, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx insert-molecules, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx insert-molecules -f files/ec -ci files/dppc.gro -o files/s -nmol 128

Reading solute configuration
Initialising inter-atomic distances...
Using random seed -743903062
Try 1 success (now 52 atoms)!
Try 2 success (now 64 atoms)!
Try 3 success (now 76 atoms)!
Try 4 success (now 88 atoms)!
Try 5 success (now 100 atoms)!
Try 6 success (now 112 atoms)!
Try 7 success (now 124 atoms)!
Try 8 success (now 136 atoms)!
Try 9 success (now 148 atoms)!
Try 10 success (now 160 atoms)!
Try 11 success (now 172 atoms)!
Try 12 success (now 184 atoms)!
Try 13 success (now 196 atoms)!
Try 14 success (now 208 atoms)!
Try 16 success (now 220 atoms)!
Try 17 success (now 232 atoms)!
Try 18 success (now 244 atoms)!
Try 19 success (now 256 atoms)!
Try 20 success (now 268 atoms)!
Try 21 success (now 280 atoms)!
Try 22 success (now 292 atoms)!
Try 23 success (now 304 atoms)!
Try 27 success (now 316 atoms)!
Try 28 success (now 328 atoms)!
Try 29 success (now 340 atoms)!
Try 30 success (now 352 atoms)!
Try 31 success (now 364 atoms)!
Try 33 success (now 376 atoms)!
Try 34 success (now 388 atoms)!
Try 35 success (now 400 atoms)!
Try 36 success (now 412 atoms)!
Try 38 success (now 424 atoms)!
Try 39 success (now 436 atoms)!
Try 41 success (now 448 atoms)!
Try 43 success (now 460 atoms)!
Try 44 success (now 472 atoms)!
Try 45 success (now 484 atoms)!
Try 46 success (now 496 atoms)!
Try 49 success (now 508 atoms)!
Try 50 success (now 520 atoms)!
Try 51 success (now 532 atoms)!
Try 52 success (now 544 atoms)!
Try 53 success (now 556 atoms)!
Try 55 success (now 568 atoms)!
Try 57 success (now 580 atoms)!
Try 59 success (now 592 atoms)!
Try 62 success (now 604 atoms)!
Try 65 success (now 616 atoms)!
Try 67 success (now 628 atoms)!
Try 71 success (now 640 atoms)!
Try 72 success (now 652 atoms)!
Try 77 success (now 664 atoms)!
Try 79 success (now 676 atoms)!
Try 80 success (now 688 atoms)!
Try 83 success (now 700 atoms)!
Try 84 success (now 712 atoms)!
Try 87 success (now 724 atoms)!
Try 89 success (now 736 atoms)!
Try 90 success (now 748 atoms)!
Try 91 success (now 760 atoms)!
Try 95 success (now 772 atoms)!
Try 96 success (now 784 atoms)!
Try 97 success (now 796 atoms)!
Try 101 success (now 808 atoms)!
Try 102 success (now 820 atoms)!
Try 103 success (now 832 atoms)!
Try 105 success (now 844 atoms)!
Try 106 success (now 856 atoms)!
Try 108 success (now 868 atoms)!
Try 109 success (now 880 atoms)!
Try 112 success (now 892 atoms)!
Try 114 success (now 904 atoms)!
Try 116 success (now 916 atoms)!
Try 123 success (now 928 atoms)!
Try 125 success (now 940 atoms)!
Try 128 success (now 952 atoms)!
Try 129 success (now 964 atoms)!
Try 130 success (now 976 atoms)!
Try 140 success (now 988 atoms)!
Try 141 success (now 1000 atoms)!
Try 142 success (now 1012 atoms)!
Try 146 success (now 1024 atoms)!
Try 153 success (now 1036 atoms)!
Try 154 success (now 1048 atoms)!
Try 157 success (now 1060 atoms)!
Try 162 success (now 1072 atoms)!
Try 167 success (now 1084 atoms)!
Try 170 success (now 1096 atoms)!
Try 172 success (now 1108 atoms)!
Try 173 success (now 1120 atoms)!
Try 177 success (now 1132 atoms)!
Try 179 success (now 1144 atoms)!
Try 183 success (now 1156 atoms)!
Try 186 success (now 1168 atoms)!
Try 189 success (now 1180 atoms)!
Try 190 success (now 1192 atoms)!
Try 192 success (now 1204 atoms)!
Try 193 success (now 1216 atoms)!
Try 197 success (now 1228 atoms)!
Try 207 success (now 1240 atoms)!
Try 209 success (now 1252 atoms)!
Try 211 success (now 1264 atoms)!
Try 213 success (now 1276 atoms)!
Try 215 success (now 1288 atoms)!
Try 217 success (now 1300 atoms)!
Try 221 success (now 1312 atoms)!
Try 223 success (now 1324 atoms)!
Try 224 success (now 1336 atoms)!
Try 226 success (now 1348 atoms)!
Try 231 success (now 1360 atoms)!
Try 232 success (now 1372 atoms)!
Try 233 success (now 1384 atoms)!
Try 235 success (now 1396 atoms)!
Try 237 success (now 1408 atoms)!
Try 241 success (now 1420 atoms)!
Try 247 success (now 1432 atoms)!
Try 248 success (now 1444 atoms)!
Try 254 success (now 1456 atoms)!
Try 258 success (now 1468 atoms)!
Try 259 success (now 1480 atoms)!
Try 262 success (now 1492 atoms)!
Try 268 success (now 1504 atoms)!
Try 269 success (now 1516 atoms)!
Try 271 success (now 1528 atoms)!
Try 272 success (now 1540 atoms)!
Try 282 success (now 1552 atoms)!
Try 285 success (now 1564 atoms)!
Try 289 success (now 1576 atoms)!

Added 128 molecules (out of 128 requested)
Writing generated configuration to files/s.gro

Output configuration contains 1576 atoms in 151 residues

GROMACS reminds you: "Life in the streets is not easy" (Marky Mark)


11.6 Adding water.

In [14]:
com_exec("gmx solvate -cp files/s.gro -cs files/water.gro -o files/solv.gro -radius 0.21")
                     :-) GROMACS - gmx solvate, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx solvate, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx solvate -cp files/s.gro -cs files/water.gro -o files/solv.gro -radius 0.21

Reading solute configuration
Reading solvent configuration

Initialising inter-atomic distances...
Generating solvent configuration
Will generate new solvent configuration of 1x1x1 boxes
Solvent box contains 3200 atoms in 3200 residues
Removed 612 solvent atoms due to solvent-solvent overlap
Removed 1263 solvent atoms due to solute-solvent overlap
Sorting configuration
Found 1 molecule type:
      W (   1 atoms):  1325 residues
Generated solvent containing 1325 atoms in 1325 residues
Writing generated configuration to files/solv.gro

Output configuration contains 2901 atoms in 1476 residues
Volume                 :         343 (nm^3)
Density                :     1286.03 (g/l)
Number of solvent molecules:   1325   


GROMACS reminds you: "Take what you want, but just what you need for survival" (Joe Jackson)


11.7 Geometry optimization.

In [35]:
com_exec("gmx grompp -f files/minimization.mdp -p files/topo.top -c files/solv.gro -o files/em")
                      :-) GROMACS - gmx grompp, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx grompp, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx grompp -f files/minimization.mdp -p files/topo.top -c files/solv.gro -o files/em

Setting the LD random seed to 1726364574
Generated 0 of the 780 non-bonded parameter combinations
Excluding 1 bonded neighbours molecule type 'Protein_A'
Excluding 1 bonded neighbours molecule type 'DPPC'
Excluding 1 bonded neighbours molecule type 'W'

NOTE 1 [file topo.top, line 15]:
  System has non-zero total charge: 4.000000
  Total charge should normally be an integer. See
  http://www.gromacs.org/Documentation/Floating_Point_Arithmetic
  for discussion on how close it should be to an integer.
  


Removing all charge groups because cutoff-scheme=Verlet
Number of degrees of freedom in T-Coupling group rest is 8700.00

There was 1 note

GROMACS reminds you: "Space May Be the Final Frontier, But It's Made in a Hollywood Basement" (Red Hot Chili Peppers)


In [36]:
com_exec("gmx mdrun -deffnm files/em -v")
                      :-) GROMACS - gmx mdrun, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx mdrun, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx mdrun -deffnm files/em -v

Compiled SIMD: SSE2, but for this host/run AVX2_256 might be better (see log).
The current CPU can measure timings more accurately than the code in
gmx mdrun was configured to use. This might affect your simulation
speed as accurate timings are needed for load-balancing.
Please consider rebuilding gmx mdrun with the GMX_USE_RDTSCP=ON CMake option.
Reading file files/em.tpr, VERSION 2019.1 (single precision)

Using 1 MPI thread
Using 4 OpenMP threads 


Steepest Descents:
   Tolerance (Fmax)   =  1.00000e+02
   Number of steps    =          100
Step=    0, Dmax= 1.0e-02 nm, Epot=  1.17202e+08 Fmax= 6.74776e+08, atom= 761
Step=    1, Dmax= 1.0e-02 nm, Epot=  8.24322e+07 Fmax= 2.17301e+08, atom= 1528
Step=    2, Dmax= 1.2e-02 nm, Epot=  5.07729e+07 Fmax= 9.10085e+07, atom= 1527
Step=    3, Dmax= 1.4e-02 nm, Epot=  3.18171e+07 Fmax= 3.33092e+07, atom= 1528
Step=    4, Dmax= 1.7e-02 nm, Epot=  1.74738e+07 Fmax= 1.29862e+07, atom= 893
Step=    5, Dmax= 2.1e-02 nm, Epot=  9.38205e+06 Fmax= 4.62334e+06, atom= 1468
Step=    6, Dmax= 2.5e-02 nm, Epot=  4.65822e+06 Fmax= 2.00804e+06, atom= 855
Step=    7, Dmax= 3.0e-02 nm, Epot=  2.56414e+06 Fmax= 8.70563e+05, atom= 1010
Step=    8, Dmax= 3.6e-02 nm, Epot=  1.44500e+06 Fmax= 6.39042e+05, atom= 899
Step=    9, Dmax= 4.3e-02 nm, Epot=  1.00255e+06 Fmax= 2.95292e+05, atom= 1301
Step=   10, Dmax= 5.2e-02 nm, Epot=  6.06938e+05 Fmax= 3.25618e+05, atom= 899
Step=   11, Dmax= 6.2e-02 nm, Epot=  4.62516e+05 Fmax= 6.55431e+04, atom= 1301
Step=   12, Dmax= 7.4e-02 nm, Epot=  1.73426e+05 Fmax= 5.14867e+04, atom= 903
Step=   13, Dmax= 8.9e-02 nm, Epot=  1.04303e+05 Fmax= 9.41367e+04, atom= 598
Step=   14, Dmax= 1.1e-01 nm, Epot=  8.19275e+04 Fmax= 2.35534e+04, atom= 1303
Step=   15, Dmax= 1.3e-01 nm, Epot=  3.28667e+04 Fmax= 7.01141e+04, atom= 598
Step=   16, Dmax= 1.5e-01 nm, Epot=  2.29248e+04 Fmax= 1.05933e+04, atom= 598
Step=   17, Dmax= 1.8e-01 nm, Epot=  1.25700e+03 Fmax= 2.24347e+05, atom= 598
Step=   19, Dmax= 1.1e-01 nm, Epot= -6.90494e+03 Fmax= 1.92842e+04, atom= 1304
Step=   20, Dmax= 1.3e-01 nm, Epot= -1.11069e+04 Fmax= 7.95541e+03, atom= 604
Step=   21, Dmax= 1.6e-01 nm, Epot= -1.84585e+04 Fmax= 2.41733e+03, atom= 1770
Step=   22, Dmax= 1.9e-01 nm, Epot= -2.69412e+04 Fmax= 3.32159e+04, atom= 2335
Step=   23, Dmax= 2.3e-01 nm, Epot= -2.89577e+04 Fmax= 3.13388e+04, atom= 2335
Step=   25, Dmax= 1.4e-01 nm, Epot= -3.04888e+04 Fmax= 4.74049e+03, atom= 2335
Step=   26, Dmax= 1.7e-01 nm, Epot= -3.22939e+04 Fmax= 8.22062e+03, atom= 471
Step=   27, Dmax= 2.0e-01 nm, Epot= -3.33466e+04 Fmax= 8.25563e+03, atom= 1054
Step=   28, Dmax= 2.4e-01 nm, Epot= -3.37149e+04 Fmax= 2.89077e+04, atom= 2617
Step=   30, Dmax= 1.4e-01 nm, Epot= -3.45483e+04 Fmax= 1.09366e+04, atom= 1512
Step=   31, Dmax= 1.7e-01 nm, Epot= -3.55666e+04 Fmax= 9.39296e+02, atom= 1512
Step=   33, Dmax= 1.0e-01 nm, Epot= -3.85668e+04 Fmax= 3.66144e+03, atom= 2617
Step=   34, Dmax= 1.2e-01 nm, Epot= -3.93116e+04 Fmax= 1.64345e+03, atom= 2656
Step=   35, Dmax= 1.5e-01 nm, Epot= -4.06946e+04 Fmax= 3.94485e+03, atom= 941
Step=   37, Dmax= 8.9e-02 nm, Epot= -4.11263e+04 Fmax= 2.51922e+03, atom= 941
Step=   38, Dmax= 1.1e-01 nm, Epot= -4.18148e+04 Fmax= 2.05123e+03, atom= 941
Step=   39, Dmax= 1.3e-01 nm, Epot= -4.25476e+04 Fmax= 2.60031e+03, atom= 941
Step=   40, Dmax= 1.5e-01 nm, Epot= -4.32321e+04 Fmax= 2.06173e+03, atom= 941
Step=   41, Dmax= 1.8e-01 nm, Epot= -4.35449e+04 Fmax= 1.99466e+04, atom= 1398
Step=   43, Dmax= 1.1e-01 nm, Epot= -4.40953e+04 Fmax= 2.40644e+03, atom= 2150
Step=   44, Dmax= 1.3e-01 nm, Epot= -4.45622e+04 Fmax= 3.41206e+03, atom= 2809
Step=   45, Dmax= 1.6e-01 nm, Epot= -4.48875e+04 Fmax= 5.68495e+03, atom= 147
Step=   46, Dmax= 1.9e-01 nm, Epot= -4.53022e+04 Fmax= 1.00061e+03, atom= 147
Step=   47, Dmax= 2.3e-01 nm, Epot= -4.67227e+04 Fmax= 1.45982e+03, atom= 2809
Step=   49, Dmax= 1.4e-01 nm, Epot= -4.69589e+04 Fmax= 1.02793e+04, atom= 2809
Step=   50, Dmax= 1.7e-01 nm, Epot= -4.70504e+04 Fmax= 1.00558e+04, atom= 2150
Step=   52, Dmax= 9.9e-02 nm, Epot= -4.72026e+04 Fmax= 6.42794e+03, atom= 1398
Step=   53, Dmax= 1.2e-01 nm, Epot= -4.74115e+04 Fmax= 2.02937e+03, atom= 941
Step=   54, Dmax= 1.4e-01 nm, Epot= -4.76944e+04 Fmax= 3.12557e+03, atom= 941
Step=   55, Dmax= 1.7e-01 nm, Epot= -4.79257e+04 Fmax= 1.47814e+03, atom= 941
Step=   56, Dmax= 2.1e-01 nm, Epot= -4.81457e+04 Fmax= 9.51248e+03, atom= 941
Step=   57, Dmax= 2.5e-01 nm, Epot= -4.85515e+04 Fmax= 1.58911e+03, atom= 941
Step=   58, Dmax= 3.0e-01 nm, Epot= -4.86712e+04 Fmax= 6.93074e+03, atom= 625
Step=   60, Dmax= 1.8e-01 nm, Epot= -4.91624e+04 Fmax= 1.10813e+03, atom= 1401
Step=   61, Dmax= 2.1e-01 nm, Epot= -4.92134e+04 Fmax= 9.43761e+03, atom= 1401
Step=   62, Dmax= 2.6e-01 nm, Epot= -4.96552e+04 Fmax= 5.66181e+03, atom= 1406
Step=   64, Dmax= 1.5e-01 nm, Epot= -4.99188e+04 Fmax= 1.00776e+03, atom= 888
Step=   65, Dmax= 1.8e-01 nm, Epot= -5.01291e+04 Fmax= 9.08302e+03, atom= 1895
Step=   67, Dmax= 1.1e-01 nm, Epot= -5.04711e+04 Fmax= 1.34201e+03, atom= 1655
Step=   68, Dmax= 1.3e-01 nm, Epot= -5.07338e+04 Fmax= 5.78733e+02, atom= 1655
Step=   69, Dmax= 1.6e-01 nm, Epot= -5.10753e+04 Fmax= 6.04897e+03, atom= 2028
Step=   70, Dmax= 1.9e-01 nm, Epot= -5.12043e+04 Fmax= 2.43119e+03, atom= 2028
Step=   72, Dmax= 1.1e-01 nm, Epot= -5.13896e+04 Fmax= 1.11868e+03, atom= 1356
Step=   73, Dmax= 1.4e-01 nm, Epot= -5.15944e+04 Fmax= 1.92269e+03, atom= 1242
Step=   75, Dmax= 8.3e-02 nm, Epot= -5.17373e+04 Fmax= 8.90046e+02, atom= 1141
Step=   76, Dmax= 9.9e-02 nm, Epot= -5.18950e+04 Fmax= 1.31639e+03, atom= 1738
Step=   77, Dmax= 1.2e-01 nm, Epot= -5.20503e+04 Fmax= 8.62281e+02, atom= 1076
Step=   78, Dmax= 1.4e-01 nm, Epot= -5.22752e+04 Fmax= 1.07509e+03, atom= 1738
Step=   80, Dmax= 8.6e-02 nm, Epot= -5.24250e+04 Fmax= 3.52491e+02, atom= 1565
Step=   82, Dmax= 5.1e-02 nm, Epot= -5.25508e+04 Fmax= 2.20312e+03, atom= 1565
Step=   83, Dmax= 6.2e-02 nm, Epot= -5.26494e+04 Fmax= 4.35641e+02, atom= 606
Step=   84, Dmax= 7.4e-02 nm, Epot= -5.26930e+04 Fmax= 5.82141e+03, atom= 1565
Step=   85, Dmax= 8.9e-02 nm, Epot= -5.28593e+04 Fmax= 1.19845e+03, atom= 1565
Step=   86, Dmax= 1.1e-01 nm, Epot= -5.28612e+04 Fmax= 2.44579e+03, atom= 1565
Step=   87, Dmax= 1.3e-01 nm, Epot= -5.28930e+04 Fmax= 2.95111e+03, atom= 1565
Step=   89, Dmax= 7.7e-02 nm, Epot= -5.30428e+04 Fmax= 5.46295e+02, atom= 570
Step=   90, Dmax= 9.2e-02 nm, Epot= -5.32358e+04 Fmax= 6.65364e+02, atom= 570
Step=   91, Dmax= 1.1e-01 nm, Epot= -5.33869e+04 Fmax= 1.01876e+03, atom= 570
Step=   92, Dmax= 1.3e-01 nm, Epot= -5.34539e+04 Fmax= 3.19728e+03, atom= 570
Step=   94, Dmax= 7.9e-02 nm, Epot= -5.35391e+04 Fmax= 1.51213e+03, atom= 1565
Step=   95, Dmax= 9.5e-02 nm, Epot= -5.36077e+04 Fmax= 8.22218e+02, atom= 606
Step=   97, Dmax= 5.7e-02 nm, Epot= -5.37076e+04 Fmax= 2.55097e+02, atom= 1759
Step=   98, Dmax= 6.9e-02 nm, Epot= -5.38492e+04 Fmax= 3.51171e+03, atom= 1565
Step=   99, Dmax= 8.2e-02 nm, Epot= -5.39593e+04 Fmax= 5.82139e+02, atom= 1565
Step=  100, Dmax= 9.9e-02 nm, Epot= -5.40067e+04 Fmax= 3.88822e+03, atom= 1565

Energy minimization reached the maximum number of steps before the forces
reached the requested precision Fmax < 100.

writing lowest energy coordinates.

Steepest Descents did not converge to Fmax < 100 in 101 steps.
Potential Energy  = -5.4006695e+04
Maximum force     =  3.8882217e+03 on atom 1565
Norm of force     =  1.0243671e+02

GROMACS reminds you: "We mathematicians are all a bit crazy." (Lev Landau)


11.8 Running molecular dynamics.

In [8]:
com_exec("gmx grompp -f files/dynamic.mdp -c files/em.gro -p files/topo.top -o files/md.tpr")
                      :-) GROMACS - gmx grompp, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx grompp, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx grompp -f files/dynamic.mdp -c files/em.gro -p files/topo.top -o files/md.tpr

Setting the LD random seed to -802935124
Generated 0 of the 780 non-bonded parameter combinations
Excluding 1 bonded neighbours molecule type 'Protein_A'
Excluding 1 bonded neighbours molecule type 'DPPC'
Excluding 1 bonded neighbours molecule type 'W'

NOTE 1 [file topo.top, line 15]:
  System has non-zero total charge: 4.000000
  Total charge should normally be an integer. See
  http://www.gromacs.org/Documentation/Floating_Point_Arithmetic
  for discussion on how close it should be to an integer.
  


Removing all charge groups because cutoff-scheme=Verlet
Number of degrees of freedom in T-Coupling group Protein is 119.96
Number of degrees of freedom in T-Coupling group DPPC is 4606.41
Number of degrees of freedom in T-Coupling group W is 3973.63

There was 1 note

Back Off! I just backed up files/md.tpr to files/#md.tpr.1#

GROMACS reminds you: "There is an infinite set A that is not too big." (John von Neumann)


In [34]:
com_exec("gmx mdrun -deffnm files/md -nt 1 -v -nsteps 3000000")
                      :-) GROMACS - gmx mdrun, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx mdrun, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx mdrun -deffnm files/md -nt 1 -v -nsteps 3000000


Back Off! I just backed up files/md.log to files/#md.log.6#
Compiled SIMD: SSE2, but for this host/run AVX2_256 might be better (see log).
The current CPU can measure timings more accurately than the code in
gmx mdrun was configured to use. This might affect your simulation
speed as accurate timings are needed for load-balancing.
Please consider rebuilding gmx mdrun with the GMX_USE_RDTSCP=ON CMake option.
Reading file files/md.tpr, VERSION 2019.1 (single precision)

Overriding nsteps with value passed on the command line: 3000000 steps, 3e+04 ps
Changing nstlist from 20 to 50, rlist from 1.134 to 1.259


Using 1 MPI thread
Using 1 OpenMP thread 


NOTE: Thread affinity was not set.

Back Off! I just backed up files/md.xtc to files/#md.xtc.6#

Back Off! I just backed up files/md.trr to files/#md.trr.2#

Back Off! I just backed up files/md.edr to files/#md.edr.6#
starting mdrun 'Martini system from files/kalp.pdb'
3000000 steps,  30000.0 ps.
step 2999900, remaining wall clock time:     0 s          
Writing final coordinates.

Back Off! I just backed up files/md.gro to files/#md.gro.2#
step 3000000, remaining wall clock time:     0 s          
               Core t (s)   Wall t (s)        (%)
       Time:     2672.437     2672.437      100.0
                         44:32
                 (ns/day)    (hour/ns)
Performance:      969.902        0.025

GROMACS reminds you: "The last good thing written in C was Franz Schubert's Symphony Number 9." (Erwin Dieterich)


11.9 Converting trajectory file to pdb and visualising.

In [35]:
com_exec("echo 0 13 | gmx trjconv -f files/md.trr -s files/md.tpr -conect -o files/md.pdb -pbc mol -skip 5")
                     :-) GROMACS - gmx trjconv, 2019.1 (-:

                            GROMACS is written by:
     Emile Apol      Rossen Apostolov      Paul Bauer     Herman J.C. Berendsen
    Par Bjelkmar      Christian Blau   Viacheslav Bolnykh     Kevin Boyd    
 Aldert van Buuren   Rudi van Drunen     Anton Feenstra       Alan Gray     
  Gerrit Groenhof     Anca Hamuraru    Vincent Hindriksen  M. Eric Irrgang  
  Aleksei Iupinov   Christoph Junghans     Joe Jordan     Dimitrios Karkoulis
    Peter Kasson        Jiri Kraus      Carsten Kutzner      Per Larsson    
  Justin A. Lemkul    Viveca Lindahl    Magnus Lundborg     Erik Marklund   
    Pascal Merz     Pieter Meulenhoff    Teemu Murtola       Szilard Pall   
    Sander Pronk      Roland Schulz      Michael Shirts    Alexey Shvetsov  
   Alfons Sijbers     Peter Tieleman      Jon Vincent      Teemu Virolainen 
 Christian Wennberg    Maarten Wolf   
                           and the project leaders:
        Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

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

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

GROMACS:      gmx trjconv, version 2019.1
Executable:   /home/emir/miniconda3/envs/molsim/bin/gmx
Data prefix:  /home/emir/miniconda3/envs/molsim
Working dir:  /home/emir/Documents/study/8_term/molecular_simulation/11_task
Command line:
  gmx trjconv -f files/md.trr -s files/md.tpr -conect -o files/md.pdb -pbc mol -skip 5

Will write pdb: Protein data bank file
Reading file files/md.tpr, VERSION 2019.1 (single precision)
Reading file files/md.tpr, VERSION 2019.1 (single precision)
Group     0 (         System) has  2901 elements
Group     1 (        Protein) has    40 elements
Group     2 (      Protein-H) has    40 elements
Group     3 (        C-alpha) has     0 elements
Group     4 (       Backbone) has     0 elements
Group     5 (      MainChain) has     0 elements
Group     6 (   MainChain+Cb) has     0 elements
Group     7 (    MainChain+H) has     0 elements
Group     8 (      SideChain) has    40 elements
Group     9 (    SideChain-H) has    40 elements
Group    10 (    Prot-Masses) has    40 elements
Group    11 (    non-Protein) has  2861 elements
Group    12 (          Other) has  2861 elements
Group    13 (           DPPC) has  1536 elements
Group    14 (              W) has  1325 elements
Select a group: trr version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up files/md.pdb to files/#md.pdb.10#
Last frame       3000 time 30000.000   


GROMACS reminds you: "According to my computations we're overdue for a transformation." (Jackson Browne)


In [1]:
import __main__
__main__.pymol_argv = [ 'pymol', '-x' ]

import pymol
import os
pymol.finish_launching()
from pymol import cmd
In [2]:
cmd.load("files/md.pdb")
cmd.bg_color("white")
In [3]:
cmd.hide("all")
cmd.show("nb_spheres", "resn w")
cmd.show("sticks", "resn dppc or resi 1-23")
cmd.color("pink", "resi 1-23")
cmd.color("silver", "resn dppc")
cmd.color("blue", "resn w")

First frame -- everything in the box.

In [8]:
import IPython

cmd.set('ray_trace_mode', 0)
cmd.png(os.path.join("files",'1_frame.png'), '1200', '720', ray=1)
In [9]:
IPython.display.Image(os.path.join("files",'1_frame.png'), retina=True)
Out[9]:

82 frame -- looks like a bilayer.

In [10]:
cmd.png(os.path.join("files",'82_frame.png'), '1200', '720', ray=1)
In [11]:
IPython.display.Image(os.path.join("files",'82_frame.png'), retina=True)
Out[11]:

210 frame -- bilayer.

In [12]:
cmd.png(os.path.join("files",'210_frame.png'), '1200', '720', ray=1)
In [13]:
IPython.display.Image(os.path.join("files",'210_frame.png'), retina=True)
Out[13]: