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

**URL:** <https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931>\
**Category:** User discussions\
**Tags:** grompp\
**Created:** [April 9, 2021, 10:01am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931 "2021-04-09T10:01:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 9, 2021, 10:01am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/1 "2021-04-09T10:01:30Z")

</div>

GROMACS version: 2021  
GROMACS modification: Yes/No  
Here post your question  
Hello  
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 (topol.top, 33509)

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [April 9, 2021, 10:45am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/2 "2021-04-09T10:45:27Z")

</div>

Hello,

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

Regards,  
Petter

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 9, 2021, 1:54pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/3 "2021-04-09T13:54:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [April 9, 2021, 2:05pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/4 "2021-04-09T14:05:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 9, 2021, 2:17pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/5 "2021-04-09T14:17:30Z")

</div>

> [@15\_123](#):
>
> Fatal error:  
> number of coordinates in coordinate file (solv.gro, 33508)  
> does not match topology (topol.top, 33509)

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?

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 9, 2021, 2:21pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/6 "2021-04-09T14:21:29Z")

</div>

Initially when the error appeared the number of coordinates in solv.gro file is 33508 and topol.top file is having 33530 number of atoms but somehow with the help of google searches and responses I reduced the topol.top 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.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [April 9, 2021, 3:46pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/7 "2021-04-09T15:46:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 10, 2021, 5:16am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/8 "2021-04-10T05:16:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 10, 2021, 7:30am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/9 "2021-04-10T07:30:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [April 12, 2021, 3:20pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/10 "2021-04-12T15:20:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![15\_123](https://avatars.discourse-cdn.com/v4/letter/1/ebca7d/32.png) [@15\_123](https://gromacs.bioexcel.eu/u/15_123)\
**Post date:** [April 15, 2021, 10:33am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/11 "2021-04-15T10:33:44Z")

</div>

okay sir,will do the steps again carefully.

---

<div class="post-metadata">

**Author:** ![hoseinkgr](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hoseinkgr](https://gromacs.bioexcel.eu/u/hoseinkgr)\
**Post date:** [July 7, 2022, 11:15pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/12 "2022-07-07T23:15:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![egozde](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@egozde](https://gromacs.bioexcel.eu/u/egozde)\
**Post date:** [May 16, 2023, 7:51am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/13 "2023-05-16T07:51:11Z")

</div>

@jalemkul  
Hi,  
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 (topol.top, 2636)

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

I can’t make them match.

---

<div class="post-metadata">

**Author:** ![Ruchi\_Baliyan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@Ruchi\_Baliyan](https://gromacs.bioexcel.eu/u/Ruchi_Baliyan)\
**Post date:** [October 2, 2023, 9:15am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/14 "2023-10-02T09:15:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tungdqz](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tungdqz](https://gromacs.bioexcel.eu/u/tungdqz)\
**Post date:** [October 10, 2023, 3:47am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/15 "2023-10-10T03:47:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tungdqz](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tungdqz](https://gromacs.bioexcel.eu/u/tungdqz)\
**Post date:** [October 10, 2023, 3:47am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/16 "2023-10-10T03:47:35Z")

</div>

You might try calculate again in create complex.gro step

---

<div class="post-metadata">

**Author:** ![Ruchi\_Baliyan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@Ruchi\_Baliyan](https://gromacs.bioexcel.eu/u/Ruchi_Baliyan)\
**Post date:** [October 12, 2023, 10:52am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/17 "2023-10-12T10:52:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [October 12, 2023, 11:19am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/18 "2023-10-12T11:19:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HLodi](https://avatars.discourse-cdn.com/v4/letter/h/67e7ee/32.png) [@HLodi](https://gromacs.bioexcel.eu/u/HLodi)\
**Post date:** [July 8, 2024, 2:15pm UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/19 "2024-07-08T14:15:06Z")

</div>

Gromacs version: 2021.4

Using lysozyme in water tutorial as a reference, I am trying to create a system with protein in water. At the equilibration step after solvating the system, using the command “gmx grompp -f ions.mdp -c prot\_solv\_ions.gro -p topol.top -o em.tpr”, I get the same error as follows:  
_Fatal error:_  
_number of coordinates in coordinate file (prot\_solv\_ions.gro, 66866)_  
_does not match topology (topol.top, 66850)_

After reading through other such discussions, I found out that this happens due to the failure to update the topology after solvation but so far, my topology files have been successfully updated for each step so I don’t understand why it may not have happened for the solvation step. Also, even if i have to change it now, how do I manually edit the topology file? Is it safe to do so?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [July 12, 2024, 7:25am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931/20 "2024-07-12T07:25:19Z")

</div>

Yes, you can modify the topology file by hand. You can use the coordinate file to help you count molecules of different types. You can also use common shell commands to help you. For example, the oxygen in water is commonly called `OW`. So you can count the number of water molecules using:

```auto
grep "OW" conf.gro | wc -l

```

[Next page](https://gromacs.bioexcel.eu/t/number-of-coordinates-did-not-match-in-coordinated-file-with-the-topology-file/1931.md?page=2)
