Preparing molecular simulations in GROMACS often involves defining specific atom groups — known as index groups — for tasks like pulling, restraints, or targeted measurements. GROMACS automatically generates standard groups (e.g., for protein, solvent, ions), which often suffice. But sometimes, you need more nuanced selections tailored to your study. That’s when custom index groups come into play.
While it’s technically possible to define custom index groups during any simulation setup phase, choosing the right moment can save time and prevent input errors. In this post, we’ll focus on how to efficiently create custom index groups during the equilibration or simulation steps using SAMSON’s GROMACS Wizard — a highly visual and intuitive way to manage these tasks.
Why Add Index Groups Later?
At the preparation step, the structure is still evolving: GROMACS hasn’t yet fully analyzed residue types to assign the default index groups. So if you create custom groups early, you can’t rely on those pre-defined groups (like “Protein” or “Water”) being usable just yet. If you reference them prematurely, it may cause selection errors later on.
Moreover, if your system has non-consecutive or non-unique residue or atom indices, creating groups too early can lead to mismatches or missing atoms. By choosing the equilibration or simulation steps, the structure is more stable and better annotated, which makes it safer and simpler to define complex selections.
Getting Started
If the system isn’t already loaded in SAMSON, click the Load button in the GROMACS Wizard next to the input path. Then, hit the Edit index groups button to launch the Index Group editing interface.

Here you’ll find the default GROMACS index groups. They can’t be modified, but you can preview them using the Select in document based on selection string option. This helps verify what each group contains — handy for building your own group logic.

Using Existing Groups and Logical Operators
You can define a new index group using GROMACS selection syntax, referencing existing groups. Use:
&for intersect (logical AND)|for union (logical OR)!for exclusion (logical NOT)
For instance, to get all atoms in the protein except C-alpha atoms, use:
|
1 |
"protein" & ! "C-alpha" |
You can test and verify this directly in SAMSON’s interface using Test selection string, and preview your selection in the document.

Selection Made Simpler with SAMSON Tools
If you’re unfamiliar with GROMACS’ selection syntax, SAMSON offers a visual alternative. For example, say you want to group all neutral side chain residues:
- Navigate to Select > Residues > Amino acids > Side chain charge > Neutral.
- Click Edit index groups again to bring up the group editor.
- Click + to start a new group, then click Generate based on current selection in document.
- Give the new group a name (e.g. NeutralResidues), and click Add index group to the list.
- Finally, click Apply to save it. It will be written to
index.ndxin your project folder.


Conclusion
Adding custom index groups during the equilibration or simulation phases provides flexibility and better accuracy when structuring your simulations. Whether you use logical syntax or SAMSON’s visual tools, the process is seamless — with the added advantage that your system is already fully loaded and annotated, reducing selection ambiguities.
If you’re unsure what the best time is to define groups in your workflow, post-preparation steps are often the safest choice — especially when working with atom-specific groups that reference default GROMACS groups. You’ll save time and avoid index mismatches that are harder to fix later in the workflow.
Learn more in the official documentation
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
