Managing atom groups in molecular dynamics is crucial when preparing a simulation, especially when fine-tuning analysis protocols or defining dynamic groups like pull coordinates. One sticking point for many modelers is knowing when and how to add custom index groups in GROMACS workflows. This post unpacks how you can do this effectively using the intuitive interface of the SAMSON GROMACS Wizard, depending on the project type and simulation step.
Why custom index groups?
GROMACS automatically generates standard index groups (protein, solvent, ions…), but they don’t always match specific analysis or simulation needs — e.g., monitoring sidechains, charged residues, or specific interactions. Creating custom groups allows greater flexibility and control.
Project Type Matters: Single vs Batch
The first important distinction is between single and batch projects:
- Single projects: You can safely add custom index groups at any stage — preparation, equilibration, or simulation.
- Batch projects: Prefer adding them at the preparation step so the same groups are automatically created for all subprojects.
Adding Custom Groups at the Preparation Step
This approach is recommended for batch projects. Use SAMSON’s selection tools or GROMACS syntax to define your group before launching simulations. However, a limitation is that default GROMACS groups (generated later during setup) aren’t available yet, so you can’t use them as building blocks for your custom groups.
Warning
If atoms or residues have non-unique or non-consecutive indices, indexing issues may occur. Always verify the resulting groups after generation.
Using GROMACS Wizard After Preparation
Once your system is loaded in SAMSON, you can benefit from the already-available default groups by adding custom groups during equilibration or simulation steps. This works well for single projects and allows referencing default groups inside your selection string.
Click on Edit index groups to open the editor:

You’ll see a list of default GROMACS groups:

Selecting with SAMSON or GROMACS Syntax
You have two options to define a group:
- Use GROMACS selection syntax (e.g.,
"Protein" & ! "C-alpha") to define logical operations with existing groups. - Use SAMSON’s graphical selection tools; the wizard will generate the corresponding syntax automatically.
For example, to select amino acid residues with neutral sidechains:

Once you’ve made a selection, click + to add a new group, then “Generate based on current selection in document.” Assign a name and click Add index group to the list, then Apply to save it to the index.ndx file:

Conclusion
Being able to define and control your own index groups aligns your simulation input with the questions you want to ask. Whether you’re doing umbrella sampling, binding free energy calculations, or monitoring structural features, knowing when and how to define your group can make a difference in the results you get.
To learn more, visit the official documentation page: GROMACS Wizard – Adding custom index groups.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
