molsysmt.structure.show_contacts#

molsysmt.structure.show_contacts(molecular_system, selection=None, center_of_atoms=False, weights=None, structure_indices='all', selection_2=None, center_of_atoms_2=False, weights_2=None, structure_indices_2=None, threshold='12 angstroms', pbc=False, syntax='MolSysMT', style='plotly', show=True, skip_digestion=False)[source]#

Visualize a contact map between two selections.

Parameters:
  • molecular_system (molecular system) – Input system to analyze.

  • selection (str, list, tuple, numpy.ndarray or None) – Atom selections (MolSysMT syntax or indices). If selection_2 is None, contacts are computed within selection.

  • selection_2 (str, list, tuple, numpy.ndarray or None) – Atom selections (MolSysMT syntax or indices). If selection_2 is None, contacts are computed within selection.

  • center_of_atoms (bool, default False) – Whether to use centers of groups of atoms for each selection.

  • center_of_atoms_2 (bool, default False) – Whether to use centers of groups of atoms for each selection.

  • weights (array-like, optional) – Weights for centers if center_of_atoms is True.

  • weights_2 (array-like, optional) – Weights for centers if center_of_atoms is True.

  • structure_indices ('all' or array-like) – Structures/frames to analyze (0-based).

  • structure_indices_2 ('all' or array-like) – Structures/frames to analyze (0-based).

  • threshold (quantity or str, default '12 angstroms') – Distance cutoff for defining contacts.

  • pbc (bool, default False) – Whether to consider periodic boundary conditions.

  • syntax (str, default 'MolSysMT') – Selection syntax when using strings.

  • style ({'plotly', 'matplotlib'}, default 'plotly') – Backend for visualization.

  • show (bool, default True) – If True, render the figure; otherwise return it.

  • skip_digestion (bool, default False) – Whether to skip argument digestion.

Returns:

The figure object (Plotly Figure or Matplotlib Figure) or the result of fig.show() when show=True.

Return type:

object