When working with molecular systems and running simulations in GROMACS, precise control over the parts of the system you analyze or manipulate can save significant time and prevent errors. One common challenge is the need to define custom index groups — specific subsets of atoms or residues — for pulling, analysis, or restraint purposes. While GROMACS does provide standard groups (like protein, water, ions), these often aren’t sufficient for more specific workflows.
Fortunately, the GROMACS Wizard in SAMSON allows you to set up custom index groups using intuitive visual tools. This post walks through how to do this at the equilibration and simulation steps—where you already have access to default index groups—making it easier to build on them.
Why not at preparation?
Adding custom groups during the preparation step is possible, but it requires caution. Since some default groups are only generated during preparation, they aren’t yet usable when you’re creating custom ones at that stage. Also, if your system includes atoms or residues with non-unique or non-consecutive indices, it could lead to confusion or incorrect groupings.
Starting from equilibration or simulation
Once your system is loaded in SAMSON (click Load if it’s not), head to the GROMACS Wizard interface and click the Edit index groups button. You’ll see a list of available default index groups originally generated by GROMACS. These are fixed but can be used to build new groups using logical operators.

You can base your selections on these groups using the GROMACS selection syntax — for example:
"protein" & ! "C-alpha"
This would select all protein atoms that are not C-alpha atoms. You can test your string with the Test selection string feature and see your selections visually highlighted in the SAMSON document with Select in document based on selection string.
Even easier: visual selections
If you prefer not to write selection strings, SAMSON can help with that too. Use its visual selection tools to pick exactly what you want in your scene. For instance:

Here, a user selects amino acid residues with neutral side chains via the menu: Select > Residues > Amino acids > Side chain charge > Neutral. Once selected, return to the GROMACS Index Groups window, click + to create a new group, then click Generate based on current selection in document. The GROMACS selection string will be created for you, and you can name your group as needed.

Once satisfied, click Add index group to the list, then Apply to save your updates. Everything gets written into the index.ndx file in your project directory.
Custom index groups can significantly fine-tune how you control simulations, restrain atoms, or extract data. By combining SAMSON’s visual capabilities and GROMACS’s selection logic, you can make these groups exactly as specific as needed—without having to write lengthy scripts.
To learn more, visit the full tutorial page: Adding custom index groups in GROMACS Wizard.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
