How renumber my gro file after removing one residue?

Hi guys. I am newbie in GROMACS. During Energy minimization I got belo error.
Steepest Descents:
Tolerance (Fmax) = 1.00000e+03
Number of steps = 50000
Step= 0, Dmax= 1.0e-02 nm, Epot= 5.83072e+18 Fmax= inf, atom= 2237
Step= 14, Dmax= 1.2e-06 nm, Epot= 5.83072e+18 Fmax= inf, atom= 2237
Energy minimization has stopped because the force on at least one atom is not
finite. This usually means atoms are overlapping. Modify the input
coordinates to remove atom overlap or use soft-core potentials with the free
energy code to avoid infinite forces.

Based on other posts I found I have to remove this residue. My problem is updating atom and residue number after removing solvent 2237. As my file is gro it is not possible to use UCSC CHIMERA.
I also run below command but got another error.
gmx editconf -f del.gro -o file-out.gro -resnr 2238
Fatal error:
Invalid line in del.gro for atom 76504:
10.38070 10.37520 7.70000

I would be thankful if any of you could help me.
regards

Hi @tahi67

What did you remove? A single water molecule?

Yes, it was a solvent; just a water molecule.

So you have to

i) remove the full molecule (not only the overlapping atom)
ii) update the second line of the gro file where the number of atoms is stored (take away 3 if this was a three-point water model)
iii) use gmx genconf -f inputstructure.gro -o outputstructure.gro -renumber to renumber the atoms (not completely sure this is mandatory but it doesn’t hurt)
i\v) update accordingly the topology (in this case taking away one water molecule from the total count)

The editconf command you are using is to renumber the residues, which is something different. I think the error you are getting is probably related to the fact that you didn’t change the atom numbers in the second line and so GROMACS is expecting N lines of atom descriptions but it gets N-3, as you removed a water molecule. As such, it is going to read the last line of the gro file as a xyz position for an atom but it finds three values which are the sides of the boxes, and so it throws an error and dies.

With the steps reported above you should be fine! :)

Dear obZehn, I did what you said and everything went well. BUT when I tried energy minimization I got the same error. I think my problem is more than removing one water molecule because of the mentioned energy (5.8307217e+18). MY structure is bilayer lipid membrane along with a peptide. My lipid is composed of 4DOPC:DOPG. Does negative charges of DOPG have an effect on energy minimization. however I neutralize the total system?

HERE IS ERROR:

Steepest Descents:
Tolerance (Fmax) = 1.00000e+03
Number of steps = 50000
Step= 0, Dmax= 1.0e-02 nm, Epot= 5.83072e+18 Fmax= inf, atom= 2237
Step= 14, Dmax= 1.2e-06 nm, Epot= 5.83072e+18 Fmax= inf, atom= 2237
Energy minimization has stopped because the force on at least one atom is not
finite. This usually means atoms are overlapping. Modify the input
coordinates to remove atom overlap or use soft-core potentials with the free
energy code to avoid infinite forces.
You could also be lucky that switching to double precision is sufficient to
obtain finite forces.

writing lowest energy coordinates.

Back Off! I just backed up em.gro to ./#em.gro.2#

Steepest Descents converged to machine precision in 15 steps,
but did not reach the requested Fmax < 1000.
Potential Energy = 5.8307217e+18
Maximum force = inf on atom 2237
Norm of force = inf

If you have just a few water molecules here and there then you can just remove them one by one and update the structure and the topology. However, if you have many, this will be a pain.

The charge per se is not a problem. You correctly neutralized the system (otherwise the grompp stage will fail because of net leftover charge), so or the overlap is due to a ion (VERY unlikely if you use gmx genion and selected water as molecule to substitute) otherwise there is no problem with ions here.

I think you have to focus on how you built the system. How did you build the membrane? How did you solvate? Is the overlap with lipids or with the peptide? The first thing it comes to my mind is that you used gmx solvate on the dry membrane and the tool put a lot of water molecules between the two leaflets. Did you visualize the system? Try to visualize it with only water active, so you see if it is present in regions of the system where it should not be. Where was the molecule you removed? Near the membrane surface or inside?

Dear obZehn, I am so thankful for your help. Actually I created my lipid system with packmol and now I prepare it with charmm and I have not faced any error. Now, my problem is related with nvt.mdp file as I am progressing with gromacs tutorial (KALP-15 in DPPC), at this step I have to change file because it contains a membrane around a peptide, whereas my peptide and membrane are separated and I have three groups and I do not know how I have to define two coupling groups in this file. PLEASE kindly help me. I attached nvt.mdp file as ref. thankyou
nvt.mdp (2.3 KB)

this is my gro file:

Makes sense. Tools like packmol are good but require a lot of attention as sometimes molecules can be close/overlap. For lipid bilayers, CHARMM-GUI is for sure the safest option, as the starting bilayer is already in a good shape for EM.

For the temperature coupling you can chose or to couple the whole system (just put tc-grps = System) and drop one value of ref-t and tau-t, or (probably better?) generate two coupling groups with gmx make_ndx. As your peptide is fully solvent exposed I would probably have all the lipids in one group and water/ions/peptide in the other, but here I might be mistaken. Once you generate and name the groups with gmx make_ndx you just have to reference the same groups in the mdp and pass the index with the flag -n to grompp!

Dear obZehn, I did below changes at nvt.mdp and run command and it went well, however when I did the same changes at npt.mdp I faced with an error.

tc-grps = system (at original file: tc-grps = Protein_DPPC Water_and_ions)

tau_t = 0.1

ref_t = 310 (at original file: 323)

These options remove motion of the protein/bilayer relative to the solvent/ions
nstcomm = 1
comm-mode = Linear
comm-grps = system (at original file: Protein_DPPC Water_and_ions)

an error after running of command: gmx mdrun -deffnm npt

Step 601 Pressure scaling more than 1%. This may mean your system is not yet equilibrated. Use of Parrinello-Rahman pressure coupling during equilibration can lead to simulation instability, and is discouraged.

while I used the original file in the tutorial and run for the files in tutorial section and this parameter (Parrinello-Rahman) was ok there, it resulted in an error in my case.

would you please help me what shall I do? thanks.

and for pressure

Try to change the parrinello-rahman barostat in favour of the c-rescale one which should be much much more robust in terms of pressure equilibration.