Package schrodinger :: Package trajectory :: Package prody :: Module compare
[hide private]
[frames] | no frames]

Module compare

This module defines functions for comparing normal modes from different models.

Functions [hide private]
 
calcOverlap(rows, cols)
Return overlap (or correlation) between two sets of modes (*rows* and *cols*).
 
printOverlapTable(rows, cols)
Print table of overlaps (correlations) between two sets of modes.
 
writeOverlapTable(filename, rows, cols)
Write table of overlaps (correlations) between two sets of modes to a file.
 
getOverlapTable(rows, cols)
Make a formatted string of overlaps between modes in *rows* and *cols*.
 
calcCumulOverlap(modes1, modes2, array=False)
Return cumulative overlap of modes in *modes2* with those in *modes1*.
 
calcSubspaceOverlap(modes1, modes2)
Return subspace overlap between two sets of modes (*modes1* and *modes2*).
 
calcCovOverlap(modelA, modelB)
Return overlap between covariances of *modelA* and *modelB*.
Variables [hide private]
  ZERO = 1e-6
Function Details [hide private]

calcOverlap(rows, cols)

 

Return overlap (or correlation) between two sets of modes (*rows* and *cols*). Returns a matrix whose rows correspond to modes passed as *rows* argument, and columns correspond to those passed as *cols* argument. Both rows and columns are normalized prior to calculating overlap.

printOverlapTable(rows, cols)

 

Print table of overlaps (correlations) between two sets of modes.
*rows* and *cols* are sets of normal modes, and correspond to rows
and columns of the printed table.  This function may be used to take
a quick look into mode correspondences between two models.

> # Compare top 3 PCs and slowest 3 ANM modes
> printOverlapTable(p38_pca[:3], p38_anm[:3]) # doctest: +SKIP
Overlap Table
                        ANM 1p38
                    #1     #2     #3
PCA p38 xray #1   -0.39  +0.04  -0.71
PCA p38 xray #2   -0.78  -0.20  +0.22
PCA p38 xray #3   +0.05  -0.57  +0.06

writeOverlapTable(filename, rows, cols)

 

Write table of overlaps (correlations) between two sets of modes to a file. *rows* and *cols* are sets of normal modes, and correspond to rows and columns of the overlap table. See also :func:`.printOverlapTable`.

calcCumulOverlap(modes1, modes2, array=False)

 

Return cumulative overlap of modes in *modes2* with those in *modes1*. Returns a number of *modes1* contains a single :class:`.Mode` or a :class:`.Vector` instance. If *modes1* contains multiple modes, returns an array. Elements of the array correspond to cumulative overlaps for modes in *modes1* with those in *modes2*. If *array* is **True**, Return array of cumulative overlaps. Returned array has the shape ``(len(modes1), len(modes2))``. Each row corresponds to cumulative overlaps calculated for modes in *modes1* with those in *modes2*. Each value in a row corresponds to cumulative overlap calculated using upto that many number of modes from *modes2*.

calcSubspaceOverlap(modes1, modes2)

 
Return subspace overlap between two sets of modes (*modes1* and
*modes2*).  Also known as the root mean square inner product (RMSIP)
of essential subspaces [AA99]_.  This function returns a single number.

.. [AA99] Amadei A, Ceruso MA, Di Nola A. On the convergence of the
   conformational coordinates basis set obtained by the essential
   dynamics analysis of proteins' molecular dynamics simulations.
   *Proteins* **1999** 36(4):419-424.

calcCovOverlap(modelA, modelB)

 
Return overlap between covariances of *modelA* and *modelB*.  Overlap
between covariances are calculated using normal modes (eigenvectors),
hence modes in both models must have been calculated.  This function
implements equation 11 in [BH02]_.

.. [BH02] Hess B. Convergence of sampling in protein simulations.
   *Phys Rev E* **2002** 65(3):031910.