When setting up molecular simulations in GROMACS, creating custom index groups can be incredibly useful—for example, to define specific groups of atoms for pulling simulations or detailed analyses. But things tend to get tricky when working on large or batch projects, especially during the preparation step. If you’re a molecular modeler using SAMSON‘s GROMACS Wizard, here’s a deeper look into why timing matters when adding index groups—and how to avoid common issues.
Why custom index groups are useful
GROMACS automatically creates standard index groups like Protein, Water, and Ions based on your system’s structure. But in many cases, these are not specific enough. For instance, you might want to define an index group for all neutral side chain residues or for custom selections used in analysis or umbrella sampling.
When to add custom index groups?
Within the GROMACS Wizard in SAMSON, you can insert custom index groups at three stages:
- Preparation
- Equilibration
- Simulation
If you’re running a single project, you can confidently add index groups at any of these phases. But for batch projects, it’s generally best to define custom index groups during the preparation step, so they’re propagated automatically to all subprojects.
But here’s the catch: preparation-time indexing isn’t always straightforward
Warning
If your system has non-unique or non-consecutive atom/residue indices during preparation, group creation may run into issues. This could lead to incorrect selections or failed runs down the line, especially if you’re relying on the gmx make_ndx tool to piece index groups together based on those indices.
An additional limitation: during preparation, you’re working before GROMACS has initialized its default index groups. So you won’t be able to reference standard groups like Protein or C-alpha in your selection strings yet. This restricts flexibility if your selections build on those.
Why choose later steps?
If your simulation permits, adding index groups during the equilibration or simulation steps gives you full access to existing groups. SAMSON’s GROMACS Wizard shows you all default groups, and you can test selection strings and even use SAMSON’s visual selection tools to form your groups intuitively.
Adding a group looks like this:

Once you click Edit index groups, you’ll see all default groups created by GROMACS so far. Click + to create your own, generate it based on your current selection in SAMSON, assign it a name, and click Apply to save it into index.ndx.

This workflow strikes a balance: you get selection power, visibility into default groups, and index consistency. To keep your simulation setups reliable, verify your systems before and after adding index groups, especially when working with non-standard topologies or unconventional residues.
Choosing the phase at which to define index groups isn’t just a workflow choice—it’s a safeguard against subtle simulation issues. For detailed steps and more examples, explore the original documentation page for Adding custom index groups in GROMACS Wizard.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
