Skip to content

Commit

Permalink
finished Amber loading docs
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjgowers authored and richardjgowers committed Apr 5, 2018
1 parent 2ac1d1c commit 7223b57
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 62 deletions.
4 changes: 0 additions & 4 deletions package/MDAnalysis/coordinates/INPCRD.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
"""INPCRD structure files in MDAnalysis --- :mod:`MDAnalysis.coordinates.INPCRD`
================================================================================
Read coordinates in Amber_ coordinate/restart file (suffix "inpcrd").
.. _Amber: http://ambermd.org/formats.html#restart
Classes
-------
Expand Down
52 changes: 1 addition & 51 deletions package/MDAnalysis/coordinates/TRJ.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@
Binary NetCDF trajectories
--------------------------
The `AMBER netcdf`_ format make use of NetCDF_ (Network Common Data
Form) format. Such binary trajectories are recognized in MDAnalysis by
the '.ncdf' suffix and read by the :class:`NCDFReader`.
Binary trajectories can also contain velocities and forces, and can record the
exact time
step. In principle, the trajectories can be in different units than the AMBER
defaults of ångström and picoseconds but at the moment MDAnalysis only supports
those and will raise a :exc:`NotImplementedError` if anything else is detected.
.. autoclass:: NCDFReader
:members:
Expand All @@ -90,45 +80,6 @@
ASCII TRAJ trajectories
-----------------------
ASCII AMBER_ TRJ coordinate files (as defined in `AMBER TRJ format`_)
are handled by the :class:`TRJReader`. It is also possible to directly
read *bzip2* or *gzip* compressed files.
AMBER ASCII trajectories are recognised by the suffix '.trj',
'.mdcrd' or '.crdbox (possibly with an additional '.gz' or '.bz2').
.. Note::
In the AMBER community, these trajectories are often saved with the
suffix '.crd' but this extension conflicts with the CHARMM CRD
format and MDAnalysis *will not correctly autodetect AMBER ".crd"
trajectories*. Instead, explicitly provide the ``format="TRJ"``
argument to :class:`~MDAnalysis.core.universe.Universe`::
u = MDAnalysis.Universe("top.prmtop", "traj.crd", format="TRJ")
In this way, the AMBER :class:`TRJReader` is used.
.. rubric:: Limitations
* Periodic boxes are only stored as box lengths A, B, C in an AMBER
trajectory; the reader always assumes that these are orthorhombic
boxes.
* The trajectory does not contain time information so we simply set
the time step to 1 ps (or the user could provide it as kwarg *dt*)
* **No direct access of frames is implemented, only iteration through
the trajectory.**
* Trajectories with fewer than 4 atoms probably fail to be read (BUG).
* If the trajectory contains exactly *one* atom then it is always
assumed to be non-periodic (for technical reasons).
* Velocities are currently *not supported* as ASCII trajectories.
.. autoclass:: TRJReader
:members:
Expand All @@ -145,8 +96,7 @@
.. The formats page was archived as
.. http://www.webcitation.org/query?url=http%3A%2F%2Fambermd.org%2Fnetcdf%2Fnctraj.xhtml&date=2018-02-11
.. Use the archived version if the original disappears. [orbeckst]
.. _AMBER netcdf: http://ambermd.org/netcdf/nctraj.xhtml
.. _NetCDF: http://www.unidata.ucar.edu/software/netcdf
.. _Issue Tracker: https://github.com/MDAnalysis/mdanalysis/issues
.. _MDAnalysis mailinglist: https://groups.google.com/group/mdnalysis-discussion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Loading Amber files with MDAnalysis
###################################

MDAnalysis can read PRMTOP, NCDF and ascii coordinate and restart files from
Amber_.
MDAnalysis can read PRMTOP files as topologies and
NCDF and ascii coordinate and restart files as trajectories from
`Amber MD`_ simulations.
Typically using NCDF as the trajectory format will give the best performance
as all other trajectory formats are ascii based.

.. _Amber: http://ambermd.org

.. _Amber MD: http://ambermd.org

.. _load_amber_top:

Expand Down Expand Up @@ -63,19 +63,75 @@ For implementation details, see
Loading Amber NCDF files
------------------------

Pecularities of Amber NCDF files
The `AMBER netcdf`_ format make use of NetCDF_ (Network Common Data
Form) format. Such binary trajectories are recognized in MDAnalysis by
the '.ncdf' or '.nc' suffix.

Binary trajectories can also contain velocities and forces, and can record the
exact time
step. In principle, the trajectories can be in different units than the AMBER
defaults of ångström and picoseconds but at the moment MDAnalysis only supports
those and will raise a :exc:`NotImplementedError` if anything else is detected.

For implementation details see :class:`MDAnalysis.coordinates.TRJ.NCDFReader`.

.. _AMBER netcdf: http://ambermd.org/netcdf/nctraj.xhtml
.. _NetCDF: http://www.unidata.ucar.edu/software/netcdf


.. _load_amber_trj:

Loading TRJ files
-----------------

All about loading Amber ascii TRJ files
ASCII `AMBER TRJ coordinate files`_
are handled by the :class:`TRJReader`. It is also possible to directly
read *bzip2* or *gzip* compressed files.

AMBER ASCII trajectories are recognised by the suffix '.trj',
'.mdcrd' or '.crdbox (possibly with an additional '.gz' or '.bz2').

.. Note::

In the AMBER community, these trajectories are often saved with the
suffix '.crd' but this extension conflicts with the CHARMM CRD
format and MDAnalysis *will not correctly autodetect AMBER ".crd"
trajectories*. Instead, explicitly provide the ``format="TRJ"``
argument to :class:`~MDAnalysis.core.universe.Universe`::

u = MDAnalysis.Universe("top.prmtop", "traj.crd", format="TRJ")

In this way, the format is correct set.

.. rubric:: Limitations

* Periodic boxes are only stored as box lengths A, B, C in an AMBER
trajectory; the reader always assumes that these are orthorhombic
boxes.

* The trajectory does not contain time information so we simply set
the time step to 1 ps (or the user could provide it as kwarg *dt*)

* Trajectories with fewer than 4 atoms probably fail to be read (BUG).

* If the trajectory contains exactly *one* atom then it is always
assumed to be non-periodic (for technical reasons).

* Velocities are currently *not supported* as ASCII trajectories.

For implementation details see
:class:`MDAnalysis.coordinates.TRJ.TRJReader`.

.. _AMBER TRJ coordinate files: http://ambermd.org/formats.html#trajectory

.. _load_amber_restart:

Loading Amber restart files
---------------------------

All about loading Amber restart files
A single frame of positions can be read from `Amber restart files`_,
which require a file suffix of ``.inpcrd`` or ``.restrt``.
See :mod:`MDAnalysis.coordinates.INPCRD` for implementation details.

.. _Amber restart files: http://ambermd.org/formats.html#restart

0 comments on commit 7223b57

Please sign in to comment.