Creating custom index groups is a key step to increase flexibility and control in molecular simulations with GROMACS. From restraining specific residues to defining pull groups, index files can be crucial. But there’s a common question among SAMSON users who rely on GROMACS Wizard: When should I add my custom index groups?
This blog post focuses on a practical and underappreciated step: adding custom index groups during the equilibration and simulation phases in the GROMACS Wizard for SAMSON. If you’ve ever been frustrated by trying to use default groups that weren’t available yet or had issues with indexing based on complex system topologies, this might be the optimal solution for you.
Why not add them during preparation?
While it may seem logical to add custom index groups during the preparation step, there are some drawbacks:
- At that point, default index groups like “Protein” or “Water” are not yet generated by GROMACS.
- If your system uses non-unique or non-consecutive atom/residue indices, you might encounter indexing issues.
To avoid these problems, add custom groups during equilibration or simulation. At this stage, default GROMACS groups are already available—you can use them directly in your custom definitions.
How to add custom groups during equilibration or simulation
Step 1: Make sure your system is loaded in SAMSON. If not, click the Load button next to your input path.
Step 2: Click the Edit index groups button.

This opens the GROMACS Index Groups window. You’ll see a list of default groups:

Method 1: Using Selection Strings
Use logical operations to build selection strings. For example:
|
1 |
"protein" & ! "C-alpha" |
This selects all non-C-alpha atoms in the protein. You can test your string with the Test selection string button and preview the selected atoms in the document.

Method 2: Use SAMSON’s visual selection tools
If you’re more visually inclined, you can use SAMSON’s interface to select atoms or residues. For example, to choose all side chains with neutral charge:
Select > Residues > Amino acids > Side chain charge > Neutral

Then in the GROMACS Index Groups window, click + and choose Generate based on current selection in document. SAMSON will auto-generate a GROMACS-compatible selection string. Name the group and click Add index group to the list, then Apply.

Why this matters
Adding custom index groups after preparation lets you leverage all predefined selection groups and avoids file preparation errors. This simple shift in workflow can save time and avoid misconfigurations, especially in complex or automated (batch) simulations.
To learn more about adding custom index groups in SAMSON’s GROMACS Wizard, visit the full tutorial: 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 at https://www.samson-connect.net.
