starling.utilities.get_off_diagonals

get_off_diagonals(distance_map, min_separation=1, max_separation=4, return_mean=False)[source]

Function to calculate the the off-diagonal elements of a matrix.

This is useful for error checking as we can KNOW the max distance between any pair of residues base on the contour length of the protein, allowing us to identify conformations that are simply impossible.

Parameters:
  • distance_map (np.ndarray) – The distance map to check for errors.

  • min_separation (int) – The minimum sequence separation to check across.

  • max_separation (int) – The maxiumum sequence separation to check across.

Returns:

All off-diagonal elements of the distance map from min_separation to max_separation away from the true diagonal.

Return type:

np.ndarray