# How to extract the Potential Energy of Protein and Ligand from the Entire System after MD Simulation

**URL:** <https://gromacs.bioexcel.eu/t/how-to-extract-the-potential-energy-of-protein-and-ligand-from-the-entire-system-after-md-simulation/8321>\
**Category:** User discussions\
**Created:** [February 12, 2024, 1:25pm UTC](https://gromacs.bioexcel.eu/t/how-to-extract-the-potential-energy-of-protein-and-ligand-from-the-entire-system-after-md-simulation/8321 "2024-02-12T13:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magic\_corn](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@magic\_corn](https://gromacs.bioexcel.eu/u/magic_corn)\
**Post date:** [February 12, 2024, 1:25pm UTC](https://gromacs.bioexcel.eu/t/how-to-extract-the-potential-energy-of-protein-and-ligand-from-the-entire-system-after-md-simulation/8321/1 "2024-02-12T13:25:20Z")

</div>

GROMACS version: 2022.2  
GROMACS modification: No

Hello, dear GROMACS users!

I would appreciate any assistance for a GROMACS beginner.  
I have constructed the entire system with a cell membrane + water + ligand + protein, and then proceeded with the MD simulation using the following mdp.

integrator = md  
dt = 0.002  
nsteps = 500000  
nstxout = 50000  
nstvout = 50000  
nstfout = 50000  
nstcalcenergy = 100  
nstenergy = 1000  
nstlog = 1000  
;  
cutoff-scheme = Verlet  
nstlist = 20  
rlist = 1.2  
vdwtype = Cut-off  
vdw-modifier = Force-switch  
rvdw\_switch = 1.0  
rvdw = 1.2  
coulombtype = PME  
rcoulomb = 1.2  
;  
tcoupl = Nose-Hoover  
tc\_grps = SOLU MEMB SOLV  
tau\_t = 1.0 1.0 1.0  
ref\_t = 303.15 303.15 303.15  
;  
pcoupl = Parrinello-Rahman  
pcoupltype = semiisotropic  
tau\_p = 5.0  
compressibility = 4.5e-5 4.5e-5  
ref\_p = 1.0 1.0  
;  
constraints = h-bonds  
constraint\_algorithm = LINCS  
continuation = yes  
;  
nstcomm = 100  
comm\_mode = linear  
comm\_grps = SOLU\_MEMB SOLV

Afterwards, to extract the energy specific to the protein and ligand rather than the entire system, I performed the steps as follows.

1. gmx make\_ndx -f step8\_601.tpr -o index\_2.ndx  
(Here, select atoms for protein and ligand to create a new index.)
2. gmx trjcat -f step8\*.trr -o combined.trr
3. gmx convert-tpr -s step8\_601.tpr -n index\_2.ndx -o energy\_tpr.tpr
4. gmx trjconv -s energy\_tpr.tpr -f combined.trr -n index\_2.ndx -o group\_trajectory.trr
5. gmx mdrun -s energy\_tpr.tpr -rerun group\_trajectory.trr -deffnm rerun\_specific -nb gpu
6. gmx eneconv -f rerun\_specific.edr -o final\_energy.edr
7. gmx energy -f final\_energy.edr -o energy\_data.xvg

Could there be a problem with my method?

I would be grateful for your response.

---

<div class="post-metadata">

**Author:** ![Karis](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@Karis](https://gromacs.bioexcel.eu/u/Karis)\
**Post date:** [February 14, 2024, 8:56am UTC](https://gromacs.bioexcel.eu/t/how-to-extract-the-potential-energy-of-protein-and-ligand-from-the-entire-system-after-md-simulation/8321/2 "2024-02-14T08:56:32Z")

</div>

It’s difficult to tell from just the commands alone, was there any specific issue you ran into when running the commands that you needed help with?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 14, 2024, 11:41am UTC](https://gromacs.bioexcel.eu/t/how-to-extract-the-potential-energy-of-protein-and-ligand-from-the-entire-system-after-md-simulation/8321/3 "2024-02-14T11:41:27Z")

</div>

> [@magic\_corn](#):
>
> Could there be a problem with my method?

The only problem I will mention is not a technical one, but a theoretical one. Extracting individual energies of various components has no physical meaning. No force field is parametrized in such a way that the absolute potential energies are targeted. You can calculate the quantity as shown, but the results will not tell you anything.
