Skip to content

Commit

Permalink
added loading_files docs page
Browse files Browse the repository at this point in the history
added Amber and Gromacs stubs

added pdbqt stub

added hoomd docs stubs

too enthusiastic with hoooomd name

WIP of new loading files docs

added link to GROParser in loading_gro docs

added ibisco loading stub

added tinker stub

added lammps load stubs

fixed up docs table

added pdb load stubs

added charmm load doc stubs

more load doc stubs

finished stubs for load docs

wrote docs for loading ibisco/yasp

updated TOP loading docs

finished Amber loading docs

rearranged gromacs docs

typos for docs

reworked PQR docs
  • Loading branch information
richardjgowers committed Apr 5, 2018
1 parent ace4dc8 commit 58a559a
Show file tree
Hide file tree
Showing 25 changed files with 723 additions and 266 deletions.
44 changes: 11 additions & 33 deletions package/MDAnalysis/coordinates/GRO.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@
`GRO format`_ which includes a conversion routine for the box.
Writing GRO files
-----------------
By default any written GRO files will renumber the atom ids to move sequentially
from 1. This can be disabled, and instead the original atom ids kept, by
using the `reindex=False` keyword argument. This is useful when writing a
subsection of a larger Universe while wanting to preserve the original
identities of atoms.
For example::
>>> u = mda.Universe()`
>>> u.atoms.write('out.gro', reindex=False)
# OR
>>> with mda.Writer('out.gro', reindex=False) as w:
... w.write(u.atoms)
Classes
-------
.. autoclass:: Timestep
:members:
.. autoclass:: GROReader
:members:
.. autoclass:: GROWriter
:members:
Developer notes: ``GROWriter`` format strings
---------------------------------------------
Expand Down Expand Up @@ -96,6 +63,17 @@
vector representation of the unit cell. The rearrangement into the odd
gromacs order is done automatically.
Classes
-------
.. autoclass:: Timestep
:members:
.. autoclass:: GROReader
:members:
.. autoclass:: GROWriter
:members:
.. _Gromacs: http://www.gromacs.org
.. _GRO: http://manual.gromacs.org/current/online/gro.html
Expand Down
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
71 changes: 0 additions & 71 deletions package/MDAnalysis/coordinates/PQR.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,77 +25,6 @@
PQR file format --- :mod:`MDAnalysis.coordinates.PQR`
=====================================================
Read atoms with charges from a PQR_ file (as written by PDB2PQR_). The
following is adopted from the description of the PQR_ format as used by APBS_:
*MDAnalysis* reads very loosely-formatted PQR files: all fields are
**whitespace-delimited** rather than the strict column formatting mandated
by the PDB_ format. This more liberal formatting allows coordinates
which are larger/smaller than ±999 Å.
MDAnalysis reads data on a per-line basis from PQR files using the following format::
recordName serial atomName residueName chainID residueNumber X Y Z charge radius
If this fails it is assumed that the *chainID* was omitted and the shorter
format is read::
recordName serial atomName residueName residueNumber X Y Z charge radius
Anything else will raise a :exc:`ValueError`.
The whitespace is the most important feature of this format: fields
*must* be separated by at least one space or tab character. The fields
are:
*recordName*
A string which specifies the type of PQR entry and should either be ATOM or
HETATM.
*serial*
An integer which provides the atom index (but note that MDAnalysis renumbers
atoms so one cannot rely on the *serial*)
*atomName*
A string which provides the atom name.
*residueName*
A string which provides the residue name.
*chainID*
An optional string which provides the chain ID of the atom.
*residueNumber*
An integer which provides the residue index.
*X Y Z*
Three floats which provide the atomic coordiantes.
*charge*
A float which provides the atomic charge (in electrons).
*radius*
A float which provides the atomic radius (in Å).
Clearly, this format can deviate wildly from PDB_ due to the use of whitespaces
rather than specific column widths and alignments. This deviation can be
particularly significant when large coordinate values are used.
Output should look like this (although the only real requirement is
*whitespace* separation between *all* entries). The chainID is optional
and can be omitted::
ATOM 1 N MET 1 -11.921 26.307 10.410 -0.3000 1.8500
ATOM 36 NH1 ARG 2 -6.545 25.499 3.854 -0.8000 1.8500
ATOM 37 HH11 ARG 2 -6.042 25.480 4.723 0.4600 0.2245
.. Warning:: Fields *must be white-space separated* or data are read
incorrectly. PDB formatted files are *not* guaranteed to be
white-space separated so extra care should be taken when quickly
converting PDB files into PQR files using simple scripts.
For example, PQR files created with PDB2PQR_ and the `--whitespace`
option are guaranteed to conform to the above format::
pdb2pqr --ff=charmm --whitespace 4ake.pdb 4ake.pqr
.. _PQR: https://apbs-pdb2pqr.readthedocs.io/en/latest/formats/pqr.html
.. _APBS: https://apbs-pdb2pqr.readthedocs.io/en/latest/apbs/index.html
.. _PDB2PQR: https://apbs-pdb2pqr.readthedocs.io/en/latest/pdb2pqr/index.html
.. _PDB: http://www.wwpdb.org/documentation/file-format
"""
from __future__ import absolute_import
from six.moves import zip
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
10 changes: 0 additions & 10 deletions package/MDAnalysis/coordinates/TRZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@
"""TRZ trajectory I/O --- :mod:`MDAnalysis.coordinates.TRZ`
============================================================
Classes to read `IBIsCO`_ / `YASP`_ TRZ binary trajectories, including
coordinates, velocities and more (see attributes of the :class:`Timestep`).
Data are read and written in binary representation but because this depends on
the machine hardware architecture, MDAnalysis *always* reads and writes TRZ
trajectories in *little-endian* byte order.
.. _IBIsCO: http://www.theo.chemie.tu-darmstadt.de/ibisco/IBISCO.html
.. _YASP: http://www.theo.chemie.tu-darmstadt.de/group/services/yaspdoc/yaspdoc.html
Classes
-------
Expand Down
1 change: 0 additions & 1 deletion package/MDAnalysis/topology/GROParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
.. autoclass:: GROParser
:members:
:inherited-members:
"""
from __future__ import absolute_import
Expand Down
36 changes: 0 additions & 36 deletions package/MDAnalysis/topology/TOPParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,6 @@
AMBER PRMTOP topology parser
============================
Reads an AMBER top file to build the system.
Amber keywords are turned into the following attributes:
+-----------------+----------------------+
| AMBER flag | MDAnalysis attribute |
+-----------------+----------------------+
| ATOM_NAME | names |
+-----------------+----------------------+
| CHARGE | charges |
+-----------------+----------------------+
| ATOMIC_NUMBER | elements |
+-----------------+----------------------+
| MASS | masses |
+-----------------+----------------------+
| ATOM_TYPE_INDEX | type_indices |
+-----------------+----------------------+
| AMBER_ATOM_TYPE | types |
+-----------------+----------------------+
| RESIDUE_LABEL | resnames |
+-----------------+----------------------+
| RESIDUE_POINTER | residues |
+-----------------+----------------------+
TODO:
Add reading of bonds etc
.. Note::
The Amber charge is converted to electron charges as used in
MDAnalysis and other packages. To get back Amber charges, multiply
by 18.2223.
.. _`PARM parameter/topology file specification`:
http://ambermd.org/formats.html#topology
Classes
-------
Expand Down
59 changes: 1 addition & 58 deletions package/MDAnalysis/topology/TPRParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,69 +28,12 @@
"""Gromacs portable run input TPR format parser
============================================
The :mod:`~MDAnalysis.topology.TPRParser` module allows reading of a
Gromacs_ portable run input file (a `TPR file`_). Because
the file format of the TPR file is changing rapidly, not all versions
are currently supported. The known working versions and the
approximate Gromacs release numbers are listed in the table
:ref:`TPR format versions <TPR-format-table>`.
.. _`TPR-format-table`:
.. table:: TPR format versions and generations read by :func:`MDAnalysis.topology.TPRParser.parse`.
========== ============== ==================== =====
TPX format TPX generation Gromacs release read
========== ============== ==================== =====
?? ?? 3.3, 3.3.1 no
58 17 4.0, 4.0.2, 4.0.3, yes
4.0.4, 4.0.5, 4.0.6,
4.0.7
73 23 4.5.0, 4.5.1, 4.5.2, yes
4.5.3, 4.5.4, 4.5.5
83 24 4.6, 4.6.1 yes
100 26 5.0, 5.0.1, 5.0.2, yes
5.0.3,5.0.4, 5.0.5
103 26 5.1 yes
110 26 2016 yes
========== ============== ==================== =====
For further discussion and notes see `Issue 2`_. Please *open a new issue* in
the `Issue Tracker`_ when a new or different TPR file format version should be
supported.
Bonded interactions available in Gromacs are described in table 5.5 of the
`Gromacs manual`_. The following ones are used to build the topology (see
`Issue 463`_):
* bonds: regular bonds (type 1), G96 bonds (type 2), Morse (type 3),
cubic bonds (type 4), connections (type 5), harmonic potentials (type 6),
FENE bonds (type 7), restraint potentials (type 10),
tabulated potential with exclusion/connection (type 8),
tabulated potential without exclusion/connection (type 9), constraints with
exclusion/connection (type 1), constraints without exclusion/connection (type
2)
* angles: regular angles (type 1), G96 angles (type 2), cross bond-bond
(type3), cross-bond-angle (type 4), Urey-Bradley (type 5), quartic angles
(type 6), restricted bending potential (type 10), tabulated angles (type 8)
* dihedrals: proper dihedrals (type 1 and type 9), Ryckaert-Bellemans dihedrals
(type 3), Fourier dihedrals (type 5), restricted dihedrals (type 10),
combined bending-torsion potentials (type 11), tabulated dihedral (type 8)
* impropers: improper dihedrals (type 2), periodic improper dihedrals (type 4)
Classes
-------
.. autoclass:: TPRParser
:members:
:inherited-members:
See Also
--------
Expand Down
Loading

0 comments on commit 58a559a

Please sign in to comment.