trjconv only writes a single TNG frame from trajectory
I'm trying to convert some trr files to tng, I'm doing:
gmx trjconv -force -s two_water_gro.gro -f new.trr -o new.tng
Where new.trr is a 10 frame file. The output tng file only contains the last frame of the trr data (according to gmx dump).
If I change the output to -o new.xtc I get the expected 10 frame trajectory.
I've attached the files mentioned
Improve frame time/step handling in trjconv
Store the exact step in PDB/GRO file headers,
and be more careful about not claiming to have
time or step information when it was not available.
This change will avoid some of the problems
described in #2189, but it does not yet properly
fix the issue in the TNG library.
Make TNG writing work with multiple identical steps
Introduce a wrapper structure around TNG so we detect
and correct for cases when writing multiple frames with
the same step, or non-zero initial steps to TNG files.
This will avoid frames overwriting each other, and make
sure the time per frame is correct.
#4 Updated by Aleksei Iupinov about 3 years ago
Per offline discussion, it seems the input file has all the frames indexed as step 0, and this causes TNG writer to overwrite all the frames with the last one, as it assumes unique step numbers.
Perhaps proper behaviour in case of duplicate step numbers and TNG writing would be to throw an error.
#6 Updated by Erik Lindahl about 3 years ago
The newly uploaded 3-frame PDB trajectory smalltraj.pdb still has problems with the new fix. This trajectory even has correct non-zero frame times, although they are only specified in text in the PDB. When converting to/from XTC everything works fine.
When used in combination with smalltraj.tpr, I can create a TNG trajectory with gmx trjconv. However, when trying to read this trajectory back into a PDB, there are error messages
WARNING: Incomplete frame: nr 0 time 0
WARNING no output, last frame read at t=0
#7 Updated by Erik Lindahl about 3 years ago
Here's another PDB trajectory (same TPR as before) that seems to still have the original problem (repeated frame-0 being dropped).
If I enumerate the models as 0,1,2, it is written fine, but with multiple "model 0", only the last one seems to be written to the TNG file, but the time is taken from the first frame.