# How do we use gmx polystat?

**URL:** <https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [April 26, 2024, 11:24am UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997 "2024-04-26T11:24:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [April 26, 2024, 11:25am UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997/1 "2024-04-26T11:25:00Z")

</div>

Hi All,

My system contains 60 polymers and I want to calculate the average end-to-end distance change with time. In the index file if I define indexes of the starting end and the ending end of the polymer with the following command would it give me the average end-to-end distance with time?

gmx polystat -s …/…/…/run.tpr -f run0-14\_nopbc.xtc -o 0.xvg -n index.ndx

My index file looks as follows. For each line, it contains indexes for the starting end and end atom index

[poly60]  
6 149  
164 307  
322 465  
480 623  
638 781  
796 939  
954 1097  
1112 1255  
1270 1413  
1428 1571  
1586 1729  
1744 1887  
1902 2045  
2060 2203  
2218 2361  
2376 2519  
2534 2677  
2692 2835  
2850 2993  
3008 3151  
3166 3309  
3324 3467  
3482 3625  
3640 3783  
3798 3941  
3956 4099  
4114 4257  
4272 4415  
4430 4573  
4588 4731  
4746 4889  
4904 5047  
5062 5205  
5220 5363  
5378 5521  
5536 5679  
5694 5837  
5852 5995  
…

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [April 26, 2024, 2:42pm UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997/2 "2024-04-26T14:42:26Z")

</div>

That should work. Have you tried?

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [April 26, 2024, 3:20pm UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997/3 "2024-04-26T15:20:43Z")

</div>

@hess Yes, I tried. However, I was unsure whether I needed to provide all indexes (all atoms) in the index file. That way too, I can get values and have doubts about which way is correct.

Thank you for clearing my doubts. So now I know that I need to provide only the indexes of the two ends to get the correct end-to-end distance of the polymer.

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [December 1, 2025, 8:47pm UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997/4 "2025-12-01T20:47:44Z")

</div>

@hess

Hi again,

Since we defined only two atoms in the index file, is the radius of gyration calculated using only those two specified atoms, or does the code include all atom indices between the first and second values listed in each line of the `[poly6]` group?

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [December 2, 2025, 7:12am UTC](https://gromacs.bioexcel.eu/t/how-do-we-use-gmx-polystat/8997/5 "2025-12-02T07:12:28Z")

</div>

The idea is to supply an index group that contains all atoms of all molecules you want to analyze. The end to end distance is taken between the first and last atom from each molecule in this index group.
