-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transformations not applied to some frames with ChainReader #3343
Comments
Hi @caioss, thanks for the super-detailed report. I haven't yet found the ultimate cause, but I've tracked it down to a mismatch of the Timesteps that are used for the alignment. It seems that the |
Ok, found the problem. The mobile group involved in the transformation holds a reference to The issue here is that |
Ok, this goes a bit deeper in that the ChainReader defers all transformations to the subreaders, and does no transform on its own. Alternatives are:
|
In solving this I implemented option 2. above, and created a shallow It seems to work, but highlights a limitation (that already exists) in that frame-aware transforms never get to see the global frame number, only the subreader's. I imagine the position-averaging transform might already suffer from this when used on ChainReaders. To counter this it seems that option 1. is the best way forward. Is there any drawback to moving the transforms to be applied at the ChainReader level rather than at the subreader level? |
Closes #3343 Takes into account over-transformation of SingleFrameReaders, which never re-create their ts when re-accessed.
Closes #3343 Takes into account over-transformation of SingleFrameReaders, which never re-create their ts when re-accessed.
Closes #3343 Takes into account over-transformation of SingleFrameReaders, which never re-create their ts when re-accessed.
Expected behavior
If an
Universe
is created with more than one trajectory file and aMDAnalysis.transformations.fit.fit_rot_trans
transformation is added to it, it is expected that all frames get fitted on-the-fly when we iterate over the trajectory.Actual behavior
Whenever a
ChainReader
is used to load the trajectories, the transformation isn't applied to some frames. It seems that there is a pattern on which frames are fitted and which are not. I reproduced this behavior with independent XTC and DCD files.Code to reproduce the behavior
This code results in some frames with low and others with high RMSD values. It was expected that all frames had low RMSD.
Output:
If we don't use the
ChainReader
by un-commenting the following line, all frames get fitted.Output:
If we keep using the
ChainReader
, but explicitly apply the transformation in the trajectory loop, all frames get fitted.Output:
Just for completeness, here is a case without the fitting stuff and the correct behavior (the example trajectory was already fitted).
Output:
Current version of MDAnalysis
The above codes were tested on versions 1.1.1 and 2.0.0-dev0.
Versions 3.6.9 and 3.8.5.
Ubuntu 18.04 and 20.04
The text was updated successfully, but these errors were encountered: