A simulation setup can be perfectly reasonable and still stumble over one small question: which atoms should this operation act on? Pulling, focused analysis, and other workflows may need a group that the standard GROMACS index groups do not provide. Creating a custom group helps make that choice explicit—and gives you a chance to check it before relying on it later.
In SAMSON’s GROMACS Wizard, you can define a group using GROMACS selection syntax or by selecting atoms or residues in SAMSON. The second route can be especially useful when you know what you want visually or through SAMSON’s selection tools, but do not want to construct the selection string by hand.
First decide when to create the group
The best point in the workflow depends on whether the group needs to use GROMACS’s generated groups, and whether you are preparing one system or a batch:
- For a batch project: consider creating groups during preparation so the step is done once for the subprojects.
- For a single project that needs default GROMACS groups: add the custom group during equilibration or simulation, after preparation has generated those groups.
- For a group that does not depend on default groups: preparation may be appropriate, especially if you want to reuse it through later stages.
There is a trade-off: at preparation, the default GROMACS-generated groups are not yet available for building a selection. Later, they can be used as the basis for a custom group.
Build from a selection you can inspect
At equilibration or simulation, make sure the system is loaded in SAMSON, then open Edit index groups. The window shows the default groups generated by GROMACS. They cannot be modified, but you can inspect which nodes they correspond to by selecting a group and using Select in document based on selection string. The groups are also available in the document folder, where double-clicking one selects its corresponding atomic structures.

This inspection step is more than a convenience: it lets you check what a group actually contains before using it as the starting point for another selection.
Two ways to define the new group
If you prefer to write a GROMACS selection, existing index-group names can be combined using & for AND, | for OR, and ! for NOT. Put an existing group name in quotes. Use Test selection string to check the expression, then Select in document based on selection string to inspect the selected nodes in SAMSON.

Alternatively, make a selection directly in SAMSON. For example, the tutorial selects neutral amino-acid side chains using Select > Residues > Amino acids > Side chain charge > Neutral. In the GROMACS Index Groups window, click +, choose Generate based on current selection in document, and give the group a name. GROMACS Wizard generates a corresponding selection string from the selected residues or atoms.

Verify before relying on it
Indexing deserves particular attention when groups are created during preparation. If residue or atom indices are non-unique or non-consecutive, indexing issues can occur in some cases. Verify that the resulting group contains the structures you intended. For a single project, creating the group later can be an alternative when you need the groups generated during preparation.
When the selection is ready, click Add index group to the list, then Apply. The groups are saved in the project’s index.ndx file using gmx make_ndx. You can then return to the workflow step that needs the group.
For the complete 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.
