msmbuilder.featurizer.RMSDFeaturizer

class msmbuilder.featurizer.RMSDFeaturizer(reference_traj=None, atom_indices=None, trj0=None)

Featurizer based on RMSD to one or more reference structures.

This featurizer inputs a trajectory to be analyzed (‘traj’) and a reference trajectory (‘ref’) and outputs the RMSD of each frame of traj with respect to each frame in ref. The output is a numpy array with n_rows = traj.n_frames and n_columns = ref.n_frames.

Parameters:

reference_traj : md.Trajectory

The reference conformations to superpose each frame with respect to

atom_indices : np.ndarray, shape=(n_atoms,), dtype=int

The indices of the atoms to superpose and compute the distances with. If not specified, all atoms are used.

trj0

Deprecated. Please use reference_traj.

Methods

describe_features(traj) Generic method for describing features.
featurize(traj)
fit(traj_list[, y])
fit_transform(X[, y]) Fit to data, then transform it.
get_params([deep]) Get parameters for this estimator.
partial_transform(traj) Featurize an MD trajectory into a vector space via distance
set_params(**params) Set the parameters of this estimator.
summarize() Return some diagnostic summary statistics about this Markov model
transform(traj_list[, y]) Featurize a several trajectories.
__init__(reference_traj=None, atom_indices=None, trj0=None)

Methods

__init__([reference_traj, atom_indices, trj0])
describe_features(traj) Generic method for describing features.
featurize(traj)
fit(traj_list[, y])
fit_transform(X[, y]) Fit to data, then transform it.
get_params([deep]) Get parameters for this estimator.
partial_transform(traj) Featurize an MD trajectory into a vector space via distance
set_params(**params) Set the parameters of this estimator.
summarize() Return some diagnostic summary statistics about this Markov model
transform(traj_list[, y]) Featurize a several trajectories.
describe_features(traj)

Generic method for describing features.

Parameters:

traj : mdtraj.Trajectory

Trajectory to use

Returns:

feature_descs : list of dict

Dictionary describing each feature with the following information about the atoms participating in each feature

  • resnames: unique names of residues
  • atominds: the four atom indicies
  • resseqs: unique residue sequence ids (not necessarily 0-indexed)
  • resids: unique residue ids (0-indexed)
  • featurizer: Featurizer name
  • featuregroup: Other information

Notes

Method resorts to returning N/A for everything if describe_features in not implemented in the sub_class

fit_transform(X, y=None, **fit_params)

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:

X : numpy array of shape [n_samples, n_features]

Training set.

y : numpy array of shape [n_samples]

Target values.

Returns:

X_new : numpy array of shape [n_samples, n_features_new]

Transformed array.

get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep: boolean, optional

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params : mapping of string to any

Parameter names mapped to their values.

partial_transform(traj)

Featurize an MD trajectory into a vector space via distance after superposition

Parameters:

traj : mdtraj.Trajectory

A molecular dynamics trajectory to featurize.

Returns:

features : np.ndarray, shape=(n_frames, n_ref_frames)

The RMSD value of each frame of the input trajectory to be featurized versus each frame in the reference trajectory. The number of features is the number of reference frames.

See also

transform
simultaneously featurize a collection of MD trajectories
set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The former have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Returns:self
summarize()

Return some diagnostic summary statistics about this Markov model

transform(traj_list, y=None)

Featurize a several trajectories.

Parameters:

traj_list : list(mdtraj.Trajectory)

Trajectories to be featurized.

Returns:

features : list(np.ndarray), length = len(traj_list)

The featurized trajectories. features[i] is the featurized version of traj_list[i] and has shape (n_samples_i, n_features)