Managing index groups is a regular task for anyone working with molecular dynamics in GROMACS. If you’ve ever had to manually modify an index.ndx file just to track specific atoms or residues across simulations, you know how time-consuming and error-prone it can get.
The GROMACS Wizard in SAMSON helps streamline this process, especially during the equilibration and simulation stages of your workflow. This blog post focuses on how to add custom index groups without touching the command line, using intuitive selection mechanisms right inside a visual molecular modeling environment.
Why custom index groups matter
GROMACS automatically generates default index groups like protein, water, ions, etc. However, you often need to define your own groups—for example:
- Atoms to be restrained during equilibration
- Groups for pull code simulations or umbrella sampling
- Residue subsets for detailed energy analysis
Doing this manually using gmx make_ndx or editing files can be tedious, especially in large systems.
Add index groups visually in SAMSON
Start by loading your system into SAMSON. In the GROMACS Wizard interface, click the Edit index groups button to open the Index Groups window:

You will see default index groups listed. While these cannot be modified directly, they are useful references. You can even use them in logical operations (like AND, OR, NOT) when defining new groups. For example:
|
1 |
"*protein" & ! "C-alpha*" |
This selects all non-C-alpha atoms in the protein. You can test and validate your selection visually inside SAMSON.
A simple example: Select neutrally charged residues
An easier and more interactive way to define groups is by selecting atoms or residues directly in SAMSON, and letting GROMACS Wizard generate the selection string for you.
For instance, you can visually select all neutrally charged residues by navigating through the menu: Select > Residues > Amino Acids > Side Chain Charge > Neutral.

Then go back to the Index Groups window, click the + button, and use Generate based on current selection in document. SAMSON automatically creates the selection string and you can name your new group (e.g., “NeutralSideChains”).

Click Add index group to the list and then Apply to save it in your project’s index.ndx file. That’s it—no manual edits, no external scripts.
Advantages of the visual approach
Working visually keeps your structure and selections in sync, avoids mistakes, and lets you double-check everything before you proceed. This is especially handy when dealing with complex selection logic or running simulations in batches.
To learn more about adding custom index groups in SAMSON’s GROMACS Wizard, including advanced selection syntax and usage tips, visit the original documentation page: https://documentation.samson-connect.net/tutorials/gromacs-wizard/adding-custom-index-groups/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
