Conformational Ensemble¶
This module defines a class for handling ensembles of conformations.

class
Ensemble
(title='Unknown')[source]¶ A class for analysis of arbitrary conformational ensembles.
Indexing (e.g.
ens[0]
) returns aConformation
instance that points to a coordinate set in the ensemble. Slicing (e.g.ens[0:10]
) returns anEnsemble
instance that contains a copy of the subset of conformations (coordinate sets).Instantiate with a title or a
Atomic
instance. All coordinate sets from atomic instances will be added to the ensemble.
addCoordset
(coords)[source]¶ Add coordinate set(s) to the ensemble. coords must be a Numpy array with suitable data type, shape and dimensionality, or an object with
getCoordsets()
method.

getCoordsets
(indices=None, selected=True)[source]¶ Returns a copy of coordinate set(s) at given indices, which may be an integer, a list of integers or None. None returns all coordinate sets. For reference coordinates, use
getCoordinates()
method.

getDeviations
()[source]¶ Returns deviations from reference coordinates for selected atoms. Conformations can be aligned using one of
superpose()
oriterpose()
methods prior to calculating deviations.

getMSFs
()[source]¶ Returns mean square fluctuations (MSFs) for selected atoms. Conformations can be aligned using one of
superpose()
oriterpose()
methods prior to MSF calculation.

getRMSDs
(pairwise=False)[source]¶ Returns root mean square deviations (RMSDs) for selected atoms. Conformations can be aligned using one of
superpose()
oriterpose()
methods prior to RMSD calculation.Parameters: pairwise (bool) – if True then it will return pairwise RMSDs as an nbyn matrix. n is the number of conformations.

getRMSFs
()[source]¶ Returns root mean square fluctuations (RMSFs) for selected atoms. Conformations can be aligned using one of
superpose()
oriterpose()
methods prior to RMSF calculation.

iterCoordsets
()[source]¶ Iterate over coordinate sets. A copy of each coordinate set for selected atoms is returned. Reference coordinates are not included.

iterpose
(rmsd=0.0001)[source]¶ Iteratively superpose the ensemble until convergence. Initially, all conformations are aligned with the reference coordinates. Then mean coordinates are calculated, and are set as the new reference coordinates. This is repeated until reference coordinates do not change. This is determined by the value of RMSD between the new and old reference coordinates. Note that at the end of the iterative procedure the reference coordinate set will be average of conformations in the ensemble.
Parameters: rmsd (float) – change in reference coordinates to determine convergence, default is 0.0001 Å RMSD

numCoordsets
()¶ Returns number of conformations.

numSelected
()[source]¶ Returns number of selected atoms. Number of all atoms will be returned if a selection is not made. A subset of atoms can be selected by passing a selection to
setAtoms()
.

setAtoms
(atoms)[source]¶ Set atoms or specify a selection of atoms to be considered in calculations and coordinate requests. When a selection is set, corresponding subset of coordinates will be considered in, for example, alignments and RMSD calculations. Setting atoms also allows some functions to access atomic data when needed. For example,
Ensemble
andConformation
instances become suitable arguments forwritePDB()
. Passing None as atoms argument will deselect atoms.

setCoords
(coords)[source]¶ Set coords as the ensemble reference coordinate set. coords may be an array with suitable data type, shape, and dimensionality, or an object with
getCoords()
method.
