When setting up a GROMACS simulation, you may find yourself needing to analyze a specific portion of a molecular system repeatedly — certain backbone atoms, a ligand, or, for instance, residues forming alpha-helices. In standard GROMACS workflows, this often requires manually selecting atoms and writing selection strings in make_ndx. For larger systems or repeated analyses, this becomes tedious and error-prone.
In SAMSON’s GROMACS Wizard, a helpful optional feature addresses this need: Custom Index Groups. These groups let you predefine atom or residue selections and make them available throughout your simulation pipeline: minimization, equilibration, and beyond. This blog post introduces the feature and shows you how to use it to define reproducible, sharable selections in just a few clicks. 🧪
Why create custom index groups?
GROMACS generates default index groups — such as Protein, Solvent, or Ion — automatically based on molecular structure. But what if you want to monitor the distance between two domains, restrain part of a loop, or apply umbrella sampling to a reaction coordinate defined by specific atoms? Without custom groups, you’d have to generate the same selections over and over again outside your workflows.
Custom index groups in SAMSON simplify this by integrating selection tools familiar from the graphical user interface, turning visual selections automatically into GROMACS-compatible selection strings. Here’s how to do it.
Step-by-step: defining a new index group
- First, set your system in GROMACS Wizard as normal.
- Click the Add/edit index groups button.
- In the popup window, perform your selection directly in the SAMSON interface. For example, you can select secondary structure elements using:
Select > Residues > Amino acids > Secondary structure > Alpha helices

- Click Generate based on current selection in document — this converts your visual selection into a GROMACS selection string.

- Give your group a name (e.g.,
HELICES) and click Add index group to the list.

What happens next?
Your custom index groups are saved in the index.ndx file created by GROMACS. Once defined, you can use these named groups just like any built-in group for analysis, restraints, or computing properties. And because they’re preserved in your project folder, colleagues can apply the same groups when working with your setup.
This not only improves reproducibility, but also ensures your workflows remain efficient and clear. Plus, you can always redefine or add more custom groups during later simulation steps if needed.
Before you start
To define meaningful custom selections, SAMSON requires that your system has unique and consecutive indices for residues and atoms. If your structure comes from a cleaned, preprocessed PDB file or has undergone proper import in SAMSON, this should already be in place.
To learn more about how to use the Custom Index Groups and explore other preparation features in SAMSON’s GROMACS Wizard, visit the full documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
