A simulation workflow can be ready to run and still hit a practical snag: the atoms you need are not in one of GROMACS’s standard index groups. Perhaps you need a particular residue subset for analysis, or two specific groups for a pulling workflow. Rebuilding selections by hand at each stage is tedious—and selecting the wrong atoms can undermine the result.
Custom index groups give you a way to define those subsets using SAMSON’s selection tools or GROMACS selection syntax. The key decision is when to create them: during preparation, or later during equilibration or simulation.
Choose the stage that fits your workflow
For a single project, custom groups can be added during preparation, equilibration, or simulation. If you are working with a batch project, the preparation step is usually the practical choice: create the groups once, then reuse them across the subprojects.
There is an important trade-off. During preparation, the default index groups that GROMACS generates later are not yet available to use as building blocks. If your custom group depends on those defaults, wait until equilibration or simulation, after the system has been prepared.
There is also a numbering caveat: unusual, non-unique, or non-consecutive residue and atom indices can cause indexing issues when groups are created during preparation. Check the groups afterward, or, for a single project, consider creating them at a later stage.
Build a group from an existing GROMACS group
At the equilibration or simulation stage, first load the system in SAMSON if it is not already loaded. Open the group editor with Edit index groups. The window shows the groups GROMACS generated for the prepared system. Although those default groups cannot be modified, you can inspect which nodes they correspond to by selecting a group and using Select in document based on selection string.

To define a custom group from existing ones, use their names in quotes and combine them with & for AND, | for OR, or ! for NOT. For example, the documentation’s expression *protein" & ! "C-alpha* selects non-C-alpha atoms in the protein. Before adding an expression, use Test selection string and, where useful, Select in document based on selection string to check what it selects. Testing is a simple way to catch a selection that is broader or narrower than intended.
Or start with a selection in SAMSON
If you prefer to select atoms or residues visually and through SAMSON’s selection tools, do that first in the document. In the example below, the selection is neutral amino-acid side chains, reached through Select > Residues > Amino acids > Side chain charge > Neutral.

Return to GROMACS Index Groups, click +, then choose Generate based on current selection in document. GROMACS Wizard creates a corresponding GROMACS selection string from the current selection. Give the group a meaningful name, click Add index group to the list, and then click Apply to save the changes.

A small verification habit that pays off
Before moving on, check that the group represents the atoms you intended. You can inspect its selection in the document, and the groups are also available in the document folder for selection. This is especially useful after preparation-stage creation when atom or residue numbering is unusual. Clear group names and a quick visual check can also make later workflow steps easier to review.
New groups are added with gmx make_ndx and saved in the project’s index.ndx file. Once applied, return to the workflow step that needs the group—for example, a pulling or analysis workflow.
For the full walkthrough, see Adding custom index groups in the GROMACS Wizard documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
