31
31
:class:`DCDReader`) although there can be issues with the unitcell (simulation
32
32
box) representation (see :attr:`DCDReader.dimensions`). DCDs can also be
33
33
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
35
35
within MDAnalysis will work seamlessly but if you process those trajectories
36
36
with other tools you might need to watch out that time and unitcell dimensions
37
37
are correctly interpreted.
@@ -82,11 +82,10 @@ class DCDReader(base.ReaderBase):
82
82
dimensions**, especially for triclinic unitcells (see `Issue 187`_). DCD
83
83
trajectories produced by CHARMM and NAMD( >2.5) record time in AKMA units.
84
84
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
86
86
optional argument. You can find a list of units used in the DCD formats on
87
87
the MDAnalysis `wiki`_.
88
88
89
-
90
89
MDAnalysis always uses ``(*A*, *B*, *C*, *alpha*, *beta*, *gamma*)`` to
91
90
represent the unit cell. Lengths *A*, *B*, *C* are in the MDAnalysis length
92
91
unit (Å), and angles are in degrees.
@@ -96,7 +95,13 @@ class DCDReader(base.ReaderBase):
96
95
original unitcell is read as ``[A, gamma, B, beta, alpha, C]`` from the DCD
97
96
file. If any of these values are < 0 or if any of the angles are > 180
98
97
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
+
100
105
101
106
.. deprecated:: 2.4.0
102
107
DCDReader currently makes independent timesteps
@@ -118,6 +123,7 @@ class DCDReader(base.ReaderBase):
118
123
.. _Issue 187: https://github.com/MDAnalysis/mdanalysis/issues/187
119
124
.. _DCDplugin: http://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/dcdplugin_8c-source.html#l00947
120
125
.. _wiki: https://github.com/MDAnalysis/mdanalysis/wiki/FileFormats#dcd
126
+
121
127
"""
122
128
123
129
format = "DCD"
@@ -375,14 +381,14 @@ class DCDWriter(base.WriterBase):
375
381
.. warning::
376
382
377
383
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.*
386
392
387
393
Furthermore, modern versions of CHARMM store box vectors and not box
388
394
length/angles. When reading MDAnalysis-generated DCD files *in CHARMM*,
0 commit comments