Atom index in position_restraints out of bounds

GROMACS version: 2020
GROMACS modification: No

This error has been reported on several forums and I tried to the suggestions. However, the error persists.

I have a dimer for which I need to restrain a certain portion of in both chains. Since I am using GROMACS for a long time, I know that the position restraint file should be created for each chain. I did that.

The problem is that the grompp is accepting posres files for Chain A but throws an error for chain B. I tried several ways to create the index file and the position restraint separately for each of the chains and the desired atoms, but nothing seems to work.

My topology file section looks like this

; Include chain topologies
#include “topol_Protein_chain_A.itp”

;; Include CRD Position restraint file for Chain A
#ifdef POSRES_CRD_A
#include “posre_crd_chain_A.itp”
#endif

#include “topol_Protein_chain_B.itp”

; Include CRD Position restraint file for Chain B
#ifdef POSRES_CRD_B
#include “posre_crd_chain_B.itp”
#endif

#include “topol_Ion_chain_A2.itp”
#include “topol_Ion_chain_B2.itp”
#include “topol_Protein_chain_A3.itp”
#include “topol_Protein_chain_B3.itp”

; Include water topology
#include “./charmm36-jul2022.ff/spce.itp”

#ifdef POSRES_WATER
; Position restraint for each water oxygen
[ position_restraints ]
; i funct fcx fcy fcz
1 1 1000 1000 1000
#endif

; Include topology for ions
#include “./charmm36-jul2022.ff/ions.itp”

[ system ]
; Name
2 Protein in water

[ molecules ]
; Compound #mols
Protein_chain_A 1
Protein_chain_B 1
Ion_chain_A2 1
Ion_chain_B2 1
Protein_chain_A3 1
Protein_chain_B3 1
SOL 111424
NA 48

İ would appreciate your suggestions

Thank you

There are no details of your error, but isn’t the issue simply that you use system absolute atom indices instead of molecule local atom indices?

Dear Hess
Thank you for answering the query.
The error thatI am getting is


ERROR 1 [file posre_crd_chain_B.itp, line 5]:
Atom index (17304) in position_restraints out of bounds (1-9143).
This probably means that you have inserted topology section
“position_restraints”
in a part belonging to a different molecule than you intended to.
In that case move the “position_restraints” section to the right molecule.

This atom index is from the protein.gro file that I generated using pdb2gmx.

I am not sure if by local indices, you are referring to the atom indices in the pdb file.

My other question is why is the first chain accepted and the second chain restraints are not accepted?

Thank you again.

Ayesha

The issue is exactly what I guessed in my first answer. You need to provide atom indices that start counting at 1 in each molecule. The restraints in the topology are set up per molecule type, not system wide.

Dear Hess

Thank you for your reply.

I was a bit confused before writing the mail. But after your previous mail, I did some searching and found some old posts on gromacs forum also.

Thank you for your time and help
.
Best regards
Ayesha

Hi, excuse me.
How were you able to solve it?