# How to quickly extract all structures with the specified time frames in the 300-ns MD simulation?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-quickly-extract-all-structures-with-the-specified-time-frames-in-the-300-ns-md-simulation/2033>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [April 26, 2021, 11:13pm UTC](https://gromacs.bioexcel.eu/t/how-to-quickly-extract-all-structures-with-the-specified-time-frames-in-the-300-ns-md-simulation/2033 "2021-04-26T23:13:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![minghao2121](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@minghao2121](https://gromacs.bioexcel.eu/u/minghao2121)\
**Post date:** [April 26, 2021, 11:13pm UTC](https://gromacs.bioexcel.eu/t/how-to-quickly-extract-all-structures-with-the-specified-time-frames-in-the-300-ns-md-simulation/2033/1 "2021-04-26T23:13:36Z")

</div>

GROMACS version:2021.1  
GROMACS modification: No

Hello,

After runing gmx cluster, I want to extract all structures (either in the seperate pdbs or in one pdb with all structures) in the maximum cluster.

I did it like this (the maximum cluster includes 66 time frames (or structures) and I want to extract them all as pdb format):

for i in {222,232.5,233,233.5,234,234.5,235,235.5,236.5,237,237.5,  
238,239,239.5,240,241.5,242,242.5,243,243.5,244,244.5,245,245.5,246,  
246.5,247,247.5,248,248.5,249,249.5,250,250.5,251,251.5,252,252.5,253,  
253.5,254,254.5,255,255.5,256,256.5,257,257.5,258.5,259,259.5,260,260.5,  
261.5,262.5,264.5,265.5,266,267.5,268.5,269,  
270,270.5,271,272,273}; do echo 1 | gmx trjconv -s md\_300ns.tpr -f md\_300ns\_noPBC.xtc -tu ns -dump $i -o clust\_mulstr\_$i.pdb; done

But I found that it is too slow to extract them all. Each time it read information from beginning.

Are there smart ways to do the same task quickly?

Thanks,  
Ming

---

<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:** [April 27, 2021, 8:33am UTC](https://gromacs.bioexcel.eu/t/how-to-quickly-extract-all-structures-with-the-specified-time-frames-in-the-300-ns-md-simulation/2033/2 "2021-04-27T08:33:25Z")

</div>

HI,  
you can try to use the gmx cluster option -cl -wcl 1 -nst 1  
Best regards  
Alessandra

---

<div class="post-metadata">

**Author:** ![minghao2121](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@minghao2121](https://gromacs.bioexcel.eu/u/minghao2121)\
**Post date:** [April 27, 2021, 2:14pm UTC](https://gromacs.bioexcel.eu/t/how-to-quickly-extract-all-structures-with-the-specified-time-frames-in-the-300-ns-md-simulation/2033/3 "2021-04-27T14:14:46Z")

</div>

@alevilla

Thanks for your help.

I will check that.

Ming
