NMA Model Editing

This module defines functions for editing normal mode data.

extendModel(model, nodes, atoms, norm=False)[source]

Extend a coarse grained model built for nodes to atoms. model may be ANM, GNM, PCA, or NMA instance. This function will take part of the normal modes for each node (i.e. Cα atoms) and extend it to all other atoms in the same residue. For each atom in nodes argument atoms argument must contain a corresponding residue. If norm is True, extended modes are normalized.

extendMode(mode, nodes, atoms, norm=False)[source]

Extend a coarse grained normal mode built for nodes to atoms. This function will take part of the normal modes for each node (i.e. Cα atoms) and extend it to all other atoms in the same residue. For each atom in nodes argument atoms argument must contain a corresponding residue. Extended mode is multiplied by the square root of variance of the mode. If norm is True, extended mode is normalized.

extendVector(vector, nodes, atoms)[source]

Extend a coarse grained vector for nodes to atoms. This function will take part of the normal modes for each node (i.e. Cα atoms) and extend it to all other atoms in the same residue. For each atom in nodes, atoms argument must contain a corresponding residue.

sliceMode(mode, atoms, select)[source]

Returns part of the mode for atoms matching select. This works slightly different from sliceVector(). Mode array (eigenvector) is multiplied by square-root of the variance along the mode. If mode is from an elastic network model, variance is defined as the inverse of the eigenvalue. Note that returned Vector instance is not normalized.

Parameters:
  • mode (Mode) – mode instance to be sliced
  • atoms (Atomic) – atoms for which mode describes a deformation, motion, etc.
  • select (Selection, str) – an atom selection or a selection string
Returns:

(Vector, Selection)

sliceModel(model, atoms, select, norm=False)[source]

Returns a part of the model (modes calculated) for atoms matching select. Note that normal modes are sliced instead of the connectivity matrix. Sliced normal modes (eigenvectors) are not normalized unless norm is True.

Parameters:
  • mode (NMA) – NMA model instance to be sliced
  • atoms (Atomic) – atoms for which the model was built
  • select (Selection, str) – an atom selection or a selection string
  • norm (bool) – whether to normalize eigenvectors, default False
Returns:

(NMA, Selection)

sliceModelByMask(model, mask, norm=False)[source]

Returns a part of the model indicated by mask. Note that normal modes (eigenvectors) are not normalized unless norm is True.

Parameters:
  • mode (NMA) – NMA model instance to be sliced
  • mask (list, ndarray) – an Integer array or a Boolean array where "True" indicates the parts being selected
  • norm (bool) – whether to normalize eigenvectors, default False
Returns:

NMA

sliceVector(vector, atoms, select)[source]

Returns part of the vector for atoms matching select. Note that returned Vector instance is not normalized.

Parameters:
  • vector (VectorBase) – vector instance to be sliced
  • atoms (Atomic) – atoms for which vector describes a deformation, motion, etc.
  • select (Selection, str) – an atom selection or a selection string
Returns:

(Vector, Selection)

reduceModel(model, atoms, select)[source]

Returns reduced NMA model. Reduces a NMA model to a subset of atoms matching select. This function behaves differently depending on the type of the model argument. For ANM and GNM or other NMA models, force constant matrix for system of interest (specified by the select) is derived from the force constant matrix for the model by assuming that for any given displacement of the system of interest, other atoms move along in such a way as to minimize the potential energy. This is based on the formulation in [KH00]. For PCA models, this function simply takes the sub-covariance matrix for selection.

[KH00]Hinsen K, Petrescu A-J, Dellerue S, Bellissent-Funel M-C, Kneller GR. Harmonicity in slow protein dynamics. Chem Phys 2000 261:25-37.
Parameters:
  • model (ANM, GNM, or PCA) – dynamics model
  • atoms (Atomic) – atoms that were used to build the model
  • select (Selection, str) – an atom selection or a selection string
Returns:

(NMA, Selection)

reduceModelByMask(model, mask)[source]

Returns NMA model reduced based on mask.

Parameters:
  • model (ANM, GNM, or PCA) – dynamics model
  • mask (list, ndarray) – an Integer array or a Boolean array where "True" indicates the parts being selected
Returns:

NMA

trimModel(model, atoms, select)[source]

Returns a part of the model for atoms matching select. This method removes columns and rows in the connectivity matrix and fix the diagonal sums. Normal modes need to be calculated again after the trim.

Parameters:
  • mode (NMA) – NMA model instance to be sliced
  • atoms (Atomic) – atoms for which the model was built
  • select (Selection, str) – an atom selection or a selection string
Returns:

(NMA, Selection)

trimModelByMask(model, mask)[source]

Returns a part of the model indicated by mask. This method removes columns and rows in the connectivity matrix indicated by mask and fix the diagonal sums. Normal modes need to be calculated again after the trim.

Parameters:
  • mode (NMA) – NMA model instance to be sliced
  • mask (list, ndarray) – an Integer array or a Boolean array where "True" indicates the parts being selected
Returns:

NMA

interpolateModel(model, nodes, coords, norm=False, **kwargs)[source]

Interpolate a coarse grained model built for nodes to coords.

model may be ANM, PCA, or NMA instance

Parameters:
  • nodes (Atomic, ndarray) – the coordinate set or object with getCoords() method that corresponds to the model
  • coords (Atomic, ndarray) – a coordinate set or an object with getCoords() method onto which the model should be interpolated

This function will take the part of the normal modes for each node (i.e. Cα atoms) and extend it to nearby atoms.

If norm is True, extended modes are normalized.

Adapted from ModeHunter as described in [JS09].

[JS09]Stember JN, Wriggers W. Bend-twist-stretch model for coarse

elastic network simulation of biomolecular motion. J Chem Phys 2009 131:074112.

# Legal notice: # # This software is copyrighted, (c) 2009-10, by Joseph N. Stember and Willy Wriggers # under the following terms: # # The authors hereby grant permission to use, copy, modify, and re-distribute this # software and its documentation for any purpose, provided that existing copyright # notices are retained in all copies and that this notice is included verbatim in # any distributions. No written agreement, license, or royalty fee is required for # any of the authorized uses. # # IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, # INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE # OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE # AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN “AS # IS” BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE # MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++