Project

General

Profile

Bug #2189

trjconv only writes a single TNG frame from trajectory

Added by Richard Gowers over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Hi,

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

Thanks
Richard

new.tng (1.33 KB) new.tng bad output Richard Gowers, 05/25/2017 04:39 PM
new.trr (3.28 KB) new.trr input traj, 10 frames Richard Gowers, 05/25/2017 04:39 PM
two_water_gro.gro (326 Bytes) two_water_gro.gro input topology Richard Gowers, 05/25/2017 04:39 PM
smalltraj.pdb (1.21 KB) smalltraj.pdb Erik Lindahl, 12/26/2017 10:52 AM
smalltraj.tpr (58.5 KB) smalltraj.tpr Erik Lindahl, 12/26/2017 10:52 AM
multi0traj.pdb (1.3 KB) multi0traj.pdb Erik Lindahl, 12/28/2017 10:00 AM

Associated revisions

Revision 2002cfde (diff)
Added by Erik Lindahl almost 2 years ago

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.

Refs #2189.

Change-Id: I44bb59fbca83da53f6e8d4e494ae6476a82eb7cd

Revision d2705e7e (diff)
Added by Erik Lindahl almost 2 years ago

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.

Fixes #2189.

Change-Id: I3f44a2681138351d89183e3e196269f2b2f258fc

History

#1 Updated by Aleksei Iupinov almost 2 years ago

Reproduced on current release-2016.

I have no idea what I'm doing, but I'm about to suggest a one-line fix which fixes this, and then someone needs to tell me if my suspicion is correct :-)

#2 Updated by Gerrit Code Review Bot almost 2 years ago

Gerrit received a related patchset '1' for Issue #2189.
Uploader: Aleksei Iupinov ()
Change-Id: gromacs~release-2016~I721f161218e91f021f2226ac39d841255b28e04d
Gerrit URL: https://gerrit.gromacs.org/7361

#3 Updated by Berk Hess almost 2 years ago

This seems to be a TNG issue rather than a trjconv issue.

#4 Updated by Aleksei Iupinov almost 2 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.

#5 Updated by Gerrit Code Review Bot almost 2 years ago

Gerrit received a related patchset '1' for Issue #2189.
Uploader: Magnus Lundborg ()
Change-Id: gromacs~release-2016~If076c57ca38c7af491e2a2a0fdfeeab27a3cd09e
Gerrit URL: https://gerrit.gromacs.org/7362

#6 Updated by Erik Lindahl almost 2 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 almost 2 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.

#8 Updated by Gerrit Code Review Bot almost 2 years ago

Gerrit received a related patchset '1' for Issue #2189.
Uploader: Erik Lindahl ()
Change-Id: gromacs~release-2018~I44bb59fbca83da53f6e8d4e494ae6476a82eb7cd
Gerrit URL: https://gerrit.gromacs.org/7397

#9 Updated by Gerrit Code Review Bot almost 2 years ago

Gerrit received a related patchset '1' for Issue #2189.
Uploader: Erik Lindahl ()
Change-Id: gromacs~release-2018~I3f44a2681138351d89183e3e196269f2b2f258fc
Gerrit URL: https://gerrit.gromacs.org/7399

#10 Updated by Erik Lindahl almost 2 years ago

  • Status changed from New to Fix uploaded

#11 Updated by Erik Lindahl almost 2 years ago

  • Status changed from Fix uploaded to Resolved

#12 Updated by Erik Lindahl almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF