Working with GROMACS simulations often requires a deeper level of system customization—especially when analyzing specific molecular interactions or controlling particular subsets. If you’re looking to pull a specific group of atoms or analyze a charged residue cluster, you probably need custom index groups.
The GROMACS Wizard in SAMSON simplifies this task significantly. But when’s the best time to add these custom index groups—during preparation, equilibration, or simulation steps? Let’s explore some practical considerations to help you decide.
Understanding the Timeline
In the GROMACS workflow, project setup typically goes through three phases: preparation, equilibration, and simulation. You can add custom index groups at any of these stages, but your choice affects usability, reusability, and flexibility.
Adding Index Groups at the Preparation Step
This is often a good option, especially when working on batch projects. If you add your custom index groups during the preparation stage, they are saved in the index.ndx file from the start. And since this preparation step is replicated across all subprojects, you avoid redefining index groups later.
However, this approach comes with a limitation: at this point, default GROMACS index groups (like Protein, Water, Ion) may not have been generated yet. As a result, you can’t define custom groups by combining or excluding these defaults.
Important Consideration
If your system has non-unique or non-consecutive residue or atom indices, defining index groups at the preparation step might lead to errors. Always verify that groups were generated as expected. For complex systems, it may be safer to wait until later steps.
Adding Index Groups at the Equilibration or Simulation Step
This might be preferable when working with a **single project**, or when your custom groups depend on GROMACS-default groups already in place. At this point, defaults are available, and you can build on them without concerns about missing references.
To do this in SAMSON, simply load your system and then click the Edit index groups button:

This opens the GROMACS Index Groups window:

You can define new custom groups based on existing ones by using GROMACS selection syntax (e.g., "Protein" & ! "C-alpha") or by selecting directly in the SAMSON document, which will auto-generate the corresponding syntax for you:

Once you’re happy with your selection, generate the group and add it to the list:

This method gives you better control and allows verification via visual selection or string testing. It also prevents potential indexing problems that might occur earlier on.
Conclusion: Choose Based on Project Needs
There’s no universal best time to add custom index groups—it comes down to your project type and how dependent your groups are on other GROMACS-generated entities. If you’re optimizing for batch processing, the preparation step is efficient. But if your selections rely on default groups or need careful tuning, equilibration or simulation stages give you more power and flexibility.
Learn more in the GROMACS Wizard documentation →
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON here.
