# ERROR moleculetype- redefined

**URL:** <https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692>\
**Category:** User discussions\
**Created:** [February 18, 2022, 10:30pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692 "2022-02-18T22:30:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 18, 2022, 10:30pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/1 "2022-02-18T22:30:49Z")

</div>

GROMACS version: version 2020 ((2020-impi-mkl-PS2018-GOLD))))

Dear all,  
ERROR 1 [file mef.itp, line 18]: moleculetype mef is redefined  
I have this error and I have no idea. I’m really new user. (only 5 day it will be finished)

I checked the nrexcl but it is not so clear for me. what I need to do?

[moleculetype]  
;name nrexcl  
mef 3

---

<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:** [February 19, 2022, 4:01pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/2 "2022-02-19T16:01:26Z")

</div>

The error means you have introduced the same `[moleculetype]` more than once. Without access to your files, there’s no way to say where that is coming from.

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 19, 2022, 4:38pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/3 "2022-02-19T16:38:41Z")

</div>

[https://drive.google.com/drive/folders/11fjCKphSId6UULxaY7jhBpsLUUuTnJRk?usp=sharing](https://drive.google.com/drive/folders/11fjCKphSId6UULxaY7jhBpsLUUuTnJRk?usp=sharing)

Can you reach my google drive? I used to amber forcefield and for ligand gaff2 via ambertool. I hope my convert files are true?

and I am trying to apply [http://www.mdtutorials.com/gmx/complex/02\_topology.html](http://www.mdtutorials.com/gmx/complex/02_topology.html)  
this tutorial but a bit of complicated for me.

I didn’t understand exactly what I need to add

```auto
; Include Position restraint file
#ifdef POSRES
#include "posre.itp"
#endif

<b>; Include ligand topology
#include "jz4.itp"</b>

; Include water topology
#include "./charmm36-mar2019.ff/tip3p.itp"

```

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 19, 2022, 6:11pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/4 "2022-02-19T18:11:43Z")

</div>

I passed it this error. I got it but know it says to me  
"“Fatal error:  
Your solvent group size (27762) is not a multiple of 28"”

what I need to do ? or which page I need to follow.

please help me…

---

<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:** [February 20, 2022, 2:43am UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/5 "2022-02-20T02:43:20Z")

</div>

This means there is something wrong with what you have selected as the solvent group for replacing ions. Please provide your complete command and all screen output, pasted from the terminal.

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 20, 2022, 2:25pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/6 "2022-02-20T14:25:18Z")

</div>

Dear Jalemkul,

I am sending you all my files with google driver and I got screenshot of all my terminals and I added to my commands as well (into the terminal.rft file)

I am adding to my google driver link.

Last error:

Fatal error:  
No line with moleculetype ‘System’ found the [molecules] section of file  
‘topol.top’

[https://drive.google.com/drive/folders/1jZv2dOSSkx2nB-xEdTAnIJmTNufO5Cgu?usp=sharing](https://drive.google.com/drive/folders/1jZv2dOSSkx2nB-xEdTAnIJmTNufO5Cgu?usp=sharing)

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 20, 2022, 3:51pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/7 "2022-02-20T15:51:11Z")

</div>

I got it! I added manually "System 195865 “” at the end of top file after that program added to ions.

like that

Selected 0: ‘System’  
Number of (28-atomic) solvent molecules: 6996

Processing topology  
Replacing 23 solute molecules in topology file (topol.top) by 23 NA and 0 CL ions.

Back Off! I just backed up topol.top to ./#topol.top.4#  
Using random seed -415048050.  
Replacing solvent molecule 957 (atom 26796) with NA  
Replacing solvent molecule 4902 (atom 137256) with NA  
Replacing solvent molecule 2796 (atom 78288) with NA  
Replacing solvent molecule 5557 (atom 155596) with NA  
Replacing solvent molecule 2017 (atom 56476) with NA  
Replacing solvent molecule 1628 (atom 45584) with NA  
Replacing solvent molecule 4258 (atom 119224) with NA  
Replacing solvent molecule 1382 (atom 38696) with NA  
Replacing solvent molecule 1177 (atom 32956) with NA  
Replacing solvent molecule 1114 (atom 31192) with NA  
Replacing solvent molecule 2558 (atom 71624) with NA  
Replacing solvent molecule 5301 (atom 148428) with NA  
Replacing solvent molecule 3647 (atom 102116) with NA  
Replacing solvent molecule 4286 (atom 120008) with NA  
Replacing solvent molecule 200 (atom 5600) with NA  
Replacing solvent molecule 6281 (atom 175868) with NA  
Replacing solvent molecule 6069 (atom 169932) with NA  
Replacing solvent molecule 6789 (atom 190092) with NA  
Replacing solvent molecule 6310 (atom 176680) with NA  
Replacing solvent molecule 3552 (atom 99456) with NA  
Replacing solvent molecule 2095 (atom 58660) with NA  
Replacing solvent molecule 4729 (atom 132412) with NA  
Replacing solvent molecule 2371 (atom 66388) with NA

and also I checked to my last .top file (ıt was there)  
[molecules]  
; Compound #mols  
DNA\_chain\_A 1  
mef 1  
SOL 65032  
System 195865  
NA 23

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 20, 2022, 3:52pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/8 "2022-02-20T15:52:01Z")

</div>

So thank you I will try to start MD. and sorry because I am really new user only one week so that is my bad

---

<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:** [February 20, 2022, 4:02pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/9 "2022-02-20T16:02:34Z")

</div>

I have not had a chance to review your files but adding “System” is certainly only a hack and not a true solution. You’re doing very complicated things and I would encourage caution. I can comment better later but as it is the weekend I am not quick with looking at these things.

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 20, 2022, 7:25pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/10 "2022-02-20T19:25:29Z")

</div>

I am looking forward your answer.

---

<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:** [February 21, 2022, 3:12am UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/11 "2022-02-21T03:12:14Z")

</div>

> [@isilayozturk](#):
>
> Fatal error:  
> No line with moleculetype ‘System’ found the [molecules] section of file  
> ‘topol.top’

The topology (before you added System in `[molecules]`) is fine. The problem is that you selected “System” as the group with which to replace molecules with ions. This is wrong. You should only ever select a contiguous group of solvent for replacing with ions, e.g. SOL. You may want to consult some simple tutorial material if this concept is not clear, e.g. [Lysozyme in Water](http://www.mdtutorials.com/gmx/lysozyme/index.html)

The files `solv.gro` and `topol.top` are correct and match in terms of their contents. Do not manually alter them, only allow GROMACS utilities (e.g. `genion` at this point) to change the contents of the topology.

---

<div class="post-metadata">

**Author:** ![isilayozturk](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@isilayozturk](https://gromacs.bioexcel.eu/u/isilayozturk)\
**Post date:** [February 21, 2022, 6:17pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/12 "2022-02-21T18:17:12Z")

</div>

I got it. thank u so much!

---

<div class="post-metadata">

**Author:** ![Hanoriega](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hanoriega/32/1562_2.png) [@Hanoriega](https://gromacs.bioexcel.eu/u/Hanoriega)\
**Post date:** [July 7, 2022, 12:05am UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/14 "2022-07-07T00:05:52Z")

</div>

Hello,

I am very new to GROMACS and in general this field, and was hoping you may help me. I have a similar error, but am still a bit confused on how I should correct it.

GROMACS: gmx grompp, version 2020.1-Ubuntu-2020.1-1  
Executable: /usr/bin/gmx  
Data prefix: /usr  
Working dir:  
Command line:  
gmx grompp -f em.mdp -p topol.top -c solvate.gro -o em.tpr

Ignoring obsolete mdp entry ‘ns\_type’

NOTE 1 [file em.mdp]:  
With Verlet lists the optimal nstlist is \>= 10, with GPUs \>= 20. Note  
that with the Verlet scheme, nstlist has no effect on the accuracy of  
your simulation.

Setting the LD random seed to -1437330375  
Generated 165 of the 1596 non-bonded parameter combinations

ERROR 1 [file topol\_Protein\_chain\_a.itp, line 22]:  
moleculetype Protein\_chain\_a is redefined

There was 1 note

* * *

Program: gmx grompp, version 2020.1-Ubuntu-2020.1-1  
Source file: src/gromacs/gmxpreprocess/toppush.cpp (line 1474)

Fatal error:  
There was 1 error in input file(s)

---

<div class="post-metadata">

**Author:** ![Sachin\_Rajpoot](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@Sachin\_Rajpoot](https://gromacs.bioexcel.eu/u/Sachin_Rajpoot)\
**Post date:** [August 27, 2023, 3:29pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/15 "2023-08-27T15:29:56Z")

</div>

ERROR 1 [file lig.itp, line 5]:  
moleculetype lig is redefined  
how did you solved this error?

---

<div class="post-metadata">

**Author:** ![caysonjh](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@caysonjh](https://gromacs.bioexcel.eu/u/caysonjh)\
**Post date:** [January 22, 2024, 7:49pm UTC](https://gromacs.bioexcel.eu/t/error-moleculetype-redefined/3692/16 "2024-01-22T19:49:08Z")

</div>

This may not be a solution to every case of this error, but I came across this same issue and the root problem was that I was running the grompp command on a mac file system, which is inherently case insensitive. I was trying to simulate a protein system that had 60 protein chains and thus had chains labeled ‘A’ and ‘a’. Those files were overwriting each other and leading to the same molecule being defined twice.

If this is the same issue you are having, I would suggest either configuring your file system to be case sensitive or moving the simulation to a remote machine that may use a case-sensitive file system.
