[gmx-users] Positions and velocities from trajectory for restart

Justin Lemkul jalemkul at vt.edu
Mon Jul 16 14:21:08 CEST 2012

On 7/16/12 7:19 AM, Inon Sharony wrote:
>     Good afternoon.
>     g_traj has the option to output position coordinates (-ox) OR velocity
>     coordinates (-ox) from an input trajectory file. The former can even be
>     output to a trajectory file format, trr/trj/cpt (-oxt). I would like to
>     restart a simulation using a separate set of MD parameters (mdp) from the
>     phase-space point in a given time frame of a previous trajectory. I need
>     BOTH position and velocity coordinates to fully reproduce the system in
>     phase-space. Non of the above cited options suffice, since they give me
>     only one of the two (positions OR velocities) but not both.
>     Ideally, I would like to use something like
>     g_traj -f traj-old -s topol -b $t_init -e $t_final -ot traj-new -fp
>     To create a new trajectory file "traj-new.trr" which contains both
>     positions and velocities which appear in "traj-old.trr" between
>     time-frames $t_init and $t_final (this could be only one time-frame),
>     where the currently non-existent g_traj option "-ot" outputs both
>     positions and velocities from one trajectory to another. Is there a way to
>     do this now? If not, could you possibly implement such an option?

The -ot option is not non-existent, it's just unrelated to what you want to do, 
and it does not write a trajectory.

"Option -ot plots the temperature of each group, provided velocities are
present in the trajectory file. No corrections are made for constrained
degrees of freedom! This implies -com."

>     From the GMX website I understand that re-starting simulations is being
>     pushed towards using checkpoint (cpt) files rather than trr. However, when
>     I tried to see if the velocities get copied to the cpt file, I got:
>     $ echo 0 | g_traj_d -f traj.trr -s topol.tpr -oxt traj.cpt -fp
>     \001\001 "Source code file: trxio.c, line: 269
>     \001\001 Fatal error: Sorry, write_trxframe_indexed can not write cpt"

Does the -oxt option work to produce a .trr file?  If you just want individual 
states from which to continue the simulation, you don't need g_traj at all. 
Just use trjconv -dump to drop out individual frames from the .trr file, which 
will contain coordinates and velocities present in the .trr file.



Justin A. Lemkul, Ph.D.
Research Scientist
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080


More information about the gromacs.org_gmx-users mailing list