Making the .ndx file with the exact numbering with the structure file

GROMACS version:2019.6
GROMACS modification: Yes/No
Here post your question
I am encountering an issue while using the GROMACS make_ndx command to generate an index file (.ndx). The atom numbering in my structure file does not correspond to the numbering in the resulting .ndx file.

For example, in my structure file, the atoms are numbered 1, 5, and 6, while in the .ndx file they are renumbered as 1, 2, and 3.

Could someone please advise on how to use the make_ndx command to generate an index file with the correct atom numbering? I would greatly appreciate any assistance in resolving this issue.

Thank you for your time.

What kind of input file are you using? Is the atom numbering sequential in the input file? What selections are you choosing when you run gmx make_ndx?

My input file i am using is .pdb file.The atom numbering sequential is in the inpute file.I am not using any selections when running gmx make_ndx.The code i use is like this :gmx make_ndx -f input_file.pdb -o ouput.ndx

OK. Now I see in your original post that the numbering is not sequential in your input file. I’m sorry that I read too quickly.

No, it’s not possible to keep the atom numbers matching the ones in the pdb file, unless they start from 1 and are sequential. The index file corresponds to the numbering GROMACS uses, i.e. starting from 1 and no gaps. If you want the atoms to match a coordinate file, convert your pdb file into a gro file using, e.g., gmx editconf.

“Thank you for your advice. I apologize for the lack of context in my previous request.
I am aiming to create an index file that will enable me to select specific atoms during the use of the ‘gmx trjconv’ for my ‘.tpr’ and ‘.xtc’ files. Could you please provide any suggestions for this problem?”

The numbers in the index file is supposed to be used for selecting the corresponding atoms in .gro, .tpr and .xtc files using GROMACS tools. What you should avoid is comparing the numbers in the index file to the atom numbers in a .pdb file.