Skip to content

Commit

Permalink
Upated CHANGELOG, brought back the old ContactAnalysis class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Domanski authored and backpropper committed Mar 13, 2016
1 parent 92e6615 commit d950a30
Showing 1 changed file with 4 additions and 46 deletions.
50 changes: 4 additions & 46 deletions package/MDAnalysis/analysis/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ def _conclude(self):
for frame, q1, n1 in self.timeseries:
f.write("{frame:4d} {q1:8.6f} {n1:5d}\n".format(**vars()))

<<<<<<< 0b318502a33fc222a7621937cfc96541788ce84d
def contact_matrix(self, d, out=None):
"""Return distance array with True for contacts.
Expand All @@ -1093,31 +1092,6 @@ def contact_matrix(self, d, out=None):
Note
----
This method is typically only used internally.
=======
def qarray(self, d, out=None):
"""Return array with ``True`` for contacts.

Note
----
This method is typically only used internally.

Arguments
---------
d : array
2D array of distances. The method uses the value of
:attr:`radius` to determine if a ``distance < radius``
is considered a contact.
out : array, optional
If `out` is supplied as a pre-allocated array of the correct
shape then it is filled instead of allocating a new one in
order to increase performance.

Returns
-------
array
contact matrix

>>>>>>> doc string upgrades in analysis.contacts
"""
if out:
out[:] = (d <= self.radius)
Expand All @@ -1128,7 +1102,6 @@ def qarray(self, d, out=None):
def fraction_native(q, out=None):
"""Calculate native contacts relative to reference state.
<<<<<<< 0b318502a33fc222a7621937cfc96541788ce84d
Parameters
----------
q: array
Expand Down Expand Up @@ -1168,9 +1141,11 @@ def fraction_native(q, out=None):
contacts : integer
total number of contacts
fraction : float
fraction of contacts relative to the reference state
Fraction of native contacts (Q) calculated from a contact matrix
>>>>>>> doc string upgrades in analysis.contacts
Note
----
This method is typically only used internally.
"""
if out:
np.logical_and(q, self.mask, out)
Expand All @@ -1180,7 +1155,6 @@ def fraction_native(q, out=None):
return contacts, float(contacts) / self.mask.sum()

def plot(self, filename=None, **kwargs):
<<<<<<< 0b318502a33fc222a7621937cfc96541788ce84d
"""Plot q(t).
Parameters
Expand Down Expand Up @@ -1212,7 +1186,6 @@ def plot(self, filename=None, **kwargs):
fig.show()

def plot_qavg(self, filename=None, **kwargs):
<<<<<<< 0b318502a33fc222a7621937cfc96541788ce84d
"""Plot `Contacts.qavg`, the matrix of average contacts.
Parameters
Expand All @@ -1223,21 +1196,6 @@ def plot_qavg(self, filename=None, **kwargs):
keyword arguments are passed on to `pylab.imshow`.
**kwargs
Arbitrary keyword arguments for the plotting function
=======
"""Plot the matrix of average contacts.
Convenience function to plot :attr:`qavg`.
Arguments
---------
filename : string, optional
If `filename` is supplied then the figure is also written
to file (the suffix determines the file type, e.g. pdf,
png, eps, ...).
**kwargs
All other keyword arguments are passed on to
:func:`matplotlib.pyplot.imshow`.
>>>>>>> doc string upgrades in analysis.contacts
"""
if not self.contact_matrix :
raise ValueError("No timeseries data; do 'Contacts.run()' first.")
Expand Down

0 comments on commit d950a30

Please sign in to comment.