When working with molecular simulations in GROMACS, you often rely on index groups to define subsets of atoms. GROMACS generates standard ones automatically—like protein, water, or ions—but what if you need more control? Whether you’re setting up biased simulations or running targeted analyses, the ability to define custom index groups becomes essential.
The GROMACS Wizard in the SAMSON platform offers a flexible way to create and manage these custom groups, integrating both GROMACS and SAMSON’s molecular selection features.
Why Custom Index Groups Matter 🧬
Standard index groups won’t always cut it. Say you want to monitor the distance between the center of mass of two side chains, or apply a pulling force to just a particular residue group. You’ll need specific index groups that GROMACS won’t automatically provide.
In SAMSON, it’s now straightforward to create these at any stage: from preparation to equilibration and simulation. But understanding when and how to do it saves time and prevents errors.
Selecting Groups During Equilibration or Simulation
A common pain point comes from modifying the system during the preparation step, where default index groups are not yet generated. That’s why defining index groups during the equilibration or simulation step can be more practical. By this point, GROMACS has already created its default groups, and you can use those as building blocks for your own custom ones.
Start by loading your system in SAMSON. If it’s not already present, click Load next to the input path. Then:
- Click the Edit index groups button.
- The GROMACS Index Groups window opens up with a list of autogenerated groups.

You can inspect these groups—though you can’t edit them, you can visualize the atoms they correspond to by clicking Select in document based on selection string.

Building Custom Groups with Logic
You’re free to define new groups either via GROMACS selection syntax (for advanced users) or by simply selecting in the SAMSON interface.
Here’s an example using GROMACS selection syntax:
|
1 |
"protein" & ! "C-alpha" |
This selects all atoms in the protein except the alpha carbons. You can test your string and preview the selected atoms in SAMSON before committing to changes.

Or Just Click to Select
Prefer pointing and clicking? Use SAMSON’s advanced selection tools. For example, you can go to:
|
1 |
Select > Residues > Amino acids > Side chain charge > Neutral |

After making your selection, go back to the GROMACS Index Groups window, hit +, and click Generate based on current selection in document. The selection string is auto-generated, and you can name and add your group.

Finally, click Apply to save to your index.ndx file. Your new group is now part of your simulation workflow.
Summary
Whether you’re defining pulling groups, analyzing specific regions, or streamlining batch simulations, adding custom index groups at the right stage can make your GROMACS workflow a lot smoother. The integration within SAMSON simplifies the task while giving you the flexibility of GROMACS syntax or interactive selection.
Learn more in the full documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
