An extensive tutorial on van der Waals forces for computer beginners, including Python exercises with ProDy.
On this page
What are van der Waals Forces?
Have you ever wondered how a gecko can walk upside down on a smooth glass ceiling? It doesn’t use glue or suction cups. Instead, it uses van der Waals (vdW) forces.
These are the weakest but most common “sticky” forces in nature. Unlike Electrostatic (which needs strong magnets) or Hydrogen bond (which needs specific “greedy” atoms), every single atom has van der Waals forces.
The “Temporary Magnet” Analogy
Imagine atoms are like bags of marbles (electrons) that are constantly moving.
- Most of the time, the marbles are spread out evenly.
- But for a split second, all the marbles might roll to one side of the bag.
- For that tiny moment, that side of the bag becomes “negatively charged,” and the other side becomes “positively charged.”
- If another bag is nearby, it will feel that tiny pull and its marbles will move too!
This creates a very weak, very short-lived attraction. In a protein, there are thousands of atoms, so all these tiny “sticky” moments add up to something very important.
Van der Waals forces are like a “weak hug.” They only work if you are very close, but if you get too close, the atoms will suddenly push each other away!
The “Sweet Spot”: Lennard-Jones Potential
Scientists use a math formula called the Lennard-Jones potential to describe this “hug.” It tells us two things:
- Attraction: Atoms like to be close to each other to feel the vdW pull.
- Repulsion: Atoms are like solid balls; they cannot occupy the same space. If they overlap, they push back violently.
The “Sweet Spot” is usually around 3.5 to 4.5 Ångströms. If atoms are in this range, they are “happy” and sticking together.
Python Exercise: Finding vdW Contacts
In this exercise, we will write a Python script using ProDy to find atoms that are in that “Sweet Spot” in a protein.
1. Setup
If you haven’t already, install the necessary tools:
uv init vdw-projectcd vdw-projectuv add prody numpy2. The Python Script
Create a file named find_vdw.py. We will look at the protein Ubiquitin (1UBQ) and find “Carbon-Carbon” contacts, which are typical for vdW interactions.
from prody import parsePDBimport numpy as np
# 1. Download and parse Ubiquitinpdb = parsePDB('1ubq')
# 2. Select only Carbon atoms (specifically in the protein "core")# Carbons are great for seeing vdW because they aren't usually charged.carbons = pdb.select('element C')
print(f"Analyzing {len(carbons)} Carbon atoms for vdW contacts...")
# 3. Use a "Neighbor Search" to find atoms close to each other# Instead of checking every single pair (which is slow),# ProDy has built-in tools for this!from prody import Contacts
# Find pairs of carbons between 3.5 and 4.0 Angstroms (The Sweet Spot)contacts = Contacts(carbons)vdw_pairs = contacts.select(3.5, 4.0)
if vdw_pairs: print(f"Found {len(vdw_pairs)} pairs in the vdW 'Sweet Spot'!\n")
# Let's look at the first 5 matches for i in range(min(5, len(vdw_pairs))): a1, a2 = vdw_pairs[i] dist = np.linalg.norm(a1.getCoords() - a2.getCoords()) print(f"Match {i+1}: {a1.getResname()}{a1.getResnum()} ({a1.getName()}) " f"<---> {a2.getResname()}{a2.getResnum()} ({a2.getName()}) " f"| Distance: {dist:.2f} Å")else: print("No contacts found in that range.")
# 4. A simple vdW Energy function (Lennard-Jones 12-6)def calculate_vdw_energy(r, epsilon=0.1, sigma=3.5): # This is the classic formula! # epsilon is the "depth" of the well (how sticky) # sigma is the distance where energy is zero term = (sigma / r) energy = 4 * epsilon * (term**12 - term**6) return energy
print("\n--- Lennard-Jones Energy Profile ---")for r in [3.0, 3.5, 4.0, 5.0]: e = calculate_vdw_energy(r) status = "Repelling (Too Close!)" if e > 0 else "Attracting (Nice!)" print(f"Distance: {r} Å | Energy: {e:6.2f} kcal/mol | {status}")3. Understanding the Code
Contacts(carbons): This is a powerful ProDy tool. It builds a “map” of where all the atoms are so it can find neighbors very quickly.contacts.select(3.5, 4.0): This asks for all pairs of atoms that are between 3.5 and 4.0 Å apart.term**12 - term**6: This is the heart of vdW physics. The12part is the “Keep Out!” repulsion (very strong when close), and the6part is the “Come Closer” attraction.
Challenge for You
- Change the element: Modify the script to look for
element O(Oxygen) orelement N(Nitrogen). Do they have similar vdW distances? - Find the “Clash”: Change the
select(3.5, 4.0)toselect(0.1, 2.0). These are atoms that are “clashing” or are covalently bonded. What does the Lennard-Jones energy look like for them? - Protein Core: Select atoms only in the protein core (e.g.,
pdb.select('buried')if available, or just look at hydrophobic residues likeresname ILE LEU VAL). These residues rely almost entirely on vdW forces to stay together!