GROMACS Wizard – Adding custom index groups

This section is part of the GROMACS Wizard tutorial.

GROMACS automatically generates standard index groups for your system based on its structure (e.g., protein, water, ions, etc.). But sometimes you might want to add custom index groups that we later be useful for analysis or during the simulation (e.g., as pull coordinate groups). You can do this thanks to GROMACS Wizard which allows you to use the extensive selection mechanisms available in SAMSON (see User Guide: Selecting).

When dealing with a single project, you can add custom index groups at any step of the following steps: preparation, equilibration, and simulation. But when dealing with a batch project it is preferable to add custom index groups at the preparation step – this way it will be done once for all the subprojects.

Note: The new index groups are added using gmx make_ndx command and are saved in the “index.ndx” file in the project folder.

Adding custom index groups at the preparation step

To learn how to add custom index groups during the preparation step please refer to Prepare: Adding custom index groups.

One downside of adding index groups at the preparation step is that you cannot yet use the default index groups that will later be generated by GROMACS during the preparation. While at the next equilibration and simulation steps, you can use the default index groups since they were already generated.

Warning: When adding index groups at the preparation step, if your system has non-unique or non-consecutive indices for residues and atoms then in some cases there might be issues in indexing. So, it is better to verify afterward that the groups were generated as you wanted them, or, for a single project, to add these groups e.g. at the equilibration or simulation steps.

Adding custom index groups at equilibration and simulation steps

First, it requires that the system is loaded in SAMSON. If it is not already loaded, you can simply click the “Load” button next to the input path.

Then to add new index groups, click the “Edit index groups” button.

This will open the GROMACS Index Groups window. You should see a list of default index groups that were generated by GROMACS. You can go through them – they are not modifiable, but you can click “Select in document based on selection string” to see the corresponding nodes.

The same index groups should be available directly in your document in the folder – you can double-click on them to select the corresponding nodes.

Let’s now add a new index group.

To specify new groups, you can either directly use the GROMACS selection syntax or use the extensive selection mechanisms available in SAMSON (see User Guide: Selecting). In the latter case, the GROMACS selection string will be automatically generated for you based on your selection in SAMSON.

Let’s see how to use the GROMACS selection syntax on an example of a selection string that uses existing index groups. To use an existing index group put its name into quotes, use & for ADD, | for OR, and ! for NOT operations. For example, the following selection string will select all non-C-alpha atoms in the protein: “protein” & ! “C-alpha”. You can test the selection string using “Test selection string” and select nodes in SAMSON based on it to verify it using “Select in document based on selection string“.

Let’s now see an example using the selection using SAMSON. First, select some nodes in your system. For the sake of the example, we will select all the neutral charged residues using Select menu > Residues > Amino acids > Side chain charge > Neutral.

Then, in the GROMACS Index Groups window – if it became hidden, click the “Edit index groups” button – click “+” under the list of index groups to initiate adding a new group and then click “Generate based on current selection in document“. GROMACS Wizard will automatically generate the corresponding GROMACS selection string using residue or atom selection syntaxes. Name the new group as you want.

To register the new index group, click “Add index group to the list“. The new group will be added to the list. Click “Apply” to save the changes – they will be saved in the “index.ndx” file in the project folder.

Comments are closed.