When working with molecular simulations in GROMACS, setting up custom index groups can be a source of both power and confusion. Many users need to define custom atom groups for pulling, restraints, or detailed analysis, but the process can feel cryptic—especially when relying on manual editing and fragile syntax rules.
Fortunately, the GROMACS Wizard in SAMSON streamlines this process, letting you visually define and validate groups within your model. Whether you’re running a single simulation or preparing a batch project, SAMSON makes it easier to ensure your index groups are accurate and meaningful.
Why custom index groups matter
By default, GROMACS generates standard groups—like Protein, Water, or Ion groups—based on your system’s topology. But real-life setups often go beyond this. Maybe you want to track only hydrophobic residues, pull on a subset of side chains, or define groups based on charge or residue name.
Defining these manually in make_ndx can be cumbersome. Misindexing or incorrect syntax may lead to simulation errors—or worse, silently skew your results.
Using SAMSON to define custom groups visually
With SAMSON’s integration, you no longer need to second-guess your selection syntax or go back and forth between a terminal and a structure viewer. Here’s how it works during the equilibration or simulation step:
- Load your system in SAMSON. If it’s not visible, click Load next to the input path.
- Click Edit index groups to open the GROMACS Index Groups window.
- Here you’ll see default GROMACS groups. These aren’t editable, but you can visualize them by clicking Select in document based on selection string.

Two ways to create your custom group
1. Using GROMACS selection syntax
You can manually write a selection string using logical operations. For instance, to select all non-C-alpha atoms in the protein:
|
1 |
"protein" & ! "C-alpha" |
You can test your string and preview the matching atoms in SAMSON for immediate feedback. This reduces the chance of introducing syntax errors that may only surface at runtime.

2. Using visual selection in SAMSON
If you’re not confident with script-based selection, you can directly select atoms, residues, or groups in your model. For example, you could:
- Go to Select > Residues > Amino acids > Side chain charge > Neutral
- Return to the Index Groups window
- Click + to add a new group
- Click Generate based on current selection in document
- Name your group and click Add index group to the list
Finally, click Apply to save the new group to the index.ndx file.

Precision and peace of mind
This workflow makes it much easier to:
- Experiment with different group definitions
- Avoid incorrect groupings due to manual index entry
- Save time when preparing or batching simulations
Especially during the equilibration or production steps—when all default GROMACS groups are already available—you gain maximum flexibility. This can be ideal when refining selections or applying constraints to specific groupings.
To learn more about creating custom GROMACS index groups in SAMSON, visit the full guide here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
