MD simulation is a tricky technique if you don’t understand what you are doing through various parameters and algorithms in GROMACS . That may lead to several errors. In this article, we are going to create an index file for the protein groups in GROMACS to solve such errors.
While you have to restrain some groups or atoms or residues during simulation, you need an index file. GROMACS has default groups but it may be possible that the group you are working with is not separately mentioned in the index file. Therefore, you have to create one specifying the group protein or residues or atoms to restrain. In such a case, without using this file you may encounter some errors. For example,
Group Protein referenced in the .mdp file was not found in the index file.
Group names must match either [moleculetype] names or custom index group
names, in which case you must supply an index file to the ‘-n’ option
Here, you will have to create an index file and pass it to the grompp command for the MD run.
Creating an index file
To create an index file, we will use the make_ndx module of GROMACS. Open the terminal (Ctrl+Alt+T) and type the following command:
$ gmx make_ndx –f protein.pdb –o protein.ndx
It will display the default groups. If you can find your group in the displayed list then select it (there are barely minimum chances of that).
Now, to create a new group of atoms (let’s say), type the following command.
$ a PO4
It will add this new group to the list of all default groups.
If you want to add a few residues, then type this:
$ r 45 56 58 78 106 180
For example, previously it was showing 11 default groups, not it will show 12 as shown below.
12 r 45 56 58 78 106 180: 53 atoms
It is showing you a default name to this group (i.e., r_45_56_58_78_106_180). You can rename it as ‘residues‘ using the following command:
$ name 12 rest_residues
Now, it will show you all 12 groups on the list. Finally, quit by typing
Using the index file
Now pass this index file to the grompp command as shown below:
$ gmx grompp -f md.mdp -c npt.gro -t npt.cpt -p topol.top -n protein.ndx -o md_0_1.tpr
This is not necessary that you create this file before this command only. You can create this before nvt or npt simulation also.
If error persists
To this point, your error should be gone. But in some cases, it may reappear, then you have to freeze these residues by adding a few lines in the md.mdp file.
Open the md.mdp file and add the following lines:
energygrps_excl = rest_residues rest_residues rest_residues SOL ! To remove computation of nonbonding interactions between the frozen groups with each other and surroundings (i.e. the solvent, SOL) freezegrps = rest_residues ! Index group to freeze freezedim = Y Y Y ! Freeze this group in all directions, x, y, and z
Now use the grompp command as explained above.
- Abraham, M. J., Murtola, T., Schulz, R., Páll, S., Smith, J. C., Hess, B., & Lindahl, E. (2015). GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers. SoftwareX, 1, 19-25.
GROMACS: Uses & Applications
GROMACS stands for GROningen MAchine for Chemical Simulations . It is a very popular and one of the most widely used open-source bioinformatics software. It is generally used for molecular dynamics simulation of macromolecules. In this article, we will explain its uses and applications in bioinformatics studies. (more…)
Easy installation of GROMACS on Ubuntu 18.04 & 20.04
We have provided several articles on GROMACS  installation on Ubuntu including the easy installation method for GROMACS version 5.x.x. In this article, we will provide shell scripts to install the latest (2021 series) of GROMACS on Ubuntu 18.04 and 20.04. (more…)
How to generate topology of small molecules & ligands for MD Simulation?
Generating the topology of small molecules/ligands is an important step in molecular dynamics (MD) Simulation. We explained it in previous articles as part of MD simulation tutorials. In this article, we will explain how can you generate the topology of ligands for MD simulation of complex or small molecules only. (more…)