Atom index Out of bounds

GROMACS version: 5.1.2
GROMACS modification: Yes/No
Here post your question
This is most common error I received while simulating protein dimers. Gromacs error help page says “to look into topol file and check the [moleculetype] section”. Here is my topol file - I tried checking it twice-thrice but couldn’t find error. Kindly help me to figure out what’s wrong in my topol.top file?

;
; File ‘topol.top’ was generated
; By user: root (4215)
; On host: ycn215.en.yuva.param
; At date: Wed Aug 5 21:32:07 2020

;
; This is a standalone topology file
;
; Created by:
; :-) GROMACS - gmx pdb2gmx, VERSION 5.1.2 (double precision) (-:
;
; Executable: /opt/app/GROMACS/gromacs-5.1.2/bin/gmx_mpi_d
; Data prefix: /opt/app/GROMACS/gromacs-5.1.2
; Command line:
; gmx_mpi_d pdb2gmx -f 4j72_New.pdb -o 4j72_processed.gro -ignh -ter
; Force field was read from current directory or a relative path - path added.
;

; Include forcefield parameters
#include “./charmm36-mar2019.ff/forcefield.itp”

; Include chain topologies
#include “topol_Protein_chain_A.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_A.itp”
#endif

#include “topol_Protein_chain_B.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_B.itp”
#endif

; Strong position restraints for InflateGRO
#ifdef STRONG_POSRES
#include “strong_posre.itp”
#endif

; Include POPE chain topology
#include “pope.itp”

; Include water topology
#include “./charmm36-mar2019.ff/tip3p.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-mar2019.ff/ions.itp”

[ system ]
; Name
Protein

[ molecules ]
; Compound #mols
Protein_chain_A 1
Protein_chain_B 1
POPE 289

Hi,
could you report which error exactly you got?
I notice that you have 2 protein chains and POPE lipids in your system, but not water in your topol file. If you have water molecules in your system ( in the structure file, gro or pdb), you should have them also in topol.top file.

Best regards
Alessandra

Hi Alessandra,
Thank for the message. As you pointed out, I have done adding POPE lipid to my protein with Inflategro perl script. Right after that, I am trying to minimize the system so to begin with shrinking. (According to Gromacs tutorials- KALP)

Here is the error I am getting :

Fatal error:
[ file strong_posre.itp, line 898 ]:
Atom index (4781) in position_restraints out of bounds (1-4779).
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.
For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors

Strong posres were added to Chain A.

Thanks,
Sumedha

Did you visit the link in the error message? It directly addresses your situation: http://www.gromacs.org/Documentation/Errors#Atom_index_n_in_position_restraints_out_of_bounds

If you have two chains, you need to have two different restraint files, not one.

Yes sir. I have visited the error documentation. Likely, changed my topol file and [molecule section].
I have two posre.itp files for two chains (“posre_Protein_chain_A.itp” and “posre_Protein_chain_B.itp”). And I have added strong_posre on Chain A only - file for which is “strong_posre.itp”.
I only understood that there is difference in numbering in gro and itp files.
But how to eliminate this error is still unclear.
Help would be much appreciated. Thanks in advance

Regards,
Sumedha

if strong_posre.itp is for chain A, you have placed the #include statement in the wrong place, since it follows the topology for chain B. You should instead have:

#include “topol_Protein_chain_A.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_A.itp”
#endif

; Strong position restraints for InflateGRO
#ifdef STRONG_POSRES
#include “strong_posre.itp”
#endif

#include “topol_Protein_chain_B.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_B.itp”
#endif

Thank you. It worked. i want to place strong posre on chain B too.
I tried
; chain A topology
#include “topol_Protein_chain_A.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_A.itp”
#endif
#ifdef STRONG_POSRES
#include “strong_posre_A.itp”
#endif
; chain B topology
#include “topol_Protein_chain_B.itp”
; Include Position restraint file
#ifdef POSRES
#include “posre_Protein_chain_B.itp”
#endif
#ifdef STRONG_POSRES
#include “strong_posre_B.itp”
#endif

But it still gives me error for “Atom index out of bounds”. Should I use define keyword separately for both strong_posre files in mdp file ?

Thanks,
Sumedha

No, what this means is you have generated an incorrect strong_posre_B.itp file. You must supply genrestr with a coordinate file that starts from 1 for any species to be restrained. If you have multiple chains, you have to renumber them in separate coordinate files. This is a major limitation of genrestr that people often encounter.

1 Like

Thanks ! Working on it.

can u please tell me how u solve the issue … i face also same error

@Fayaz start a new thread with details