When working on molecular dynamics simulations with GROMACS, one of the recurring challenges is managing custom index groups. These groups are often necessary for tasks like defining pull groups, analyzing specific parts of your system, or applying targeted constraints. While GROMACS generates standard groups automatically (e.g., protein, water, ions), there are many cases where these are not enough.
The GROMACS Wizard in SAMSON offers a convenient and flexible way to define custom index groups, especially useful at the equilibration and simulation steps. If you’ve already gone through the preparation step and want to assign additional selection groups without rerunning everything, this approach can save you time and increase precision.
Why not stop at preparation?
Although it’s possible to add index groups during the preparation phase, there are some limitations. The most important is that the default index groups generated by GROMACS will not yet be available at that point. This makes combining custom and default groups harder early on. At the equilibration and simulation stages, default groups have already been established, enabling you to build on top of them.
Step-by-step: Adding custom index groups during equilibration or simulation
To get started, ensure your system has been loaded into SAMSON. If not, simply click the Load button next to your input path.
Next, open the GROMACS Index Groups editor by clicking the Edit index groups button:

This opens a window showing all existing default index groups. You can preview any group using the Select in document based on selection string option.

Method 1: Use GROMACS selection syntax
GROMACS selection strings allow for flexible Boolean logic. For example, if you want to select all non-C-alpha atoms in a protein, you can use:
|
1 |
"protein" & ! "C-alpha" |
You can test your selection string within the GROMACS Wizard interface and preview the selected atoms in the system.

Method 2: Select directly in SAMSON
If you’re more comfortable with visual selection, you can use SAMSON’s selection tools. For example, to select all neutral amino acid side chains, go to:
Select > Residues > Amino acids > Side chain charge > Neutral

Then, back in the GROMACS Index Groups window, click the + button to add a new group and then click Generate based on current selection in document. The selection string will be auto-generated and you can name your group accordingly.

Click Add index group to the list, then Apply to save your changes. The new group will be stored in the index.ndx file.
Why this matters
Flexibility in defining atom groups on-the-fly during later simulation stages reduces repeated work. Whether you realize mid-simulation that you need to track a specific region, or want to apply restraints to newly relevant atoms, this method gives you control—with minimal disruption.
To learn more, visit the original GROMACS Wizard documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at www.samson-connect.net.
