Make_ndx for big system

GROMACS version:2023.2
GROMACS modification: Yes/No
Here post your question @milosz.wieczor @hess @scinikhil @jalemkul
Hello, I know that the .gro format only supports atom numbers up to 99999, so it will loop once it reaches 100000 atoms. When I want to use make_ndx, if I choose some of the default index groups like water and NA, will we face a problem? for being sure, Are default index groups generated based on the residue name? Or do I need to renumber the .gro file before creating the .ndx file?
thank you in advance

The index file shouldn’t suffer from the same “overflow” of the .gro/.pdb structure files, that is, every atom of your system will have a unique number. If this wasn’t the case, groups would be ill defined!

Also, the renumbering of the .gro file shouldn’t change the index file, as by logic the index follows the list as is, so if the first residue is 65 for any reason its first atom will still be 1 in the index file.

The atoms numbers in structure files, gro or pdb, are irrelevant (except maybe for warnings). The atom number used by gromacs is the sequence number of the atom line, not a number read from a line.

Thank you for your response. Therefore, for a large .gro file like the one below, if I select Na, Cl, and water, the .ndx file selects them correctly, and do we not need to renumber before creating the .ndx file? Could you kindly confirm if my understanding is correct?
31609SOL HW299998 4.633 10.248 1.495
31610SOL OW99999 4.725 9.730 1.180
31610SOL HW1 0 4.638 9.734 1.219
31610SOL HW2 1 4.724 9.650 1.128
31611SOL OW 2 4.770 10.029 0.452
31611SOL HW1 3 4.796 10.022 0.544
31611SOL HW2 4 4.690 9.977 0.446

Then you select by name, that is never an issue.

If you wanted to select by residue number, you would have an issue. Then you should use the tpr file instead, where the residues number continuously in molecule blocks.

in the ndx :
0 System : 280840 atoms
1 DNA : 5711 atoms
2 NA : 1955 atoms
3 CL : 1776 atoms
4 Water : 271398 atoms
as I wanted to select Na, Cl, water, I selected number 2 and 3 and 4. so it seems there is no problem. am i right?

As I wrote, these are selected by name, so no issues at all.

thank you so much. I highly apricate your assistance.
Best regards