3 # this is the demo molecule
11 -----------------------------------------------------------------
12 -----------------------------------------------------------------
13 This is the GROMACS demo. ( This demo takes about 15 to 30 min. )
15 In this demo we will demonstrate you how to simulate Molecular
16 Dynamics (MD) using the GROMACS software package.
18 This demo will perform a complete molecular dynamics (MD) simulation
19 of a small peptide in water. The only input file we need to do this is
20 a pdb file of this peptide.
22 If you have a problem or remark with respect to this demonstration,
23 please mail to: gromacs@chem.rug.nl
24 -----------------------------------------------------------------
25 -----------------------------------------------------------------
27 echo -n "Press <enter>"
30 #########################
31 ### CHECK ENVIRONMENT ###
32 #########################
35 -----------------------------------------------------------------
36 -----------------------------------------------------------------
37 Before we you can actually start the GROMACS demo, I am going to check
38 if GROMACS is installed properly on your system. If GROMACS is not
39 installed properly on your computer, I strongly recommend you to
40 contact your system manager.
41 -----------------------------------------------------------------
42 -----------------------------------------------------------------
44 echo -n "Press <enter>"
53 -----------------------------------------------------------------
54 -----------------------------------------------------------------
55 Before we can start any simulation we need a molecular toplogy
56 file. This topology file ( .top extension ) is generated by the
57 program pdb2gmx. The only input file of the pdb2gmx program is the pdb
58 file of our peptide ( .pdb extension ).
60 Because most pdb files do not contain all hydrogen atoms, the pdb2gmx
61 program will also add them to our peptide. The output file which
62 contains the structure of the peptide when hydrogen atoms are added is a
63 gromos structure file ( .gro extension )
65 -----------------------------------------------------------------
66 -----------------------------------------------------------------
70 echo "Because your DISPLAY variable is set, I will pop up a"
71 echo "window with the output of the pdb2gmx program"
73 echo -n "Press <enter>"
77 echo "Starting pdb2gmx"
79 xterm
-title pdb2gmx
-sb -e tail +0f output.pdb2gmx
&
81 echo 0 | pdb2gmx
-f ${MOL}.pdb -o ${MOL}.gro -p ${MOL}.top
>& output.pdb2gmx
82 echo "pdb2gmx finished"
83 echo -n "Press <enter>"
91 -----------------------------------------------------------------
92 -----------------------------------------------------------------
93 Because a simulation of a peptide in vacua is a bit unrealistic, we
94 have to solvate our peptide in a box of water. genbox is the program
97 The genbox program reads the peptide structure file and an input file
98 containing the sizes of the desired water box. The output of genbox is
99 a gromos structure file of a peptide solvated in a box of water. The
100 genbox program also changes the topology file ( .top extension ) to
101 include water. First we will use the program editconf to define the
102 right boxsize for our system.
104 -----------------------------------------------------------------
105 -----------------------------------------------------------------
108 if ( $?DISPLAY
) then
109 echo "Because your DISPLAY variable is set, I will pop up a"
110 echo "window with the output of the genbox program"
113 echo -n "Press <enter>"
116 echo "Starting editconf and genbox..."
117 if ( $?DISPLAY
) then
118 xterm
-title genbox
-sb -e tail +0f output.genbox
&
120 editconf
-f ${MOL}.gro
-o ${MOL}.gro
-dc 0.5 >& output.genbox
122 echo "editconf finished"
123 echo -n "Press <enter>"
126 genbox
-cp ${MOL}.gro -cs -o ${MOL}_b4em.gro -p ${MOL}.top
>>& output.genbox
128 echo "genbox finished"
129 echo -n "Press <enter>"
137 -----------------------------------------------------------------
138 -----------------------------------------------------------------
139 In principle we can start a Molecular Dynamics simulation now. However
140 it is not very wise to do so, because our system is full of close
141 contacts. These close contacts are mainly a result of the genbox
142 program. The added solvent might have some close contacts with the
143 peptide resulting in very high repulsive energies. If we would start a
144 Molecular Dynamics (MD) simulation without energy minimisation the
145 system would not be stable because of these high energies.
147 The standard procedure to remove these close contacts is
148 Energy Minimisation (EM). Energy minimisation slightly changes the
149 coordinates of our system to remove high energies from our system.
151 Before we can start the Energy Minimisation we have to preprocess all
152 the input files with the GROMACS preprocessor named grompp. grompp
153 preprocesses the topology file (.top), the structure file (.gro) and a
154 parameter file (.mdp) resulting in a binary topology file (.tpb/.tpr
155 extension). This binary topology file contains all information for a
156 simulation (in this case an energy minimisation).
157 -----------------------------------------------------------------
158 -----------------------------------------------------------------
161 if ( $?DISPLAY
) then
162 echo "Because your DISPLAY variable is set, I will pop up a"
163 echo "window with the output of the grompp program"
166 echo -n "Press <enter>"
169 echo generating energy minimisation parameter
file...
170 cat > em.mdp
<< _EOF_
186 ; Energy minimizing stuff
192 echo "Starting grompp..."
193 if ( $?DISPLAY
) then
194 xterm
-title grompp
-sb -e tail +0f output.grompp_em
&
196 grompp
-f em
-c ${MOL}_b4em -p ${MOL} -o ${MOL}_em
>& output.grompp_em
198 echo "grompp finished"
199 echo -n "Press <enter>"
207 -----------------------------------------------------------------
208 -----------------------------------------------------------------
209 Now the binary topology file is generated, we can start the energy
210 minimisation (EM). The program which performs the EM is called
211 mdrun. In fact all simulations are performed by the same program:
214 As the Energy Minimisation is running, watch the output of the
215 program. The first number ( from left to right ) is the number of the
216 iteration step. The second number is the step size, which gives an
217 indication of the change in the system. The third number is the
218 potential energy of the system. This number starts at a high value and
219 rapidly drops down, and converges, to a large negative value.
220 -----------------------------------------------------------------
221 -----------------------------------------------------------------
224 if ( $?DISPLAY
) then
225 echo "Because your DISPLAY variable is set, I will pop up a"
226 echo "window with the output of the mdrun program"
229 echo -n "Press <enter>"
232 echo "starting energy minimisation mdrun..."
233 if ( $?DISPLAY
) then
234 xterm
-title mdrun
-sb -e tail +0f output.mdrun_em
&
236 mdrun
-s ${MOL}_em -o ${MOL}_em -c ${MOL}_b4pr
-v >& output.mdrun_em
238 echo "mdrun finished"
239 echo -n "Press <enter>"
247 -----------------------------------------------------------------
248 -----------------------------------------------------------------
249 Once all close contacts are removed from the system, we want to do
250 molecular dynamics of the water molecules, and keep the peptide
251 fixed. This is called position restrained (PR) MD.
253 Position Restrained MD keeps the peptide fixed and lets all water
254 molecules equilibrate around the peptide in order to fill holes
255 etc. which were not filled by the genbox program.
257 We are first going to preprocess the input files to generate the
258 binary topology. The input files are the topology file, the structure
259 file ( output of the EM ) a paremeter file, and an index file.
261 By default our system is split into several groups. In this case we
262 use two of those groups: Protein and SOL(vent). We use these groups to
263 put position restraints on all the atoms of the peptide.
265 The parameter file ( .mdp extension ) contains all information about
266 the PR-MD like: step size, number of steps, temperature, etc. This
267 Paramter file also tells GROMACS what kind of simulation should be
268 performed ( like EM, PR-MD and MD etc. )
269 -----------------------------------------------------------------
270 -----------------------------------------------------------------
273 if ( $?DISPLAY
) then
274 echo "Because your DISPLAY variable is set, I will pop up a"
275 echo "window with the output of the grompp program"
278 echo -n "Press <enter>"
281 echo "generating parameter file..."
282 cat > pr.mdp
<< _EOF_
283 title = ${MOL} position restraining
287 constraints = all-bonds
291 nsteps = 100 ; total 0.2 ps.
305 ; Temperature coupling is on in two groups
308 tc-grps = protein sol
310 ; Pressure coupling is not on
313 compressibility = 4.5e-5
315 ; Generate velocites is on at 300 K.
322 echo "Starting grompp..."
323 if ( $?DISPLAY
) then
324 xterm
-title grompp
-sb -e tail +0f output.grompp_pr
&
326 grompp
-f pr -c ${MOL}_b4pr -r ${MOL}_b4pr -p ${MOL} -o ${MOL}_pr
>& output.grompp_pr
327 echo "grompp finished"
329 echo -n "Press <enter>"
337 -----------------------------------------------------------------
338 -----------------------------------------------------------------
339 Now we start the Position restrained Molecular Dynamics simulation. It
340 is important to note that in this example the simulated time is too
341 short to equilibrate our system completely, but that would simple take
342 too much time. ( about one day ).
344 -----------------------------------------------------------------
345 -----------------------------------------------------------------
348 if ( $?DISPLAY
) then
349 echo "Because your DISPLAY variable is set, I will pop up a"
350 echo "window with the output of the mdrun program"
353 echo -n "Press <enter>"
356 echo "starting mdrun..."
357 if ( $?DISPLAY
) then
358 xterm
-title mdrun
-sb -e tail +0f output.mdrun_pr
&
360 mdrun
-s ${MOL}_pr -o ${MOL}_pr -c ${MOL}_b4md
-v >& output.mdrun_pr
362 echo "mdrun finished"
363 echo -n "Press <enter>"
371 -----------------------------------------------------------------
372 -----------------------------------------------------------------
373 Now our complete system is finally ready for the actual Molecular
374 Dynamics simulation. We start again by preprocessing the input files
375 by the grompp program to generate the binary topology file (.tpb/.tpr
378 -----------------------------------------------------------------
379 -----------------------------------------------------------------
382 if ( $?DISPLAY
) then
383 echo "Because your DISPLAY variable is set, I will pop up a"
384 echo "window with the output of the grompp program"
387 echo -n "Press <enter>"
390 echo "generating parameter file..."
391 cat > md.mdp
<< _EOF_
394 constraints = all-bonds
398 nsteps = 250 ; total 0.5 ps.
410 ; Temperature coupling is on in two groups
413 tc-grps = protein sol
415 ; Pressure coupling is not on
418 compressibility = 4.5e-5
420 ; Generate velocites is on at 300 K.
426 echo "Starting grompp..."
427 if ( $?DISPLAY
) then
428 xterm
-title grompp
-sb -e tail +0f output.grompp_md
&
430 grompp
-f md
-c ${MOL}_b4md -p ${MOL} -o ${MOL}_md
>& output.grompp_md
432 echo "grompp finished"
433 echo -n "Press <enter>"
441 -----------------------------------------------------------------
442 -----------------------------------------------------------------
443 Now we can start the MD simualtion. Watch the number of steps
444 increasing ( the total number of steps is 250 ).
446 -----------------------------------------------------------------
447 -----------------------------------------------------------------
450 if ( $?DISPLAY
) then
451 echo "Because your DISPLAY variable is set, I will pop up a"
452 echo "window with the output of the mdrun program"
455 echo -n "Press <enter>"
458 echo "starting mdrun..."
459 if ( $?DISPLAY
) then
460 xterm
-title mdrun
-sb -e tail +0f output.mdrun_md
&
462 mdrun
-s ${MOL}_md -o ${MOL}_md -c ${MOL}_after_md
-v >& output.mdrun_md
464 echo "mdrun finished"
465 echo -n "Press <enter>"
473 -----------------------------------------------------------------
474 -----------------------------------------------------------------
475 We are finished simulating, and we are going to view the calculated
476 trajectory. The trajectory file ( .trj extension ) contains all
477 coordinates, velocities and forces of all the atoms in our system.
479 The next program we are going run is ngmx. ngmx is a very simple
482 Once the ngmx program has been started you need to click on a few
483 buttons to view your trajectory.
485 1. Once the program has been started a dialog box shows up. Click on
486 the box on the left of the word Protein. ( This means that we want to
487 view the peptide ). Then Click on the OK Button
489 2. Now we see the edges of the box with a lines drawing of the peptide
492 3. Select Animation in the Display menu. If you did this correctly. A
493 dialog box at the bottom of the screen appears. This dialog box is
494 used to move through your trajectory.
496 4. Click on the FastForward button (two triangles pointing to the
497 right) and watch the peptide moving.
498 -----------------------------------------------------------------
499 -----------------------------------------------------------------
502 if ( $?DISPLAY
) then
503 echo Starting Trajectory viewer...
504 ngmx
-f ${MOL}_md
-s ${MOL}_md
&