When fine-tuning a molecular dynamics workflow, being able to define your own atom groups — for pulling, analysis, or restraints — is incredibly important. GROMACS nudges you in the right direction by generating standard index groups automatically, such as Protein, Water, and Ion. But what do you do when your simulation calls for something more personal?
That’s where the GROMACS Wizard in SAMSON shines with its support for custom index groups. However, the timing and method of adding those groups can heavily influence the reliability of your simulation.
đź’ˇ Why you might need custom index groups
Let’s say you’re running umbrella sampling, or pulling two residues apart — you’ll need to specify exactly which atoms belong to Group A and Group B. But what if the residues you want aren’t in any default index group? You’ll need to define them yourself.
SAMSON’s selection features make this fairly easy, but what’s less obvious is when to do this in a workflow that includes preparation, equilibration, and simulation steps.
⚠️ Adding custom groups too early can backfire
Although tempting, adding custom index groups during the preparation step of your project isn’t always ideal. Why? Because the default GROMACS index groups (automatically generated during preparation) haven’t been created yet. That means you can’t easily build custom groups from them.
For example, you won’t be able to base a new index on Protein or C-alpha if they haven’t been defined yet. This limitation subtly forces restraint: if you need custom groups based on GROMACS defaults, wait until equilibration or simulation.
🔍 Equilibration and simulation are safer bets
Once your system enters the equilibration or simulation stage, the default GROMACS groups are available, making it safer to define your custom sets.
The process is straightforward:
- Load your system in SAMSON.
- Click Edit index groups near the input path.
- To base your group on existing GROMACS groups, use the selection syntax:
"Protein" & ! "C-alpha"— this selects all protein atoms that are not C-alpha atoms. - Alternatively, use SAMSON’s graphical selection tools to select whatever atoms or residues you want.
- Click + and then Generate based on current selection in document.
- Name your group and add it to the list.
- Click Apply to save the new group to your
index.ndxfile.

âś… Best practices
- Need to use standard GROMACS groups? Add custom groups after preparation.
- Running batch simulations? Better to add custom groups during preparation so all subprojects inherit them.
- If your system has non-unique or non-consecutive atom/residue indices, double-check that your groups were correctly generated.
- Use the Test selection string and Select in document tools to validate custom group definitions.

Want to go further?
You can learn more about custom index groups in the GROMACS Wizard documentation:
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 download SAMSON at https://www.samson-connect.net.
