Skip to content

Commit 2f95972

Browse files
committed
DCD doc updates
1 parent 0f7df5a commit 2f95972

File tree

1 file changed

+18
-12
lines changed
  • package/MDAnalysis/coordinates

1 file changed

+18
-12
lines changed

package/MDAnalysis/coordinates/DCD.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
:class:`DCDReader`) although there can be issues with the unitcell (simulation
3232
box) representation (see :attr:`DCDReader.dimensions`). DCDs can also be
3333
written but the :class:`DCDWriter` follows recent NAMD/VMD convention for the
34-
unitcell but still writes AKMA time. Reading and writing these trajectories
34+
unitcell while still writing AKMA time. Reading and writing these trajectories
3535
within MDAnalysis will work seamlessly but if you process those trajectories
3636
with other tools you might need to watch out that time and unitcell dimensions
3737
are correctly interpreted.
@@ -82,11 +82,10 @@ class DCDReader(base.ReaderBase):
8282
dimensions**, especially for triclinic unitcells (see `Issue 187`_). DCD
8383
trajectories produced by CHARMM and NAMD( >2.5) record time in AKMA units.
8484
If other units have been recorded (e.g., ps) then employ the configurable
85-
:class:MDAnalysis.coordinates.LAMMPS.DCDReader and set the time unit as a
85+
:class:`MDAnalysis.coordinates.LAMMPS.DCDReader` and set the time unit as a
8686
optional argument. You can find a list of units used in the DCD formats on
8787
the MDAnalysis `wiki`_.
8888
89-
9089
MDAnalysis always uses ``(*A*, *B*, *C*, *alpha*, *beta*, *gamma*)`` to
9190
represent the unit cell. Lengths *A*, *B*, *C* are in the MDAnalysis length
9291
unit (Å), and angles are in degrees.
@@ -96,7 +95,13 @@ class DCDReader(base.ReaderBase):
9695
original unitcell is read as ``[A, gamma, B, beta, alpha, C]`` from the DCD
9796
file. If any of these values are < 0 or if any of the angles are > 180
9897
degrees then it is assumed it is a new-style CHARMM unitcell (at least
99-
since c36b2) in which box vectors were recorded.
98+
since c36b2) in which box vectors were recorded. If all angles are numberse
99+
between -1 and +1, then they are treated as cosines of the angle (following
100+
the modern NAMD > 2.5/VMD convention).
101+
102+
Ultimately, all unitcell representations are converted to the MDAnalysis
103+
standard unit cell representation in :attr:`DCDReader.dimensions`.
104+
100105
101106
.. deprecated:: 2.4.0
102107
DCDReader currently makes independent timesteps
@@ -118,6 +123,7 @@ class DCDReader(base.ReaderBase):
118123
.. _Issue 187: https://github.com/MDAnalysis/mdanalysis/issues/187
119124
.. _DCDplugin: http://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/dcdplugin_8c-source.html#l00947
120125
.. _wiki: https://github.com/MDAnalysis/mdanalysis/wiki/FileFormats#dcd
126+
121127
"""
122128

123129
format = "DCD"
@@ -375,14 +381,14 @@ class DCDWriter(base.WriterBase):
375381
.. warning::
376382
377383
Multiple conventions exist for how unit cells are written to DCD
378-
files. Until 2.10.0 MDAnalysis followed the old CHARMM/NAMD (≤2.5)
379-
convention of storing ``[A, gamma, B, beta, alpha, C]`` while wrongly
380-
stating that the new NAMD/VMD convention would be followed. In 2.10.0,
381-
MDAnalysis switched to following the documented behavior and now stores
382-
the box with angle cosines, as described above. The MDAnalysis
383-
:class:`DCDReader` can correctly read either format but *if you have code
384-
that relies on a specific format for the box information in the raw DCD
385-
file, please check your results.*
384+
files. Until 2.10.0 MDAnalysis followed the old X-PLOR/CHARMM/NAMD
385+
(≤2.5) convention of storing ``[A, gamma, B, beta, alpha, C]`` while
386+
wrongly stating that the new NAMD/VMD convention would be followed. In
387+
2.10.0, MDAnalysis switched to following the documented behavior and now
388+
stores the box with angle cosines, as described above. The MDAnalysis
389+
:class:`DCDReader` can correctly read either format but *if you have
390+
code that relies on a specific format for the box information in the raw
391+
DCD file, please check your results.*
386392
387393
Furthermore, modern versions of CHARMM store box vectors and not box
388394
length/angles. When reading MDAnalysis-generated DCD files *in CHARMM*,

0 commit comments

Comments
 (0)