moleculekit.projections.projection module#

class moleculekit.projections.projection.Projection#

Bases: ABC

Abstract base class for all trajectory projecting (Metric) classes.

A projection maps the coordinates of a Molecule onto a lower-dimensional representation (e.g. distances, dihedral angles, RMSD). Concrete subclasses (the Metric* classes) must implement project() and getMapping(). This class cannot be instantiated directly.

copy()#

Produces a deep copy of the object

Returns:

proj – A deep copy of this projection object.

Return type:

Projection object

abstractmethod getMapping(mol)#

Returns the description of each projected dimension.

Subclasses must implement this method.

Parameters:

mol (Molecule) – A Molecule object which will be used to calculate the descriptions of the projected dimensions.

Returns:

map – A DataFrame mapping each projected dimension (output column) to the atoms it describes, with columns describing the type, atom indexes and a description.

Return type:

DataFrame object

abstractmethod project(mol)#

Projects a molecule onto the lower-dimensional representation.

Subclasses must implement this method.

Parameters:

mol (Molecule) – A Molecule object to project.

Returns:

data – An array containing the projected data, with one row per frame.

Return type:

numpy.ndarray