Skip to content
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

Cell representation in DCDFile.py #323

Open
lohedges opened this issue Sep 2, 2020 · 2 comments
Open

Cell representation in DCDFile.py #323

lohedges opened this issue Sep 2, 2020 · 2 comments
Assignees
Labels

Comments

@lohedges
Copy link
Member

lohedges commented Sep 2, 2020

When adding support for triclinic simulation boxes with SOMD I needed to modify DCDFile.py. In the file I noticed that periodic boxes are written to file with:

boxSize = space.dimensions()
file.write(struct.pack('<i6di', 48, boxSize[0], 0, boxSize[1], 0, 0, boxSize[2], 48))

According the specification described at this MDAnalysis page, the format should be [A, gamma, B, beta, alpha, C], where A, B, C are the magnitudes of the cell vectors, and alpha, beta, and gamma are the angles between the axes: BC, AC, and AB. If correct, should the Python code above not read:

boxSize = space.dimensions()
file.write(struct.pack('<i6di', 48, boxSize[0], 90, boxSize[1], 90, 90, boxSize[2], 48))

(I used the specification described by MDAnalysis when writing out triclinic cell information.)

Perhaps this doesn't matter for the purposes for which you are using DCD files, or perhaps it is assumed that the space is orthorhombic when alpha, beta, and gamma are all zero.

@lohedges
Copy link
Member Author

lohedges commented Nov 4, 2020

Hi @jmichel80, any comment on this? It would be good to update this for consistency with the TriclinicBox code if okay.

@jmichel80
Copy link
Contributor

Hi @lohedges,

I honestly don't know. We mostly visualise the DCD files in VMD, or process them via tools like MDTraj. There is some code in Nautilus.py that updates a Sire system from info read in a DCD file, but the angles are ignored. I haven't noticed something odd in the past. Could you verify that DCD files generated after updating the code to match MDAnalysis specs and see whether that affects visualisation in VMD ? The issue reported here doesn't fill me with confidence as it looks like different conventions are used by different codes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants