When running molecular dynamics simulations with GROMACS, precise control over groups of atoms can play a pivotal role in analyses and custom workflows. While GROMACS automatically generates standard index groups (e.g., protein, solvent, ions), did you know you can define custom index groups to tailor simulations to your exact needs? In this post, we’ll explore how to use the SAMSON platform to easily create and manage custom index groups for GROMACS.
Why use custom index groups?
Custom index groups are especially useful for:
- Pulling simulations: Define groups for restraint or pulling forces.
- Analysis: Simplify post-simulation evaluations by grouping specific atoms or residues.
- Special workflows: For instance, focusing on certain secondary structures like alpha helices or beta sheets.
SAMSON makes creating these groups incredibly intuitive, even if you’re unfamiliar with GROMACS syntax.
Step-by-step: How to create custom index groups
Let’s break down the process of adding an index group for alpha helices as an example.
1. Open the index group editor
In the GROMACS Wizard within SAMSON, click the Add/edit index groups button. This will open a user-friendly dialog to specify your new groups:

2. Select residues or atoms
Take advantage of the advanced selection tools in SAMSON. For our example, choose all residues forming alpha helices:
- Go to Select > Residues > Amino acids > Secondary structure > Alpha helices.

3. Generate the selection string
With your selection in place, click Generate based on current selection in document. SAMSON will automatically convert your selection into a GROMACS-compatible string. For example, the generated selection string might look like this:
|
1 |
resid 1 to 10 or resid 20 to 30 |
Assign a name to your group—for example, HELICES. You can test the string to ensure it encapsulates the desired residues.

4. Add the group to your list
When satisfied, click Add index group to the list. SAMSON records this new group, which will now appear in your project’s list of index groups:

Did you know?
Beyond alpha helices, you can define more creative custom groups, such as:
- Ligands or active sites based on proximity to specific atoms.
- Sub-regions of a protein or RNA.
- Specific molecules from a solvent or ion set.
How index groups integrate into GROMACS

The newly added groups will be saved in the index.ndx file, which is natively supported by GROMACS for creating dynamic simulations or running analyses. This setup ensures flexibility, whether for pulling studies or complex simulations with layered groups.
Final thoughts
The ability to define custom index groups can immensely enrich your molecular modeling workflows, fine-tuning them for targeted exploration. The SAMSON platform ensures this process is approachable and efficient. To explore this feature and step up your molecular simulations, try it out now!
For a detailed dive into this functionality, visit the official SAMSON documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON today at https://www.samson-connect.net.
