How do I print out the energy of solute from edr file?

GROMACS version:2023.3
GROMACS modification: No
How do I print out the energy of solute during the production run in alchemical transformation? I tried
gmx energy -f myfile.edr -n myfile.ndx -o solE.xvg
But -n option is not available. Is there any other way to access this information during alchemical transformation? I can only access total energy from myfile.edr. Thank you very much.

The energy of a molecule is not something that is computed or saved.

1 Like

If you have the trajectory, you can use gmx trjconv to generate a subset of it that corresponds to the solute, and “fake” .top/.pdb files that only contain the solute.

Then you can perform a rerun with a modified .mdp file (set a regular Coulomb cut-off, update the nblist each step, and set the desired lambda value) which will produce a new .edr file. But mind this is only doable with the frames you saved in your .xtc, so you’re losing quite some data (even if it’s mostly correlated).

1 Like

If I understand correctly, I cannot retrieve the numbers from the previous run, but I need to generate a new set of numbers (not identical). This will be a valuable learning experience for me. I plan to experiment with trjconv to see if I can obtain the desired information for the solute. Thank you very much for the advice.

Note that convert-tpr can be used rather than making changes to coordinates and topologies to write a new .tpr file that only contains the subset of atoms of interest.

1 Like

Right, good point. I was originally thinking of gromologist’s automated rerun feature but I figured it’s not trivial to do with arbitrary alchemical intermediates (will soon be though, if someone finds that useful).

1 Like