From 4b763d3a2bbbb771886c2950b17976ffdad1f66e Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Tue, 23 May 2017 21:59:21 -0700 Subject: [PATCH 1/6] helanal: minor doc change (numpyfication) --- package/MDAnalysis/analysis/helanal.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/package/MDAnalysis/analysis/helanal.py b/package/MDAnalysis/analysis/helanal.py index 496307126bc..d1b88f89a10 100644 --- a/package/MDAnalysis/analysis/helanal.py +++ b/package/MDAnalysis/analysis/helanal.py @@ -215,10 +215,10 @@ def helanal_trajectory(universe, selection="name CA", If the specified finish time precedes the specified start time or current time stamp of trajectory object. - .. Note:: - - Only a single helix is analyzed. Use the selection to specify the - helix, e.g. with "name CA and resid 1:20" or use start=1, stop=20. + Notes + ----- + Only a single helix is analyzed. Use the selection to specify the helix, + e.g. with "name CA and resid 1:20" or use start=1, stop=20. .. versionchanged:: 0.13.0 @@ -487,9 +487,6 @@ def helanal_main(pdbfile, selection="name CA", ref_axis=None): logger *MDAnalysis.analysis.helanal*. A simple way to enable a logger is to use :func:`~MDAnalysis.lib.log.start_logging`. - .. Note:: Only a single helix is analyzed. Use the selection to specify - the helix, e.g. with "name CA and resid 1:20". - Parameters ---------- pdbfile : str @@ -512,6 +509,13 @@ def helanal_main(pdbfile, selection="name CA", ref_axis=None): * Best fit tilt * Rotation angles: local screw angles (per residue) + + Notes + ----- + Only a single helix is analyzed. Use the selection to specify the + helix, e.g. with "name CA and resid 1:20". + + Example ------- Analyze helix 8 in AdK (PDB 4AKE); the standard logger is started and @@ -528,6 +532,7 @@ def helanal_main(pdbfile, selection="name CA", ref_axis=None): .. versionchanged:: 0.16.0 Removed the `start` and `end` keywords for selecting residues because this can be accomplished more transparently with `selection`. + """ universe = MDAnalysis.Universe(pdbfile) From fe680455e59ad1d2d0ea50c620ed1ce572ed787a Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Fri, 9 Mar 2018 16:55:47 -0700 Subject: [PATCH 2/6] RMSD doc improvements --- package/MDAnalysis/analysis/rms.py | 66 +++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/package/MDAnalysis/analysis/rms.py b/package/MDAnalysis/analysis/rms.py index 95ebabb0cf2..b28da093c2a 100644 --- a/package/MDAnalysis/analysis/rms.py +++ b/package/MDAnalysis/analysis/rms.py @@ -89,7 +89,6 @@ "backbone and resid 30-59"], # NMP filename="rmsd_all_CORE_LID_NMP.dat") R.run() - R.save() import matplotlib.pyplot as plt rmsd = R.rmsd.T # transpose makes it easier for plotting @@ -202,6 +201,14 @@ def rmsd(a, b, weights=None, center=False, superposition=False): reference configuration divided by :math:`1/\sqrt{N}` where :math:`N` is the number of coordinates. + The weights :math:`w_i` are calculated from the input weights + `weights` :math:`w'_i` as relative to the mean: + + .. math:: + + w_i = \frac{w'_i}{\langle w' \rangle} + + Example ------- >>> u = Universe(PSF,DCD) @@ -382,6 +389,9 @@ def __init__(self, atomgroup, reference=None, select='all', than `tol_mass`. ref_frame : int (optional) frame index to select frame from `reference` + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. Raises ------ @@ -395,20 +405,29 @@ def __init__(self, atomgroup, reference=None, select='all', length) or if it is not a 1D array (see :func:`MDAnalysis.lib.util.get_weights`). - If `weights` are not compatible with `groupselections`: only equal - weights (``weights=None``) or mass-weighted (``weights="mass"``) - are supported for additional `groupselections`. + A :exc:`ValueError` is also raised if `weights` are not compatible + with `groupselections`: only equal weights (``weights=None``) or + mass-weighted (``weights="mass"``) are supported for additional + `groupselections`. Notes ----- - The root mean square deviation of a group of :math:`N` atoms relative to a - reference structure as a function of time is calculated as + The root mean square deviation :math:`\rho(t)` of a group of :math:`N` + atoms relative to a reference structure as a function of time is + calculated as .. math:: \rho(t) = \sqrt{\frac{1}{N} \sum_{i=1}^N w_i \left(\mathbf{x}_i(t) - \mathbf{x}_i^{\text{ref}}\right)^2} + The weights :math:`w_i` are calculated from the input weights `weights` + :math:`w'_i` as relative to the mean of the input weights: + + .. math:: + + w_i = \frac{w'_i}{\langle w' \rangle} + The selected coordinates from `atomgroup` are optimally superimposed (translation and rotation) on the `reference` coordinates at each time step as to minimize the RMSD. Douglas Theobald's fast QCP algorithm @@ -425,6 +444,11 @@ def __init__(self, atomgroup, reference=None, select='all', .. _STAMP: http://www.compbio.dundee.ac.uk/manuals/stamp.4.2/ + See Also + -------- + rmsd + + .. versionadded:: 0.7.7 .. versionchanged:: 0.8 `groupselections` added @@ -669,7 +693,14 @@ def __init__(self, atomgroup, **kwargs): step : int (optional) step between frames, default None becomes 1. verbose : bool (optional) - if ``False``, suppress all output + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. + + Raises + ------ + ValueError + raised if negative values are calculated, which indicates that a + numerical overflow or underflow occured Notes @@ -703,16 +734,23 @@ def __init__(self, atomgroup, **kwargs): protein):: import MDAnalysis as mda + from MDAnalysis.analysis import align from MDAnalysis.tests.datafiles import TPR, XTC u = mda.Universe(TPR, XTC, in_memory=True) protein = u.select_atoms("protein") - # TODO: need a step to center and make whole: this trajectory - # contains the protein being split across periodic boundaries + # 1) need a step to center and make whole: this trajectory + # contains the protein being split across periodic boundaries + # + # TODO + + # 2) fit to the initial frame to get a better average structure + # (the trajectory is changed in memory) + prealigner = align.AlignTraj(u, select="protein and name CA", in_memory=True).run() - # reference = average structure + # 3) reference = average structure reference_coordinates = u.trajectory.timeseries(asel=protein).mean(axis=1) # make a reference structure (need to reshape into a 1-frame "trajectory") reference = mda.Merge(protein).load_new( @@ -723,8 +761,7 @@ def __init__(self, atomgroup, **kwargs): whole trajectory to the reference by minimizing the RMSD. We use :class:`MDAnalysis.analysis.align.AlignTraj`:: - from MDAnalysis.analysis.align import AlignTraj - aligner = AlignTraj(u, reference, select="protein and name CA", in_memory=True).run() + aligner = align.AlignTraj(u, reference, select="protein and name CA", in_memory=True).run() The trajectory is now fitted to the reference (the RMSD is stored as `aligner.rmsd` for further inspection). Now we can calculate the RMSF:: @@ -761,11 +798,10 @@ def __init__(self, atomgroup, **kwargs): super(RMSF, self).__init__(atomgroup.universe.trajectory, **kwargs) self.atomgroup = atomgroup - def run(self, start=None, stop=None, step=None, progout=None, - verbose=None, quiet=None): + def run(self, start=None, stop=None, step=None, verbose=None, quiet=None): """Perform the analysis.""" - if any([el is not None for el in (start, stop, step, progout, quiet)]): + if any([el is not None for el in (start, stop, step, quiet)]): warnings.warn("run arguments are deprecated. Please pass them at " "class construction. These options will be removed in 0.17.0", category=DeprecationWarning) From de6a58542a4c6c7d7ec8182257c850c1c4001e0d Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Fri, 23 Mar 2018 21:11:18 -0700 Subject: [PATCH 3/6] add GSD to docs --- package/MDAnalysis/coordinates/GSD.py | 9 ++++--- package/MDAnalysis/coordinates/__init__.py | 3 +++ package/MDAnalysis/topology/GSDParser.py | 24 +++++++++++-------- package/MDAnalysis/topology/__init__.py | 2 +- package/doc/sphinx/source/conf.py | 1 + .../documentation_pages/coordinates/GSD.rst | 1 + .../coordinates_modules.rst | 1 + 7 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 package/doc/sphinx/source/documentation_pages/coordinates/GSD.rst diff --git a/package/MDAnalysis/coordinates/GSD.py b/package/MDAnalysis/coordinates/GSD.py index 2e7dea1946e..9db0bb3b77d 100644 --- a/package/MDAnalysis/coordinates/GSD.py +++ b/package/MDAnalysis/coordinates/GSD.py @@ -22,9 +22,10 @@ """GSD trajectory reader --- :mod:`MDAnalysis.coordinates.GSD` ============================================================ -Class to read the GSD trajectory, output of HOOMD-blue. The GSD format specifies -both the topology and the trajectory of the particles in the simulation. The -topology is read by the GSDTopology class. +Class to read the GSD trajectory, output of `HOOMD-blue`_. The GSD format +specifies both the topology and the trajectory of the particles in the +simulation. The topology is read by the +:class:`~MDAnalysis.topology.GSDParser.GSDParser` class. The GSD format was developed having in mind the possibility of changing number of particles, particle types, particle identities and changing topology. @@ -34,6 +35,8 @@ to be different to the one that was set at the first time step. No check on changes in particle identity or topology is currently implemented. +.. _`HOOMD-blue`: http://codeblue.umich.edu/hoomd-blue/index.html + Classes ------- diff --git a/package/MDAnalysis/coordinates/__init__.py b/package/MDAnalysis/coordinates/__init__.py index f558e1314d3..dfe69c3fdcf 100644 --- a/package/MDAnalysis/coordinates/__init__.py +++ b/package/MDAnalysis/coordinates/__init__.py @@ -186,6 +186,9 @@ class can choose an appropriate reader automatically. | TXYZ [#a]_ | txyz, | r | Tinker XYZ format. | | | arc | | Module :mod:`MDAnalysis.coordinates.TXYZ` | +---------------+-----------+-------+------------------------------------------------------+ + | HOOMD [#a]_ | gsd | r | HOOMD GSD format (using :mod:`gsd.hoomd`). | + | | | | Module :mod:`MDAnalysis.coordinates.GSD` | + +---------------+-----------+-------+------------------------------------------------------+ | GAMESS | gms, | r | Generic semi-formatted GAMESS output log; can be | | | log, | | compressed (gzip or bzip2). Module | | | out | | :mod:`MDAnalysis.coordinates.GMS` | diff --git a/package/MDAnalysis/topology/GSDParser.py b/package/MDAnalysis/topology/GSDParser.py index 780d1087627..0137b19068d 100644 --- a/package/MDAnalysis/topology/GSDParser.py +++ b/package/MDAnalysis/topology/GSDParser.py @@ -20,23 +20,28 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -GSD topology parser +"""GSD topology parser ========================= .. versionadded:: 0.17.0 -The :class:`GSDParser` generates a topology from files for the HOOMD_ code. - -Parser for the HOOMD-blue GSD topology/trajectory format. The GSD file stores -information on both the topology and the trajectory in the same file, and allows -for varying atom numbers/identities and topologies during the course of the -simulation. At the moment MDAnalysis can deal only with the case in which there -is no variation. +The :class:`GSDParser` generates a topology from HOOMD_ GSD topology/trajectory +files. The GSD file stores information on both the topology and the trajectory +in the same file, and allows for varying atom numbers/identities and topologies +during the course of the simulation. At the moment MDAnalysis can deal only +with the case in which there is no variation. The trajectory data are read with +the :class:`~MDAnalysis.coordinates.GSD.GSDReader` class. .. _HOOMD: http://codeblue.umich.edu/hoomd-blue/index.html .. _HOOMD GSD: https://bitbucket.org/glotzer/gsd + +To load a GSD HOOMD file:: + + import MDAnalysis as mda + u = mda.Universe("example.gsd") + + Classes ------- @@ -51,7 +56,6 @@ import numpy as np from . import guessers -from ..lib.util import openany from .base import TopologyReaderBase from ..core.topology import Topology from ..core.topologyattrs import ( diff --git a/package/MDAnalysis/topology/__init__.py b/package/MDAnalysis/topology/__init__.py index 0ccc3778d30..073ab93313e 100644 --- a/package/MDAnalysis/topology/__init__.py +++ b/package/MDAnalysis/topology/__init__.py @@ -141,7 +141,7 @@ bonds, angles, angles, and dihedrals. dihedrals :mod:`MDAnalysis.topology.HoomdXMLParser` - GSD gsd types, charges, GSD topology file. Reads atom types, + GSD [#a]_ gsd types, charges, GSD topology file. Reads atom types, radii, masses masses, and charges if possible. Also reads bonds, bonds, angles, angles, and dihedrals. dihedrals :mod:`MDAnalysis.topology.GSDParser` diff --git a/package/doc/sphinx/source/conf.py b/package/doc/sphinx/source/conf.py index b39ed86ea1c..d1654716028 100644 --- a/package/doc/sphinx/source/conf.py +++ b/package/doc/sphinx/source/conf.py @@ -334,4 +334,5 @@ 'https://matplotlib.org': None, 'https://networkx.github.io/documentation/stable/': None, 'https://www.mdanalysis.org/GridDataFormats/': None, + 'https://gsd.readthedocs.io/en/stable/': None, } diff --git a/package/doc/sphinx/source/documentation_pages/coordinates/GSD.rst b/package/doc/sphinx/source/documentation_pages/coordinates/GSD.rst new file mode 100644 index 00000000000..aff15b428fa --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/coordinates/GSD.rst @@ -0,0 +1 @@ +.. automodule:: MDAnalysis.coordinates.GSD diff --git a/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst b/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst index e4e2c11183b..359719e3330 100644 --- a/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst +++ b/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst @@ -24,6 +24,7 @@ provide the format in the keyword argument *format* to coordinates/DLPoly coordinates/DMS coordinates/GMS + coordinates/GSD coordinates/GRO coordinates/INPCRD coordinates/LAMMPS From d404dd4f446416592105a65a24de913e0a8ae551 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sat, 24 Mar 2018 12:57:33 -0700 Subject: [PATCH 4/6] make diffusionmap.DistanceMatrix full y use AnalysisBase Changes enable use of verbose (related to #1630) --- package/MDAnalysis/analysis/diffusionmap.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/package/MDAnalysis/analysis/diffusionmap.py b/package/MDAnalysis/analysis/diffusionmap.py index 6aaa93ea0bc..20d36d12762 100644 --- a/package/MDAnalysis/analysis/diffusionmap.py +++ b/package/MDAnalysis/analysis/diffusionmap.py @@ -201,7 +201,8 @@ class DistanceMatrix(AnalysisBase): Save the `dist_matrix` to a given filename """ def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5, - weights=None, start=None, stop=None, step=None): + weights=None, start=None, stop=None, step=None, + **kwargs): """ Parameters ---------- @@ -236,16 +237,22 @@ def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5, which means that the trajectory would be read until the end. step : int, optional Step between frames to analyse, Default: None becomes 1. + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. """ self._u = u traj = self._u.trajectory + + # remember that this must be called before referencing self.n_frames + super(DistanceMatrix, self).__init__(self._u.trajectory, + start=start, stop=stop, step=step, **kwargs) + self.atoms = self._u.select_atoms(select) self._metric = metric self._cutoff = cutoff self._weights = weights self._calculated = False - # remember that this must be called before referencing self.n_frames - self._setup_frames(traj, start, stop, step) def _prepare(self): self.dist_matrix = np.zeros((self.n_frames, self.n_frames)) From 4ce5ae9d69b6886eb793fc157e78bcfc2fb499fe Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sat, 24 Mar 2018 13:03:50 -0700 Subject: [PATCH 5/6] analysis docs: explain verbose - fixes #1630 - added explanation of `verbose` for all analysis classes that are derived from AnalysisBase Note: The default remains False (as in AnalysisBase), unlike the request in the issue to set it to True. I didn't want to change the general behavior without further discussion but if there are more voices in favor of showing a progress bar by default then we can change to True. --- package/MDAnalysis/analysis/align.py | 6 ++++-- package/MDAnalysis/analysis/contacts.py | 4 +++- package/MDAnalysis/analysis/lineardensity.py | 4 ++++ package/MDAnalysis/analysis/pca.py | 3 +++ package/MDAnalysis/analysis/polymer.py | 7 ++++++- package/MDAnalysis/analysis/rdf.py | 5 +++++ 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/package/MDAnalysis/analysis/align.py b/package/MDAnalysis/analysis/align.py index 377db2ddc9d..6c3dbccf195 100644 --- a/package/MDAnalysis/analysis/align.py +++ b/package/MDAnalysis/analysis/align.py @@ -558,8 +558,6 @@ def __init__(self, mobile, reference, select='all', filename=None, exact methods force : bool (optional) Force overwrite of filename for rmsd-fitting - verbose : bool (optional) - Set logger to show more information start : int (optional) First frame of trajectory to analyse, Default: 0 stop : int (optional) @@ -572,6 +570,10 @@ def __init__(self, mobile, reference, select='all', filename=None, performance substantially in some cases. In this case, no file is written out (`filename` and `prefix` are ignored) and only the coordinates of `mobile` are *changed in memory*. + verbose : bool (optional) + Set logger to show more information and show detailed progress of + the calculation if set to ``True``; the default is ``False``. + Attributes ---------- diff --git a/package/MDAnalysis/analysis/contacts.py b/package/MDAnalysis/analysis/contacts.py index d38e330f824..6b2370f8add 100644 --- a/package/MDAnalysis/analysis/contacts.py +++ b/package/MDAnalysis/analysis/contacts.py @@ -397,7 +397,9 @@ def __init__(self, u, selection, refgroup, method="hard_cut", radius=4.5, which means that the trajectory would be read until the end. step : int, optional Step between frames to analyse, Default: None becomes 1. - + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. """ self.u = u super(Contacts, self).__init__(self.u.trajectory, **basekwargs) diff --git a/package/MDAnalysis/analysis/lineardensity.py b/package/MDAnalysis/analysis/lineardensity.py index 1e1f853ae7b..291920141a8 100644 --- a/package/MDAnalysis/analysis/lineardensity.py +++ b/package/MDAnalysis/analysis/lineardensity.py @@ -56,6 +56,10 @@ class LinearDensity(AnalysisBase): The frame to end at [-1] step : int The step size through the trajectory in frames [0] + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. + Example ------- diff --git a/package/MDAnalysis/analysis/pca.py b/package/MDAnalysis/analysis/pca.py index e83564c13d5..7d7c82a88e1 100644 --- a/package/MDAnalysis/analysis/pca.py +++ b/package/MDAnalysis/analysis/pca.py @@ -190,6 +190,9 @@ def __init__(self, universe, select='all', align=False, mean=None, step : int, optional Step between frames of trajectory to use for generation of covariance matrix, Default: None + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. """ super(PCA, self).__init__(universe.trajectory, **kwargs) diff --git a/package/MDAnalysis/analysis/polymer.py b/package/MDAnalysis/analysis/polymer.py index 4f82538c217..b72dad27d98 100644 --- a/package/MDAnalysis/analysis/polymer.py +++ b/package/MDAnalysis/analysis/polymer.py @@ -55,7 +55,8 @@ class PersistenceLength(AnalysisBase): Notes ----- - This analysis requires that the trajectory supports indexing + This analysis requires that the trajectory supports indexing. + .. versionadded:: 0.13.0 """ @@ -75,6 +76,10 @@ def __init__(self, atomgroups, **kwargs): step : int, optional Frame index to stop analysis. Default: None becomes n_frames. Iteration stops *before* this frame number. + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. + """ super(PersistenceLength, self).__init__( atomgroups[0].universe.trajectory, **kwargs) diff --git a/package/MDAnalysis/analysis/rdf.py b/package/MDAnalysis/analysis/rdf.py index b705a6c2108..e69565db673 100644 --- a/package/MDAnalysis/analysis/rdf.py +++ b/package/MDAnalysis/analysis/rdf.py @@ -65,6 +65,10 @@ class InterRDF(AnalysisBase): step : int (optional) The step size through the trajectory in frames (default is every frame) + verbose : bool (optional) + Show detailed progress of the calculation if set to ``True``; the + default is ``False``. + Example ------- @@ -83,6 +87,7 @@ class InterRDF(AnalysisBase): within the same molecule. For example, if there are 7 of each atom in each molecule, the exclusion mask `(7, 7)` can be used. + .. versionadded:: 0.13.0 """ From d91dd3c1441dce5d36ba9f2f048a7a4578b0e059 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Tue, 27 Mar 2018 00:16:53 -0700 Subject: [PATCH 6/6] improved docs for analysis.density fixes #1726 --- package/MDAnalysis/analysis/density.py | 58 ++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/package/MDAnalysis/analysis/density.py b/package/MDAnalysis/analysis/density.py index ff20bc2ebb2..80c17c912e3 100644 --- a/package/MDAnalysis/analysis/density.py +++ b/package/MDAnalysis/analysis/density.py @@ -37,16 +37,30 @@ Generating a density from a MD trajectory ----------------------------------------- +A common use case is to analyze the solvent density around a protein of +interest. The density is calculated with :func:`density_from_Universe` in the +fixed coordinate system of the simulation unit cell. It is therefore necessary +to orient and fix the protein with respect to the box coordinate system. In +practice this means centering and superimposing the protein, frame by frame, on +a reference structure and translating and rotating all other components of the +simulation with the protein. In this way, the solvent will appear in the +reference frame of the protein. + An input trajectory must 1. have been centered on the protein of interest; 2. have all molecules made whole that have been broken across periodic - boundaries; + boundaries [#pbc]_; 3. have the solvent molecules remapped so that they are closest to the - solute (this is important when using funky unit cells such as - a dodecahedron or a truncated octahedron). + solute (this is important when using triclinic unit cells such as + a dodecahedron or a truncated octahedron) [#pbc]_. +4. have a fixed frame of reference; for instance, by superimposing a protein + on a reference structure so that one can study the solvent density around + it [#fit]_. -To generate the density of water molecules around a protein:: +To generate the density of water molecules around a protein (assuming that the +trajectory is already appropriately treated for periodic boundary artifacts and +is suitably superimposed to provide a fixed reference frame) [#testraj]_ :: from MDAnalysis.analysis.density import density_from_Universe u = Universe(TPR, XTC) @@ -98,6 +112,40 @@ .. autofunction:: notwithin_coordinates_factory +.. rubric:: Footnotes + +.. [#pbc] Making molecules whole can be accomplished with the + :meth:`MDAnalysis.core.groups.AtomGroup.wrap` of + :attr:`Universe.atoms` (use ``compound="fragments"``). + + When using, for instance, the Gromacs_ command `gmx trjconv`_ + + .. code-block:: bash + + gmx trjconv -pbc mol -center -ur compact + + one can make the molecules whole ``-pbc whole``, center it on a group + (``-center``), and also pack all molecules in a compact unitcell + representation, which can be useful for density generation. + +.. [#fit] Superposition can be performed with + :class:`MDAnalysis.analysis.align.AlignTraj`. + + The Gromacs_ command `gmx trjconv`_ + + .. code-block:: bash + + gmx trjconv -fit rot+trans + + will also accomplish such a superposition. Note that the fitting has + to be done in a *separate* step from the treatment of the periodic + boundaries [#pbc]_. + +.. [#testraj] Note that the trajectory in the example (`XTC`) is *not* properly + made whole and fitted to a reference structure; these steps were + omitted to clearly show the steps necessary for the actual density + calculation. + .. Links .. ----- @@ -105,6 +153,8 @@ .. _VMD: http://www.ks.uiuc.edu/Research/vmd/ .. _Chimera: https://www.cgl.ucsf.edu/chimera/ .. _PyMOL: http://www.pymol.org/ +.. _Gromacs: http://www.gromacs.org +.. _`gmx trjconv`: http://manual.gromacs.org/programs/gmx-trjconv.html """