@@ -3,7 +3,7 @@ suppressPackageStartupMessages(library(patchwork))
3
3
suppressPackageStartupMessages(library(ggplot2 ))
4
4
5
5
# Load figure themes and colors
6
- source(" figure_themes.R " )
6
+ source(" figure_themes.r " )
7
7
8
8
# Define function for loading data
9
9
load_process_data <- function (results_file_to_load , normalized_or_raw ) {
@@ -129,18 +129,32 @@ areashape_boxplot <- (
129
129
130
130
areashape_boxplot
131
131
132
- ks_zernike_highlight_df <- ks_test_df %> %
132
+ head(ks_test_df )
133
+
134
+ ks_areashape_highlight_df <- ks_test_df %> %
133
135
dplyr :: mutate(
136
+ areashape_or_not = ifelse(feature_group == " AreaShape" , " AreaShape" , " Other" ),
134
137
zernike_or_not = ifelse(measurement == " Zernike" , " Zernike" , " Other" )
135
138
)
136
139
137
- ks_zernike_highlight_df $ zernike_or_not <- factor (
138
- ks_zernike_highlight_df $ zernike_or_not ,
140
+ ks_areashape_highlight_df $ areashape_or_not <- factor (
141
+ ks_areashape_highlight_df $ areashape_or_not ,
142
+ levels = c(" AreaShape" , " Other" )
143
+ )
144
+
145
+ ks_areashape_highlight_df $ zernike_or_not <- factor (
146
+ ks_areashape_highlight_df $ zernike_or_not ,
139
147
levels = c(" Zernike" , " Other" )
140
148
)
141
149
150
+ print(length(unique(
151
+ ks_areashape_highlight_df %> %
152
+ dplyr :: filter(areashape_or_not == " AreaShape" ) %> %
153
+ dplyr :: pull(feature )
154
+ )))
155
+
142
156
length(unique(
143
- ks_zernike_highlight_df %> %
157
+ ks_areashape_highlight_df %> %
144
158
dplyr :: filter(zernike_or_not == " Zernike" ) %> %
145
159
dplyr :: pull(feature )
146
160
))
@@ -152,10 +166,10 @@ custom_labeller <- function(value) {
152
166
153
167
variance_gg <- (
154
168
ggplot(
155
- ks_zernike_highlight_df ,
169
+ ks_areashape_highlight_df ,
156
170
aes(x = mitocheck_variance , y = jump_variance )
157
171
)
158
- + geom_point(aes(color = feature_group ), alpha = 0.01 )
172
+ + geom_point(aes(color = areashape_or_not ), alpha = 0.01 )
159
173
+ theme_bw()
160
174
+ figure_theme
161
175
+ theme(
@@ -186,18 +200,18 @@ variance_gg <- (
186
200
variance_gg
187
201
188
202
custom_labeller <- function (value ) {
189
- paste(" AreaShape features with data type:" , stringr :: str_to_title(value ))
203
+ paste(" Zernike features with data type:" , stringr :: str_to_title(value ))
190
204
}
191
205
192
- variance_areashape_gg <- (
206
+ variance_zernike_gg <- (
193
207
ggplot(
194
- ks_zernike_highlight_df %> %
208
+ ks_areashape_highlight_df %> %
195
209
dplyr :: filter(
196
- feature_group == " AreaShape "
210
+ zernike_or_not == " Zernike "
197
211
),
198
212
aes(x = mitocheck_variance , y = jump_variance )
199
213
)
200
- + geom_point(alpha = 0.01 , aes( color = zernike_or_not ) )
214
+ + geom_point(alpha = 0.01 , color = " black " )
201
215
+ theme_bw()
202
216
+ figure_theme
203
217
+ theme(
@@ -223,16 +237,16 @@ variance_areashape_gg <- (
223
237
)
224
238
)
225
239
226
- variance_areashape_gg
240
+ variance_zernike_gg
227
241
228
242
sup_fig_gg <- (
229
243
(
230
244
full_summary_boxplot / areashape_boxplot
231
245
) | (
232
- variance_gg / variance_areashape_gg
246
+ variance_gg / variance_zernike_gg
233
247
)
234
- ) + plot_annotation(tag_levels = " A" ) + plot_layout(heights = c(1 , 0.6 ))
248
+ ) + plot_annotation(tag_levels = list (c( " A" , " B " , " C " , " " )) ) + plot_layout(heights = c(1 , 0.6 ))
235
249
236
- ggsave(output_file , dpi = 500 , height = 10 , width = 13 )
250
+ ggsave(output_file , dpi = 500 , height = 11 , width = 13 )
237
251
238
252
sup_fig_gg
0 commit comments