luna.analysis.summary module

count_interaction_types(interactions, must_have_target=True, compounds=None, key_map={})[source]

Count the number of each type of interaction in interactions.

Parameters
  • interactions (iterable) – An iterable object containing a sequence of interactions (InteractionType).

  • must_have_target (bool) – If True, count only interactions involving the target ligand. The default value is True.

  • compounds (iterable, optional) – Only count interactions involving the compounds in compounds. The default value is None, which implies that all compounds will be considered.

  • key_map (dictionary, optional) – A dictionary to control which interactions to count and how to aggregate them. The keys are the interaction types to be considered and the values are the final interaction type, which can be used to aggregate interactions. If a value is None, the interaction will be ignored.

    For example, to aggregate all covalent interactions, key_map could be defined as follows:

    key_map = {"Single bond": "Covalent bond",
               "Double bond": "Covalent bond",
               "Triple bond": "Covalent bond",
               "Aromatic bond": "Covalent bond"}
    

    Now, if Ionic interactions should be ignored, key_map could be defined as follows:

    key_map = {"Ionic": None}
    
Returns

interaction_types_count – The count of each interaction type.

Return type

dict