Skip to content

Commit 6ca31da

Browse files
committed
Fix formula in docstring
1 parent 3db9c5e commit 6ca31da

3 files changed

Lines changed: 48 additions & 42 deletions

File tree

src/springcraft/anm.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -326,32 +326,16 @@ def bfactor(self, mode_subset=None, tem=None,
326326
)
327327

328328
def dcc(self, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
329-
"""
329+
r"""
330330
Computes the normalized *dynamic cross-correlation* between
331-
nodes of the ANM. The DCC for a nodepair :math:`ij` is computed as:
332-
333-
.. math::
334-
335-
DCC_{ij} = \frac{3 k_B T}{\gamme} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
336-
337-
with :math:`\lambda` and :math:`\vec{u}` as
338-
Eigenvalues and Eigenvectors corresponding to mode :math:`k` of
339-
the modeset :math:`L`.
340-
341-
DCCs can be normalized to MSFs exhibited by two compared nodes
342-
following:
343-
344-
.. math::
345-
346-
nDCC_{ij} = \frac{DCC_{ij}}{[\DCC_{ii} DCC_{jj}]^{1/2}}
331+
nodes of the ANM.
347332
348333
The DCC is a measure for the correlation in fluctuations
349334
exhibited by a given pair of nodes. If normalized, pairs with
350335
correlated fluctuations (same phase and period),
351336
anticorrelated fluctuations (opposite phase, same period)
352337
and non-correlated fluctuations are assigned (normalized)
353338
DCC values of 1, -1 and 0 respectively.
354-
355339
For results consistent with MSFs, temperature-weighted
356340
absolute values can be computed (only relevant if results
357341
are not normalized).
@@ -374,12 +358,31 @@ def dcc(self, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
374358
If tem is None, no temperature scaling is conducted.
375359
tem_factors : int, float, optional
376360
Factors included in temperature weighting
377-
(with K_B as preset).
361+
(with :math:`k_B` as preset).
378362
379363
Returns
380364
-------
381365
dcc : ndarray, shape=(n, n), dtype=float
382366
DCC values for ENM nodes.
367+
368+
Notes
369+
-----
370+
The DCC for a nodepair :math:`ij` is computed as:
371+
372+
.. math::
373+
374+
DCC_{ij} = \frac{3 k_B T}{\gamma} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
375+
376+
with :math:`\lambda` and :math:`\vec{u}` as
377+
Eigenvalues and Eigenvectors corresponding to mode :math:`k` of
378+
the modeset :math:`L`.
379+
380+
DCCs can be normalized to MSFs exhibited by two compared nodes
381+
following:
382+
383+
.. math::
384+
385+
nDCC_{ij} = \frac{DCC_{ij}}{[DCC_{ii} DCC_{jj}]^{1/2}}
383386
"""
384387
return nma.dcc(
385388
self, mode_subset, norm, tem, tem_factors

src/springcraft/gnm.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -245,32 +245,16 @@ def bfactor(self, mode_subset=None, tem=None,
245245
)
246246

247247
def dcc(self, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
248-
"""
248+
r"""
249249
Computes the normalized *dynamic cross-correlation* between
250-
nodes of the GNM. The DCC for a nodepair :math:`ij` is computed as:
251-
252-
.. math::
253-
254-
DCC_{ij} = \frac{3 k_B T}{\gamme} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
255-
256-
with :math:`\lambda`. and :math:`\vec{u}`. as
257-
Eigenvalues and Eigenvectors corresponding to mode :math:`k`. of
258-
the modeset :math:`L`.
259-
260-
DCCs can be normalized to MSFs exhibited by two compared nodes
261-
following:
262-
263-
.. math::
264-
265-
nDCC_{ij} = \frac{DCC_{ij}}{[\DCC_{ii} DCC_{jj}]^{1/2}}
250+
nodes of the GNM.
266251
267252
The DCC is a measure for the correlation in fluctuations
268253
exhibited by a given pair of nodes. If normalized, pairs with
269254
correlated fluctuations (same phase and period),
270255
anticorrelated fluctuations (opposite phase, same period)
271256
and non-correlated fluctuations are assigned (normalized)
272257
DCC values of 1, -1 and 0 respectively.
273-
274258
For results consistent with MSFs, temperature-weighted
275259
absolute values can be computed (only relevant if results
276260
are not normalized).
@@ -293,12 +277,31 @@ def dcc(self, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
293277
If tem is None, no temperature scaling is conducted.
294278
tem_factors : int, float, optional
295279
Factors included in temperature weighting
296-
(with K_B as preset).
280+
(with :math:`k_B` as preset).
297281
298282
Returns
299283
-------
300284
dcc : ndarray, shape=(n, n), dtype=float
301285
DCC values for ENM nodes.
286+
287+
Notes
288+
-----
289+
The DCC for a nodepair :math:`ij` is computed as:
290+
291+
.. math::
292+
293+
DCC_{ij} = \frac{3 k_B T}{\gamma} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
294+
295+
with :math:`\lambda` and :math:`\vec{u}` as
296+
Eigenvalues and Eigenvectors corresponding to mode :math:`k` of
297+
the modeset :math:`L`.
298+
299+
DCCs can be normalized to MSFs exhibited by two compared nodes
300+
following:
301+
302+
.. math::
303+
304+
nDCC_{ij} = \frac{DCC_{ij}}{[DCC_{ii} DCC_{jj}]^{1/2}}
302305
"""
303306
return nma.dcc(
304307
self, mode_subset, norm, tem, tem_factors

src/springcraft/nma.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def bfactor(enm, mode_subset=None, tem=None,
229229
return b_factors
230230

231231
def dcc(enm, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
232-
"""
232+
r"""
233233
Computes the normalized *dynamic cross-correlation* between
234234
nodes of the GNM/ANM.
235235
@@ -254,7 +254,7 @@ def dcc(enm, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
254254
If tem is None, no temperature scaling is conducted.
255255
tem_factors : int, float, optional
256256
Factors included in temperature weighting
257-
(with K_B as preset).
257+
(with :math:`k_B` as preset).
258258
259259
Returns
260260
-------
@@ -268,7 +268,7 @@ def dcc(enm, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
268268
269269
.. math::
270270
271-
DCC_{ij} = \frac{3 k_B T}{\gamme} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
271+
DCC_{ij} = \frac{3 k_B T}{\gamma} \sum_k^L \left[ \frac{\vec{u}_k \cdot \vec{u}_k^T}{\lambda_k} \right]_{ij}
272272
273273
with :math:`\lambda` and :math:`\vec{u}` as
274274
Eigenvalues and Eigenvectors corresponding to mode :math:`k` of
@@ -279,7 +279,7 @@ def dcc(enm, mode_subset=None, norm=True, tem=None, tem_factors=K_B):
279279
280280
.. math::
281281
282-
nDCC_{ij} = \frac{DCC_{ij}}{[\DCC_{ii} DCC_{jj}]^{1/2}}
282+
nDCC_{ij} = \frac{DCC_{ij}}{[DCC_{ii} DCC_{jj}]^{1/2}}
283283
"""
284284
from .gnm import GNM
285285
from .anm import ANM

0 commit comments

Comments
 (0)