GROMACS version: 2022.4
GROMACS modification: No
Hello everyone,
(1) I want to analyze a trajectory for desired system states.
(2) Thereafter, my plan is to extract the desired frames using gmx traj
, with the output in the .trr
format. This particular format contains the coordinate as well as velocity and force information unlike the other file formats.
(3) Next, I want to restart the simulation using the extracted frame after using gmx grompp
to create the run file.
(4) However, gmx grompp
does not accept the .trr
file as an input.
(5) Thus, I am not able to get the input file for the next gmx mdrun
step.
Is there any way of fixing this issue or a comparable workaround? I would like to retain the velocity and force information for the next set of simulations.
Although a similar question has been discussed before, I am not sure if there have been any further updates regarding this issue. Thank you very much.
You say that you want to extract frames to the .trr format. Does the original trajectory contain velocities?
gmx grompp
can use a trajectory as input (using the -t
option), but it will only use the last frame. So, if you want to use another frame you will need to extract that separately, but still to a .trr file, if you want to keep the precision. When you say that you want to “retain the velocity and force information”, you should be aware that forces are not used as input for generating the simulation starting state (the .tpr file). The forces are calculated from the coordinates.
1 Like
@MagnusL Thank you very much for your assistance.
I plan to extract the separate frames in the .trr format. As this is the default GROMACS trajectory output format and as per the available information, I thought the frames would also contain the velocity and force information.
Can I only pass the .trr file using the -t
flag to the gmx grompp
command without using the -c
flag? I think retaining the coordinate and velocity information should be sufficient for my case, even if the force information is not there in the .tpr file.
.trr files can indeed store coordinates, velocities and forces. If you write the .trr file from your simulation (gmx mdrun
) you can specify what output you want in the file. However, if you convert another file (e.g., an .xtc file) into a .trr file there will not be any velocity data. That is why I wondered if the original trajectory contained velocities (i.e. a .trr or .tng file written with velocity output).
I’m quite sure you need the -c
option coordinate input file as well, but if also using the -t
option, the coordinates and velocities from the last frame in the trajectory will be used instead. Coordinates and velocities are enough for a checkpoint file, so I think it should be enough in your case.
1 Like
Thanks a lot for the information. The output file is indeed in the .trr format, but I plan to select certain frames from the trajectory based on parameters of interest.
Afterward, I want to use both the .gro and .trr files for a particular frame of interest to create the input .tpr file for the next simulation using gmx grompp
.