For molecular modelers working with GROMACS, creating custom index groups can be a crucial step for advanced simulations and analysis. These groups allow for tailored insights, such as isolating specific sets of atoms or defining pull coordinate groups, which are essential for certain types of experiments. However, the process isn’t always straightforward, and if not approached carefully, indexing errors may arise.
If you are a SAMSON user, the GROMACS Wizard provides an accessible and highly customizable way to create and manage index groups. Below, we’ll walk you through key takeaways for efficiently adding custom index groups during the preparation, equilibration, or simulation steps, helping you make this process seamless.
Preparation Step: Key Considerations
Adding index groups at the preparation step can save time, especially for batch projects, as the configuration will propagate to all subprojects. However, there’s a potential downside: at the preparation stage, default index groups from GROMACS have not yet been generated. This means you’ll need to create groups without the benefit of referencing default ones. For instance, you might define groups using general SAMSON selection mechanisms or your molecular structure’s organization.
One critical aspect to keep in mind is that indexing could suffer if your system has non-unique or non-sequential residue or atom IDs. After adding new groups, ensure you verify their configuration by examining the output in the index.ndx file.
Warning
Issues in indexing can occur if residues or atoms are not uniquely or consecutively numbered. For single projects, consider opting to add groups at later steps, such as equilibration or simulation.
Equilibration and Simulation Steps: Leveraging Default Groups
At the equilibration or simulation steps, you gain access to the default index groups generated by GROMACS, making it easier to build upon them. For instance, you might combine existing groups using the scriptable GROMACS selection syntax.
Adding Custom Groups Using Existing Selections
Once your system is loaded in SAMSON, follow these steps:
- Click the Edit index groups button to open the GROMACS Index Groups window.
- Explore the default index groups and select Select in document based on selection string to visualize nodes.
- To create a new group, use the GROMACS selection syntax. For example, to exclude C-alpha atoms from a protein, input:
"protein" & ! "C-alpha". Click Test selection string to verify your selection.

Creating Groups Based on Custom Selections in SAMSON
If using SAMSON’s extensive selection tools, follow these steps:
- Highlight specific nodes in your system via Select menus. For instance, to filter neutrally charged residues, navigate: Select > Residues > Amino acids > Side chain charge > Neutral.
- Return to the Index Groups window and click +, then choose Generate based on current selection in document. Name your group appropriately.
- Click Add index group to the list and select Apply. This will save your changes to the
index.ndxfile.

This workflow lets you easily leverage SAMSON’s intuitive selection tools, converting them into standardized GROMACS syntax on the fly.
Conclusion
Custom index groups are invaluable for anyone looking to extract deeper insights from GROMACS simulations. Whether done at the preparation, equilibration, or simulation steps, SAMSON’s GROMACS Wizard makes it easier to streamline this process and minimize potential frustrations when managing complex systems.
Explore the full documentation for step-by-step instructions and additional tips: https://documentation.samson-connect.net/tutorials/gromacs-wizard/adding-custom-index-groups/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
