Concatenation of two xtc files

GROMACS version: 5.1.4
GROMACS modification: No
Respected community members, I have a doubt regarding the concatenation of trajectories. I am performing a protein-ligand simulation using the latest Charmm36 ForceField. Initially I ran the simulation for 100 ns and then later I extended the simulation for additional 50 ns. I have used the following commands for performing this operation:

gmx convert-tpr -s md_0_100.tpr -extend 50000 -o md_0_150.tpr
gmx mdrun -deffnm md_0_150 -cpi md_0_100_prev.cpt -noappend

The extended simulation got completed successfully. After this I concatenated the 0-100 ns xtc file and 100-150 ns xtc files by using the following command:
gmx trjcat -f md_0_100.xtc md_0_150.part0002.xtc -o Final150_md.xtc

I am pasting the output printed on the terminal

Reading frame 1 time 99940.000

Summary of files and start times used:

      File                Start time       Time step

         md_0_100.xtc        0.000 ps       10.000 ps
md_0_150.part0002.xtc    99930.000 ps       10.000 ps

Reading frame 0 time 0.000

Continue writing frames from md_0_100.xtc t=0 ps, frame=0
Last frame 10000 time 100000.000 → frame 9000 time 90000.000 ps
Reading frame 0 time 99930.000
lasttime 99920

Continue writing frames from md_0_150.part0002.xtc t=99930 ps, frame=9993
Reading frame 5000 time 149930.000 → frame 15000 time 150000.000 ps

Last frame written was 15000, time 150000.000000 ps

I am saving the coordinates every 10.0 ps. My doubt is why the second file md_0_150.part0002.xtc starts from 99930.000 ps instead of 100000.00 ps. Since I am new to Gromacs I am not able to understand what this entire thing actually means. I also tried to repeat the concatenation step by using the same command as mentioned above but this time I introduced the -cat flag so that the two .xtc files get merged properly. I am pasting the terminal output for this exercise below:

gmx trjcat -f md_0_100.xtc md_0_150.part0002.xtc -o testconcatenatedtrajectory.xtc -cat

Reading frame 1 time 99940.000

Summary of files and start times used:

      File                Start time       Time step

         md_0_100.xtc        0.000 ps       10.000 ps
md_0_150.part0002.xtc    99930.000 ps       10.000 ps

Reading frame 0 time 0.000

Continue writing frames from md_0_100.xtc t=0 ps, frame=0
Last frame 10000 time 100000.000 → frame 10000 time 100000.000 ps
Reading frame 0 time 99930.000
lasttime 100000

Continue writing frames from md_0_150.part0002.xtc t=99930 ps, frame=10001
Reading frame 5000 time 149930.000 → frame 14010 time 140020.000 ps

Last frame written was 15008, time 150000.000000 ps

gcq#164: “Welcome to the Power Age” (2 Unlimited)

Once again the start time for th second .xtc file ( md_0_150.part0002.xtc) is 99930.000 ps. Can someone please help me in understanding what is going on here. How can I merge the two xtc files properly. Thank you in advance.

Respected community members, I performed a 100 ns simulation and then I decided to extend it for 50 ns so that i get a 150 ns total coverage. In addition to the above posted question I have an additional doubt. I was looking into the log files for both of my simulations i.e. 0-100 ns simulation and 100-150 ns simulation. The log file of the first simulation clearly indicates that the simulation started at step = 0, and time = 0 and got over at 50000000 steps (dt = 0.002) and time = 100000.00000 ps. Now, when I was looking into the log file for second simulation (extention) I was surprised to see that this simulation started at step = 49965000, time = 99930.00 ps. In my openion the extended simulation should have started from where the first simulation got over. What can be the reason behind this? Can someone please help me. Thanks in advance.

At fixed intervals (typically 15 minutes), mdrun will output a checkpoint file. This allows one to restart a crashed simulation while loosing only 15 minute worth of runtime. Additionally, at the last step, a checkpoint is output to allow restart from the final state. When a checkpoint is to be generated, the previous one is kept as NAME_prev.cpt. To not generate too many files, previous checkpoint are not kept. You have the most recent NAME.cpt and the one just before, NAME_prev.cpt.

You seem to have used -cpi md_0_100_prev.cpt to restart your simulation - this is not the very last checkpoint, which would be md_0_100.cpt. This means that a small part (70 ps) of your simulation is likely in your file twice.

I would double check this by running gmx dump -f trajectoryfile.xtc| grep time on both files, and trim one of them of the redundant timespan.

Dear expert, thanks a lot for your reply. Accoding to what you have said, I checked my log files of both the simulations 0-100 ns (original) simulation and the extended simulation. I found out that the xtc file for the extended simulation had the redundancy in the trajectory from 99930.00-100000.00 ps. Hence, I trimmed this xtc file using the command:

gmx trjconv -f md_0_150.xtc -s md_0_100.tpr -o cut101-150ns.xtc -b 100010 -e 150000

Since the initial simulation was carried out from 0 ps to 100000.00 ps, I wanted the extended trajectory to be from 100010 ps till 150000 ps, hence, I made the selections under -b and -e flags accordingly. Is this correct? Instead of 100010 ps should it be 100000 ps? When I executed this command the software prompted me to select a group for output. I selected 0 (system). The print at the terminal is as follows:

Selected 0: ‘System’

Reading frame 0 time 100010.000

Precision of md_0_150.part0002.xtc is 0.001 (nm)

Using output precision of 0.001 (nm)

→ frame 4990 time 149910.000 → frame 4000 time 140010.000

I am not able to understand why it says so.

Then I again tried to concatenate the initial and newly trimmed xtc trajectories together by using the following command:

gmx trjcat -f md_0_100.xtc cut101_150ns.xtc -o Final150_ns.xtc

The following was printed on the terminal.

Reading frame 1 time 100020.000

Summary of files and start times used:

File Start time Time step


md_0_100.xtc 0.000 ps 10.000 ps

cut101_150ns.xtc 100010.000 ps 10.000 ps

Reading frame 0 time 0.000

Continue writing frames from md_0_100.xtc t=0 ps, frame=0

Last frame 10000 time 100000.000 → frame 10000 time 100000.000 ps

Reading frame 0 time 100010.000

lasttime 100000

Continue writing frames from cut101_150ns.xtc t=100010 ps, frame=10001

→ frame 15000 time 150000.000 ps → frame 14010 time 140100.000 ps

Last frame written was 15000, time 150000.000000 ps

Please let me know if my procedure is correct or not. One more question, why it shows frame 14010 time 140100.000 ps ? What is the meaning of this. Thanks and regards in advance.

The line displayed with the arrow is showing progress when running, don’t be too concerned about it.

The other lines indicates what has been done, and it seems correct (“Reading frame 0 time 0.000” for the first file, then “Reading frame 0 time 100010.000” for the second one, and resulting file “Last frame written was 15000, time 150000.000000 ps”)

Dear expert, thanks for your help and support.

Regards