|
1 | | -function [results_pcc, resultsRC_pcc, results_c, results_cs, results_ls, ... |
2 | | - results_o1, results_o2] = ... |
| 1 | +function [results_pcc, resultsRC_pcc, results_ss, results_c, results_cs, ... |
| 2 | + results_ls, results_o1, results_o2] = ... |
3 | 3 | doAnalysis(n_ROIs, RoI, ROI_sizes, desc, particles, results_dir, ... |
4 | 4 | options, PixelSize, HistBinSize, RmaxAxisLimit, E, minPts, ... |
5 | 5 | PlotNonOverlap, Color) |
|
15 | 15 | % options string array of strings specifying analyses to be performed: |
16 | 16 | % 'combined' the analysis is combined over all ROIs |
17 | 17 | % 'plotting' plots are to be produced. |
| 18 | +% 'SimpleStats' Pearson's correlation and Manders' split |
| 19 | +% coefficients per ROI |
18 | 20 | % 'BiStats' pairwise mutual distances and bivariate |
19 | 21 | % Ripley's statistics for each ROI |
20 | 22 | % 'Clustering' clusters for each label per ROI |
|
41 | 43 | % desc_results.mat containing the various results_ cell arrays for one cell |
42 | 44 | % Various results containers from the called helper functions in case the |
43 | 45 | % user wants to have more details: |
44 | | -% bivariate statistics |
| 46 | +% results_bi bivariate statistics |
45 | 47 | % Also, figures *_ROI*_L1/2_pairwiseCDF/PDF compared to a random dist. |
46 | 48 | % *_ROI*_L1,L2_pairwisePDF2/CDF2 2-label PDF/CDF |
47 | 49 | % *_ROI*_bivripley bivariate Ripley |
|
108 | 110 | plotting = true; |
109 | 111 | end |
110 | 112 |
|
| 113 | + results_ss = []; |
| 114 | + results_bi = []; |
111 | 115 | results_pcc = []; |
112 | 116 | resultsRC_pcc = []; |
113 | 117 | results_c = []; |
|
116 | 120 | results_o1 = []; |
117 | 121 | results_o2 = []; |
118 | 122 |
|
| 123 | + % Pearson's correlation and Manders' split coefficients per ROI. |
| 124 | + if any(contains(options, "SimpleStats")) |
| 125 | + results_ss = PA.doSimpleStats(n_ROIs, RoI, PixelSize, desc, particles, ... |
| 126 | + results_dir); |
| 127 | + fprintf("Done SimpleStats\n"); |
| 128 | + end |
| 129 | + |
119 | 130 | % Pairwise mutual distances and bivariate Ripley's per ROI and the latter |
120 | 131 | % also combined over all ROIs. |
121 | 132 | if any(contains(options, "BiStats")) |
122 | | - PA.doBiStats(n_ROIs, RoI, desc, particles, results_dir, combined); |
| 133 | + results_bi = PA.doBiStats(n_ROIs, RoI, desc, particles, results_dir, ... |
| 134 | + combined); |
| 135 | + fprintf("Done BiStats\n"); |
123 | 136 | end |
124 | 137 |
|
125 | 138 | % Clusters for each label per ROI. |
126 | 139 | if any(contains(options, "Clustering")) |
127 | | - results_c = PA.doClustering(n_ROIs, RoI, desc, results_dir, plotting,... |
128 | | - PixelSize, E, minPts); |
| 140 | + results_c = PA.doClustering(n_ROIs, RoI, desc, results_dir, plotting,... |
| 141 | + PixelSize, E, minPts); |
| 142 | + fprintf("Done Clustering\n"); |
129 | 143 | end |
130 | 144 |
|
131 | 145 | % C2C nearest neighbor distances between label 1/label 2 clusters per ROI |
132 | 146 | % and combined over all ROIs. |
133 | 147 | if any(contains(options, "Clustering2")) |
134 | 148 | results_cs = PA.doClusterSep2(n_ROIs, results_c, desc, particles, ... |
135 | 149 | results_dir, plotting); |
| 150 | + fprintf("Done Clustering2\n"); |
136 | 151 | end |
137 | 152 |
|
138 | 153 | % Nearest neighbor distances between label 1/label 2 localizations per ROI |
139 | 154 | % and combined over all ROIs. |
140 | 155 | if any(contains(options, "LocSep2")) |
141 | 156 | results_ls = PA.doLocSep2(n_ROIs, RoI, desc, particles, results_dir, ... |
142 | 157 | plotting); |
| 158 | + fprintf("Done LocSep2\n"); |
143 | 159 | end |
144 | 160 |
|
145 | 161 | % Overlaps between label 1 clusters and label 2 localizations. |
|
148 | 164 | results_o1 = PA.doOverlap(n_ROIs, RoI, results_c, l12, desc, ... |
149 | 165 | particles, results_dir, PlotNonOverlap, ... |
150 | 166 | Color, plotting); |
| 167 | + fprintf("Done Overlap1\n"); |
151 | 168 | end |
152 | 169 |
|
153 | 170 | % Overlaps between label 2 clusters and label 1 localizations. |
|
156 | 173 | results_o2 = PA.doOverlap(n_ROIs, RoI, results_c, l12, desc, ... |
157 | 174 | particles, results_dir, PlotNonOverlap, ... |
158 | 175 | Color, plotting); |
| 176 | + fprintf("Done Overlap2\n"); |
159 | 177 | end |
160 | 178 |
|
161 | 179 | % Pair correlation per ROI and combined over all ROIs. |
162 | 180 | if any(contains(options, "PairCorr")) |
163 | 181 | [results_pcc, resultsRC_pcc] = ... |
164 | 182 | PA.doPairCorr(n_ROIs, RoI, ROI_sizes, desc, results_dir, combined, ... |
165 | 183 | plotting, HistBinSize, RmaxAxisLimit); |
| 184 | + fprintf("Done PairCorr\n"); |
166 | 185 | end |
167 | 186 |
|
168 | 187 | % 2D plot per ROI. |
169 | 188 | if any(contains(options, "Plot2")) |
170 | 189 | PA.doPlot2(n_ROIs, RoI, desc, particles, results_dir, Color, plotting); |
| 190 | + fprintf("Done Plot2\n"); |
171 | 191 | end |
172 | 192 |
|
173 | 193 | % Save results. |
174 | 194 | save(fullfile(results_dir, sprintf('%s_results.mat', desc)), 'n_ROIs', ... |
175 | | - 'RoI', 'results_pcc', 'resultsRC_pcc', 'results_c', 'results_cs', ... |
176 | | - 'results_o1', 'results_o2'); |
| 195 | + 'RoI', 'results_ss', 'results_c', 'results_cs', 'results_ls', ... |
| 196 | + 'results_o1', 'results_o2', 'results_pcc', 'resultsRC_pcc'); |
| 197 | + fprintf("Done saving results\n"); |
177 | 198 |
|
178 | 199 | end |
0 commit comments