msmbuilder.clustering._assign

msmbuilder.clustering._assign(metric, ptraj, generator_indices)[source]

Assign the frames in ptraj to the centers with indices generator_indices

Parameters:

metric : msmbuilder.metrics.AbstractDistanceMetric

A metric capable of handling ptraj

ptraj : prepared trajectory

ptraj return by the action of the preceding metric on a msmbuilder trajectory

generator_indices : array_like

indices (with respect to ptraj) of the frames to be considered the cluster centers.

Returns:

assignments : ndarray

assignments[i] = j means that the i`th frame in ptraj is assigned to `ptraj[j]

distances : ndarray

distances[i] = j means that the distance (according to metric) from ptraj[i] to ptraj[assignments[i]] is j