# Trjconv options to extract frames from long trajectory

**URL:** <https://gromacs.bioexcel.eu/t/trjconv-options-to-extract-frames-from-long-trajectory/4235>\
**Category:** User discussions\
**Tags:** gmx-trjconv\
**Created:** [May 31, 2022, 6:22am UTC](https://gromacs.bioexcel.eu/t/trjconv-options-to-extract-frames-from-long-trajectory/4235 "2022-05-31T06:22:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![subha24](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@subha24](https://gromacs.bioexcel.eu/u/subha24)\
**Post date:** [May 31, 2022, 6:22am UTC](https://gromacs.bioexcel.eu/t/trjconv-options-to-extract-frames-from-long-trajectory/4235/1 "2022-05-31T06:22:39Z")

</div>

GROMACS version: 2021.4  
GROMACS modification: Yes/No  
Here post your question

I want to extract frames from a 1us long trajectory at every 1000ps. My doubt is should I used the -dt option or -skip option or -n option and provide an index file with the frames indices. Please confirm if the following commands are equivalent. I am supposing the -n index option is handy if specific frames are required to be extracted and not necessarily frames at certain intervals.

gmx trjconv -f md\_0\_1\_noPBC.xtc -dt 1000 -o trajectory\_reduced\_frames.xtc  
or  
gmx trjconv -f md\_0\_1\_noPBC.xtc -skip 100 -o trajectory\_reduced\_frames.xtc  
or  
`gmx trjconv -f md_0_1_noPBC.xtc -o protein-only.xtc -n index.ndx` where `index.ndx`

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [May 31, 2022, 7:38am UTC](https://gromacs.bioexcel.eu/t/trjconv-options-to-extract-frames-from-long-trajectory/4235/2 "2022-05-31T07:38:48Z")

</div>

Hi,

With `-dt` you can specify the time difference between extracted frames in picoseconds, while `-skip` specifies it as difference between frame indices. So `-dt 1000` extracts a frame every 1000 ps = 1 ns, and `-skip 100` every 100 \* timestep \* nstxout ps. If you want every 10 ps, it’s simplest to use `-dt 10`.

I believe `-n` only specifies the atom numbers to keep in your output (protein-only, etc), while `-fr` can be used to get specific frames. Either way, the third command is clearly different from the first two.

Petter

---

<div class="post-metadata">

**Author:** ![subha24](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@subha24](https://gromacs.bioexcel.eu/u/subha24)\
**Post date:** [May 31, 2022, 8:12am UTC](https://gromacs.bioexcel.eu/t/trjconv-options-to-extract-frames-from-long-trajectory/4235/3 "2022-05-31T08:12:14Z")

</div>

Thanks. That clarified the doubt.
