Path A - Module 31: Proximity & Neighborhoods#
In the molecular world, distance isn’t everything. What matters is who your neighbors are. To understand how your peptide blocks the Alzheimer’s fibril, you need to identify the residues that are actually interacting with it.
In this module, you will learn to extract “Neighborhoods” based on spatial proximity.
import molsysmt as msm
from molsysmt import systems
# Load our solvated complex
fibril = msm.convert('pdb:2BEG', to_form='molsysmt.MolSys')
peptide = msm.build.build_peptide('KLVFF')
molsys = msm.merge([fibril, peptide])
# Add water to see the hydration shell
solvated_molsys = msm.build.solvate(molsys, clearance='1.0 nm')
1. Finding Neighboring Residues#
The function get_neighbors() returns a list of elements that are within a certain distance from your target. Let’s find which protein residues are within 0.5 nm of our peptide.
# Find residues of the protein (selection_2) near the peptide (selection)
neighbors = msm.get_neighbors(solvated_molsys, selection='molecule_type=="peptide"',
selection_2='molecule_type=="protein"',
threshold='0.5 nm', element='group')
print(f"Found {len(neighbors[0])} neighboring residues in the fibril.")
res_names = msm.get(solvated_molsys, element='group', selection=neighbors[0], group_name=True)
print(f"Neighborhood residues: {set(res_names)}")
2. The Hydration Shell#
How many water molecules are directly “touching” our therapeutic peptide? This is the first hydration shell.
water_neighbors = msm.get_neighbors(solvated_molsys, selection='molecule_type=="peptide"',
selection_2='molecule_type=="water"',
threshold='0.35 nm', element='molecule')
print(f"There are {len(water_neighbors[0])} water molecules in the first hydration shell.")
3. Contact Analysis#
While neighbors gives you a list, get_contacts() can give you the exact pairs of atoms that are interacting. This is more detailed and useful for chemical bond analysis.
contacts = msm.get_contacts(solvated_molsys, selection='molecule_type=="peptide"',
selection_2='molecule_type=="protein"',
threshold='0.4 nm')
print(f"Found {len(contacts[0])} atomic contact pairs between the peptide and the target.")
🏆 Path A Challenge: The Interaction Mapper#
Use
msm.get_neighbors()to find all Ions (Cl- or Na+) that are within 0.8 nm of the peptide.Identify which Chain of the fibril has the most contacts with the peptide.
Visualize the system and highlight the neighboring residues you found in task 2.
Proximity is the precursor to interaction. In Module 32, we will learn how to plot these interactions in a clear, visual way using interaction matrices.