Repository navigation
Expand file tree
/
Copy pathpostHoc_plots.R
More file actions
501 lines (448 loc) · 19.9 KB
/
Copy pathpostHoc_plots.R
File metadata and controls
501 lines (448 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
library('dplyr')
library('tidyr')
library('purrr')
library('stringr')
library('ggplot2')
library('data.table')
library('scales')
library('gridExtra')
library('grid')
library('patchwork')
#source('utils.R')
# load step2 inference results
df_step2=fread("Step2_Results_allgenes_SummaryStats_withFDR.csv",stringsAsFactors=F)
gene_consensus_df = fread('Gene_noTie_PEstates.csv',stringsAsFactors=F)
# load combined p-values by either method (easier to do bonferroni correction)
df_pvals=read.csv('Step2_inferenceResults_finalPvals_byGeneDatatypes.csv',stringsAsFactors=F)
df_pvals$lm_sign=df_pvals$P_LM<=(0.05/nrow(df_pvals))
df_pvals$cop_sign=df_pvals$P_Copula<=(0.05/nrow(df_pvals))
df_combined = df_step2 %>%
inner_join(gene_consensus_df , by = "GeneID")
# combine the pe group
df_combined = df_combined %>% inner_join(df_pvals, by = c("GeneID", "DataType", "Combined_State" = "PE_Group"))
# plot qqplot using p2
p_vals = na.omit(df_combined$Full_PVal_Theta)
n = length(p_vals)
# Calculate Expectations
qq_df = data.frame(
Observed = -log10(sort(p_vals)),
Expected = -log10(ppoints(n))
)
p_qq = ggplot(qq_df, aes(x = Expected, y = Observed)) +
geom_point(alpha = 0.5, size = 1, color = "steelblue") +
geom_abline(intercept = 0, slope = 1, color = "red", linetype = "dashed", linewidth=1) +
labs(
title = "QQ Plot: P-values for theta (p2)",
subtitle = paste("N =", n, "Gene-dataType"),
x = "Expected -log10(P)",
y = "Observed -log10(P)"
) +
theme_bw() +
theme(plot.title = element_text(face="bold"))
ggsave("Step3_qqPlot_Theta_Pval.png", p_qq, width = 6, height = 6)
# plot RNA prediction?
df_predall=read.csv('Step2_Results_allgenes_Validation_RNA_Predictions.csv',stringsAsFactors=F)
df_lm_pred = fread("Step1_Results_allgenes_lm_predictions.csv",stringsAsFactors=F)
# it predicts using 3 covariates, we need to calculate average prediction
df_lm_avgPred = df_lm_pred %>%
group_by(GeneID, DataType, individual) %>%
mutate(Predicted_avg_RNA = mean(Predicted_RNA, na.rm = TRUE)) %>%
ungroup() %>%
select(-Model_Covariate, -Predicted_RNA) %>%
distinct()
# slice significants through df_combined
df_pred_copula_sign=inner_join(df_predall, df_combined %>% filter(cop_sign == TRUE) %>% select(GeneID, DataType), by = c("GeneID", "DataType"))
df_pred_lm_sign=inner_join(df_lm_avgPred, df_combined %>% filter(lm_sign == TRUE) %>% select(GeneID, DataType), by = c("GeneID", "DataType"))
plot_prediction_performance = function(df_pred_copula, df_pred_lm, title_suffix = "Significant Genes") {
copula_prep = df_pred_copula %>%
select(GeneID, DataType, individual,
Y_Obs = RNA_Observed,
Y_Base = RNA_Pred_Base,
Y_Copula = RNA_Pred_Full)
lm_prep = df_pred_lm %>% select(GeneID,DataType,individual,Y_lm=Predicted_avg_RNA)
# merge for common sets
df_master = inner_join(copula_prep, lm_prep, by = c("GeneID", "DataType", "individual"))
# calculate MSE
df_metrics=df_master %>%
group_by(GeneID, DataType) %>%
summarise(
MSE_Base = mean((Y_Obs - Y_Base)^2, na.rm = TRUE),
MSE_LM = mean((Y_Obs - Y_lm)^2, na.rm = TRUE),
MSE_Copula = mean((Y_Obs - Y_Copula)^2, na.rm = TRUE),
Cor_Base = cor(Y_Obs, Y_Base, use="complete.obs"),
Cor_LM = cor(Y_Obs, Y_lm, use="complete.obs"),
Cor_Copula = cor(Y_Obs, Y_Copula, use="complete.obs"),
.groups = "drop"
) %>%
filter(!is.na(MSE_Base) & !is.na(MSE_LM) & !is.na(MSE_Copula)) %>%
filter(!is.na(Cor_Base) & !is.na(Cor_LM) & !is.na(Cor_Copula))
# calculate MSE difference (we use this to plot mse difference)
df_viz = df_metrics %>%
mutate(
Gain_LM = MSE_Base - MSE_LM,
Gain_Copula = MSE_Base - MSE_Copula
)
# plot MSE
p1 = ggplot(df_viz, aes(x = Gain_LM, y = Gain_Copula)) +
geom_point(alpha = 0.5, size = 1.5, color = "#4c72b0") +
geom_abline(intercept = 0, slope = 1, color = "red", linetype = "dashed", linewidth = 1) +
geom_hline(yintercept = 0, linetype = "dotted") +
geom_vline(xintercept = 0, linetype = "dotted") +
# transform axis to log-scale
scale_x_continuous(trans = scales::pseudo_log_trans(sigma = 0.1, base = 10),
breaks = c(-10, -1, -0.1, 0, 0.1, 1, 10)) +
scale_y_continuous(trans = scales::pseudo_log_trans(sigma = 0.1, base = 10),
breaks = c(-10, -1, -0.1, 0, 0.1, 1, 10)) +
labs(
x = "MSE gain (Linear)",
y = "MSE gain from (Copula)"
) +
theme_bw()+theme(axis.title = element_text(size = 12, face="bold"),
axis.text.x = element_text(size = 8, angle = 45, hjust = 1), axis.text.y = element_text(size = 8))
# plot correlation
df_long = df_viz %>%
select(GeneID, Cor_Base, Cor_LM, Cor_Copula) %>%
pivot_longer(cols = starts_with("Cor"), names_to = "Model", values_to = "Correlation")
# Calculate medians for vertical lines
medians = df_long %>% group_by(Model) %>% summarise(med = median(Correlation, na.rm=TRUE))
cols = c("Cor_Base"="#999999", "Cor_LM"="#377eb8", "Cor_Copula"="#e41a1c")
labs = c("Cor_Base"="Baseline (P+E)", "Cor_LM"="3-way LM", "Cor_Copula"="Copula LM")
p2 = ggplot(df_long, aes(x = Correlation, fill = Model)) +
geom_density(alpha = 0.4) +
geom_vline(data = medians, aes(xintercept = med, color = Model), linetype="dashed", linewidth=1,show.legend = FALSE) +
scale_fill_manual(values = cols, labels = labs) +
scale_color_manual(values = cols) +
labs(
x = "Pearson Correlation",
y = "Density"
) +
theme_bw() +
theme(
axis.title = element_text(size = 12, face="bold"),
axis.text = element_text(size = 8),
legend.position = "top",
legend.title = element_blank(),
legend.margin = margin(0,0,0,0),
legend.box.margin = margin(-5,-5,-5,-5)
) +
labs(x = "Correlation", y = "Density")
return(list(mse_plot = p1, cor_plot = p2, data = df_viz))
}
plots_all = plot_prediction_performance(df_predall, df_lm_avgPred, "All Genes")
plots_cop = plot_prediction_performance(df_pred_copula_sign, df_lm_avgPred, "Copula Sig.")
plots_lm = plot_prediction_performance(df_predall, df_pred_lm_sign, "LM Sig.")
# so here we can make a visual improvement of the 2 scatter plots by counting which model behaves the best by gene-data type pairs
get_winner_stats_from_plot_data = function(df_viz, label) {
df_viz %>%
mutate(
Winner = case_when(
MSE_Copula < MSE_Base & MSE_Copula < MSE_LM ~ "Copula LM",
MSE_LM < MSE_Base & MSE_LM < MSE_Copula ~ "3-way LM",
TRUE ~ "Baseline"
)
) %>%
group_by(Winner) %>%
summarise(Count = n(), .groups = 'drop') %>%
mutate(Category = label)
}
# fancier plot to combine the above figures together (i.e. 3 density + 3 scatter plots)
stats_all = get_winner_stats_from_plot_data(plots_all$data, "All Genes")
stats_copula_sig = get_winner_stats_from_plot_data(plots_cop$data, "Copula Sig.")
stats_lm_sig = get_winner_stats_from_plot_data(plots_lm$data, "LM Sig.")
df_3way = rbind(stats_all, stats_copula_sig, stats_lm_sig) %>%
group_by(Category) %>%
mutate(
Total = sum(Count),
Percentage = Count / Total
) %>%
ungroup()
df_3way$Category = factor(df_3way$Category,
levels = c("All Genes", "Copula Sig.", "LM Sig."))
df_3way$Winner = factor(df_3way$Winner,
levels = c("Copula LM", "3-way LM","Baseline"))
cols = c("Baseline"="#999999", "3-way LM"="#377eb8", "Copula LM"="#e41a1c")
p_bar = ggplot(df_3way, aes(x = Category, y = Percentage, fill = Winner)) +
geom_bar(stat = "identity", position = "stack", width = 0.6, color="black",alpha = 0.7) +
geom_text(aes(label = Count),
position = position_stack(vjust = 0.5),
size = 4, fontface = "bold", color = "white") +
scale_fill_manual(values = cols,breaks = c("Baseline","Copula LM","3-way LM"),
labels =c("Baseline"= "Baseline (P+E)","3-way LM" = "3-way LM", "Copula LM" = "Copula LM"))+
theme_bw() +
labs(
title = "Best Performing Model (Lowest MSE)",
y = "Percentages of Genes",
x = ""
) +
theme(
legend.position = "top",
legend.title = element_blank(),
axis.text = element_text(size = 12, face="bold"),
plot.title = element_text(face="bold")
)
#ggsave("Step3_RNA_Prediction_MSE_Barplot_modelPerformance.png", p, width = 6, height = 6)
# now panel plot
row1 = (plots_all$cor_plot + ggtitle("All gene-data types")) +
(plots_cop$cor_plot + ggtitle("Copula LM Significant") + theme(axis.title.y = element_blank(), axis.text.y = element_blank())) +
(plots_lm$cor_plot + ggtitle("3-way LM significant") + theme(axis.title.y = element_blank(), axis.text.y = element_blank())) +
plot_layout(guides = "collect") & theme(legend.position = "top")
# Bottom Row: MSE Plots
# We remove Y labels for columns 2 & 3
row2 = plots_all$mse_plot +
(plots_cop$mse_plot + theme(axis.title.y = element_blank(), axis.text.y = element_blank())) +
(plots_lm$mse_plot + theme(axis.title.y = element_blank(), axis.text.y = element_blank()))
# Combine Grid (Panel A)
panel_A = wrap_elements(row1 / row2)
# Final Assembly: Panel A / Panel B
final_plot = (panel_A / p_bar) +
plot_layout(heights = c(2, 0.8)) +
plot_annotation(tag_levels = 'A', tag_suffix = ')') &
theme(plot.tag = element_text(size = 18, face = "bold"))
# Save
ggsave("Step3_predictionPerformance.png", final_plot, width = 12, height = 12, dpi = 900)
# another panel plot for volcano (adjused R2 vs p-val), count by covariate, stratification by pe group
# panel A: volcano (R2 vs p-val)
get_volcano_plot = function(rna_res_df){
n_tests = nrow(rna_res_df)
bonferroni_cutoff = 0.05 / n_tests
log_cutoff = -log10(bonferroni_cutoff)
df_viz = rna_res_df %>%
mutate(
R2_Gain = AdjR2_Full - AdjR2_Base,
LogP = -log10(P_Combined),
Category = case_when(
P_Combined < bonferroni_cutoff ~ "Significant",
TRUE ~ "Not Significant"
)
) %>%
filter(!is.na(R2_Gain) & !is.na(LogP))
p = ggplot(df_viz, aes(x = R2_Gain, y = LogP, color = Category)) +
# Non-Sig
geom_point(data = subset(df_viz, Category == "Not Significant"),
alpha = 0.5, size = 2, color = "gray80") +
# Sig
geom_point(data = subset(df_viz, Category == "Significant"),
alpha = 0.8, size = 2.5, color = "firebrick") +
# Threshold Line
geom_hline(yintercept = log_cutoff, linetype = "dashed", color = "red", linewidth = 0.8) +
theme_bw() +
labs(
title = "R2 gain vs Significance",
subtitle = paste0("Bonferroni Threshold: p < ", formatC(bonferroni_cutoff, format="e", digits=3)),
x = "Gain in Adjusted R2 (Full Model - Base Model)",
y = "-log10( P-combined )"
) +
theme(
legend.position = "none",
plot.title = element_text(face = "bold"),
axis.ticks.y=element_blank(),
#axis.ticks.length=grid::unit(-15,'pt'),
axis.text = element_text(size = 12, color="black"),
axis.title = element_text(size = 12, face="bold"),
axis.text.y=element_text(margin=margin(r=-12))
)
return(p)
}
# Panel B: significant by covariate
get_theta_plot = function(rna_res_df){
df_viz = rna_res_df %>%
mutate(
LogP = -log10(P_Combined),
Covariate = Top_Covariate
) %>%
filter(!is.na(LogP) & !is.na(Covariate))
n_tests = nrow(rna_res_df)
bonferroni_cutoff = 0.05 / n_tests
log_cutoff = -log10(bonferroni_cutoff)
summary_stats = df_viz %>%
group_by(Covariate) %>%
summarise(n_pass = sum(P_Combined < bonferroni_cutoff), .groups = 'drop')
p = ggplot(df_viz, aes(x = LogP, y = Covariate)) +
geom_boxplot(width = 0.5, fill = "gray95", color = "black", outlier.shape = NA) +
geom_jitter(height = 0.1, size = 1.5, alpha = 0.5, aes(color = Covariate)) +
# Threshold Line
geom_vline(xintercept = log_cutoff, linetype = "dashed", color = "red", linewidth = 0.8) +
# Add Counts
geom_text(
data = summary_stats,
aes(x = log_cutoff + 0.2, y = Covariate , label = paste0("n=", n_pass)),
color = "red", fontface = "bold", hjust = 0, vjust = -1.5, size = 4
) +
theme_bw() +
scale_color_brewer(palette = "Dark2") +
labs(
title = "Theta P-value Distribution by Covariate",
x = "-log10( P-Combined )",
y = "Covariate"
) +
theme(
plot.title = element_text(face = "bold"),
legend.position = "none",
axis.ticks.y=element_blank(),
#axis.ticks.length=grid::unit(-15,'pt'),
axis.text = element_text(size = 12, color="black"),
axis.title = element_text(size = 12, face="bold"),
axis.text.y=element_text(margin=margin(r=-12))
)
return(p)
}
# Panel C: Bar Plot (count by data type by pe group)
get_bar_plot = function(df_sign, plotPercentage=FALSE) {
# count by group
df_counts = df_sign %>%
group_by(DataType, Top_Covariate, Combined_State) %>%
summarise(Count = n(), .groups = 'drop') %>%
group_by(DataType, Top_Covariate) %>%
mutate(Total_Count = sum(Count), Pct = Count / Total_Count) %>% ungroup()
# calculate total count for labels
df_totals = df_counts %>%
group_by(DataType, Top_Covariate) %>%
summarise(Total_Count = sum(Count), .groups = 'drop')
if (plotPercentage){
p = ggplot() +
geom_bar(data = df_counts,
aes(x = Top_Covariate, y = Pct, fill = Combined_State),
stat = "identity", width = 0.7, color = "black", linewidth = 0.2) +
geom_text(data = df_totals,
aes(x = Top_Covariate, y = 1, label = Total_Count),
vjust = -0.5, size = 3.5, fontface = "bold") +
facet_grid(~ DataType, switch = "x") +
scale_fill_brewer(palette = "Set3", name = "P-E Group") +
theme_bw() +
labs(title = "Significant Genes: Breakdown by Datatype and Covariate",
y = "% of Significant Genes", x = "Datatype / Covariate")
} else {
p = ggplot() +
geom_bar(data = df_counts,
aes(x = Top_Covariate, y = Count, fill = Combined_State),
stat = "identity", width = 0.7, color = "black", linewidth = 0.2) +
geom_text(data = df_totals,
aes(x = Top_Covariate, y = Total_Count, label = Total_Count),
vjust = -0.5, size = 3.5, fontface = "bold") +
facet_grid(~ DataType, switch = "x") +
scale_fill_brewer(palette = "Set3", name = "P-E Group") +
scale_y_continuous(expand=expansion(add=c(0,5)))+
theme_bw() +
labs(title = "Significant Genes: Breakdown by Datatype and Covariate",
y = "Number of Significant Genes", x = "Datatype / Covariate")
}
p = p + theme(
strip.placement = "outside",
strip.background = element_blank(),
strip.text = element_text(size = 12, face = "bold"),
legend.position = "top",
plot.title = element_text(face = "bold"),
axis.text.x = element_text(angle = 45, hjust = 1, size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 12)
)
return(p)
}
pA = get_volcano_plot(df_combined)
pB = get_theta_plot(df_combined)
# part c only significant ones
df_sig_only = df_combined %>% filter(cop_sign == TRUE)
pC = get_bar_plot(df_sig_only, plotPercentage = FALSE)
final_panel = (pA / pB / pC) +
plot_annotation(tag_levels = 'A', tag_suffix = ')') &
theme(plot.tag = element_text(size = 18, face = "bold"))
ggsave("Step3_significant_findingBreakdown.png", final_panel, width = 10, height = 12, dpi = 900)
# plot raw scatter data (pve and theta vs rna)
# need a helper function to control legend
get_legend = function(a.gplot){
tmp = ggplot_gtable(ggplot_build(a.gplot))
leg = which(sapply(tmp$grobs, function(x) x$name) == "guide-box")
legend = tmp$grobs[[leg]]
return(legend)
}
plot_combined_scatter = function(hit_row, df_all=df_theta) {
# we are only going to be interested in plotting this from the selected rows from df_copula_hits (or df_lm_hits)
# hit_row will just be one row from one of these dataframe
# grap the info from df_xx_hits
gene_id = hit_row$GeneID
dataType = hit_row$DataType
covariate = hit_row$Top_Covariate
p_val = hit_row$P_Combined
df = subset(df_all, GeneID == gene_id & DataType == dataType & Phase == 'Phase1')
#create grouping
if (covariate == "Infection") {
# influenza is easy: binary
df$Group = ifelse(df$pheno_num == 1, "Flu (1)", "No Flu (0)")
my_colors = c("No Flu (0)" = "#F8766D", "Flu (1)" = "#00BFC4")
} else {
# Continuous Case (Age / Admixture), split by quartiles
covar = ifelse(covariate == "Age", "AGE_std", "Admixture_std")
vals = df[[covar]]
# Calculate Quartiles
q1 = quantile(vals, 0.25, na.rm = TRUE)
q3 = quantile(vals, 0.75, na.rm = TRUE)
# Check for extreme skew (probbaly just to the left)
if (abs(q1 - q3) < 1e-6) {
# split by just binary instead (Zero vs Non-Zero)
# for admixture, this often happens (==0 vs >0)
df$Group = ifelse(vals <= q1, "Low / Zero", "High / Positive")
my_colors = c("Low / Zero" = "gray50", "High / Positive" = "#D55E00")
} else {
# group: Low <= Q1 | High >= Q3 | Medium is between
df$Group = case_when(
vals <= q1 ~ "Low (<= 25%)",
vals >= q3 ~ "High (>= 75%)",
TRUE ~ "Medium"
)
# re-order
df$Group = factor(df$Group, levels = c("Low (<= 25%)", "Medium", "High (>= 75%)"))
my_colors = c("Low (<= 25%)" = "#619CFF",
"Medium" = "#00BA38",
"High (>= 75%)" = "#F8766D")
}
}
# plot
globalTitle = paste0("Scatter plot: ", gene_id, " (", dataType, ") | ","Covariate: ", covariate, " | P-val: ", formatC(p_val, format = "e", digits = 2))
# first plot P vs E colored by covariate
p1 = ggplot(df, aes(x = promoter_log_std, y = enhancer_log_std, color = Group, fill = Group)) +
geom_point(size = 3, alpha = 0.7) +
# Regression Lines per Group
geom_smooth(method = "lm", alpha = 0.15) +
scale_color_manual(values = my_colors) +
scale_fill_manual(values = my_colors) +
theme_bw() +
labs(title = "Promoter vs Enhancer",
x = "Promoter (Std)",
y = "Enhancer (Std)",
color = covariate, fill = covariate) +
theme(legend.position = "bottom")
# get legend from p1
shared_legend = get_legend(p1)
# the get rid of the legend from the plot
p1 = p1 + theme(legend.position = "none")
# then plot theta_hat vs RNA, color coded by covariate (don't plot legend)
p2 = ggplot(df, aes(x = Theta_Hat, y = RNA_seq_log_std, color = Group, fill = Group)) +
geom_point(size = 3, alpha = 0.7) +
geom_smooth(method = "lm", alpha = 0.15) +
scale_color_manual(values = my_colors) +
scale_fill_manual(values = my_colors) +
theme_bw() +
labs(title = "Theta Hat vs RNA",
x = "Theta Hat", y = "RNA Seq (Log Std)") +
theme(legend.position = "none")
# combine these two plot (add the legend in the middle)
combined_plot = arrangeGrob(p1, p2, ncol = 2,
top = textGrob(globalTitle, gp = gpar(fontsize = 14, fontface = "bold")),bottom = shared_legend)
ggsave(paste0('Step3_ScatterCheck_', gene_id, '_', dataType, '_', strsplit(covariate,split='_')[[1]][1], '.png'), plot = combined_plot, width = 14, height = 7)
}
# load standardized values for RNA, promoter, enhancer, covariate, theta_hat
df_theta=fread('Step1_Results_allgenes_Theta_covar.csv',stringsAsFactors=F)
# let's get an index since we input the row index. Easier for later pick
df_combined$Inx=as.numeric(rownames(df_combined))
# plot scatter plot
plot_combined_scatter(hit_row=df_combined[27,])
plot_combined_scatter(hit_row=df_combined[1,])
for (i in 1:50){
plot_combined_scatter(hit_row=df_combined[i,])
}
# now get one for age
head(df_combined[df_combined$Top_Covariate=='Age',],20)
plot_combined_scatter(hit_row=df_combined[307,])
for (i in df_combined$Inx[df_combined$Top_Covariate=='Age'][1:20]){
plot_combined_scatter(hit_row=df_combined[i,])
}