# How to calculate the minimum distance of a group's centroid to a protein?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-calculate-the-minimum-distance-of-a-groups-centroid-to-a-protein/3258>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [December 7, 2021, 5:18am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-minimum-distance-of-a-groups-centroid-to-a-protein/3258 "2021-12-07T05:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![llzhu](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@llzhu](https://gromacs.bioexcel.eu/u/llzhu)\
**Post date:** [December 7, 2021, 5:18am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-minimum-distance-of-a-groups-centroid-to-a-protein/3258/1 "2021-12-07T05:18:52Z")

</div>

GROMACS version: 2018.8  
GROMACS modification: No  
I want to calculate the minimum distance of a group’s centroid to a protein, I don’t know how to definite the centorid of the group in the .ndx file. Would you like to tell me how to calculate the minimum distance of a group’s centorid to a protein?  
Thank you for your interest and response.

Kind Regards  
Lili

---

<div class="post-metadata">

**Author:** ![Yogesh](https://avatars.discourse-cdn.com/v4/letter/y/49beb7/32.png) [@Yogesh](https://gromacs.bioexcel.eu/u/Yogesh)\
**Post date:** [December 7, 2021, 5:55am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-minimum-distance-of-a-groups-centroid-to-a-protein/3258/2 "2021-12-07T05:55:03Z")

</div>

gmx distance -s aaa.tpr -f aaa.gro -n index.ndx -select ‘com of group “Chain\_A” plus com of group “Chain\_B”’ -oall dist.xvg

define atomselection of your two groups in index file
