# How to solve this issue for PCA analysis?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825>\
**Category:** User discussions\
**Created:** [August 6, 2024, 6:34am UTC](https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825 "2024-08-06T06:34:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iqramuneer](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqramuneer](https://gromacs.bioexcel.eu/u/iqramuneer)\
**Post date:** [August 6, 2024, 6:34am UTC](https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825/1 "2024-08-06T06:34:08Z")

</div>

GROMACS version: 2021  
GROMACS modification: Yes/No  
Here post your question  
Hi i am using gromacs 2021. i want to perform pca analysis but getting this error.  
“Range checking error (possible bug):  
The provided structure file only contains 59387 coordinates, but coordinate  
index 3864 was requested for fitting. Make sure to update structure files and  
index files if you store only a part of your system.”  
please help me out if this could be resolve.

---

<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 6, 2024, 9:25am UTC](https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825/2 "2024-08-06T09:25:32Z")

</div>

Could you share what commands you entered to get to this error?

---

<div class="post-metadata">

**Author:** ![iqramuneer](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqramuneer](https://gromacs.bioexcel.eu/u/iqramuneer)\
**Post date:** [August 6, 2024, 11:34am UTC](https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825/3 "2024-08-06T11:34:25Z")

</div>

i tried these two  
gmx covar -s md\_100.gro -f md\_noPBC.xtc -o eigenvalues.xvg -v eigenvectors.trr -xpma covar.xpm  
gmx covar -s md\_100.tpr -f md\_noPBC.xtc -o eigenvalues.xvg -v eigenvectors.trr -xpma covar.xpm  
both times same error.

---

<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 6, 2024, 12:10pm UTC](https://gromacs.bioexcel.eu/t/how-to-solve-this-issue-for-pca-analysis/9825/4 "2024-08-06T12:10:09Z")

</div>

If you’re following the [manual](https://manual.gromacs.org/current/reference-manual/analysis/dihedral-pca.html), the gmx covar step involves generating “a reference file ([tpr](https://manual.gromacs.org/current/reference-manual/file-formats.html#tpr), [gro](https://manual.gromacs.org/current/reference-manual/file-formats.html#gro), [pdb](https://manual.gromacs.org/current/reference-manual/file-formats.html#pdb) etc.) containing the same number of “atoms” as the new [trr](https://manual.gromacs.org/current/reference-manual/file-formats.html#trr) file, that is for n dihedrals you need 2n/3 atoms (rounded up if not an integer number)”. So you can take any pre-existing .gro file and delete all but 2n/3 atoms (doesn’t matter which atoms as long as the number of atoms match), then use that .gro file for the gmx covar command along with the -nofit option.

Also, the -f option should be the .trr you generated from the previous step
