-
Hi MDAnalysis, I´m unsure if this is a issue or discussion so feel free to move this post if it is in the wrong place. I am writing a MD run+analysis pipeline and as a part of this work i want to be able to restart my simulation after running analysis using MDAnalysis. Currently I'm using DCD files to store the trajectory, and i have understood that this file format is not necessarily well defined with the box vectors being a particular issue. My pipeline overwrites the trajectory DCD file with a centered, wrapped and aligned version of the trajectory. However, somewhere in this conversion the file format changes such that despite the file containing the same number of atoms and having the same size, OPENMM will not append to the DCD file. Does anyone have guidance on how to write a OPENMM compatible DCD trajectory using MDA as below?
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
MDAnalysis writers will not append to files, that's not implemented (see #3861 ). if you want to combine multiple files into a single trajectory you can use the "ChainReader": make a universe that concatenates on the fly (give a list of filenames u = mda.Universe(structure_filename, temp_files)
u.atoms.write(output_filename, frames="all") (Note that in many cases you don't need the explicit loop for the writer but you can just use the I don't know why OpenMM would not read a MDAnalysis DCD. You'd need to provide more context. |
Beta Was this translation helpful? Give feedback.
-
The original way of doing it seems to have produced valid files for ChimeraX and MDTraj. However, i have now changed to using the chainreader. Thank you for your suggestion. After some digging it seems like you guys and the OPENMM people are using a different format for the initial header of the DCD file (box information and so on). Would it be possible for you to ask the OPENMM people what they use (not documented from what i could see) and maybe add a option to the DCDwriter to write in that format? I do not know how to decode the dcd binary, otherwise i could check for you. |
Beta Was this translation helpful? Give feedback.
-
Looks like @epretti fixed this in OpenMM, are there any remaining issues that need to be tackled? |
Beta Was this translation helpful? Give feedback.
-
No, @epretti did a wonderful job of fixing it, im closing the issuee as resolved now. Thanks for your time! |
Beta Was this translation helpful? Give feedback.
No, @epretti did a wonderful job of fixing it, im closing the issuee as resolved now. Thanks for your time!