We developed automated computer vision software to detect exocytic events marked by pH-sensitive fluorescent probes. Here, we demonstrate the use of a graphical user interface and RStudio to detect fusion events, analyze and display spatiotemporal parameters of fusion, and classify events into distinct fusion modes.
Timelapse TIRF microscopy of pH-sensitive GFP (pHluorin) attached to vesicle SNARE proteins is an effective method to visualize single vesicle exocytic events in cell culture. To perform an unbiased, efficient identification and analysis of such events, a computer-vision based approach was developed and implemented in MATLAB. The analysis pipeline consists of a cell segmentation and exocytic-event identification algorithm. The computer-vision approach includes tools for investigating multiple parameters of single events, including the half-life of fluorescence decay and peak ΔF/F, as well as whole-cell analysis of the frequency of exocytosis. These and other parameters of fusion are used in a classification approach to distinguish distinct fusion modes. Here a newly built GUI performs the analysis pipeline from start to finish. Further adaptation of Ripley's K function in R Studio is used to distinguish between clustered, dispersed, or random occurrence of fusion events in both space and time.
VAMP-pHluorin constructs or transferrin receptor (TfR)-pHuji constructs are excellent markers of exocytic events, as these pH-sensitive fluorophores are quenched within the acid vesicle lumen and fluoresce immediately upon fusion pore opening between the vesicle and plasma membrane1. Following fusion pore opening, fluorescence decays exponentially, with some heterogeneity that reveals information about the fusion event. Here, a graphical user interface (GUI) application is described that automatically detects and analyzes exocytic events. This application allows the user to automatically detect exocytic events revealed by pH sensitive markers2 and generate features from each event that can be used for classification purposes3 (Figure 1A). In addition, analysis of exocytic event clustering using Ripley's K function is described.
The automated classification of exocytic events into different exocytic modes was recently reported3. Two modes of exocytosis, full-vesicle fusion (FVF) and kiss-and-run fusion (KNR) exocytosis have previously been described4,5,6,7. During FVF, the fusion pore dilates, and the vesicle is incorporated into the plasma membrane. During KNR, the fusion pore transiently opens and then reseals4,5,8,9,10. Four modes of exocytosis were identified in developing neurons, two related to FVF and two related to KNR. This work demonstrates that both FVF and KNR can be further subdivided into fusion events that proceed immediately to fluorescence decay (FVFi and KNRi) after fusion pore opening or exocytic events that exhibit a delay after fusion pore opening before fluorescence decay begins (FVFd and KNRd) (Figure 1B). The classifier identifies the mode of exocytosis for each fusion event. Here this analysis has been incorporated into a GUI that can be installed in MATLAB in Windows and Mac based operating systems. All analysis files can be found at https://drive.google.com/drive/folders/1VCiO-thMEd4jz-tYEL8I4N1Rf_zjnOgB?usp=sharing or
https://github.com/GuptonLab.
NOTE: The original Exocytosis Analysis GUI was written and compiled in Matlab version 9.10 (2021a). New versions of MATLAB have required updates to the GUI, which are available for download from our website: https://guptonlab.web.unc.edu/code/
1. Choose datasets and directory
2. Set the pixel size and framerate
3. Choose or make masks
4. Analysis and feature extraction
5. Classification of exocytic events
6. Spatiotemporal analysis of exocytosis using Ripley's K values
7. RStudio setup
8. Ripley's analysis
NOTE: The Ripleys_k_analysis.R file also automatically generated Ripley's k value plots. Running the entire script will automatically run the functions mentioned below, but it is included in detail if one wishes to run each portion of the script individually or make changes to the analysis.
Here the GUI (Figure 2A) was utilized to analyze exocytic events from three VAMP2-pHluorin expressing neurons at 3 DIV using TIRF (total internal reflection fluorescence) microscopy. E15.5 cortical neurons were isolated, followed by transfection with VAMP2-pHluorin and plating using the protocols as outlined in Winkle et al., 2016 and Viesselmann et al., 201111,12. The methodology of imaging parameters is as outlined in Urbina et al., 20182. Briefly, TIRF microscopy was used to image the basal plasma membrane of neurons every 100 ms for 2 min. Figure 2, Figure 3, Figure 4 show a step-by-step guide to analyze exocytic events. The folder where the neuron images are located is selected, and a directory to deposit the final analysis datafiles is chosen (Figure 2A). Using the MaskMaker function, a mask is generated for the neurons, which is inspected in the GUI (Figure 2B). In this instance, the cell mask is of good quality, and the analysis can proceed. Should a mask be insufficient, a mask can be created in ImageJ (Figure 3). After using the MaskMaker function or creating a mask in ImageJ and selecting the directory where the mask files are located, the analysis is performed (Figure 4A). Results are generated in the DataFiles folder when the analysis is finished (the yellow indicator changes back to green) (Figure 4B).
Datafiles are automatically generated and named according to the raw data files provided.
Assuming the datafile is named X:
X_tracking: This file includes x,y position and frame number of each event as well as bounding boxes which can be used to draw boxes around each event. Age indicates the number of frames past the initial detection where an event is a distinct gaussian puncta. If classification is checked, the classification results will appear in this file, which indicates the probability of an exocytic event belonging to one of four classes. If the probability is greater than .5, and greater than other probabilities, then an exocytic class was chosen.
X_fluorescent traces: This file includes x,y position and frame number of each event. In addition, it includes fluorescent intensity measures in a region of interest around each event 2 seconds before and 10 seconds following the peak ΔF/F for each event (indicated by the Timepoint columns).
X_cell_statistics: This file includes the cell area, total image time, and automatically calculated frequency of exocytic events for each cell (in events/mm2/minute).
Feature extraction files include:
X_contrast: Contrast. A measure of the intensity contrast between a pixel and its neighbor over the whole image.
X_correlation: Correlation. A measure of how correlated a pixel is to its neighbor over the whole image.
X_energy Total energy. Defined as the squared sum of the pixel intensity.
X_homogeneity measures the closeness of the distribution of elements in the ROI to the ROI diagonal.
X_ring_fluorescence: the average fluorescence of border pixels.
X_SD: Standard Deviation. This is defined as the standard deviation of the ROI.
Examples of average fluorescence traces ± SEM from each exocytic class were plotted from X_fluorescent traces file (Figure 5A). Using the Cell_statistics file, the frequency of exocytosis for each class was plotted for each neuron (Figure 5B). With the Classification checkbox clicked, the program assigns each exocytic event to a class, plotted in Figure 5C. Following classification, the Ripley's K analysis code was used to determine if exocytic events are random, clustered, or dispersed in space and time. Density heatmaps of the localization of exocytic events (Figure 5D) were generated. These reveal expected clustered "hotspots" in distinct regions of the neuron. Next, Ripley's K analysis was performed for the soma, neurite, and clustering over time (Figure 5E). The Ripley's K value and SEM (black line and blue shaded region, respectively) rise above the line of complete spatial randomness (red dotted line), suggesting statistically significant clustering.
Figure 1: Representation of exocytic analysis and classification. (A) Outline of the analysis pipeline for the GUI. Cells are segmented from the background before exocytic events are identified and tracked. Parameters such as the peak ΔF/F and t1/2 are calculated from fluorescent traces of exocytosis in a ROI around the event pre and post-fusion. (B) illustration of the four modes of exocytosis and example image montages. After fusion, events may proceed instantaneous to FVF or KNR (FVFi and KNRi), or a delay may be present before the onset of fusion fate to FVF or KNR (FVFd and KNRd). Please click here to view a larger version of this figure.
Figure 2: Step by step example analysis. (A) First, datasets are chosen (1., red box), and a directory is chosen to place analysis files (2., red box). Next, the framerate and pixel size are specified (3., green box). Here, 0.08 µm pixel size and 100 ms framerate were used. The MaskMaker function button is then pushed (4., blue box). A folder titled "MaskFiles" is automatically created in the chosen directory containing a mask file for each image file in the dataset. (B) When datasets are loaded, selecting a data file and/or mask file will display the first frame of the images for ease of comparison (Green box). Mask files may not be completely correct; this mask file can be corrected for errors, or a new mask file may be made manually Please click here to view a larger version of this figure.
Figure 3: Creating a mask file manually in ImageJ. (A) First, open the file for making a mask. The "Polygon Selections" button is outlined in red. By clicking around the edge of the cell, a polygon outline is created. (B) How to create a mask from the polygon outline. By selecting Edit | Selection | Create Mask, a black and white mask will be created from the polygon (right image). Please click here to view a larger version of this figure.
Figure 4: Analysis of exocytic events. (A) Demonstration of the analysis button (orange box) and a running analysis. Notice the run indicator turns yellow while an analysis is being performed. (B) Example analysis files that are created in the chosen directory when the analysis is complete. DataFiles contain all analysis files of the exocytic event. (C) Analysis files generated in the DataFiles Folder. Color boxes represent the open files in subsequent images. (D) Three open files, "X_fluorescent_traces.csv" (red) and "X_Cell_statistics"(green), and "X_tracking"(blue). Fluorescent traces contain the x,y position and frame number of each event, as well as fluorescent intensity at each ROI. Cell_statistics contains summary information of whole-cell exocytic statistics such as frequency of exocytosis. X_tracking contains position and time information for each exocytic event as well as the probability of each class of exocytosis for each event, represented as a number between 0-1 (>0.5 indicates an event belongs to a particular class). Please click here to view a larger version of this figure.
Figure 5: Representative results. (A) Average fluorescence traces +/- SEM from each exocytic class. (B) Frequency of events plotted for three murine cortical neurons for each exocytic class. These data values were plotted from "X_Cell_statistics", using the classes assigned in "X_tracking". (C) Distribution of the classes of exocytosis for the same three cells used in A). Here, the ratio of each mode is plotted. (D) Density plot of where exocytic events are occurring as generated in the Ripley's K Analysis portion of the protocol. This can be interpreted as a "heat map" of the spatial likelihood of where events are occurring. (E) Ripley's K analysis of three cells used for A) and B). The red line indicates what value completely spatially random distribution of exocytic events would be. The black line indicates the aggregate Ripley's K value for the three cells in this example, and the blue shaded region represents the confidence interval. Here, the shaded region notably falls outside of the line of complete spatial randomness between ~0.25-1 µm, suggesting exocytic events are clustered at those distances. Please click here to view a larger version of this figure.
When using the exocytic detection and analysis software, please consider that the program only accepts lossless compression .tif files as input. The .tif image files may be 8-bit, 16-bit, or 32-bit grayscale (single channel) images. Other image formats must be converted into one of these types before input. For reference, examples used here are 16-bit grayscale images.
Inherent in the automated detection process, the timelapse image sets are processed for the automated background subtraction and photobleaching correction. For background subtraction, the pixels outside of the masked region of the mask file are averaged over the timelapse of the whole image, and the average value is subtracted from the image set. For photobleaching correction, a mono-exponential decay fit is applied to the average fluorescence of pixels in the mask over the course of the video, with the corrected intensity adjusted as follows:
Corrected intensity = (Intensity at time t) ÷ exp-k×t where k = decay constant
Therefore, no pre-processing is necessary prior to input. These processes, however, critically rely on the image mask to effectively separate the cell from the background, and thus a proper cell mask is necessary for good results.
The automated cell mask creator requires a uniform signal with a sufficient signal-to-noise ratio (ideally, at least 2x the standard deviation of the average background signal) to perform well. Empirically, the CAAX box tagged with a fluorescent protein, which inserts into the plasma membrane upon prenylation, works well. There is no requirement that the signal can be maintained throughout the timelapse imaging of exocytosis, as a suitable mask can be created from a high signal in the first 10 frames of the sequence. However, if the cell morphology changes significantly during the imaging paradigm, care should be taken.
When using the automated detection software, include the framerate and pixel size for accurate temporal and spatial outputs. If no framerate or pixel size is declared, the output will be per-pixel and per-frame. As a rule-of-thumb, vesicle diameters in developing neurons are on the scale of ~100 nm13, and thus the automated detection of events may work for vesicles similar in size. As it stands, there is no hard limit on the size of vesicles that can be detected (by pixel area), as automated detection relies on Gaussian-shaped intensity over a large range of Gaussian widths. Fusion of vesicles smaller than the width of a pixel can be detected accurately if the intensity of the event meets the signal-to-noise criteria of 2x the standard deviation of the average background signal as the fluorescence diffraction expands over multiple pixels.
This program was developed for detecting exocytic events in developing neurons. However, the software has been exploited to successfully detect exocytic events in other cell lines2, indicating the detection algorithm is robust. Although we have used the software for detecting exocytic events in non-neuronal cell types, differences in exocytic event mode between cell types14 indicate that the classification algorithm may not be suitable for other cell types. Exocytic events in developing neurons were originally classified using three different methods: Hierarchical clustering, Dynamic Time Warping, and Principal Component Analysis (PCA), revealing four different classes3. Here all three classifiers are employed in the GUI to categorize exocytic events into one of these established four classes. For each exocytic event, a probability score between 0-1 is assigned for each of the four possible classes. Any class with a probability score > 0.5 is considered to be of that class. This classification has only been used in developing neurons to date. Whether these classes exist in other cell types or at later developmental time points in neurons is not known. A large number of events with probability scores of <0.5 for any of the classes would suggest the classification procedure may not be appropriate for the exocytic events currently being evaluated. If low probability scores are assigned to exocytic events of different cell types, this would suggest that de novo classification is needed as new or alternate modes of exocytosis may exist. The same classification methods used here would need to be applied to the automatically detected exocytic events.
To explore the spatial and temporal clustering of exocytic events, Ripley's K analysis15 is exploited. Analyzing clustering for neurons involves three separate analyses: One for the soma, one for the neurites, and one for time. The reason for splitting the soma and neurites is to account for the extreme morphology of neurites, which are often thin enough that they can be treated as a 2D network and apply a 2D variant of Ripley's K analysis. For time, a 1D Ripley's K analysis is implemented for temporal clustering. Ripley's K analysis is a robust method for detecting clustering of point processes and colocalization. The graph of Ripley's K can be interpreted as such: the Ripley's K value + confidence interval has a 5% chance to fall outside of the line of complete spatial randomness at any point, analogous to a p-value of 0.05. Where the value falls outside of the line of complete spatial randomness, exocytic events are clustered (above CSR) or are separated at regular intervals (below CSR) at those distances (x-axis).
The creation of the mask file relies on a high initial signal-to-noise of the cell. pH sensitive markers may not always perform well in illuminating a cell, depending on what protein the probe is attached to. Another option for making mask files if the signal to noise of the exocytic marker insufficiently highlights the cell border is to employ a second fluorescent channel/image for mask creation. If using a different fluorescence marker (tagRFP-CAAX, for example) to make masks, when choosing a dataset, first navigate to the folder with the images to make masks from (for example, a folder containing the tagRFP-CAAX images). Use the Mask Maker button here. Importantly, remember to rename the mask files to match the exocytic data file to be analyzed with the above naming scheme (following the example above, the mask files named "CAAX_1_mask_file.tif" will need to be renamed to "VAMP2_488_WT_1_mask_file.tif" to match the VAMP2 image set to be analyzed). Once mask files are appropriately named, return to the Choose Dataset button again to navigate to exocytic dataset files to analyze.
The detection of exocytosis is remarkably sensitive, and exocytic events were accurately detected at signal-to-noise ratios as low as a ΔF/F of 0.01. The sensitivity of the detection depends partially on the variance of the background fluorescence, and events less than 4 standard deviations above the background signal will not be detected.
The detection of exocytic events relies on their transient nature. As a feature of the analysis of transient events, our detection code explores a 20-second window around the exocytic event. In some cell types, kiss-and-stay exocytosis may "stay" for a much longer temporal window than in developing neurons, and the automated detection may not robustly capture these less transient events. This feature is an easily modifiable variable for those comfortable with MATLAB. Similar to the limitation of the 20 second ROI, exocytic events that appear but do not disappear before the last time frame of the video may not be counted as true exocytosis, which may influence the frequency, which is calculated based on the entire length of the time series.
The mask maker included is automated by design and performs well on segmenting complex shapes from the background; however, the fully automated design limits the range of signal-to-noise and signal type that can be used to generate a mask automatically. If the user cannot include a fluorescent cell marker that is uniform and of a significant signal-to-noise ratio, the cell mask will need to be drawn manually.
User based analysis of exocytosis is a time-consuming process and subject to personal bias, as events are not always clearly separated from other fluorescence. The use of an automated analysis program to correctly identify and analyze exocytic events in an unbiased manner increases analysis efficiency and improves reproducibility and rigor.
Not only does this exocytic event detection work for accurately capturing pH sensitive fluorescence in developing neurons but other cell types as well (Urbina et al., 2018). Whether classification works for other cell types will require determination. Future applications of this technique may be useful at synapses, in non-neuronal cell types, or with novel markers of exocytic vesicle docking and fusion, such as recently described pHmScarlet16.
The authors have nothing to disclose.
We thank Dustin Revell and Reginald Edwards for testing code and the GUI. Funding was provided by the National Institutes of Health supported this research: including R01NS112326 (SLG), R35GM135160 (SLG), and F31NS103586 (FLU).
MATLAB | MathWorks | https://www.mathworks.com/products/matlab.html | |
R | R Core Team | https://www.r-project.org/ | |
Rstudio | Rstudio, PBC | https://rstudio.com/ |