Extracting energy of ligand from md simulation

Hi, I have ran a MD simulation with a protein in a box of water molecules. I was wondering if it would be possible for me to extract the energies of just the protein, without contribution from water molecules.

Thank you.

You would have to extract the protein from the .tpr file with gmx convert-tpr and create a matching subset trajectory of protein-only coordinates with gmx trjconv, then use mdrun -rerun to recalculate energies. There is no point in doing this as the energy is not physically meaningful.