# Fatal error: lnvalid line in complex.gro for atom 23403 during DEFINING UNIT CELL

**URL:** https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841
**Category:** User discussions
**Created:** [August 8, 2024, 3:54am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841 "2024-08-08T03:54:27Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 8, 2024, 3:54am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/1 "2024-08-08T03:54:27Z")

</div>

GROMACS version:2022.1  
GROMACS modification: Yes/No  
Here post your question :  
Protein-Ligand Complex-Define Box and Solvate:

during the command:

gmx editconf -f complex.gro -o newbox.gro -bt dodecahedron -d 1.0

the below fatal error occurs: Invalid line in complex.gro for atom 23403:

The gro file that I couldn’t protein correctly using gmx pdb2gmx -f c1.pdb -o c1.gro -ter creates the gro file correctly when I use gmx pdb2gmx -f c1.pdb -o c1.gro -ter -ignh, and also creates the complex.gro file according to the instructions.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/5/5a33f76dbff3d815be0a8b3978d55b76c88f281d.png)

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 8, 2024, 4:47am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/3 "2024-08-08T04:47:56Z")

</div>

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1DVHJpSVhRy7DtwCpbdZJ-ISVzDhQNIZW%2Fview%3Fusp%3Dsharing&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1DVHJpSVhRy7DtwCpbdZJ-ISVzDhQNIZW%2Fview%3Fusp%3Dsharing&ifkv=AdF4I76YotNNdhB9F-GPq2-Zfv3qZ7JFoAE4V4yY4eQGIRQrud7o0D5eiCdoqVXEOM0mBpVD4oSxeQ&osid=1&passive=1209600&service=wise&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S1543820940%3A1723092415951483&ddm=0)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1DVHJpSVhRy7DtwCpbdZJ-ISVzDhQNIZW%2Fview%3Fusp%3Dsharing&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1DVHJpSVhRy7DtwCpbdZJ-ISVzDhQNIZW%2Fview%3Fusp%3Dsharing&ifkv=AdF4I76YotNNdhB9F-GPq2-Zfv3qZ7JFoAE4V4yY4eQGIRQrud7o0D5eiCdoqVXEOM0mBpVD4oSxeQ&osid=1&passive=1209600&service=wise&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S1543820940%3A1723092415951483&ddm=0)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

Hi the above link can be viewed by anyone, complex.gro and protein.gro file to discover fatal error:

Invalid line in complex.gro for atom 23403 appears

Thanks:)

---

<div class="post-metadata">

### Author: ![Karis](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@Karis](https://gromacs.bioexcel.eu/u/Karis)
#### Post date: [August 16, 2024, 7:27am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/4 "2024-08-16T07:27:13Z")

</div>

Hi Louis, the files still require permission to access

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 7:45am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/5 "2024-08-16T07:45:33Z")

</div>

> **[complex.gro](https://drive.google.com/file/d/1DVHJpSVhRy7DtwCpbdZJ-ISVzDhQNIZW/view?usp=sharing)**
>
> Google Drive file.

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1APEYMWQTUo0_TYWbZqUEtWA6MZmd5bBH%2Fview%3Fusp%3Ddrive_link&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1APEYMWQTUo0_TYWbZqUEtWA6MZmd5bBH%2Fview%3Fusp%3Ddrive_link&ifkv=Ab5oB3r56HZ-vZfwsYrRSCDP0_eY7tHhOPM3WbhxL6qZIhxb9CCwHgRvpoxzdwz9UVjBDmqXg2Ck-g&osid=1&passive=1209600&service=wise&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S1159719735%3A1723794336862678&ddm=0)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

I changed the permissions.

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 7:46am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/6 "2024-08-16T07:46:33Z")

</div>

thank you

---

<div class="post-metadata">

### Author: ![Karis](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@Karis](https://gromacs.bioexcel.eu/u/Karis)
#### Post date: [August 16, 2024, 7:54am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/7 "2024-08-16T07:54:20Z")

</div>

Does it work if you remove the empty line you highlighted separating the 2 molecules?

---

<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: [August 16, 2024, 7:55am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/8 "2024-08-16T07:55:52Z")

</div>

As well as the empty line before the box dimensions.

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 8:17am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/10 "2024-08-16T08:17:51Z")

</div>

thank you

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 8:25am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/11 "2024-08-16T08:25:15Z")

</div>

After I followed the tutorial on solvation and added ions, I ran gmx grompp -f em.mdp -c solv\_ions.gro -p topol.top -o em.tpr with the fatal error: the largest distance between excuded atoms is 6.113nm. Thank you.

 ![QQ图片20240816162249](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/5/5dcf75d53ef1c1c6d8d7f459967eed578b55f641.jpeg)

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 8:35am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/12 "2024-08-16T08:35:15Z")

</div>

Thank you.

---

<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: [August 16, 2024, 8:35am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/13 "2024-08-16T08:35:44Z")

</div>

If you visualize the system in VMD, does the periodic box look correct? Use the options in the `Periodic` tab in `Graphical Representations`. Are there are gaps between the periodic cells or overlaps between them?

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 9:26am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/14 "2024-08-16T09:26:04Z")

</div>

After I did both of the following correctly  
gmx editconf -f complex.gro -o newbox.gro -c -d 1.2 -bt cubic  
gmx solvate -cp newbox.gro -cs spc216.gro -o solv.gro -p topol.top  
, error running gmx grompp -f ions.mdp -c solv.gro -p topol.top -o ions.tpr.

 ![1](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/1/1cc4c89bcbe7a653c15b865443e91ee9947c6eea.png)  
 ![2](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/3/3c93f59de9e4f8b9c8b005474954347d44dc0738.png)  
 ![1](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/1/1cc4c89bcbe7a653c15b865443e91ee9947c6eea.png)  
Here are the related files including topol.top, newbox.gro, ions.mdp.

> **[gromacs20240816.zip](https://drive.google.com/file/d/1xM-pd5oyjZo9ttj8sk-pT-qfULXsm8rn/view?usp=sharing)**
>
> Google Drive file.

Thank you

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 9:32am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/15 "2024-08-16T09:32:03Z")

</div>

Thanks. I’ll check it out.

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [August 16, 2024, 10:42am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/16 "2024-08-16T10:42:23Z")

</div>

In vmd it shows the following,Thanks.

 ![12](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/f/f95c643c031396c0e0cfe43c4063c5406400068d.jpeg)

---

<div class="post-metadata">

### Author: ![Karis](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@Karis](https://gromacs.bioexcel.eu/u/Karis)
#### Post date: [August 16, 2024, 12:25pm UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/17 "2024-08-16T12:25:51Z")

</div>

I’d found a [post](https://gromacs.bioexcel.eu/t/the-largest-distance-between-excluded-atoms-is-1-725-nm-which-is-larger-than-the-cut-off-distance/4153) where someone encountered a similar issue, apparently it’s one specific to the version of gromacs you’re using

---

<div class="post-metadata">

### Author: ![Louis\_dai](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Louis\_dai](https://gromacs.bioexcel.eu/u/Louis_dai)
#### Post date: [September 13, 2024, 9:13am UTC](https://gromacs.bioexcel.eu/t/fatal-error-lnvalid-line-in-complex-gro-for-atom-23403-during-defining-unit-cell/9841/18 "2024-09-13T09:13:38Z")

</div>

thanks
