# Intramolecule atomic distance using gmx distance

**URL:** <https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269>\
**Category:** User discussions\
**Created:** [November 16, 2022, 5:07pm UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269 "2022-11-16T17:07:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnab\_1](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@arnab\_1](https://gromacs.bioexcel.eu/u/arnab_1)\
**Post date:** [November 16, 2022, 5:07pm UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/1 "2022-11-16T17:07:41Z")

</div>

Hi,  
I would like to calculate distance between two atoms in a molecule i.e intramolecular atomic distance from the trajectory file. Could anyone suggest the procedure?  
I have tried the command gmx distance -f \<.trr\> -s \<.gro\> -n \<.index\> -select -oav \<.xvg\> but this command probably give either the intermoleculer distance.  
Thanks in advance

---

<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:** [November 17, 2022, 3:55am UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/2 "2022-11-17T03:55:59Z")

</div>

`gmx distance` will compute whatever distance you specify when using `-select`. If you give it two atoms that are in the same molecule, it will compute exactly the distance you specify.

---

<div class="post-metadata">

**Author:** ![arnab\_1](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@arnab\_1](https://gromacs.bioexcel.eu/u/arnab_1)\
**Post date:** [November 17, 2022, 5:51am UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/3 "2022-11-17T05:51:47Z")

</div>

Thank you Dr. Justin @jalemkul for the clarification. Just a little query that suppose I have 100 molecules of A in the trajectory file and I would like to calculate the specific distance between two atoms for one molecule out of those 100. Will that be the same procedure as you suggested?  
Thanks

---

<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:** [November 18, 2022, 3:45am UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/4 "2022-11-18T03:45:10Z")

</div>

If you provide a properly formatted selection that refers to two atoms of a given molecule, you will get that distance.

---

<div class="post-metadata">

**Author:** ![arnab\_1](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@arnab\_1](https://gromacs.bioexcel.eu/u/arnab_1)\
**Post date:** [November 19, 2022, 11:53am UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/5 "2022-11-19T11:53:29Z")

</div>

Okay noted.Thank you so much @jalemkul Dr Justin.

---

<div class="post-metadata">

**Author:** ![xieliqiang](https://avatars.discourse-cdn.com/v4/letter/x/ea666f/32.png) [@xieliqiang](https://gromacs.bioexcel.eu/u/xieliqiang)\
**Post date:** [February 1, 2024, 4:54am UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/6 "2024-02-01T04:54:39Z")

</div>

Dear sir，  
i have a micelle composed of 40 molecules A, and i have a drug molecule B. i wang to caculate the rdf function between the center of mass (com) of the micelle and drug B, but i can not get a proper result.( the drug was on the surface of the miclle ,but the rdf was not right.

how should i do next .  
thank you in advance.

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [February 1, 2024, 5:15pm UTC](https://gromacs.bioexcel.eu/t/intramolecule-atomic-distance-using-gmx-distance/5269/7 "2024-02-01T17:15:55Z")

</div>

Hi! Just FYI, you’re more likely to have your question answered if you post it as a separate topic, rather than a comment to an old discussion.
