mdciao.sites.sites_to_res_pairs

mdciao.sites.sites_to_res_pairs(site_dicts, top, fragments=None, default_fragment_index=None, consensus_maps=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

  • default_fragment_index (NoneType, default is None) – In case a residue identified as, e.g, “GLU30”, appears more than one time in the topology, e.g. in case of a dimer, pass which fragment/monomer should be chosen by default. The default behaviour (None) will prompt the user when necessary

  • consensus_maps (dict, default is None) – Dictionary of consensus maps, i.e. keyed with nomenclature type (GPCR,CGN,KLIFS) and valued with lists of len top.n_residues

  • get_fragments_kwargs (dict) – Optional arguments for get_fragments. The optional parameters of are:

Other Parameters:
  • method (str, default is ‘lig_resSeq+’) – The method passed will be the basis for creating fragments. Check the following options with the example sequence

    “…-A27,Lig28,K29-…-W40,D45-…-W50,CYSP51,GDP52”

    • ‘resSeq’

      breaks at jumps in resSeq entry:

      […A27,Lig28,K29,…,W40],[D45,…,W50,CYSP51,GDP52]

    • ‘resSeq+’

      breaks only at negative jumps in resSeq:

      […A27,Lig28,K29,…,W40,D45,…,W50,CYSP51,GDP52]

    • ‘bonds’

      breaks when residues are not connected by bonds, ignores resSeq:

      […A27][Lig28],[K29,…,W40],[D45,…,W50],[CYSP51],[GDP52]

      notice that because phosphorylated CYSP51 didn’t get a bond in the topology, it’s considered a ligand

    • ‘resSeq_bonds’

      breaks at resSeq jumps and at missing bonds

    • ‘lig_resSeq+’

      Like resSeq+ but put’s any non-AA residue into it’s own fragment. […A27][Lig28],[K29,…,W40],[D45,…,W50,CYSP51],[GDP52] Also check maxjump

    • ‘chains’

      breaks into chains of the PDB file/entry

    • None or ‘None’

      all residues are in one fragment, fragment 0

  • fragment_breaker_fullresname (list) – list of full residue names. Example [GLU30] will be used to break fragments, so that [R1, R2, … GLU30,…R10, R11] will be broken into [R1, R2, …], [GLU30,…,R10,R11]

  • atoms (boolean) – Instead of returning residue indices, return atom indices

  • join_fragments (list of lists) – After getting the fragments with method, join these fragments again. The use case are hard cases where no method gets it right and some post-processing is needed. Duplicate entries in any inner list will be removed. One fragment idx cannot appear in more than one inner list, otherwise an exception is thrown

  • verbose (boolean) – Be verbose

  • salt (list, default is [“Na+”,”Cl+”, “NA”,”CL”]) – Residues that match these residue names and have only one atom will be put together in the last fragment. Use salt = [] to deactivate. Doesn’t apply for methods involving bonds or None and chains

  • water (bool, default is True) – Put water on its own fragment. Doesn’t apply for methods involving bonds or None and chains

  • maxjump (int or None, default is 500) – The maximum allowed positive sequence-jump in the ‘resSeq+’ methods, i.e. don’t join ALA500 with GLU551 even though the jump in sequence is positive None means no limit for positive jumps

  • pick_this_fragment_by_default (None or integer.) – Pick this fragment without asking in case of ambiguity. If None, the user will we prompted

  • fragment_names – list of strings providing informative names for the input fragments

  • additional_resnaming_dicts (dict of dicts, default is None) – Dictionary of dictionaries. Lower-level dicts are keyed with residue indices and valued with additional residue names. Higher-level keys can be whatever. Use case is e.g. if “R131” needs to be disambiguated bc. it pops up in many fragments. You can pass {“GPCR”:{895:”3.50”, …} here and that label will be displayed next to the residue. mdciao.cli methods use this.

  • just_inform (bool, default is False) – Just inform about the AAs, don’t ask for a selection

  • extra_string_info (str,) – string with any additional info to be printed in case of ambiguity

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