Having the structure composed of C-alpha atoms and the corresponded trajectory I try to perform the following steps to fix the PBC of the trajectory for PCA analysis of this system.
I opened in VMD the resulted trajectory and visually everything looks OK without any pbc artifacts.
However performing PCA in the first step
gmx covar -s ./reference_CA.pdb -f ./2.trr -o ./eigenval.xvg
there is always the same error:
Program: gmx covar, version 2021.4-Ubuntu-2021.4-2
Source file: src/gromacs/gmxana/gmx_covar.cpp (line 327)
Fatal error:
Invalid periodic boundary conditions: Only triclinic boxes with the first
vector parallel to the x-axis and the second vector in the xy-plane are
supported.
Thank you very much for your kind repply !
Actually I do not have a pdb since this was calculated in amber ! I’ve used this protocol many times and this is the first time when I have an issue …
Would it be it possible to fix pbc in the pdb file using some gromacs utility like editconf ??
If you use, e.g., gmx dump you should be able to find the box dimensions of the first frame in the trajectory. Hopefully it would work if you use that as box dimensions with gmx editconf.
If you’ve used this protocol before and it has worked, you could first compare the pdb file you are using now to those that have worked before. If there is no apparent difference in the PBC data there is probably another issue.
Actually I could not find a difference … I also tried to align reference along the principal axe using editconf -princ but it does not change anything. I also tried several different references and the error is persist. May be there is a bug in my version of gromacs ?
I think (but may be wrong) it will usually look rectangular in VMD. It might be more informative to check the actual values of the periodic box shape in the trajectory. gmx dump can be used for that.
I must admit I’m not sure about the PDB file. I guess it would be the CRYST1 field with dimensions and angles.
To get the data from the .trr you can use gmx dump -f 2.trr | less and then you can view all the contents of the file (if it’s called 2.trr). For every frame, the PBC info is found in the box (3x3) field. For example,
That’s probably the explanation then. In some step (possibly going from Amber to GROMACS) the box vectors have been messed up. All those values < 1e-13 should almost certainly be 0. I think the correct box vectors would have been:
You might be able to find where the error occurred by closely checking the Amber input and output (I don’t know how) as well as the values after converting to GROMACS trr before any other treatment (e.g., PBC treatment and centering).
Okay, thank you very much !
Actually if I do not do any PBC threatmenat of the trajectory using gmx trajconv the values are still the same
natoms= 188 step= -1 time=2.1150000e+03 lambda= 0
box (3x3):
box[ 0]={ 1.09726e+01, -1.76640e-14, 1.82731e-15}
box[ 1]={ 1.35400e-14, 1.10870e+01, -7.23157e-15}
box[ 2]={-1.16679e-14, 9.82559e-15, 1.47502e+01}
So this is the first time when I have this issue ( the trr file was produced via cpptraj software of amber tools anyway … )
I guess there is some kind of dump tool for Amber as well. It would be interesting to see if the box vectors are correct in the Amber trajectory. My guess would be that it is a float precision problem and that either Amber or cpptraj have turned the 90 degree angles into almost 90 degree angles.
Right, thank you very much ! I believe it could be related to using different version of cpptraj (with parallelisation) for this conversion. I will check it now ;-)
well checked it extensively. indeed sometimes the bug persist. may be there are some gromacs tools which cool reset completely PBC vectors from any trr file ?
There are no tools that I can think of. It would be possible to write one suitable for this case, but in general it is risky modifying the periodic box of an existing trajectory.
There are two solutions to this, as I see it:
Fix the conversion tool (cpptraj) so that such obvious float precision errors are avoided, e.g., set the box vector value to 0 when it’s < 1e-13.
Set a tolerance in the GROMACS tools (at least gmx covar) so that such cases do not trigger this fatal error. I guess that the tool would function normally.
Both these solutions would take a while before they are available to you.
No, not yet at least. If you want to experiment, I don’t think it would be difficult for you to find where in the code this check is located and introduce a tolerance instead of a strict check. You could even try disabling the check completely to see how that would work for your system.