When working with molecular simulations, one recurring challenge many modelers face is the need to define custom index groups in GROMACS. Whether it’s isolating a specific subset of residues or preparing for advanced workflows such as pulling or umbrella sampling, the default index groups generated by GROMACS might not always be enough. Thankfully, the GROMACS Wizard in SAMSON offers a streamlined way to navigate this issue.
Why Add Custom Index Groups?
Custom index groups can be pivotal for tasks such as defining pull groups, isolating specific residues for analysis, or preparing specific regions for energy minimization. However, creating these groups manually in other workflows can be time-consuming and error-prone, especially for systems with unusual residue or atom numbering. By leveraging the tools available in SAMSON’s GROMACS Wizard, this task becomes much more intuitive and adaptable to your needs.
Steps to Add Custom Index Groups
With SAMSON, custom index groups can be added at multiple steps of a project’s workflow: preparation, equilibration, or simulation. Here’s a walkthrough of how each option works and a key recommendation for your workflow.
1. Adding Custom Index Groups During Preparation
If you’re working on a batch project or need consistency across multiple subprojects, it is best to define custom index groups during the preparation step. To initiate this:
- Select the required nodes using SAMSON’s intuitive selection tools (e.g., specific residues or atom types).
- Click the Edit index groups button in the GROMACS Wizard, and then click Generate based on current selection in document.
- SAMSON will automatically create a GROMACS-compatible selection string. Give the group a meaningful name, then click Add index group to the list.
One limitation of adding groups at the preparation step is that default index groups generated by GROMACS won’t yet be available. Ensure your group doesn’t rely on these defaults, or alternatively, verify the result carefully.
Warning
If your system has non-unique or non-consecutive residue and atom indices, verify the integrity of the generated groups carefully.
2. Editing Index Groups at Equilibration or Simulation Steps
Another option is to add or modify custom index groups after the system’s default groups have been generated. Here’s how:
- Load your prepared system in SAMSON, if not already loaded.
- Access the GROMACS Index Groups window via the GROMACS Wizard and explore the list of default groups.
- To create a new group, use either the GROMACS selection syntax or SAMSON’s selection tools. For example, to exclude a protein’s C-alpha atoms, use this selection string:
"protein" & ! "C-alpha". Test the selection string using the Test selection string feature before adding it.
The flexibility to create or modify groups at these stages allows you to incorporate GROMACS-generated default groups into more complex selection logics.

Best Practices to Avoid Pitfalls
- For batch projects, aim to add index groups during the preparation stage to minimize repetitive manual tasks later for subprojects.
- Always double-check groups created for systems with unusual numbering schemes.
- For single projects, leverage equilibrated or simulated systems so you can rely on default GROMACS-generated groups as building blocks.
Conclusion
Defining custom index groups can make your workflows more precise and efficient when working with GROMACS. By using SAMSON’s user-friendly selection tools and the GROMACS Wizard, molecular modelers can effortlessly manage even the most complex selection requirements without diving into cumbersome manual processes.
To dive deeper, explore the original documentation at Adding Custom Index Groups in GROMACS Wizard.
SAMSON and all SAMSON Extensions are free for non-commercial use. To get started, download SAMSON at SAMSON Connect.
