The right atoms, on purpose: building reusable GROMACS groups

A molecular simulation can be perfectly prepared and still stall over a deceptively small question: which atoms should this operation act on? A default GROMACS index group may be too broad for a pulling setup, a residue subset, or a focused analysis. Custom index groups let you define the atoms you need and reuse that selection in your workflow.

In SAMSON’s GROMACS Wizard, you can create groups from GROMACS selection expressions or from a selection you make directly in SAMSON. The useful choice is not only what to select, but when to create the group.

Choose the right point in the workflow

For a batch project, creating custom groups during preparation is often the practical choice: the groups are created once for all subprojects. The trade-off is that GROMACS has not yet generated its default index groups at that stage, so you cannot build a new group from those defaults.

For a single project, you can also add groups during equilibration or simulation. This is useful when you want to combine groups that GROMACS generated during preparation. The system must be loaded in SAMSON; if it is not, use Load next to the input path, then open Edit index groups.

There is one reason to be cautious about adding groups during preparation: structures with non-unique or non-consecutive residue or atom indices can cause indexing issues in some cases. Verify the generated groups afterward. If you are working on one project and need access to GROMACS’s default groups, consider creating the custom group at a later step instead.

Build a group from existing groups

In the GROMACS Index Groups window, review the default groups. They are not modifiable, but you can inspect which nodes they correspond to with Select in document based on selection string. You can also double-click groups in the document to select their structures.

Default GROMACS index groups in the index groups window

When writing a selection expression, put existing group names in quotes and combine them with & for AND, | for OR, and ! for NOT. For example, "protein" & ! "C-alpha" selects protein atoms except C-alpha atoms. Use Test selection string to check the expression, then use Select in document based on selection string to inspect the selected atoms in context. That extra check is worthwhile: a syntactically valid expression is not necessarily the group you intended.

Adding a custom group using existing GROMACS index groups

Or start with a selection in SAMSON

If you are more comfortable selecting molecular structures visually, first make the selection in SAMSON. For example, the tutorial selects amino acid residues with neutral side-chain charge using Select > Residues > Amino acids > Side chain charge > Neutral.

Selecting amino acid residues with neutral side chains in SAMSON

Then, in the GROMACS Index Groups window, click +, choose Generate based on current selection in document, and give the group a clear name. GROMACS Wizard generates a corresponding selection string from your selected residues or atoms. Click Add index group to the list, then Apply to save the change.

Creating a custom index group from the current SAMSON selection

The new groups are added using gmx make_ndx and saved in the project folder’s index.ndx file. A simple habit can prevent confusion later: name each group for its purpose, test or visually inspect its membership, and confirm you created it at the workflow stage where the groups it depends on are available.

For the complete 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.