# Re-count time frames after 'gmx trjcat'

**URL:** <https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415>\
**Category:** User discussions\
**Created:** [July 2, 2020, 12:59pm UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415 "2020-07-02T12:59:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacek](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@Jacek](https://gromacs.bioexcel.eu/u/Jacek)\
**Post date:** [July 2, 2020, 12:59pm UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415/1 "2020-07-02T12:59:15Z")

</div>

GROMACS version: 2018  
GROMACS modification: No

Hi all,

I combined two trajectories of 50 ns each with ‘gmx trjcat’ and now the time of the trajectory goes from 0 ns to 50 ns, and then again from 0 ns to 50 ns, instead of going from 0 ns - 100 ns. The problem is now that ‘-b -e’ additions are not working properly (putting ‘-b 0 -e 60’ gives the entire 100 ns and not the first 60 consecutive ns). Is there an easy way to rename/recount the time frames?

Thanks a lot.

Best,  
Jacek

---

<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:** [July 2, 2020, 1:12pm UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415/2 "2020-07-02T13:12:56Z")

</div>

Use `-settime` when concatenating.

---

<div class="post-metadata">

**Author:** ![Jacek](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@Jacek](https://gromacs.bioexcel.eu/u/Jacek)\
**Post date:** [July 2, 2020, 1:18pm UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415/3 "2020-07-02T13:18:09Z")

</div>

Thx for the suggestion, I’ll try that.

---

<div class="post-metadata">

**Author:** ![Jacek](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@Jacek](https://gromacs.bioexcel.eu/u/Jacek)\
**Post date:** [July 6, 2020, 11:19pm UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415/4 "2020-07-06T23:19:37Z")

</div>

Forgot to write: It worked!  
Thx again

---

<div class="post-metadata">

**Author:** ![ptrujillo](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@ptrujillo](https://gromacs.bioexcel.eu/u/ptrujillo)\
**Post date:** [June 30, 2021, 5:26am UTC](https://gromacs.bioexcel.eu/t/re-count-time-frames-after-gmx-trjcat/415/5 "2021-06-30T05:26:10Z")

</div>

Hello! Nice to say hi, I am trying to join several paths, but when I apply the command

gmx trjcat -f run1.trr run2.trr run3.trr run4.trr run5.trr run6.trr -n indice.ndx -o parte1.trr -cat yes -overwrite yes -settime

It seems to me that it does not consider all the frames, since the 6 files are 3ps therefore I should obtain an ouput with 18 ps and I obtain one of 17ps.

I tried removing -settime, but it doesn’t work either. I saw in a previous thread that I could join two by two, but it still indicates a shorter simulation time.

Enter the new start time (ps) for each file.

There are two special options, both disable sorting:

c (continue) - The start time is taken from the end  
of the previous file. Use it when your continuation run  
restarts with t=0.

l (last) - The time in this file will be changed the  
same amount as in the previous. Use it when the time in the  
new run continues from the end of the previous one,  
since this takes possible overlap into account.

```
      File Current start (ps) New start (ps)

```

* * *

```
             run1.trr 0.000 ps '' not recognized as a floating point number, 'c' or 'l'. Try again: c
             run2.trr 0.000 ps c
             run3.trr 0.000 ps c
             run4.trr 0.000 ps c
             run5.trr 0.000 ps c
             run6.trr 0.000 ps c

```

Sorting disabled.

Summary of files and start times used:

```
      File Start time Time step

```

* * *

```
             run1.trr 0.000 ps 0.100 ps
             run2.trr Continue from last file
             run3.trr Continue from last file
             run4.trr Continue from last file
             run5.trr Continue from last file
             run6.trr Continue from last file

```

Reading frame 0 time 0.000  
lasttime 0

Continue writing frames from run1.trr t=0 ps, frame=0  
Reading frame 20 time 2.000 → frame 20 time 2.000 ps  
Reading frame 0 time 0.000  
lasttime 2.9  
Reading frame 1 time 0.100  
Continue writing frames from run2.trr t=3 ps, frame=30  
Reading frame 20 time 2.000 → frame 50 time 5.000 ps  
Reading frame 0 time 0.000  
lasttime 5.8  
Reading frame 1 time 0.100  
Continue writing frames from run3.trr t=5.9 ps, frame=59  
Reading frame 20 time 2.000 → frame 80 time 8.000 ps  
Reading frame 0 time 0.000  
lasttime 8.7  
Reading frame 1 time 0.100  
Continue writing frames from run4.trr t=8.8 ps, frame=88  
Reading frame 20 time 2.000 → frame 110 time 11.000 ps  
Reading frame 0 time 0.000  
lasttime 11.6  
Reading frame 1 time 0.100  
Continue writing frames from run5.trr t=11.7 ps, frame=117  
Reading frame 20 time 2.000 → frame 140 time 14.000 ps  
Reading frame 0 time 0.000  
lasttime 14.5  
Reading frame 1 time 0.100  
Continue writing frames from run6.trr t=14.6 ps, frame=146  
Reading frame 20 time 2.000 → frame 170 time 17.000 ps

Last frame written was 174, time 17.400000 ps

The amount of time is also less when I try to join only two files.

If someone has solved this problem please I appreciate their guidance

regards!
