No line with moleculetype 'Water' found the [ molecules ] section of file 'xxx.top'

GROMACS version: 2022.3
GROMACS modification: with Plumed2-2.8.1

I used this command:

gmx genion -s genion_.tpr -p new.top -o fullsystem.pdb -pname Na+ -nname Cl- -conc 0 -neutral

Which gives me:

 :-) GROMACS - gmx genion, 2022.3-plumed_2.8.1 (-:

Executable:   /home/gridsan/ywang3/local/gromacs-2022.3/bin/gmx
Data prefix:  /home/gridsan/ywang3/local/gromacs-2022.3
Working dir:  /home/gridsan/ywang3/Project/Capping/FEP_test/test_genion
Command line:
  gmx genion -s genion_step5_174735_17042023.tpr -p new.top -o fullsystem_174735_17042023.pdb -pname Na+ -nname Cl- -conc 0 -neutral

Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Will try to add 2 Na+ ions and 0 Cl- ions.
Select a continuous group of solvent molecules
Group     0 (         System) has  6019 elements
Group     1 (          Other) has   124 elements
Group     2 (            LIG) has   124 elements
Group     3 (          Water) has  5895 elements
Group     4 (            SOL) has  5895 elements
Group     5 (      non-Water) has   124 elements
Select a group: 3
Selected 3: 'Water'
Number of (3-atomic) solvent molecules: 1965

Processing topology

-------------------------------------------------------
Program:     gmx genion, version 2022.3-plumed_2.8.1
Source file: src/gromacs/gmxpreprocess/genion.cpp (line 351)

Fatal error:
No line with moleculetype 'Water' found the [ molecules ] section of file
'new.top'

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

The water name in my file is WAT. I can achieve the genion without -p new.top, but once I involved this file, I encounter this problem.

I also observed that gromacs generates a tmp file temp.topzxZd1H, where in this file, below [ molecules ] is empty.

I guess there are some problems to read these files?

I also tried to use like dos2unix new.top, but it didn’t work, and I didn’t move files between OS.

“Water” is a default group that GROMACS tools recognize, but for genion, you need to explicitly refer to the [moleculetype] name of what you want to replace. So “Water” will not work in this instance. It appears from the list that SOL is the appropriate choice.

Hi, thanks for your reply.

I am still confused about the logic here. My initial files (.pdb and .top) contain “LIG” (the ligands) and “WAT” (the water), which are the same as the [moleculetype] name. So if I choose the [moleculetype] name in genion, it should be “WAT”, neither “SOL” nor “Water”.
The ndx list here doesn’t show “WAT” either.
I also tried to select “SOL” when genion, but it also raise an error by:

Fatal error:
No line with moleculetype 'SOL' found the [ molecules ] section of file
'new.top'

This is the error if I choose WAT or SOL as the answer:

gmx genion -s genion_step5_174735_17042023.tpr  -o fullsystem_174735_17042023.pdb -pname Na+ -nname Cl- -conc 0 -neutral -p fullsystem_174735_17042023.top 
               :-) GROMACS - gmx genion, 2022.3-plumed_2.8.1 (-:

Executable:   /home/gridsan/ywang3/local/gromacs-2022.3/bin/gmx
Data prefix:  /home/gridsan/ywang3/local/gromacs-2022.3
Working dir:  /home/gridsan/ywang3/Project/Capping/FEP_test/test_genion
Command line:
  gmx genion -s genion_step5_174735_17042023.tpr -o fullsystem_174735_17042023.pdb -pname Na+ -nname Cl- -conc 0 -neutral -p fullsystem_174735_17042023.top

Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Will try to add 2 Na+ ions and 0 Cl- ions.
Select a continuous group of solvent molecules
Group     0 (         System) has  6019 elements
Group     1 (          Other) has   124 elements
Group     2 (            LIG) has   124 elements
Group     3 (          Water) has  5895 elements
Group     4 (            SOL) has  5895 elements
Group     5 (      non-Water) has   124 elements
Select a group: WAT
Selected 3: 'Water'
Number of (3-atomic) solvent molecules: 1965

Processing topology

-------------------------------------------------------
Program:     gmx genion, version 2022.3-plumed_2.8.1
Source file: src/gromacs/gmxpreprocess/genion.cpp (line 351)

Fatal error:
No line with moleculetype 'Water' found the [ molecules ] section of file
'fullsystem_174735_17042023.top'

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------
gmx genion -s genion_step5_174735_17042023.tpr  -o fullsystem_174735_17042023.pdb -pname Na+ -nname Cl- -conc 0 -neutral -p fullsystem_174735_17042023.top 
               :-) GROMACS - gmx genion, 2022.3-plumed_2.8.1 (-:

Executable:   /home/gridsan/ywang3/local/gromacs-2022.3/bin/gmx
Data prefix:  /home/gridsan/ywang3/local/gromacs-2022.3
Working dir:  /home/gridsan/ywang3/Project/Capping/FEP_test/test_genion
Command line:
  gmx genion -s genion_step5_174735_17042023.tpr -o fullsystem_174735_17042023.pdb -pname Na+ -nname Cl- -conc 0 -neutral -p fullsystem_174735_17042023.top

Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Reading file genion_step5_174735_17042023.tpr, VERSION 2022.3-plumed_2.8.1 (single precision)
Will try to add 2 Na+ ions and 0 Cl- ions.
Select a continuous group of solvent molecules
Group     0 (         System) has  6019 elements
Group     1 (          Other) has   124 elements
Group     2 (            LIG) has   124 elements
Group     3 (          Water) has  5895 elements
Group     4 (            SOL) has  5895 elements
Group     5 (      non-Water) has   124 elements
Select a group: SOL
Selected 4: 'SOL'
Number of (3-atomic) solvent molecules: 1965

Processing topology

-------------------------------------------------------
Program:     gmx genion, version 2022.3-plumed_2.8.1
Source file: src/gromacs/gmxpreprocess/genion.cpp (line 351)

Fatal error:
No line with moleculetype 'SOL' found the [ molecules ] section of file
'fullsystem_174735_17042023.top'

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

Does it work for a non-PLUMED version of 2022.3? If not, please provide your topology files so we can take a look at them.