I runned MD using Gromacs to simulate interaction between protein and ligand. now I want to calculate energy binding between a special residue ( like as His 145) and Ligand. how can I solve this problem? which command should I use?
You don't need g_enemat. If you use correct energygrps, the LJ and Coulombic terms are written to the .edr file and you can extract them with g_energy.
Note, though, that this quantity is not a "binding energy" - it is an interaction energy, and it may or may not yield a physically useful quantity.
You should have done it before running your simulation. In the *.mdp file, write
energygrps = group1 group2 group3 ..
(for example group1 can be define as the name of your Ligand in the *.ndx file: See also Gromacs website and search for energygrps for more details.)
and then run you simulation. After that in *.edr output you can find different interaction energy for each group.
You can rerun you simulation for short time (like 50ns) and see if the energy data have equilibrated (I assume your system has equilibrated). You can use g_analyze for making block errors and see if a short simulation can give you enough sampling.
However, for finding correct and useful free energy profile you need to perform PMF which is expensive and much more difficult.
g_enemat extracts an energy matrix from the energy file (-f). With -groups (groups.dat as input file) a file must be supplied with on each line a group of atoms to be used. For these groups matrix of interaction energies will be extracted from the energy file by looking for energy groups with names corresponding to pairs of groups of atoms, e.g. if your -groups file contains:
You don't need g_enemat. If you use correct energygrps, the LJ and Coulombic terms are written to the .edr file and you can extract them with g_energy.
Note, though, that this quantity is not a "binding energy" - it is an interaction energy, and it may or may not yield a physically useful quantity.
In order to use g_enemat, you should first have done what I had told you. you should run the simulation with energygrps = group1 group2 group3in the *.mdp file.
But if you have done this, you can use either g_enemat or g_energy.
In addition to what correctly Justin said, g_energy will give you back the potential energy which is not the binding energy. To calculate the contribution of a particular residue to the binding free energy you have to exploit different approaches, going from accurate theories (i.e. TI, FEP) to less accurate theories (i.e. MM/PBSA MM/GBSA). In first approximation you can try the Computational Alanine Scanning (CAS), by which you mutate your residue in Alanine. In few words, you can run MM/PBSA on the wild system and the on the Alanine mutated one. The DDG = DG[wild] - DG[mutate] should give you the contribution of your residue in binding your ligand. For more information refers to this publications: