distances : Utility functions to calculate structural similarity¶
-
idpflex.distances.
distance_submatrix
(dist_mat, indexes)[source]¶ Extract matrix of distances for a subset of indexes
If matrix is in condensed format, then the submatrix is returned in condensed format too.
-
idpflex.distances.
extract_coordinates
(a_universe, group, indexes=None)[source]¶ Obtain XYZ coordinates for an atom group and for a subset of frames
-
idpflex.distances.
generate_distance_matrix
(feature_vectors, weights=None, func1d=<function zscore>, func1d_args=None, func1d_kwargs=None)[source]¶ Calculate a distance matrix between measurements, based on features of the measurements
Each measurement is characterized by a set of features, here implemented as a vector. Thus, we sample each feature vector-item a number of times equal to the number of measurements.
- Distance d between two feature vectors f and g given weights w
`d**2 = sum_i w_i * (f_i - g_i)**2
- Parameters
feature_vectors (list) – List of feature vectors, one vector for each measurement
weights (list) – List of feature weight vectors, one for each measurement
func1d (function) – Apply this function to the set of values obtained for each feature vector-item. The size of the set is number of measurements. The default function transforms the values in each feature vector-item set such that the set has zero mean and unit standard deviation.
func1d_args (list) – Positional arguments to func1D
func1d_kwargs (dict) – Optional arguments for func1D
- Returns
Distance matrix in vector-form distance
- Return type