# How to calculate mindist for complex systems?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849>\
**Category:** User discussions\
**Created:** [September 21, 2020, 9:05pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849 "2020-09-21T21:05:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![busrasavas](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@busrasavas](https://gromacs.bioexcel.eu/u/busrasavas)\
**Post date:** [September 21, 2020, 9:05pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/1 "2020-09-21T21:05:09Z")

</div>

GROMACS version:2020  
GROMACS modification: No

Hi,  
I am working with a system that includes two different proteins, DNA, and a ligand. My simulation has reached 500 ns and all the analysis with GROMACS tools such as RMSD, RMSF, radius of gyration and energies look normal except for mindist. Below, you can find the command I used and the output of it after running gmx mindist on my system. As you can see, it looks like that my system “sees itself” through the periodic boundary conditions multiple times during my simulation. The message I receive from gmx mindist indicates that the observed minimum distance across the periodic boundary condition is detected between the two atoms (red and white spheres on the figure) that reside at the protein-ligand interface of my system. As, this did not make sense to me, I wanted to consult you whether I am using the command in a proper manner:

$gmx mindist -f complex\_md.xtc -s complex\_md.tpr -od md\_mindist.xvg -pi -n index.ndx  
28 (Protein | DNA | ligand)

 ![mindist](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/879c909d6c07fe34af1ac7b6a30bc140232314fd.png)

Also, I encountered the same situation whether I chose protein or protein-DNA-ligand for the group choice.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [September 22, 2020, 8:01am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/2 "2020-09-22T08:01:38Z")

</div>

Hi,  
gmx mindist calculates the minimum distance between two periodic image. In your case the minimum distance is between protein-DNA-ligand system and its image and it is a distance between two atoms (one belongs to protein-DNA-ligand and one to the corresponding image). To visualize such a distance you have to visualize the box and its neighbour image. I do not know if pymol allows this, if not, you can use VMD.  
The picture you show it is not representative since white and red atoms belong to the system (image).

Is the reported distance closer to the values of non-bonded cut-off than your original box was too small? Please note that distances are reported in nm

Best regards  
Alessandra

---

<div class="post-metadata">

**Author:** ![busrasavas](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@busrasavas](https://gromacs.bioexcel.eu/u/busrasavas)\
**Post date:** [September 22, 2020, 6:19pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/3 "2020-09-22T18:19:29Z")

</div>

Dear Allessandra,

Thank you for the response!

I have followed your suggestion and used VMD to to visualize the periodic images of my system. You can find the related screenshots below, general view and close-up. There, the green complex is the unique copy of my system, where the gray ones are its images. This snapshot is taken from 339290 ps, as my mindist output was the following:

The shortest periodic distance is 0.138431 (nm) at time 339290 (ps),between atoms 3893 and 8558

To illustrate this message further, I have highlighted atoms 3893 and 8558, in white and red spheres, respectively. Also, my ligand is shown in orange.

So, as far as I have investigated, the mindist message points me at two atoms that are in the same image of my complex. Could you please guide me further on what might have gone wrong, such that I have obtained this mindist outcome?

 ![mindist_vmd](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/9b90cbe68b8536c18798c73d31abc4daee969966.png)  
 ![mindist_vmd_2](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/280fabae98c5a1222d99aae73c9b5f403744f3f2.png)

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [September 23, 2020, 7:06am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/4 "2020-09-23T07:06:29Z")

</div>

HI,

Is the picture at 339290 (ps)? Did your protein jump in and out of the box? What happen if you remove the jump?

“The shortest periodic distance is 0.138431 (nm) at time 339290 (ps),between atoms 3893 and 8558”  
The minimum distance, you reported, is very short (it is in the same order of C-C bond). That makes me think that maybe something is wrong with the setting (topology) of your system. Did you get any warnings in the pre-processing steps?

Alessandra

---

<div class="post-metadata">

**Author:** ![busrasavas](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@busrasavas](https://gromacs.bioexcel.eu/u/busrasavas)\
**Post date:** [September 24, 2020, 8:38am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/5 "2020-09-24T08:38:18Z")

</div>

Dear Alessandra,  
Yes, the picture is at 339290 (ps). I removed the jump then performed mindist. The output I received is now;

The shortest periodic distance is 2.12897 (nm) at time 397630 (ps),  
between atoms 3311 and 6921.

So, I understand that I should use mindist after removing jump for further applications. Does this make sense?

Thank you for your guidance!

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [September 24, 2020, 12:55pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-mindist-for-complex-systems/849/6 "2020-09-24T12:55:45Z")

</div>

Hi,  
in general, gmx mindist -pi work directly on the output of mdrun and running it on post-processed trj file may cause artefact. But your case is a special case, since you have a molecular complex (three component). In these cases, it may be necessary to ensure that there are nojump of the 3 components.  
Best regards  
Alessandra
