Skip to content

Commit

Permalink
added duecredit
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium committed May 13, 2020
1 parent ca0553f commit 206900a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions package/MDAnalysis/analysis/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
from MDAnalysis.lib.log import ProgressBar

from ..lib import util
from ..due import due, Doi
from .base import AnalysisBase


Expand Down Expand Up @@ -348,13 +349,21 @@ def transform(self, atomgroup, n_components=None, start=None, stop=None,

return dot

@due.dcite(
Doi('10.1002/(SICI)1097-0134(19990901)36:4<419::AID-PROT5>3.0.CO;2-U'),
Doi('10.1529/biophysj.104.052449'),
description="RMSIP",
path='MDAnalysis.analysis.pca',
)
def rmsip(self, other, n_components=None):
"""Compute the root mean square inner product between subspaces.
This is only symmetric if the number of components is the same for
both instances. The RMSIP effectively measures how
correlated the vectors of this instance are to those of ``other``.
Please cite [Amadei1999]_ and [Leo-Macias2004]_ if you use this function.
Parameters
----------
other: :class:`~MDAnalysis.analysis.pca.PCA`
Expand All @@ -370,6 +379,10 @@ def rmsip(self, other, n_components=None):
0 indicates that they are mutually orthogonal, whereas 1 indicates
that they are identical.
See also
--------
rmsip
.. versionadded:: 1.0.0
"""
try:
Expand All @@ -388,6 +401,11 @@ def rmsip(self, other, n_components=None):

return rmsip(a.T, b.T, n_components=n_components)

@due.dcite(
Doi('10.1016/j.str.2007.12.011'),
description="Cumulative overlap",
path='MDAnalysis.analysis.pca',
)
def cumulative_overlap(self, other, i=0, n_components=None):
"""Compute the cumulative overlap of a vector in a subspace.
Expand All @@ -413,6 +431,10 @@ def cumulative_overlap(self, other, i=0, n_components=None):
the ``other`` subspace. 0 indicates that they are mutually
orthogonal, whereas 1 indicates that they are identical.
See also
--------
cumulative_overlap
.. versionadded:: 1.0.0
"""
Expand Down Expand Up @@ -470,6 +492,12 @@ def cosine_content(pca_space, i):
scipy.integrate.simps(pca_space[:, i] ** 2))


@due.dcite(
Doi('10.1002/(SICI)1097-0134(19990901)36:4<419::AID-PROT5>3.0.CO;2-U'),
Doi('10.1529/biophysj.104.052449'),
description="RMSIP",
path='MDAnalysis.analysis.pca',
)
def rmsip(a, b, n_components=None):
"""Compute the root mean square inner product between subspaces.
Expand Down Expand Up @@ -516,6 +544,11 @@ def rmsip(a, b, n_components=None):
return msip**0.5


@due.dcite(
Doi('10.1016/j.str.2007.12.011'),
description="Cumulative overlap",
path='MDAnalysis.analysis.pca',
)
def cumulative_overlap(a, b, i=0, n_components=None):
"""Compute the cumulative overlap of a vector in a subspace.
Expand Down

0 comments on commit 206900a

Please sign in to comment.