User's guide for Matlab code

Sizing nanomaterials in biological fluids by cFRAP:

from characterizing protein aggregation to diagnosing epithelial and vascular permeability

Ranhua Xiong1,2, Roosmarijn E. Vandenbroucke3,4, Katleen Broos5, Elien Van Wonterghem3,4, Claude Libert3,4, Jo Demeester1, Stefaan C. De Smedt1,§, Kevin Braeckmans1,2,§,*

1Laboratory of General Biochemistry and Physical Pharmacy, Ghent University, Ghent, Belgium

2Centre for Nano- and Biophotonics, Ghent University, Ghent, Belgium

3Inflammation Research Center, VIB, Ghent, Belgium

4Department Biomedical Molecular Biology, Ghent University, Ghent, Belgium

5Anabiotec nv, Evergem, Belgium

§ Shared senior authors (equal contribution)

*Email:

In this guide it is explained how to use the custom written Matlab code for analysis of FRAP recovery images and to obtain the diffusion coefficient or size distributions. The user’s guide includes the following sections: description of the structure of the main code, the procedure for adding the cFRAP code to the Matlab program, examples on simulated and experimental FRAP images.

1.  Structure of code

The cFRAP code consists of a main routine which is used to call three main subroutines: the image loading routine, rFRAP and cFRAP fitting routines, and the data output and saving routines. Each routine is written as a separate M-file:

A.  Main routine M-file : rFRAP_MEM_GUI.m . A flow chart of the main routine is presented in Fig. 1. When the main routine is running, a window named ‘rFRAP_MEM_GUI’ will open (Fig. 3). The FRAP image files and parameters are required to be filled out in this window (for details please refer to the examples further on). The main routine calls the subroutines to load the FRAP images and starts with performing a one component least squares fitting to obtain reasonable initial values for D, K0, k and r2 that are needed for further cFRAP analysis. Before cFRAP analysis, it is verified if χ2 can arrive at a value <M+2M when performing a classic least-squares fit of the multi-component rFRAP model. If so, the main routine continues by calling the subroutine for cFRAP analysis. Otherwise, it stops and asks for a different set of parameters or better quality FRAP movies. After finishing cFRAP analysis, the resulting distributions of the diffusion coefficient is saved in ‘csv’ format.

B.  Image loading M-files: bfopen.m, importdata.m and load_image.m. These functions are used to load the FRAP images that should be either in Nikon ‘.nd2’, ‘.mat’ or ‘.tif’ format.

C.  One component rFRAP fitting M-file: rFrapFit.m. This M-file is needed to perform a classic least-squares fitting of the FRAP images according to the one component rFRAP model as reported earlier1.

D.  Multicomponent rFRAP fitting M-file: FRAP_leastsquare.m. The function is used to perform a classic least-squares fit of the FRAP images with the multicomponent rFRAP model.

E.  cFRAP fitting M-file: FRAP_MEM.m. This function performs cFRAP analysis of the FRAP images. First the recovery data is normalized to the fluorescence intensity before bleaching. Correction for laser fluctuations and bleaching during imaging is performed by dividing the pixels of each recovery image by the average value from one or more reference background regions in the same image. Data analysis is done by fitting of the cFRAP model (Eq. (12)) to the average fluorescence intensity values in rectangular ring-shaped areas of into which the ROI is divided. To accelerate convergence of the fitting routine, initial values of the parameters D, K0, k and r2 are set according to the results from the 1 component least square fitting. The cFRAP procedure then continues with maximizing the entropy according to Eq. (10) under the constraint M-2M≤χ2≤M+2M. cFRAP analysis is performed on the values of all ring-shaped in the ROI over the entire time lapse movie.

F.  Data saving M-file: mat2csv_wheaders.m. This function is able to output the data as a ‘csv’ file.

Figure 1. Flow chart of the cFRAP Matlab code.

2.  Adding the cFRAP source code to Matlab

Matlab software version of R2010b or above is required. Uncompressing the zip file of “matlab code soure package.zip” and copy the fold of “cFRAP-v3.0” , to e.g. “C:\Program Files\MATLAB\R2010b\”. Run Matlab and add this folder to the Matlab search path (e.g. File->Set Path->Add Folder->Save) .

3.  Examples of analysing FRAP images by cFRAP

3.1 Example 1: analyse simulated rFRAP images with the cFRAP code

Step 1: Simulate rFRAP images

A.  Start Matlab software and input “sim_rFRAP_Im” in the command window to open the GUI for the simulation of rFRAP images (Fig. 2a).

Note : the “Simulate” button will start calculation of the simulated images; “Display” can be used to display the selected images. The slider can be used to display a particular frame number.

B.  Clicking the ‘Simulate’ button will open a window where the desired parameters of the simulated images can be filled out (Fig. 2b). By clicking ‘OK’ the simulated images will be calculated according to Eq. (2). For the example shown in Fig. 2b, an rFRAP time lapse movie will be calculated for single component system with a diffusion coefficient of 5 µm2/s. The movie will consist of 30 recovery frames and with 1s intervals. The simulated image can be viewed by clicking the ‘Display’ button.

Figure 2. GUI for simulation and viewing of FRAP images (a). This window will pop up when clicking the ‘Simulate’ button and is designed to input all parameters that are required for the simulation of FRAP images (b).

Step 2: Analysis of simulated rFRAP images

A.  Type “rFRAP_MEM_GUI” in the Matlab command window to open the main GUI for cFRAP analysis (Fig. 3a).

B.  Select the recovery images simulated in previous step by clicking ‘Select Files’ and the name of the file will be shown in list box after selection.

C.  The radio button “Simulated Images” should be selected for analyzing simulated recovery images. A noise level should be filled out as the percentage of Gaussian noise that will be added to the simulated images before applying cFRAP analysis. The radio button “Is Multicomponent LS fitting” should be selected to check if χ2 can reach the required small value (see above).

D.  Click the ‘Analyse’ button to open the input window shown in Fig. 3b. The required parameters should be filled out before clicking ‘OK’ to start the analysis.

E.  After finishing the calculation, the data is saved as ‘csv’ file. The diffusion coefficient distribution can be displayed by selecting the csv file in the list-box as shown in Fig. 3c.

Figure 3. Main GUI window for cFRAP analysis (a). A pop-up window is used to input the required parameters for cFRAP analysis (b). The diffusion coefficient distribution is displayed in the GUI window when cFRAP analysis is complete (c).

3.2 Example 2: cFRAP analysis of experimental rFRAP images

A.  Type “slop_intercept” in the Matlab command window to open the GUI for calculation of fluorescence intensity variance as a function of average fluorescence intensity (required for Eq. (14)) to calculate the variance of each ROI divided ring region. In the equation, a and b are constant parameters and they can be determined by a series of images with various laser intensities in a homogeneous solution of the fluorescent species with identical instrumental settings as will be the final FRAP experiment as described before. The average and variance of fluorescence intensity for each ring can be calculated and plotted as variance as a function of the average of fluorescence of intensity. The slope (a parameter) and intercept (b parameter) of a linear fit through the data points will yield the constant of a and b. The program will yield the slope and intercept values which are used to calculate the variance of each ring region into which the ROI is divided (Fig. 4a).

B.  Load the movies recorded with different laser intensities and calculate the parameters slope and intercept by clicking the ‘calculate’ button.

C.  Type “rFRAP_MEM_GUI” in the Matlab command window to open GUI for rFRAP_MEM analysis (Fig. 3a) and load the experimental FRAP recovery images. Select the ‘Experimental images’ radio button and fill out the slope and intercept values into the pop-up interface window. Select the radio button “Is Multicompent LS fitting” to check if χ2 can reach the required small value (see above). .

D.  When cFRAP analysis is complete, the result is saved as a ‘csv’ file. The diffusion coefficient distribution can be displayed by selecting the file in the list-box as shown in Fig. 4b.

Figure 4. GUI for calculating the slope and intercept in Eq. (14). (a) These two parameters are required for subsequent cFRAP analysis. (b) The diffusion coefficient distribution can be displayed by selecting the file in the list-box.