mdciao.sites.sites_to_res_pairs

mdciao.sites.sites_to_res_pairs(site_dicts, top, fragments=None, **get_fragments_kwargs)

Return the pairs of res_idxs needed to compute the contacts contained in the input sites.

The idea is to join all needed pairs of res_idxs in one list regardless of what site they come from.

Note

Any residue not found in top is assigned a ‘None’ in the returned res_idx_pairs.

Parameters
  • site_dicts (list of dicts) – Anything that mdciao.sites.x2site understands

  • top (Topology) –

  • fragments (list, default is None) – You can pass along fragment definitions so that it’s easier to de-duplicate any AA in your input. Otherwise, these will be created on-the-fly by mdciao.fragments.get_fragments

  • get_fragments_kwargs – see fragments.get_fragments

Returns

  • res_idxs_pairs (2D np.ndarray) – Unique residue pairs contained in the site_dicts, expressed as residue indices of top [0,1] is considered != [0,1]. Any residues that couldn’t be found will appear as ‘None’

  • site_maps (list) – For each site, a list with the indices of res_idxs_pairs that matches the site’s pairs in res_idxs_pairs