rinikerlab/PyGromosTools

Missing data point when concatenating trajectories

candidechamp opened this issue · 2 comments

When a list of trajectory files (tre, trc or trg) are concatenated, the default option is to skip the 0th frame of every trx file (except the first), as it assumes the convention followed is that the last element in the (n-1)th trajectory is equal to the 0th element of the nth trajectory.

This leads to a missing datapoint for every concatenation when we don't follow this convention (i.e., use a whole number of steps and printout frequency in the imd file, which is fairly common).

As discussed with @MTLehner it is possible to simply check automatically the last/first frame and automatically detect whether the element should be included or removed (to avoid a duplicate entry).

edit: For anyone who needs to fix this before the issue is solved with the automatic checking, the option skip_new can be set in add_traj(self, traj, skip_new_0=True) in pygromos/files/trajectory/_general_trajectory.py

@candidechamp default is changed in PR #143

@candidechamp can you try it again the last commit to #144 should have fixed the deep_equals != equals problem for trajectories, by overriding the equals method for trajectory blocks