One of the recurring challenges when setting up molecular dynamics (MD) simulations with GROMACS is defining custom index groups. These groups provide more control during analysis and simulation by letting you specify exactly which atoms or residues you want to monitor, apply constraints to, or use as a reference.
Custom index groups are particularly useful when standard groups like protein or water are not enough — for example, when you want to track a specific side chain or subset of charged residues. But building these groups manually with gmx make_ndx and the GROMACS command-line interface can be cumbersome — especially for large or complex systems.
That’s where the GROMACS Wizard in SAMSON can save you time. It offers a visual and interactive way to define index groups, making use of SAMSON’s selection mechanisms or even standard GROMACS selection syntax.
Step-by-step: Define custom groups at the simulation stage
The simulation stage is a great place to define your index groups if you want stable reference to GROMACS’ default groups (like Protein-H, Water, etc.), which are already loaded at that point. Here’s how you can proceed:
- Make sure your system is loaded in SAMSON. If not, just press the Load button next to the input path.
- Click the Edit index groups button to open the GROMACS Index Groups window.
- Review the list of existing index groups. You can’t modify them directly, but you can use them as building blocks for your custom group.

Option 1: Use GROMACS selection syntax
In the index groups window, you can write a selection string using logical operators to combine standard groups. For instance, to select all protein atoms that are not alpha-carbons:
|
1 |
*"protein" & ! "C-alpha"* |
You can then click Test selection string to preview the selection in your document and ensure it matches expectations.

Option 2: Use your SAMSON selection
If you prefer a more visual approach, use SAMSON’s selection tools to select the part of the system you’re interested in. For example, you can select all amino acid residues with neutral side chains from the menu:
Select > Residues > Amino acids > Side chain charge > Neutral

Then go back to the GROMACS Index Groups window and click + to add a new group, and then click Generate based on current selection in document. A proper GROMACS selection string will be generated behind the scenes.

Assign a name to your group and click Add index group to the list, followed by Apply to save the group to the index.ndx file.
Why molecular modelers find this helpful
Defining such groups in a visual interface directly tied to your molecular document can reduce errors and avoid trial-and-error loops common in command-line workflows. You can also test your selection before committing, which is hugely reassuring when working with complex systems. For batch simulations, consider defining common index groups during the preparation stage to propagate them easily across multiple subprojects.
To learn more about working with custom index groups in the GROMACS Wizard, visit the official documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
