HuLab-Code /
RCC
RGC Ca2+ Clustering(RCC): The clustering and grouping procedures that we developed and detail below were based on previously described principles and protocols (3). First, we determined the range of non-specific fluctuation of fluorescence intensity in in vivo RGC imaging, which is in between +15% to -20% (ΔF/F0). Thus, we defined the RGCs with fluorescence changes within this range in response to UV stimulation as no-response (NR) RGCs. We then analyzed the rest of the RGCs with significant changes of fluorescence intensity in response to light stimulation using sparse principal component analysis (sPCA) (4, 5), which extracted 16 unbiased sparse response features in response to UV ON-OFF stimulation and therefore resulted in a 16-dimensional feature vector for each RGC. We fit each data set with a Gaussians mixture distribution model using an iterative expectation-maximization (EM) algorithm (MATLAB’s fitgmdist object) (6) with a maximum of 2000 optimization iterations. In the setup, we constrained the covariance matrix for each component to be diagonal, resulting in 32 parameters per component (16 for the mean, 16 for the variances). To avoid local minima, we set the EM algorithm repeating 20 times per candidate number of clusters and used the solution with the greatest likelihood. To find the optimal number of clusters, we evaluated the Bayesian information criterion (BIC) (7), which resulted in 47 automatically defined RGC clusters. These RGC clusters were further re-grouped with a custom-made one-dimensional hierarchical clustering MATLAB script (github.com/HuLab-Code/RCC) to combine similar clusters to achieve a good compromise between clustering complexity and quality. In this step, we used the unweighted average distance (UPGMA) algorithm to calculate the standard linkage (linkage) of the means of the RGC clusters and obtain the correlation distance. We presented the linkage result as a dendrogram plot (using linkage and dendrogram). The leaf order was optimized using the MATLAB’s optimalleaforder function and modified for clarity of presentation. By setting the grouping distance threshold as 0.28, 9 RGC functional groups were identified based on their similarity as presented in the main manuscript and the grouped individual data points were projected to a two-dimensional space by using t-Distributed Stochastic Neighbor Embedding (tSNE) (8) for visualization. For the clustering analysis under different conditions, each detected RGC fluorescent signal trace was normalized by its Euclidean norm (norm function) and compared with the normalized mean intensity of each group by performing the cross-correlation (xcross function in MATLAB, with lag range set as 0). The RGC trace was then assigned to the group that has the highest cross-correlation value that is larger than 0.75.