When working with molecular simulations in GROMACS, one of the recurring challenges is setting up precise and useful index groups — subsets of atoms or residues that play a role in analysis or during simulation (such as being part of a pull group). Most workflows rely on standard groups generated based on structure alone (e.g. protein, solvent, ions), but many molecular modelers need more refined selections.
This is where custom index groups in the GROMACS Wizard of SAMSON really shine. SAMSON lets you build and register these groups visually and interactively based on smart selection tools—allowing you to work at a high level without fiddling with selection syntax unless you want to.
Why create custom index groups?
There are several practical reasons why you’d want to define your own index groups in GROMACS:
- To use specific residues as pull groups in umbrella sampling.
- To monitor the center of mass of a loop, domain, or ligand.
- To define restraints between specific protein domains.
- To speed up analysis by focusing only on interesting subsets of atoms.
Without appropriate index groups, you may end up running less informative, less efficient, or outright incorrect simulations.
How SAMSON simplifies the process
GROMACS Wizard in SAMSON offers a built-in option to define and manage custom index groups during the preparation step. Here’s how it works:
- Click the Add/edit index groups button during preparation.
- A pop-up appears where you can type custom GROMACS selection strings—or even better, generate them from selections made visually in the SAMSON viewport using its rich selection mechanisms.
For example, say you want to create a group containing residues part of alpha helices. You’d select them via:
Select > Residues > Amino acids > Secondary structure > Alpha helices

Then, in the index groups window, click Generate based on current selection. SAMSON automatically builds the appropriate GROMACS selection string for you.

Give your new group a name like HELICES, test the selection, and click Add index group to the list.

That’s it — GROMACS Wizard saves your group to the index.ndx file and includes it in the final prepared system. These groups can be referenced in future GROMACS commands such as gmx mdrun, gmx distance, or during umbrella sampling.
Also helpful: you can define new index groups later in the workflow (e.g., during minimization or simulation stages), giving you full flexibility.
Requirements
Just keep in mind: this feature requires that residues and atoms in your system have unique and consecutive indices. This should typically be the case in preprocessed structures, especially if they’ve been cleaned using SAMSON tools.
Wrap-up
Defining index groups used to be a manual, syntax-heavy task, especially if you’re not deeply familiar with GROMACS conventions. With SAMSON, you can visually select atoms of interest and carry those selections into index groups with a few clicks—saving time and reducing mistakes.
To learn more about index groups and other preparation steps, visit the GROMACS Wizard documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
