Preparation of Topology and Coordinate Files for MD simulations in Gromacs
In the last tutorial, drawing a molecule was demonstrated using Avogadro. In this tutorial, the focus is on preparation of the topology file for running simulations in Gromacs, which is one of the most widely used open-source package for molecular dynamics simulations. The PEO with 4 repeat units is employed as the example.
The general steps for MD simulations in Gromacs can be summarized as:
- Prepare the pdb file of a molecule of interest (PEO4.pdb in this example)
- Generate the topology file (PEO4.itp) and the coordinate file (PEO4.gro)
- Run MD simulation in Gromacs
- Post analysis
- Done
This tutorial will focus on the first two steps with the left being covered in later tutorials.
Define the Residue or Molecule
With the PEO4.pdb file at hand, the next step is to generate the topology and coordinate file for simulations. The gmx pdb2gmx can be used for this goal. Before that, one needs to define the residues composing the molecule if it is not consisted by the standard ones. In this example, the OPLS-AA force field is adopted and the residues are defined as:
[ PEO1 ]
[ atoms ]
;CH3
C31 opls_181 0.11 1
HP1 opls_185 0.03 1
HP2 opls_185 0.03 1
HP3 opls_185 0.03 1
;O
OP1 opls_180 -0.40 1
;CH2
C21 opls_182 0.14 1
HP4 opls_185 0.03 1
HP5 opls_185 0.03 1
;CH2
C22 opls_182 0.14 1
HP6 opls_185 0.03 1
HP7 opls_185 0.03 1
[ bonds ]
HP1 C31
HP2 C31
HP3 C31
C31 OP1
OP1 C21
C21 HP4
C21 HP5
C21 C22
C22 HP6
C22 HP7
C22 +OP1
[ angles ]
[ PEO2 ]
[ atoms ]
;O
OP1 opls_180 -0.40 1
;CH2
C21 opls_182 0.14 1
HP1 opls_185 0.03 1
HP2 opls_185 0.03 1
;CH2
C22 opls_182 0.14 1
HP3 opls_185 0.03 1
HP4 opls_185 0.03 1
[ bonds ]
-C22 OP1
OP1 C21
C21 HP1
C21 HP2
C21 C22
C22 HP3
C22 HP4
C22 +OP1
[ angles ]
[ PEO3 ]
[ atoms ]
;O
OP1 opls_180 -0.40 1
;CH2
C21 opls_182 0.14 1
HP1 opls_185 0.03 1
HP2 opls_185 0.03 1
;CH2
C22 opls_182 0.14 1
HP3 opls_185 0.03 1
HP4 opls_185 0.03 1
;O
OP2 opls_180 -0.40 1
;CH3
C31 opls_181 0.11 1
HP5 opls_185 0.03 1
HP6 opls_185 0.03 1
HP7 opls_185 0.03 1
[ bonds ]
-C22 OP1
OP1 C21
C21 HP1
C21 HP2
C21 C22
C22 HP3
C22 HP4
C22 OP2
OP2 C31
C31 HP5
C31 HP6
C31 HP7
[ angles ]
The above definition should be added to the aminoacids.rtp file so that Gromacs knows the definition. To find the right atom types, one can refer to the atomtypes.atp file. Note also that the force field selected may not reproduce macroscopic properties correctly and thus need modifications in research. Here the standard OPLS-AA force field is applied for a pedagogical purpose.
Correct the PEO4.pdb file
Note that the original PEO4.pdb file generated by Avogadro cannot be used directly by Gromacs. One needs to correct the file so that Gromacs can use it for topology and coordinate files convert.
The corrected pdb file of PEO4.pdb is as follows:
TITLE Write by avogadro-pdbwrap
ATOM 1 C31 PEO1 1 -0.034 -1.337 0.010 1.00 0.00 C
ATOM 2 HP1 PEO1 1 -0.289 -2.093 -0.761 1.00 0.00 H
ATOM 3 HP2 PEO1 1 -0.862 -0.594 0.033 1.00 0.00 H
ATOM 4 HP3 PEO1 1 0.049 -1.879 0.979 1.00 0.00 H
ATOM 5 OP1 PEO1 1 1.180 -0.718 -0.352 1.00 0.00 O
ATOM 6 C21 PEO1 1 1.640 0.090 0.713 1.00 0.00 C
ATOM 7 HP4 PEO1 1 2.217 -0.527 1.435 1.00 0.00 H
ATOM 8 HP5 PEO1 1 0.801 0.600 1.247 1.00 0.00 H
ATOM 9 C22 PEO1 1 2.528 1.200 0.162 1.00 0.00 C
ATOM 10 HP6 PEO1 1 2.841 1.839 1.018 1.00 0.00 H
ATOM 11 HP7 PEO1 1 1.906 1.791 -0.550 1.00 0.00 H
ATOM 12 OP1 PEO2 2 3.664 0.656 -0.488 1.00 0.00 O
ATOM 13 C21 PEO2 2 4.459 1.700 -1.026 1.00 0.00 C
ATOM 14 HP1 PEO2 2 4.871 1.375 -2.005 1.00 0.00 H
ATOM 15 HP2 PEO2 2 3.867 2.619 -1.257 1.00 0.00 H
ATOM 16 C22 PEO2 2 5.602 2.079 -0.077 1.00 0.00 C
ATOM 17 HP3 PEO2 2 5.186 2.338 0.918 1.00 0.00 H
ATOM 18 HP4 PEO2 2 6.083 3.021 -0.423 1.00 0.00 H
ATOM 19 OP1 PEO2 3 6.532 1.016 0.084 1.00 0.00 O
ATOM 20 C21 PEO2 3 7.532 1.049 -0.925 1.00 0.00 C
ATOM 21 HP1 PEO2 3 7.721 2.069 -1.334 1.00 0.00 H
ATOM 22 HP2 PEO2 3 7.240 0.385 -1.767 1.00 0.00 H
ATOM 23 C22 PEO2 3 8.874 0.597 -0.354 1.00 0.00 C
ATOM 24 HP3 PEO2 3 9.135 1.263 0.502 1.00 0.00 H
ATOM 25 HP4 PEO2 3 9.627 0.707 -1.169 1.00 0.00 H
ATOM 26 OP1 PEO3 4 8.803 -0.752 0.054 1.00 0.00 O
ATOM 27 C21 PEO3 4 10.046 -1.148 0.610 1.00 0.00 C
ATOM 28 HP1 PEO3 4 10.921 -0.645 0.131 1.00 0.00 H
ATOM 29 HP2 PEO3 4 10.050 -0.921 1.699 1.00 0.00 H
ATOM 30 C22 PEO3 4 10.242 -2.645 0.407 1.00 0.00 C
ATOM 31 HP3 PEO3 4 9.407 -3.187 0.904 1.00 0.00 H
ATOM 32 HP4 PEO3 4 11.213 -2.917 0.886 1.00 0.00 H
ATOM 33 OP2 PEO3 4 10.256 -2.927 -0.977 1.00 0.00 O
ATOM 34 C31 PEO3 4 10.685 -4.253 -1.183 1.00 0.00 C
ATOM 35 HP5 PEO3 4 11.764 -4.364 -0.938 1.00 0.00 H
ATOM 36 HP6 PEO3 4 10.565 -4.496 -2.259 1.00 0.00 H
ATOM 37 HP7 PEO3 4 10.062 -4.982 -0.618 1.00 0.00 H
END
Topology and Coordinate Files Generation
With the corrected pdb file, the following command can be used:
gmx pdb2gmx -f PEO4_wraped.pdb -o PEO4.gro
Files
What’s the next
With the generated PEO4.gro and topol.top file, the next step is running MD simulations using Gromacs. Stay tuned!
Useful reading
The general background information about this tutorial can be found, for example, at: