Skip to content

Commit

Permalink
Docs fixed!
Browse files Browse the repository at this point in the history
  • Loading branch information
jdetle committed Jul 10, 2016
1 parent 566501f commit a92788e
Showing 1 changed file with 38 additions and 49 deletions.
87 changes: 38 additions & 49 deletions package/MDAnalysis/analysis/diffusionmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,36 @@
approximated by the euclidean distance between rows i and j of
self.diffusion_space.
.. _Distance-Matrix-tutorial:
Distance Matrix tutorial
------------------------
Often a, a custom distance matrix could be useful for local
epsilon determination or other manipulations on the diffusion
map method. The :class:`DistanceMatrix` exists in
:mod:`~MDAnalysis.analysis.diffusionmap` and can be passed
as an initialization argument for :class:`DiffusionMap`.
>>> import MDAnalysis as mda
>>> import numpy as np
>>> import MDAnalysis.analysis.diffusionmap as diffusionmap
>>> from MDAnalysis.tests.datafiles import PSF, DCD
Now create the distance matrix and pass it as an argument to
:class:`DiffusionMap`.
>>> u = mda.Universe(PSF,DCD)
>>> dist_matrix = diffusionmap.DistanceMatrix(u, select='all')
>>> dist_matrix.run()
>>> dmap = diffusionmap.DiffusionMap(dist_matrix)
>>> dmap.run()
Classes
-------
.. autoclass:: DiffusionMap
.. autoclass:: DistMatrix
.. autoclass:: DistanceMatrix
References
----------
Expand All @@ -116,14 +141,15 @@
Coifman, Ronald R., Lafon, Stephane Diffusion maps. Appl. Comput. Harmon.
Anal. 21, 5–30 (2006).
For more information:
For more information
--------------------
.. [deLaPorte1]
J. de la Porte, B. M. Herbst, W. Hereman, S. J. van der Walt.
An Introduction to Diffusion Maps.
.. [Clementi1]
Rohrdanz, M. A, ZheA flexible ALPS/Aprun task bundler https://www.olcf.ornl.gov/kb_articles/wraprun/
ng, W, Maggioni, M, & Clementi, C.
Rohrdanz, M. A, Zheng, W, Maggioni, M, & Clementi, C.
Determination of reaction coordinates via locally scaled
diffusion map. J. Chem. Phys. 134, 124116 (2011).
Expand All @@ -132,7 +158,6 @@
Debenedetti, P. G. Nonlinear dimensionality reduction in molecular simulation:
The diffusion map approach Chem. Phys. Lett. 509, 1−11 (2011)
.. If you choose the default metric, this module uses the fast QCP algorithm
[Theobald2005]_ to calculate the root mean square distance (RMSD) between
two coordinate sets (as implemented
Expand All @@ -155,25 +180,12 @@


class DistanceMatrix(AnalysisBase):
""" Calculate the pairwise distance between each frame in a trajectory using
a given metric
"""Calculate the pairwise distance between each frame in a trajectory
using a given metric
A distance matrix can be initialized on its own and used as an
initialization argument in :class:`DiffusionMap`:: As an example
>>> import MDAnalysis as mda
>>> import numpy as np
>>> import MDAnalysis.analysis.diffusionmap as diffusionmap
>>> from MDAnalysis.tests.datafiles import PSF, DCD
Now create the distance matrix and pass it as an argument to
:class:`DiffusionMap`.
>>> u = mda.Universe(PSF,DCD)
>>> dist_matrix = diffusionmap.DistanceMatrix(u, select='all')
>>> dist_matrix.run()
>>> dmap = diffusionmap.DiffusionMap(dist_matrix)
>>> dmap.run()
initialization argument in :class:`DiffusionMap`. Refer to the
:ref:`Distance-Matrix-tutorial` for a demonstration.
Attributes
----------
Expand Down Expand Up @@ -299,33 +311,10 @@ def __init__(self, u, epsilon=1, **kwargs):
Specifies the method used for the choice of scale parameter in the
diffusion map. More information in [Lafon1]_, [Ferguson1]_ and
[Clementi1]_, Default: 1.
Keywords
--------
select: str, optional
Any valid selection string for
:meth:`~MDAnalysis.core.AtomGroup.AtomGroup.select_atoms`
This selection of atoms is used to calculate the RMSD between
different frames. Water should be excluded.
metric : function, optional
Maps two numpy arrays to a float, is positive definite and
symmetric. The API for a metric requires that the arrays must have
equal length, and that the function should have weights as an
optional argument. Weights give each index value its own weight for
the metric calculation over the entire arrays. Default: metric is
set to rms.rmsd().
cutoff : float, optional
Specify a given cutoff for metric values to be considered equal,
Default: 1EO-5
weights : array, optional
Weights to be given to coordinates for metric calculation
start : int, optional
First frame of trajectory to analyse, Default: 0
stop : int, optional
Last frame of trajectory to analyse, Default: -1
step : int, optional
Step between frames to analyse, Default: 1
"""
**kwargs
Parameters to be passed for the initialization of a
:class:`DistanceMatrix`.
"""
if isinstance(u, Universe):
self._dist_matrix = DistanceMatrix(u, **kwargs)
elif isinstance(u, DistanceMatrix):
Expand Down

0 comments on commit a92788e

Please sign in to comment.