Is it possible to extract coordinates from a .cpt file?

GROMACS version: 2022.4
GROMACS modification: No
Hi all,

I want to visualize coordinates of the output of some simulations of which I only have the checkpoint file, .itp files, topol.top, and a .ndx file I made to detail some subgroups. Other files were removed by automated cleaning performed by our computing cluster. Is it possible?

Thanks

Hi @kyfi

If you have the tpr file then inside there is the first snapshot of the simulation saved. Same if you have any gro or pdb files, you can have access to a single frame usually. In terms of trajectory, if you do not have an xtc or trr then there is no way to retrieve the trajectory. The only choice is to run the simulation again, and even in that case the result will no be identical.

1 Like

I’m afraid I don’t have the tpr file. I appreciate the response though!

From the cpt file you can get the coordinates, but they are not reported in the “normal” way, i.e., as part of some kind of structural file that you can visualize, but as a long vector. You can give it a look, just dump the cpt with gmx dump -cp your_cpt_file.cpt > output.txt and then read the text file. In principle if you have the full topological information you should be able to rebuild the frame from these coordinates, but it is going to be a lot of work.

Now that I think about it, maybe if you have the exact topology (so same molecules in same order and number) you can try to build a new box with the same components without caring about the coordinates, and then you compile with grompp a new tpr file passing the new structure with -c and the old checkpoint file as -t. In fact the manual for grompp reports that

Starting coordinates can be read from trajectory with -t. The last frame with coordinates and velocities will be read, unless the -time option is used. Only if this information is absent will the coordinates in the -c file be used. Note that these velocities will not be used when gen_vel = yes in your .mdp file.

So, I think this new tpr will have the the coordinates of the checkpoint file, and then you can get them as structure file with something like gmx editconf -f new.tpr -o structure.pdb. Anyway, this is still only a frame, the information about the trajectory is still not there, but in case you need to retrieve the status it should work.

gmx trjconv can take a cpt file as input and write coordinates in any format supported by GROMACS.