# Time seems to be not correct using "trjcat"

**URL:** <https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117>\
**Category:** User discussions\
**Created:** [November 9, 2021, 11:00pm UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117 "2021-11-09T23:00:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [November 9, 2021, 11:00pm UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117/1 "2021-11-09T23:00:39Z")

</div>

GROMACS version:2021  
GROMACS modification: /No  
Here post your question

I use `gmx trjcat -f trj1.xtc trj2.xtc -cat -o combine.xtc` to combine two trajectories into one. Each trajectory is from 0 to 50 ns, with 0.1 ns interval, totalling 501 frames. In the `combine.xtc`, I want the frame 1 to 501 to be trj1’s frames, and frame 502 to 1002 to be trj2’s frames.

The prompt I got is shown below. I can see `Last frame written was 1001`, which means there are 1002 frames (the first frame is called “frame 0” in Gromacs), which is good. However, why it is showing `frame 910 time 40900.000 ps` ?

I actually do not care about the time. I just want to simply combine the two trajectories.

```auto
Command line:
  gmx trjcat -f trj1.xtc trj2.xtc -cat -o combine.xtc

Reading frame 1 time 100.000

Summary of files and start times used:

          File Start time Time step
---------------------------------------------------------
                 trj1.xtc 0.000 ps 100.000 ps
                 trj2.xtc 0.000 ps 100.000 ps WARNING: same Start time as previous

Reading frame 0 time 0.000 Note that major changes are planned in future for trjcat, to improve usability and utility.
lasttime 0

Continue writing frames from trj1.xtc t=0 ps, frame=0
Last frame 500 time 50000.000 -> frame 500 time 50000.000 ps
Reading frame 0 time 0.000
lasttime 50000

Continue writing frames from trj2.xtc t=0 ps, frame=501
Last frame 500 time 50000.000 -> frame 910 time 40900.000 ps

Last frame written was 1001, time 50000.000000 ps

```

---

<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:** [November 11, 2021, 8:45am UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117/2 "2021-11-11T08:45:38Z")

</div>

Hi,

You can fix the times to be continuous with the flag `-settime`. That will prompt you for how each new trajectory “relates” to the previous.

Petter

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [November 11, 2021, 8:59am UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117/3 "2021-11-11T08:59:09Z")

</div>

Hi, Petter, thank you. Yes, I can use `-settime` to correct it based on the prompt. But I still do not understand why `frame 910 time 40900.000 ps` appears when `-settime` is not supplied.

In any case, can I confirm that the frame 1 to 501 are trj1’s frames, and frame 502 to 1002 are trj2’s frames? Thank you.

---

<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:** [November 11, 2021, 11:25am UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117/4 "2021-11-11T11:25:40Z")

</div>

My best guess is that it’s an error with the text message, but that the files have been correctly cat’ed and that it means to say the correct time + frame. I’d suggest extracting the last frames from `trj2.xtc` and `combined.xtc` and compare them to see if they are identical. E.g. by loading them in `vmd` or dumping into text files through `gmx trjconv -dump <time> -o <out.gro>` or similar.

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [November 11, 2021, 11:37am UTC](https://gromacs.bioexcel.eu/t/time-seems-to-be-not-correct-using-trjcat/3117/5 "2021-11-11T11:37:48Z")

</div>

Hi Petter, thank you very much, this is a great suggestion!
