Reduce dimensions in frames from one or more ensembles, using one or more
dimensionality reduction methods. The function optionally takes
pre-calculated distances matrices as an argument. Note that not all
dimensionality reduction procedure can work directly on distance matrices,
so the distance matrices might be ignored for particular choices of
method.

Parameters:

ensembles (MDAnalysis.Universe, or list or list of list thereof) – The function takes either a single Universe object, a list of Universe
objects or a list of lists of Universe objects. If given a single
universe, it simply works on the conformations in the trajectory. If
given a list of ensembles, it will merge them and analyse them together,
keeping track of the ensemble to which each of the conformations belong.
Finally, if passed a list of list of ensembles, the function will just
repeat the functionality just described - merging ensembles for each
ensemble in the outer loop.

method (MDAnalysis.analysis.encore.dimensionality_reduction.DimensionalityReductionMethod or list) – A single or a list of instances of the DimensionalityReductionMethod
classes from the dimensionality_reduction module. A separate analysis
will be run for each method. Note that different parameters for the
same method can be explored by adding different instances of
the same dimensionality reduction class. Options are Stochastic
Proximity Embedding or Principal Component Analysis.

distance_matrix (encore.utils.TriangularMatrix, optional) – Distance matrix for stochastic proximity embedding. If this parameter
is not supplied an RMSD distance matrix will be calculated on the fly (default).
If several distance matrices are supplied, an analysis will be done
for each of them. The number of provided distance matrices should
match the number of provided ensembles.

allow_collapsed_result (bool, optional) – Whether a return value of a list of one value should be collapsed
into just the value (default = True).

ncores (int, optional) – Maximum number of cores to be used (default is 1).

Returns:

list of coordinate arrays in the reduced dimensions (or potentially a single

coordinate array object if allow_collapsed_result is set to True)

Example

Two ensembles are created as Universe object using a topology file and
two trajectories. The topology- and trajectory files used are obtained
from the MDAnalysis test suite for two different simulations of the protein
AdK.
Here, we reduce two ensembles to two dimensions, and plot the result using
matplotlib:

The module defines classes for interfacing to various dimensionality reduction
algorithms. One has been implemented natively, and will always be available,
while others are available only if scikit-learn is installed