Build the GROMACS groups your workflow actually needs

A simulation can be ready to run and still be missing one small but important thing: the right atom or residue group. Maybe you need a defined subset for pulling, want to isolate residues for analysis, or need a group that the standard GROMACS-generated list does not provide. Without it, later steps can stall—or you may end up repeating selection work.

GROMACS Wizard lets you add custom index groups using either GROMACS selection syntax or selections made directly in SAMSON. The useful first decision is when to create the group: during preparation, or later during equilibration or simulation. That choice determines which existing groups you can build on and whether the group is created once or for a single prepared system.

Choose the right point in the workflow

For a batch project, the preparation step is generally the practical place to add groups: you define them once for the batch’s subprojects. There is a trade-off. At preparation, GROMACS has not yet generated its default index groups, so you cannot define your new group by combining those defaults.

For a single project, equilibration or simulation may be a better fit if your selection depends on groups created during preparation. At those stages, the existing groups are available to inspect and use as a starting point. In short: create early for reuse across a batch; create later when you need to build on GROMACS’s generated groups.

Two ways to define a group

Once the system is loaded, open Edit index groups. The window lists the default groups generated by GROMACS. Although these groups cannot be modified, you can inspect what they select by using Select in document based on selection string. You can also double-click the corresponding groups in the document to select their structures.

Default index groups in the GROMACS Index Groups window

If you already know the GROMACS selection syntax, you can write a selection that combines existing groups. The operators include & for AND, | for OR, and ! for NOT. For example, this can help define a subset of a protein while excluding a named group. Use Test selection string to check the selection, then use Select in document based on selection string to see which nodes it corresponds to. This visual check is especially useful before you rely on the group in a later workflow step.

Alternatively, make the selection in SAMSON first. For instance, you might select amino acid residues with neutral side chains using Select > Residues > Amino acids > Side chain charge > Neutral. In the index-groups window, click +, then Generate based on current selection in document. GROMACS Wizard generates a GROMACS selection string from the current selection, which you can name and add to the list.

Selecting amino acid residues with neutral side chains in SAMSON

Verify before moving on

Creating a group is not the last check. Confirm that the selected atoms or residues are the ones you intended, particularly if the structure has unusual, non-unique, or non-consecutive atom or residue numbering. The documentation specifically cautions that such numbering can cause indexing issues when groups are added during preparation. If the group is for one project and depends on prepared groups, adding it later can be an alternative; either way, inspect the result rather than assuming the selection translated as intended.

When the group looks right, click Add index group to the list, then click Apply. The changes are saved to index.ndx in the project folder. Keeping the group’s purpose clear in its name can also make it easier to identify when you return to the project for pulling or analysis.

Creating a custom index group from the current SAMSON selection

The key habit is simple: choose the creation step based on what groups are available, then test the selection against the structure before applying it. For the full walkthrough, see the GROMACS Wizard guide to adding custom index groups.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.