Molecular modelers often want fine-grain control over atom group selections when preparing systems for molecular dynamics simulations. Whether you’re planning to apply umbrella sampling, pulling simulations, or compute specific interactions, you may need to define custom index groups. Although GROMACS automatically generates standard index groups, there are cases where these predefined groups aren’t enough.
The GROMACS Wizard in SAMSON makes it easy to define custom index groups directly through its interactive graphical interface. Here’s how to do it, and why it matters.
Why define custom index groups?
Imagine you’re running a simulation involving a protein, and you’re only interested in tracking atoms in alpha helices. Alternatively, you might want to define a pulling group to measure distances between specific residues. This is where custom index groups come into play. They allow you to:
- Precisely target structural regions for analysis or restraints
- Use flexible selection mechanisms (including GROMACS syntax or visual selection in SAMSON)
- Ensure consistency across simulation steps like minimization, equilibration, and production
When and how to add index groups
Custom index groups can be added during the preparation step—or even later—using the GROMACS Wizard interface. To start:
- Click the Add/edit index groups button.
- A pop-up window will appear allowing you to define groups using either the GROMACS selection syntax or by selecting atoms directly in SAMSON.

Example: Selecting alpha helices
Suppose you want to create a group containing all residues in alpha helices:
- In SAMSON, go to Select > Residues > Amino acids > Secondary structure > Alpha helices.
- Once selected, click Generate based on current selection in document in the Index Groups window.
- Name the group (e.g.,
HELICES) and click Add index group to the list.

Behind the scenes
When you define an index group, GROMACS Wizard uses the gmx make_ndx command to generate a corresponding index.ndx file. This file is stored in your project folder and used in subsequent simulation steps. The groups you add this way are fully compatible with GROMACS command-line tools too.
Requirements and notes
- Your system must have unique and consecutive indices for atoms and residues.
- You can also test group selection strings within the pop-up window to ensure they select the intended atoms.
- These groups can also be edited or added in later steps such as energy minimization or during simulation setup.
Defining custom index groups gives you better control and flexibility in your simulations—without having to modify index files manually.
Want to learn more or see other features available in the GROMACS Wizard? Visit the full documentation page here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
