Using gmx to calculate distances between two

GROMACS version: gromacs/2020-5-openmpi-4.1.1-cuda-11.5.0-mkl-2021.4.0
GROMACS modification: Yes/No
I am tyring to use GROMACS to measure distances in my movie PDB file. It keeps giving me the same error that atoms are missing even though I verified that they are not or the atoms do not evaluate into even number of positions. What can I do in this case?

Could you share the exact command you used along with copy-pasting all the outputs (errors, warnings, notes, etc.) that you got from the command?

Of course,

I put the commands

  • $module load gromacs/2020-5-openmpi-4.1.1-cuda-11.5.0-mkl-2021.4.0
  • $ gmx distance -f ph0-traj.pdb -s ph0-traj.pdb -oall
  • resid 256 and name CA
  • Selection ‘resid 256 and name CA’ parsed >
  • resid 291 and name C
  • Selection ‘resid 291 and name C’ parsed >

And then I get the results:

Inconsistency in user input: Selection ‘resid 256 and name CA’ does not evaluate into an even number of positions (there are 1 positions).

When using selection, gromacs is trying to return the distance between all the objects in a given line. Se with the selection you entered, it would try to return the distance between all the objects in ’ resid 256 and name CA’ and the distance between all the objects in ‘resid 291 and name C’, and these being single atoms, it throws the error. To specify that the distance you want is between those 2 atoms, you need to include them in the same line using a ‘plus’, so ‘resid 256 and name CA plus resid 291 and name C’.

Of course, this can get really complicated really quickly with more complex selections, so the more straightforward way to do this is to use gmx make_ndx to add the atoms you want to specific groups so that you can just choose those groups whenever you need to analyze them in this way.

Thank you so much for the suggestion. I will try it out and let you know if it works. Thank you so much!

1 Like