Path A - Module 32: Visualizing Interaction Matrices#

A picture is worth a thousand indices. While lists of neighbors are useful for calculation, Interaction Matrices are the best way to understand the binding pattern of your therapeutic peptide.

In this module, you will learn to generate instant contact plots using MolSysMT.

import molsysmt as msm
from molsysmt import systems

# Load our complex (no need for water this time to make the plot cleaner)
fibril = msm.convert('pdb:2BEG', to_form='molsysmt.MolSys')
peptide = msm.build.build_peptide('KLVFF')
molsys = msm.merge([fibril, peptide])

1. Generating a Contact Map#

The function get_contacts() returns the boolean contact matrix between two selections. Handing that matrix to Matplotlib is all it takes to turn it into a plot: MolSysMT computes the interaction, and the plotting library draws it.

import matplotlib.pyplot as plt

# Contacts between the peptide and the first chain of the fibril
contact_map = msm.structure.get_contacts(molsys, selection='molecule_type=="peptide"',
                                         selection_2='chain_index==0', threshold='0.6 nm')

figure, axis = plt.subplots()
axis.imshow(contact_map[0].astype(int), origin='lower', interpolation='nearest', aspect='auto')
axis.set_xlabel('Fibril chain 0 atom index')
axis.set_ylabel('Peptide atom index')
plt.show()

2. Identifying Hotspots#

In the plot above, the dark areas represent close contacts. Look for the diagonal patterns or clusters: those are your Interaction Hotspots. These are the residues you should target to improve the peptide’s affinity.

3. All-vs-All Contacts#

You can also use this tool to see the internal organization of the fibril by plotting the contacts of the protein against itself.

# Internal structure of the A-beta fibril (showing the beta-sheet arrangement)
contact_map = msm.structure.get_contacts(molsys, selection='molecule_type=="protein"',
                                         threshold='0.5 nm')

figure, axis = plt.subplots()
axis.imshow(contact_map[0].astype(int), origin='lower', interpolation='nearest')
axis.set_xlabel('Protein atom index')
axis.set_ylabel('Protein atom index')
plt.show()

🏆 Path A Challenge: The Map Reader#

  1. Generate a contact map between the peptide and Chain 2 of the fibril.

  2. Increase the threshold to 1.0 nm and observe how the map changes.

  3. Pass center_of_atoms=True with a group-wise selection to get_contacts to see whether a residue-level view is cleaner than the atom-level one.

Visualizing interactions is key for reporting results. In Module 33, we will look at Ensemble Descriptors: global metrics like the Radius of Gyration and RMSF to study the flexibility of your system.