Skip to content

Commit 980a593

Browse files
committedMay 27, 2024·
cleaned the PEG tutorial
1 parent 81d632c commit 980a593

File tree

3 files changed

+79
-55
lines changed

3 files changed

+79
-55
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. container:: justify
2+
3+
If you are completely new to GROMACS, I recommend that
4+
you follow this tutorial on a simple :ref:`bulk-solution-label` first.

‎docs/doc-sphinx/source/tutorials/bulksolution.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ Improving the NVT
696696
:alt: Gromacs tutorial : temperature versus time.
697697
:class: only-dark
698698
699-
.. contained:: figurelegend
699+
.. container:: figurelegend
700700
701701
Evolution of the temperature as a function of the time
702702
during the NVT equilibration.

‎docs/doc-sphinx/source/tutorials/stretchingpolymer.rst

+74-54
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,48 @@ Polymer in water
55

66
.. container:: hatnote
77

8-
Solvating a small molecule in water before stretching it
8+
Solvating and stretching a small polymer molecule
99

1010
.. figure:: figures/stretchingpolymer/video-PEG-dark.webp
11-
:alt: peg molecule in water
11+
:alt: Movie of a peg polymer molecule in water as simulated with GROMACS
1212
:height: 250
1313
:align: right
1414
:class: only-dark
1515

1616
.. figure:: figures/stretchingpolymer/video-PEG-light.webp
17-
:alt: peg molecule in water
17+
:alt: Movie of a peg polymer molecule in water as simulated with GROMACS
1818
:height: 250
1919
:align: right
2020
:class: only-light
2121

2222
.. container:: justify
2323

24-
The goal of this tutorial is to use GROMACS and
25-
create a small hydrophilic polymer (PEG -
26-
PolyEthylene Glycol) in a reservoir of water.
27-
An all-atom description is used, therefore all species considered here
28-
are made of charged atoms connected by bond constraints.
24+
The goal of this tutorial is to use GROMACS and solvate a small
25+
hydrophilic polymer (PEG - PolyEthylene Glycol) in a reservoir of water.
2926

30-
Once the system is created, a constant stretching force will be applied to both
31-
ends of the polymer, and its length will be measured with time.
27+
.. container:: justify
28+
29+
An all-atom description is used for both PEG (GROMOS 54A7 force
30+
field :cite:`schmid2011definition`) and water
31+
(SPC flexible model :cite:`wu2006flexible`) and the long
32+
range Coulomb interactions are solved using the PPPM solver :cite:`luty1996calculating`.
33+
Once the water reservoir is properly
34+
equilibrated at the desired temperature and pressure, the polymer molecule
35+
is added and a constant stretching force is applied to both
36+
ends of the polymer. The evolution of the polymer length
37+
is measured as a function of time.
38+
39+
.. container:: justify
3240

33-
This tutorial was inspired by a very nice |Liese2017| by Liese and coworkers, in which
34-
they compare MD simulations of a PEG molecule in water with force spectroscopy experiments.
41+
This tutorial was inspired by a |Liese2017| by Liese and coworkers, in which
42+
molecular dynamics simulations are
43+
compared with force spectroscopy experiments :cite:`liese2017hydration`.
3544

3645
.. |Liese2017| raw:: html
3746

38-
<a href="https://doi.org/10.1021/acsnano.6b07071" target="_blank">publication</a>
47+
<a href="https://doi.org/10.1021/acsnano.6b07071" target="_blank">publication</a>
48+
49+
.. include:: ../non-tutorials/recommand-salt.rst
3950

4051
.. include:: ../contact/needhelp.rst
4152

@@ -48,13 +59,7 @@ PEG molecule in vacuum
4859

4960
.. |download_H2O.data| raw:: html
5061

51-
<a href="../../../../inputs/polymerstretching/free-peg-in-vacuum/peg.gro" target="_blank">here</a>
52-
53-
.. container:: justify
54-
55-
Opening *peg.gro* using VMD, one can see that it consists of
56-
a rather long polymer chain main of carbon atoms (in gray),
57-
oxygen atoms (in red), and hydrogen atoms (in white):
62+
<a href="../../../../inputs/polymerstretching/free-peg-in-vacuum/peg.gro" target="_blank">here</a>
5863

5964
.. figure:: figures/stretchingpolymer/light-PEG.png
6065
:alt: PEG polymer for molecular dynamics simulation in GROMACS
@@ -66,8 +71,11 @@ PEG molecule in vacuum
6671
:class: only-dark
6772
:width: 500
6873

69-
This PEG molecule contains 24 carbon atoms, 12 oxygen atoms,
70-
and 50 hydrogen atoms.
74+
.. container:: figurelegend
75+
76+
The PEG molecule as visualized using VMD. It consists of
77+
a rather long polymer chain main of carbon atoms (in gray),
78+
oxygen atoms (in red), and hydrogen atoms (in white).
7179

7280
.. container:: justify
7381

@@ -76,7 +84,6 @@ PEG molecule in vacuum
7684
file named *topol.top*, and copy the following lines in it:
7785

7886
.. code-block:: bw
79-
:caption: *to be copied in free-peg-in-vacuum/topol.top*
8087
8188
[ defaults ]
8289
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
@@ -109,14 +116,15 @@ PEG molecule in vacuum
109116

110117
.. container:: justify
111118

112-
These 2 files contain the parameters for the PEG molecules, as well as extra parameters for the water molecules
113-
that will be added later.
119+
These 2 files contain the parameters for the PEG molecules, as well as extra
120+
parameters for the water molecules that will be added later.
121+
122+
.. container:: justify
114123

115-
Create an *inputs/* folder next to *ff/*, and create a new empty file called nvt.mdp.
116-
Copy the following lines into it:
124+
Create an *inputs/* folder next to *ff/*, and create a new empty file
125+
called nvt.mdp. Copy the following lines into it:
117126

118127
.. code-block:: bw
119-
:caption: *to be copied in free-peg-in-vacuum/inputs/nvt.mdp*
120128
121129
integrator = md
122130
dt = 0.002
@@ -157,26 +165,30 @@ PEG molecule in vacuum
157165
158166
.. container:: justify
159167

160-
After the simulation is over, open the trajectory file with VMD by typing:
168+
After the simulation is over, open the trajectory file with VMD by typing
169+
in a terminal:
161170

162171
.. code-block:: bash
163172
164173
vmd peg.gro nvt.trr
165174
166175
.. container:: justify
167176

168-
You should see the PEG molecule moving due to thermal agitation.
177+
The PEG molecule can be seen moving due to thermal agitation. See
178+
the corresponding |video_peg_youtube|.
179+
180+
.. |video_peg_youtube| raw:: html
169181

170-
.. include:: ../contact/supportme.rst
182+
<a href="https://www.youtube.com/watch?v=8ldIHP175TI&t=9s" target="_blank">video</a>
171183

172184
Angle distribution
173185
------------------
174186

175187
.. container:: justify
176188

177-
Let us use the power of GROMACS to extract the angular
178-
distribution between triplets of atoms during the run.
179-
First, let us create an index file from the *peg.gro* file:
189+
Let us use the tools of GROMACS to extract the angular distribution
190+
between triplets of atoms during the run. First, let us create an index
191+
file from the *peg.gro* file:
180192

181193
.. code-block:: bash
182194
@@ -197,8 +209,8 @@ Angle distribution
197209
.. container:: justify
198210

199211
Here each number corresponds to the atom index, as can be seen from the
200-
*peg.gro* file. For instance, atom of id 2 is a carbon atom, and
201-
five in an oxygen:
212+
*peg.gro* file. For instance, the atom of *id 2* is a carbon atom, and
213+
the atom id *id 5* is an oxygen:
202214

203215
.. code-block:: bw
204216
@@ -235,8 +247,10 @@ Angle distribution
235247
:alt: Angle distribution from molecular dynamics simulation in GROMACS
236248
:class: only-dark
237249

250+
.. container:: figurelegend
251+
238252
Angle distribution for the Carbon and oxygen atoms of the PEG molecule in
239-
vacuum.
253+
vacuum as extracted using *gmx angle*.
240254

241255
Pull on the PEG
242256
---------------
@@ -247,8 +261,10 @@ Pull on the PEG
247261
Duplicate the *free-peg-in-vacuum/* folder, and call the
248262
copy *pulled-peg-in-vacuum/*.
249263

264+
.. container:: justify
265+
250266
First, change the box size to make room for the pulling by replacing
251-
the last line of peg.gro from
267+
the last line of *peg.gro* from
252268

253269
.. code-block:: bw
254270
@@ -265,19 +281,21 @@ Pull on the PEG
265281
.. container:: justify
266282

267283
Then, for convenience, let us center the PEG molecule
268-
in the box by typing:
284+
in the box by using *gmx trjconv*:
269285

270286
.. code-block:: bash
271287
272288
gmx trjconv -f peg.gro -o peg-centered.gro -s nvt.tpr -center -pbc mol
273289
274290
.. container:: justify
275291

276-
And choose *System* for both centering and output. Then, let us
292+
Choose *System* for both centering and output. Then, let us
277293
specify to GROMACS which atoms are going to be pulled. This can be done
278294
by adding 2 additional groups named *End1* and *End2*
279295
to the index file *index.ndx*:
280296

297+
.. container:: justify
298+
281299
Create an index file by typing:
282300

283301
.. code-block:: bash
@@ -298,7 +316,7 @@ Pull on the PEG
298316
.. container:: justify
299317

300318
Then press *q* to save and quit. The index file *index.ndx*
301-
contains 2 additional group, with one oxygen atom each:
319+
contains 2 additional groups, with one oxygen atom each:
302320

303321
.. code-block:: bw
304322
@@ -317,12 +335,11 @@ Pull on the PEG
317335
318336
.. container:: justify
319337

320-
Then, duplicate the ``nvt.mdp`` file, call the duplicate ``pull.mdp``.
321-
Remove the ``comm-mode = angular`` line. Then, add the following lines
322-
to ``pull.mdp``:
338+
Then, duplicate the *nvt.mdp* file, name the duplicate *pull.mdp*.
339+
Remove the *comm-mode = angular* line, and add the following lines
340+
to *pull.mdp*:
323341

324342
.. code-block:: bw
325-
:caption: *to be copied in pulled-peg-in-vacuum/inputs/pull.mdp*
326343
327344
pull = yes
328345
pull-coord1-type = constant-force
@@ -340,12 +357,11 @@ Pull on the PEG
340357
341358
.. container:: justify
342359

343-
These lines are ensuring that a force is applied along the *z* direction
360+
These lines ensure that a force is applied along the *z* direction
344361
to both groups *End1* and *End2*. Turn off the velocity generator
345362
as well:
346363

347364
.. code-block:: bw
348-
:caption: *to be modified in pulled-peg-in-vacuum/inputs/pull.mdp*
349365
350366
gen_vel = no
351367
@@ -372,7 +388,7 @@ Pull on the PEG
372388
.. container:: justify
373389

374390
Looking at the evolution of the position with time, one can see
375-
that the polymer stretches very quickly:
391+
that the polymer stretches very quickly.
376392

377393
.. figure:: figures/stretchingpolymer/position-light.png
378394
:alt: End to end position from molecular dynamics simulation in GROMACS
@@ -382,12 +398,14 @@ Pull on the PEG
382398
:alt: End to end position from molecular dynamics simulation in GROMACS
383399
:class: only-dark
384400

401+
.. container:: figurelegend
402+
385403
Evolution of the end-to-end distance with time.
386404

387405
.. container:: justify
388406

389407
You can also visualize the PEG molecule during the stretching, this is
390-
what I see:
408+
what I see.
391409

392410
.. figure:: figures/stretchingpolymer/light-PEG-stretched.png
393411
:alt: PEG polymer for molecular dynamics simulation in GROMACS
@@ -397,7 +415,9 @@ Pull on the PEG
397415
:alt: PEG polymer for molecular dynamics simulation in GROMACS
398416
:class: only-dark
399417

400-
The PEG molecule under stretching in vacuum.
418+
.. container:: figurelegend
419+
420+
The PEG molecule under stretching in a vacuum.
401421

402422
PEG molecule in water
403423
=====================
@@ -433,7 +453,7 @@ PEG molecule in water
433453
434454
.. container:: justify
435455

436-
Add the line *#include "ff/tip3p.itp"* to the topol.top file:
456+
Add the line *#include "ff/tip3p.itp"* to the *topol.top* file:
437457

438458
.. code-block:: bw
439459
@@ -452,16 +472,16 @@ PEG molecule in water
452472

453473
<a href="../../../../inputs/polymerstretching/free-peg-in-water/ff/tip3p.itp" target="_blank">here</a>
454474

455-
.. include:: ../contact/supportme.rst
456-
457475
Equilibrating the system
458476
------------------------
459477

460478
.. container:: justify
461479

462-
Here we perform a 3 steps equilibration of the solvated PEG system, starting with
480+
Here we perform a 3-step equilibration of the solvated PEG system, starting with
463481
an energy minimization, followed by a NVT run, and finally with a NPT run.
464482

483+
.. container:: justify
484+
465485
First, let us perform an energy minimization of the system:
466486

467487
.. code-block:: bash

0 commit comments

Comments
 (0)
Please sign in to comment.