Problem in using make_ndx to define index

GROMACS version: v2025.3
GROMACS modification: No
Here post your question

Hello, I am new to GROMACS and am encountering issues in making groups using make_ndx. My pdb file and the processed.gro generated by gmx editconf includes two chains (Chain A: residue 1-112, Chain H: residues 1-125).

Below is from the topol.top file.
[ molecules ]
; Compound #mols
Protein_chain_A 1
Protein_chain_H 1
SOL 24397

I tried to use gmx make_ndx -f processed.gro -o index_test.ndx to generate groups containing each chain. When I use r 1-112 or 113-237, the number of atoms does not match (especially for chain H) while chain shows empty group. I can only manage to create group using ri, but it is a bit difficult to read the plots that used atoms as x-axis.

Analysing residue names:
There are: 237 Protein residues
Analysing Protein…
0 System : 3649 atoms
1 Protein : 3649 atoms
2 Protein-H : 1832 atoms
3 C-alpha : 237 atoms
4 Backbone : 711 atoms
5 MainChain : 946 atoms
6 MainChain+Cb : 1164 atoms
7 MainChain+H : 1184 atoms
8 SideChain : 2465 atoms
9 SideChain-H : 886 atoms

chain
Group is empty
r 1-112
Found 3459 atoms with res.nr. in range 1-112
r 113-237
Found 190 atoms with res.nr. in range 113-237
ri 1-112
Found 1818 atoms with resind.+1 in range 1-112
ri 113-237
Found 1831 atoms with resind.+1 in range 113-237

May I know if I am doing anything wrong? Is it possible to use residue no. to make index and plot the graphs?
Thank you very much for your reply.

Hi @kpham

Try to use the tpr file, the gro do not contain much topological information!

I have tried using md.tpr file, but the no. of atoms still look strange.

gmx make_ndx -f md.tpr -o index.ndx

Reading structure file
Going to read 0 old index file(s)
Analysing residue names:
There are: 237 Protein residues
There are: 24255 Water residues
There are: 142 Ion residues
Analysing Protein…
0 System : 76556 atoms
1 Protein : 3649 atoms
2 Protein-H : 1832 atoms
3 C-alpha : 237 atoms
4 Backbone : 711 atoms
5 MainChain : 946 atoms
6 MainChain+Cb : 1164 atoms
7 MainChain+H : 1184 atoms
8 SideChain : 2465 atoms
9 SideChain-H : 886 atoms
10 Prot-Masses : 3649 atoms
11 non-Protein : 72907 atoms
12 Water : 72765 atoms
13 SOL : 72765 atoms
14 non-Water : 3791 atoms
15 Ion : 142 atoms
16 Water_and_ions : 72907 atoms

chain
Group is empty
r 1-112
Found 3459 atoms with res.nr. in range 1-112
r 113-235
Found 520 atoms with res.nr. in range 113-235

The correct syntax to select residues from the chain [chainID] is

chain [chainID]

In addition, unless I’m mistaken, gro files has no information on chain identifiers, you have to use PDB to use them. You can type ‘h‘ when in make_ndx dialog to read the manual with all descriptors in detail.

You should double-check me on this by manually comparing atom numbers in the ndx file you produced, but I think “r X“ is selecting the lines in the structure file with “residue number=X”, so “r 1-112“ is selecting residues 1-112 from both chains. I think you can obtain the results you’re seeking by “ri 1-112“ and “ri 113-235“, “ri“ selects residue index which is numbered continuously through the structure file

Yes, you are right. chain [chainID] works well for .pdb only and ri can be used for both .gro or .pdb. Thank you very much for your help.