mdtraj.geometry.squareform(distances, residue_pairs)

Reshape the contact distance to square contact maps

distancesnp.ndarray, shape=(n_frames, n_pairs)

Distances between pairs of residues, as computed by mdtraj.geometry.compute_contacts.

residue_pairsnp.ndarray, shape=(n_pairs, 2)

The indices of the residues involved in each pair, as returned by mdtraj.geometry.compute_contacts

contact_mapsnp.ndarray, shape=(n_frames, n_residues, n_residues)

Reshaped version of distances, such that the distance, in the k`th frame of the trajectory from residue `i to residue j is given by contact_maps[k, i, j]. All entries in contact_maps corresponding to the distance between residues that were not part of residue_pairs are 0.0.

See also


Compute the array of contact distances