Save Time in GROMACS Setup by Creating Custom Atom Groups Visually

A common bottleneck for researchers preparing molecular systems for GROMACS simulations is dealing with index groups. Whether you’re setting up umbrella sampling, defining distance restraints, or tracking domains across simulations, you often need to define custom selections beyond the standard groups autogenerated by GROMACS (e.g., Protein, SOL, NA).

Typically, users resort to the gmx make_ndx command-line tool to manually define these groups using atom/residue indices or verbose selection expressions. This can be slow, error-prone, and unintuitive, especially when your structures are complex.

With the GROMACS Wizard in SAMSON, there’s a way to define custom index groups visually, using intuitive selection tools — saving you time and reducing mistakes. Here’s how it works.

Adding custom index groups visually

Once you’ve selected your molecular system in SAMSON, you can launch the Index Groups dialog via the “Add/edit index groups” button.

Add/edit index groups

A new window appears, allowing you to define one or more custom groups. This works in two ways:

  • Text input: manually write a GROMACS selection string if you know the syntax.
  • SAMSON-based selection: use the SAMSON interface to select atoms or residues, and let it generate the selection string for you automatically.

For example, suppose you want to isolate alpha helices in a protein structure. In SAMSON, just use:

Select > Residues > Amino acids > Secondary structure > Alpha helices.

Select alpha helices

Then in the Index Groups dialog, click Generate based on current selection in document.

Generate an index group selection string based on the current selection in the document

Name the group (e.g. HELICES), preview or test the selection if desired, and click Add index group to the list.

Add the index group to the list

The new group will appear in your list and will be included in the index.ndx file created during the preparation step. This means you can immediately use it in later GROMACS stages like energy minimization or umbrella sampling setups.

A newly added index group in the list

Why this matters

Visual selection reduces the cognitive load of parsing structure files, remembering atom indices, or debugging syntax. Plus, since the GROMACS Wizard is integrated into SAMSON, all selections are consistent with the molecular system you’re working with.

This workflow is especially helpful for large systems with mixed components — such as protein-ligand complexes — or when defining groups for force probes or collective variables.

A few tips

  • Make sure your system has consecutive and unique atom/residue indices. GROMACS group generation depends on this assumption.
  • You can define or modify index groups during other simulation stages too — minimization, equilibration, etc.
  • GROMACS Wizard uses gmx make_ndx under the hood, so your index groups remain fully compatible with standard GROMACS workflows.

To dive into more examples and capabilities, visit the GROMACS Wizard: Step 1 – Prepare documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.