Range checking error (gmx covar)

GROMACS version: 2020.5
Dear,

I am trying to calculate the covariance for my system using gmx covar and C-alpha for the least squares fit. However, it gives me the following error:
“Range checking error (possible bug):
The provided structure file only contains 55028 coordinates, but coordinate index 3771 was requested for fitting. Make sure to update structure files and index files if you store only a part of the system”

While applying PBC, I save the whole system in the trajectory. Therefore, I do not understand why this error shows up.

Regards
Purvi

Hi
I can not understand what can be the problem. Can you provide more information on the command line, you used?
Thank you
Alessandra

Hi Alessandra,

Thank you for the reply.
I use the command “gmx covar -s md.tpr -f md.xtc” for calculating the covariance matrix. The system consists of a protein in a cubic box with tip3p water model.
It works if I run the same command on supercomputer where the production MD was performed but not on my personal system.

Kindest Regards
Purvi Gupta

This is a bug in src/gromacs/gmxana/gmx_covar.cpp. Line 92 is:
if (largestIndex < largestOkayIndex)
But should be:
if (largestIndex >= largestOkayIndex)
If you installed Gromacs yourself, you can change this yourself, recompile and install.

Dear Hess,

Thank you so much. It works now. :)

Kindest Regards
Purvi Gupta

Hi,

Recently in the GROMACS 2025.2 version, during COVAR analysis, i encountered the same error, which is as follows:

My command line: gmx covar -s protein_whole.gro -f trajector_conv_forlig_final_whole.xtc -b 110 -e 490 -tu ns -o eigenvalues_NAP_whole.xvg -av average_structure_NAP_whole.pdb -v eigenvectors_NAP_whole.trr -xpma covapic_NAP_whole.xpm -n index_classification.ndx

Program: gmx covar, version 2025.2
Source file: src/gromacs/gmxana/gmx_covar.cpp (line 108)
Function: void gmx::{anonymous}::throwErrorIfIndexOutOfBounds(gmx::ArrayRef, int, const std::string&)

Range checking error (possible bug):
The provided structure file only contains 30872 coordinates, but coordinate
index 31684 was requested for fitting. Make sure to update the structure files and
index files if you store only a part of your system.

My trajectory and structure are created out of the same index group. Please let me know, how to fix this.

If you reduced you trajectory and structure file using an index group, you should create a new index file for that new structure file.

Thanks for the reply. I will try it out.