Inconsistency with splitres behaviour of gmx make_ndx
Summary
In GROMACS 2023 and 2024, when using gmx make_ndx
with splitres 1
(where 1 is the (default) Protein group), the returned index file contains a list of residues, as expected, but each one has just one atom.
In GROMACS 2021, each residue contains a list of all atoms.
Exact steps to reproduce
$ echo -e 'splitres 1\nq' | ./bin/gmx make_ndx -f ~/gromacs/src/testutils/simulationdatabase/alanine_vacuo.gro -o index.ndx && tail index.ndx
:-) GROMACS - gmx make_ndx, 2025-dev-20240330-3a8c89011c-dirty (-:
Executable: /home/aland/gromacs/build/clang-17/./bin/gmx
Data prefix: /home/aland/gromacs (source tree)
Working dir: /home/aland/gromacs/build/clang-17
Command line:
gmx make_ndx -f /home/aland/gromacs/src/testutils/simulationdatabase/alanine_vacuo.gro -o index.ndx
Reading structure file
Going to read 0 old index file(s)
Analysing residue names:
There are: 3 Protein residues
Analysing Protein...
0 System : 22 atoms
1 Protein : 22 atoms
2 Protein-H : 10 atoms
3 C-alpha : 1 atoms
4 Backbone : 5 atoms
5 MainChain : 7 atoms
6 MainChain+Cb : 8 atoms
7 MainChain+H : 9 atoms
8 SideChain : 13 atoms
9 SideChain-H : 3 atoms
nr : group '!': not 'name' nr name 'splitch' nr Enter: list groups
'a': atom '&': and 'del' nr 'splitres' nr 'l': list residues
't': atom type '|': or 'keep' nr 'splitat' nr 'h': help
'r': residue 'res' nr 'chain' char
"name": group 'case': case sensitive 'q': save and quit
'ri': residue index
>
Splitting group 1 'Protein' into residues
>
Back Off! I just backed up index.ndx to ./#index.ndx.4#
GROMACS reminds you: "It Just Tastes Better" (Burger King)
[ SideChain ]
1 2 3 4 10 11 12 13 14 19 20 21 22
[ SideChain-H ]
1 11 19
[ Protein_ACE_1 ]
1
[ Protein_ALA_2 ]
7
[ Protein_NME_3 ]
17
For developers: Why is this important?
If a user wants to split some atom group by residue, it makes more sense to print all atoms in the residue, not just the first one.
Besides, our tools should behave consistently across versions.
If this is a bug, (1) what happens, and (2) what did you expect to happen?
[ Protein_ACE_1 ]
1
[ Protein_ALA_2 ]
7
[ Protein_NME_3 ]
17
[ Protein_ACE_1 ]
1 2 3 4 5 6
[ Protein_ALA_2 ]
7 8 9 10 11 12 13 14 15 16
[ Protein_NME_3 ]
17 18 19 20 21 22
Relevant input files, logs and/or screenshots
Reported on user forums: https://gromacs.bioexcel.eu/t/inconsistency-with-splitres-behaviour-of-gmx-make-ndx/8759