Skip to content

Introduction to Diffusion

Many of our favorite proteins diffuse on DNA. This MATLAB code will help you visualize the different types of diffusion that we may encounter and give you an intuitive idea for how to analyze your diffusion data.

The code is well commented, but I recommend you familiarize yourself with MATLAB before you begin.

  1. Making Play Data
  2. Computing Diffusion Coefficients
  3. Additional Considerations

This file will generate play data for four types of molecules that you are likely to encounter:

  • Stationary protein
  • “Motor” Proteins
  • Biased-diffusion (eg. diffusion with buffer flow)
  • Diffusing proteins

The code is well-commented and will help familiarize you with MATLAB.

Code:

You’ll need to place all three files in the same folder.

NOTE: Our wiki auto-corrects all filenames to lowercase. MATLAB is case-sensitive, so read the code and change the filename to correct uppercase, if needed.

Code:

2.1 Obtaining MSDs From Blinky Trajectories

Section titled “2.1 Obtaining MSDs From Blinky Trajectories”

Real data frequently has issues with photoblinking. In the example below, the code has been re-written to deal with missing frames; Code:

  • msdv2.m - Helper function to compute MSD(t) for a trajectory with blinking frames
  • testing_msd.m - Helper testing code to make sure everything is working with a play dataset.

Computing the diffusion coefficient can be tricky, especially for very short trajectories. This code will give you an idea for what can go wrong.

COMING SOON