For molecular modelers working with GROMACS, creating custom index groups can be a valuable but time-consuming step, especially when setting up umbrella sampling or applying restraints to specific parts of a biomolecular system. While GROMACS provides the gmx make_ndx command and its own selection syntax, defining the right atoms often turns into a repetitive and error-prone task — even more so when dealing with large systems or batch simulations.
This is where the GROMACS Wizard in SAMSON can save time and frustration. SAMSON’s graphical interface and advanced selection tools allow you to define and manage atom groups visually, removing much of the trial-and-error involved in writing selection strings from scratch.
Why Add Custom Index Groups?
While GROMACS generates default index groups like Protein or Water, these might not be enough when you want to:
- Define pull groups in steered molecular dynamics
- Apply restraints to specific residues or atoms
- Isolate regions for analysis, such as active sites or flexible loops
Instead of editing index files manually or trying to reverse-engineer group selections in the command-line interface, SAMSON helps you build new index groups using intuitive selection tools.
Create Index Groups Visually
Start by loading your system in SAMSON and navigating to the simulation step (equilibration or production). Once your structure is loaded, click the Edit index groups button. You’ll see a list of existing GROMACS index groups, already generated during preparation:

Want to select all non-Cα atoms of the protein? You can enter a custom selection string like:
|
1 |
"Protein" & ! "C-alpha" |
Or — a lot easier — you can just use SAMSON’s graphical selection tools. Here’s how.
From Selection to Custom Group
Let’s say you want to target neutral amino acid residues. Use the menu: Select > Residues > Amino acids > Side chain charge > Neutral. The matching atoms or residues will be highlighted in the viewer.

Then return to the GROMACS Index Groups window, click the + button to add a new group, and hit Generate based on current selection in document. Give your group a name like NeutralResidues and click Add index group to the list.

When you hit Apply, the new group is saved into the index.ndx file, ready to be used in your .mdp inputs or analysis scripts.
When to Add Index Groups
For single-project workflows, you can insert index groups during any stage: preparation, equilibration, or simulation. But for batch projects with many subprojects, it’s better to define custom groups during the preparation stage. That way each subproject gets the same predefined groups.
However, keep in mind that if your system has non-unique or non-consecutive indices, creating index groups too early (at preparation) can result in mismatches. The documentation suggests verifying the outcome or adding groups later if needed.
To learn more about custom index groups in SAMSON and how to use them throughout your GROMACS workflow, visit the full 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.
