Skip to content

Commit

Permalink
make diffusionmap.DistanceMatrix full y use AnalysisBase
Browse files Browse the repository at this point in the history
Changes enable use of verbose (related to #1630)
  • Loading branch information
orbeckst committed Mar 24, 2018
1 parent de6a585 commit d404dd4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions package/MDAnalysis/analysis/diffusionmap.py
Expand Up @@ -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
----------
Expand Down Expand Up @@ -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))
Expand Down

2 comments on commit d404dd4

@karthik-lekkala
Copy link

@karthik-lekkala karthik-lekkala commented on d404dd4 Apr 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class diffusion map
run function line 353 should be
self._eigenvectors = self._eigenvectors[:,sort_idx]
and transform should be fixed accordingly

@orbeckst
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthik-lekkala thanks for commenting. Can you please raise an issue – it's hard to keep track of comments on the files. Many thanks!!

Please sign in to comment.