Custom index groups in GROMACS: add structure-aware selections in SAMSON

A common challenge in setting up molecular simulations with GROMACS is managing selection groups. GROMACS generates standard index groups such as protein, solvent, and ions, but more advanced protocols – from umbrella sampling to pulling and restraints – often require custom selection groups. Defining these by hand, using GROMACS’ make_ndx, can be error-prone and obscure.

If you’re using SAMSON’s GROMACS Wizard, though, there’s a simpler and more visual way to define those groups — by selecting atoms directly in SAMSON’s user interface — and automatically exporting them to GROMACS as index groups. This makes your workflow more streamlined and less prone to manual errors.

Why custom index groups matter

When setting up simulations, you may need to identify and track specific parts of your system, such as:

  • Alpha-helical regions within a protein
  • Ligands or cofactors
  • Specific residue selections or functional sites
  • Atoms involved in a pulling coordinate

With standard GROMACS tools, defining these requires careful typing and knowledge of atom numbering. Errors in index definitions are easy to make and hard to debug.

SAMSON’s solution: visual selection + automatic indexing

The GROMACS Wizard in SAMSON allows you to create custom index groups using SAMSON’s extensive selection capabilities. For example, to define a group containing only alpha helices, you can simply:

  1. Open your molecular system in SAMSON.
  2. Use the top bar menu: Select > Residues > Amino acids > Secondary structure > Alpha helices.
  3. Click Add/edit index groups in the wizard:
  4. Add/edit index groups

  5. In the pop-up window, click Generate based on current selection in document:
  6. Generate index selection from SAMSON

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

You now have a reusable index group stored in index.ndx, and available for any upcoming minimization, equilibration, or simulation step.

Best practices and tips

  • Unique and consecutive indices: Your system must use continuous and unique atom and residue indices. This ensures compatibility with gmx make_ndx.
  • Batch workflows supported: You can define different selections for different conformations in batch projects.
  • Reusable selections: Once added, custom index groups are stored and can be re-used or modified later in your workflow.

More than just selection

Because the GROMACS Wizard integrates with SAMSON, the selection process is not just easier — it’s more insightful. You can visually confirm your selections, test the resulting GROMACS selection string, and ensure that what gets passed to your simulation setup is precisely what you intended.

Learn how to add custom index groups directly within SAMSON to simplify how you handle selections in GROMACS. Learn more in the documentation.

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

Comments are closed.