Plotting Functions

This module defines plotting functions for protein dynamics analysis.

Plotting functions are called by the name of the plotted data/property and are prefixed with show. Function documentations refers to the matplotlib.pyplot function utilized for actual plotting. Arguments and keyword arguments are passed to the Matplotlib functions.

showContactMap(enm, *args, **kwargs)[source]

Show Kirchhoff matrix using spy().

showCrossCorr(modes, *args, **kwargs)[source]

Show cross-correlations using imshow(). By default, origin=lower and interpolation=bilinear keyword arguments are passed to this function, but user can overwrite these parameters. See also calcCrossCorr().

showCumulOverlap(mode, modes, *args, **kwargs)[source]

Show cumulative overlap using plot().

Parameters:modes (ModeSet, ANM, GNM, PCA) – multiple modes
showFractVars(modes, *args, **kwargs)[source]

Show fraction of variances using bar(). Note that mode indices are incremented by 1.

showCumulFractVars(modes, *args, **kwargs)[source]

Show fraction of variances of modes using plot(). Note that mode indices are incremented by 1. See also showFractVars() function.

showMode(mode, *args, **kwargs)[source]

Show mode array using plot().

showOverlap(mode, modes, *args, **kwargs)[source]

Show overlap bar().

Parameters:
showOverlapTable(modes_x, modes_y, **kwargs)[source]

Show overlap table using pcolor(). modes_x and modes_y are sets of normal modes, and correspond to x and y axes of the plot. Note that mode indices are incremented by 1. List of modes is assumed to contain a set of contiguous modes from the same model.

Default arguments for pcolor():

  • cmap=plt.cm.jet
  • norm=plt.normalize(0, 1)
showProjection(ensemble, modes, *args, **kwargs)[source]

Show a projection of conformational deviations onto up to three normal modes from the same model.

Parameters:
  • ensemble (Ensemble, Conformation, Vector, Trajectory) – an ensemble, trajectory or a conformation for which deviation(s) will be projected, or a deformation vector
  • modes (Mode, ModeSet, NMA) – up to three normal modes
  • color (str, list) – a color name or a list of color name, default is 'blue'
  • label (str, list) – label or a list of labels
  • marker (str, list) – a marker or a list of markers, default is 'o'
  • linestyle (str) – line style, default is 'None'
  • text (list) – list of text labels, one for each conformation
  • fontsize (int) – font size for text labels

The projected values are by default converted to RMSD. Pass rmsd=False to use projection itself.

Matplotlib function used for plotting depends on the number of modes:

showCrossProjection(ensemble, mode_x, mode_y, scale=None, *args, **kwargs)[source]

Show a projection of conformational deviations onto modes from different models using plot(). This function differs from showProjection() by accepting modes from two different models.

Parameters:
  • ensemble (Ensemble, Conformation, Vector, Trajectory) – an ensemble or a conformation for which deviation(s) will be projected, or a deformation vector
  • mode_x (Mode, Vector) – projection onto this mode will be shown along x-axis
  • mode_y (Mode, Vector) – projection onto this mode will be shown along y-axis
  • scale (str) – scale width of the projection onto mode x or y, best scaling factor will be calculated and printed on the console, absolute value of scalar makes the with of two projection same, sign of scalar makes the projections yield a positive correlation
  • scalar (float) – scalar factor for projection onto selected mode
  • color (str, list) – a color name or a list of color name, default is 'blue'
  • label (str, list) – label or a list of labels
  • marker (str, list) – a marker or a list of markers, default is 'o'
  • linestyle (str) – line style, default is 'None'
  • text (list) – list of text labels, one for each conformation
  • fontsize (int) – font size for text labels

The projected values are by default converted to RMSD. Pass rmsd=False to calculate raw projection values. See Plotting for a more elaborate example.

showEllipsoid(modes, onto=None, n_std=2, scale=1.0, *args, **kwargs)[source]

Show an ellipsoid using plot_wireframe().

Ellipsoid volume gives an analytical view of the conformational space that given modes describe.

Parameters:
  • modes (ModeSet, PCA, ANM, NMA) – 3 modes for which ellipsoid will be drawn.
  • onto – 3 modes onto which ellipsoid will be projected.
  • n_std (float) – Number of standard deviations to scale the ellipsoid.
  • scale (float) – Used for scaling the volume of ellipsoid. This can be obtained from sampleModes().
showSqFlucts(modes, *args, **kwargs)[source]

Show square fluctuations using plot(). See also calcSqFlucts().

showScaledSqFlucts(modes, *args, **kwargs)[source]

Show scaled square fluctuations using plot(). Modes or mode sets given as additional arguments will be scaled to have the same mean squared fluctuations as modes.

showNormedSqFlucts(modes, *args, **kwargs)[source]

Show normalized square fluctuations via plot().

resetTicks(x, y=None)[source]

Reset X (and Y) axis ticks using values in given array. Ticks in the current figure should not be fractional values for this function to work as expected.

showDiffMatrix(matrix1, matrix2, *args, **kwargs)[source]

Show the difference between two cross-correlation matrices from different models. For given matrix1 and matrix2 show the difference between them in the form of (matrix2 - matrix1) and plot the difference matrix using imshow(). When NMA models are passed instead of matrices, the functions could call calcCrossCorr() function to calculate the matrices for given modes.

To display the absolute values in the difference matrix, user could set abs keyword argument True.

By default, origin=lower and interpolation=bilinear keyword arguments are passed to this function, but user can overwrite these parameters.

Read the Docs v: v1.5
Versions
latest
v1.5
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.