When modeling molecular systems with GROMACS, you might find that the default index groups generated by the software are insufficient to fully address your needs. Whether you’re defining pull groups, isolating specific residues, or preparing for advanced analysis workflows, creating custom index groups becomes an essential part of the process. But how can you do this efficiently? Enter the GROMACS Wizard in SAMSON, a tool designed to help you create and manage custom index groups seamlessly.
Why You Might Need Custom Index Groups
Default index groups in GROMACS are automatically generated based on your system’s structure (e.g., protein, water, ions), which is usually sufficient for standard setup and simulations. However, in more complex workflows, such as specifying advanced pull coordinates or conducting tailored analysis, additional groups often become necessary.
Custom index groups allow you to:
- Group subsets of atoms or residues that are not categorized by default.
- Prepare systems for batch processing.
- Streamline workflows by isolating specific parts of your system.
With the GROMACS Wizard integrated in SAMSON, you can create these custom index groups efficiently using the selection tools already built into the platform.
Step-by-Step: Adding Custom Index Groups
During the Preparation Stage
Adding index groups during the preparation stage ensures they are created once and reused in subsequent stages like equilibration and simulation. This is especially useful when working on batch projects to avoid repetitive tasks.
However, a drawback to this approach is that default GROMACS-generated groups are not yet available during preparation. As a workaround, you can use SAMSON’s extensive selection mechanisms to define new index groups independently. Once defined, SAMSON will save the groups using the gmx make_ndx command to the index.ndx file in the project folder. It’s recommended to inspect these groups carefully, particularly if your system includes non-unique or non-consecutive atom indices.
Pro Tip
For a single project, you might want to define custom groups during equilibration or simulation steps instead, where default groups from GROMACS are already available.
During Equilibration or Simulation Stages
In cases where the preparation stage is already complete, you can create additional index groups in accordance with the default GROMACS-generated ones. This approach is straightforward:
- Open the GROMACS Wizard in SAMSON and load your system if it hasn’t been loaded yet.
- Click the Edit index groups button to bring up the Index Groups Manager. Here, you’ll see both default and custom-generated groups.

Select the existing index group of interest or define your new group using either the GROMACS selection syntax or SAMSON’s robust selection tools. This versatility allows you to:
- Specify atoms and residues using logical operations like
&,|, or!. - Leverage SAMSON’s prebuilt selection templates, such as isolating neutral side-chain residues or targeting specific structural elements.
Once you’re satisfied with the custom group, save it to the project, and it will automatically integrate with your workflow for future use.

Powerful Selection with SAMSON
The combination of SAMSON’s selection mechanisms and GROMACS Wizard simplifies the often cumbersome task of defining custom groups. For example, instead of manually typing selection strings, you can select relevant nodes directly in SAMSON (e.g., through graphical selection tools like Select > Residues > Amino acids > Side chain charge > Neutral). SAMSON will then generate the corresponding GROMACS syntax for you.
Conclusion
Custom index groups open new possibilities in molecular modeling, allowing users to tailor their simulations and analyses to their needs. The combination of the GROMACS Wizard and SAMSON makes this process not only feasible but incredibly efficient. Whether you are working on batch processing or dealing with complex molecular systems, knowing how to enhance your workflow with custom groups can be a game changer.
To explore this topic in more detail, visit the original documentation at https://documentation.samson-connect.net/tutorials/gromacs-wizard/adding-custom-index-groups/.
SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at https://www.samson-connect.net.
