Number of coordinates did not match in coordinated file with the topology file

GROMACS version: 2021
GROMACS modification: Yes/No
Here post your question
While performing protein-ligand interaction I encountered this fatal error saying that my coordinate numbers in coordinate file did not match the topology file. so please help me to resolve this error mentioned below:
Program: gmx grompp, version 2020.1-Ubuntu-2020.1-1
Source file: src/gromacs/gmxpreprocess/grompp.cpp (line 669)

Fatal error:
number of coordinates in coordinate file (solv.gro, 33508)
does not match topology (, 33509)


the error is as the message says: your topology file ( has 1 more atom than your coordinate file (solv.gro). You need to correct either file to make them match.


Thanks a lot, but will you please tell me how to match this number?

How many atoms are in your ligand in its topology vs. its coordinates? Most often, a difference of one atom is a result of using coordinates that have a different protonation state than the topology.

22 atoms are their in my ligand. Rest am new to Gromacs so I dnt know how to differentiate between these two files and make them to have same number of atoms?

Initially when the error appeared the number of coordinates in solv.gro file is 33508 and file is having 33530 number of atoms but somehow with the help of google searches and responses I reduced the file error from 33530 to 33509. But now the remaining 1 atom differnce is not reducing and hence both the files remain unmatchable with equal number of atoms. So here am looking for any suggestion that how to reduce this one atom error and make them equal in both the files.

You need to provide exact, step-by-step descriptions (including actual commands, where relevant) as to what you did. There are too many things you might have done that were right or wrong for us to tell. You also did not directly answer my question about about ligand atoms - 22 in coordinates or topology? What did you do to “solve” the original discrepancy in terms of the number of atoms? There shouldn’t be too much magic that is ever necessary here, and rectifying this mismatch issue is always the same solution - let tools like solvate and genion update your topology for you in terms of water and ions, do not make manual edits to those numbers, and carefully copy and paste ligand coordinates and update the topology accordinatly.

If you need further help, please provide the exact details I’ve noted above. Without that, it’s just unproductive guesswork.

okay let me just go through it again and then tell you about it sir. Thanks a lot sir.

Sir by your help am able to resolve the issue; thank you. But in upcoming step ’ Equillibration - Thermostats step" I have encountered another error while running the command “gmx make_ndx -f em.gro -o index.ndx”
i.e. as follows-

Error in user input:
Invalid command-line options
In command-line option -f
File ‘em.gro’ does not exist or is not accessible.
The file could not be opened.
Reason: No such file or directory
(call to fopen() returned error code 2)

Please advise me how to overcome this error and also from where did this em.gro file will be found?

Hope to hear soon.
Thanks in advance sir.

That means your previous step (presumably energy minimization based on “em” as the file name) failed. Pay attention to warnings and errors printed to the terminal and output files.

okay sir,will do the steps again carefully.

Hey dear friend, according to your first issue about mismatching coordinate and topology files, I got the same error. I appreciate knowing your answer.

I have the same issue. I did exactly the same thing on your mdtutorial. But i got this fatal error:

number of coordinates in coordinate file (solv.gro, 33518)
does not match topology (, 2636)

on solv.gro file, line 33518 = 10295SOL HW233518 7.610 7.577 4.020
on file, line 2636 = JZ4 1SOL 10294

I can’t make them match.

Hello sir, i am facing the problem regarding coordinate files.
number of coordinates in coordinate file (box_sol.gro, 204998)
does not match topology (, 204954)
Please help me to solve it.

You have to break the line at JZ4 1SOL 10294 to:
JZ4 1
SOL 10294

You might try calculate again in create complex.gro step

Please elaborare. Or please send me if you have some detailed explanation for simulation

The difference is 44 atoms. Assuming that the rest of your topology agrees with your coordinate file, I would think that you have too few molecules of one kind in your topology file. Are there any molecules with 44, 22 or 11 atoms? Counting those, in your coordinate (.gro) and in your topology, would be a good starting point.

If you don’t get warnings about atom name mismatches my guess would be that it is the last molecule entry in your topology that has the wrong number.