|
@@ -552,6 +552,7 @@ generate_scatter_plot <- function(plot, config) {
|
|
|
return(plot)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
generate_box_plot <- function(plot, config) {
|
|
|
plot <- plot + geom_boxplot()
|
|
|
|
|
@@ -684,18 +685,18 @@ generate_rank_plot_configs <- function(df_filtered, is_lm = FALSE, adjust = FALS
|
|
|
configs <- list()
|
|
|
|
|
|
# SD-based plots for L and K
|
|
|
- for (var in c("L", "K")) {
|
|
|
+ for (variable in c("L", "K")) {
|
|
|
for (sd_band in sd_bands) {
|
|
|
|
|
|
# Determine columns based on whether it's lm or not
|
|
|
if (is_lm) {
|
|
|
- rank_var <- paste0(var, "_Rank_lm")
|
|
|
- zscore_var <- paste0("Z_lm_", var)
|
|
|
- y_label <- paste("Int Z score", var)
|
|
|
+ rank_var <- paste0(variable, "_Rank_lm")
|
|
|
+ zscore_var <- paste0("Z_lm_", variable)
|
|
|
+ y_label <- paste("Int Z score", variable)
|
|
|
} else {
|
|
|
- rank_var <- paste0(var, "_Rank")
|
|
|
- zscore_var <- paste0("Avg_Zscore_", var)
|
|
|
- y_label <- paste("Avg Z score", var)
|
|
|
+ rank_var <- paste0(variable, "_Rank")
|
|
|
+ zscore_var <- paste0("Avg_Zscore_", variable)
|
|
|
+ y_label <- paste("Avg Z score", variable)
|
|
|
}
|
|
|
|
|
|
# Annotated Plot Configuration
|
|
@@ -704,7 +705,7 @@ generate_rank_plot_configs <- function(df_filtered, is_lm = FALSE, adjust = FALS
|
|
|
x_var = rank_var,
|
|
|
y_var = zscore_var,
|
|
|
plot_type = "scatter",
|
|
|
- title = paste(y_label, "vs. Rank for", var, "above", sd_band, "SD"),
|
|
|
+ title = paste(y_label, "vs. Rank for", variable, "above", sd_band, "SD"),
|
|
|
sd_band = sd_band,
|
|
|
annotations = list(
|
|
|
list(
|
|
@@ -729,7 +730,7 @@ generate_rank_plot_configs <- function(df_filtered, is_lm = FALSE, adjust = FALS
|
|
|
x_var = rank_var,
|
|
|
y_var = zscore_var,
|
|
|
plot_type = "scatter",
|
|
|
- title = paste(y_label, "vs. Rank for", var, "above", sd_band, "SD No Annotations"),
|
|
|
+ title = paste(y_label, "vs. Rank for", variable, "above", sd_band, "SD No Annotations"),
|
|
|
sd_band = sd_band,
|
|
|
annotations = NULL,
|
|
|
sd_band_values = sd_band,
|
|
@@ -739,26 +740,26 @@ generate_rank_plot_configs <- function(df_filtered, is_lm = FALSE, adjust = FALS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- # Average ZScore and Rank Avg ZScore Plots for r, L, K, and AUC
|
|
|
- for (var in variables) {
|
|
|
+ # Avg ZScore and Rank Avg ZScore Plots for r, L, K, and AUC
|
|
|
+ for (variable in variables) {
|
|
|
for (plot_type in c("Avg_Zscore_vs_lm", "Rank_Avg_Zscore_vs_lm")) {
|
|
|
|
|
|
# Define x and y variables based on plot type
|
|
|
if (plot_type == "Avg_Zscore_vs_lm") {
|
|
|
- x_var <- paste0("Avg_Zscore_", var)
|
|
|
- y_var <- paste0("Z_lm_", var)
|
|
|
- title_suffix <- paste("Avg Zscore vs lm", var)
|
|
|
+ x_var <- paste0("Avg_Zscore_", variable)
|
|
|
+ y_var <- paste0("Z_lm_", variable)
|
|
|
+ title_suffix <- paste("Avg Zscore vs lm", variable)
|
|
|
} else if (plot_type == "Rank_Avg_Zscore_vs_lm") {
|
|
|
- x_var <- paste0(var, "_Rank")
|
|
|
- y_var <- paste0(var, "_Rank_lm")
|
|
|
- title_suffix <- paste("Rank Avg Zscore vs lm", var)
|
|
|
+ x_var <- paste0(variable, "_Rank")
|
|
|
+ y_var <- paste0(variable, "_Rank_lm")
|
|
|
+ title_suffix <- paste("Rank Avg Zscore vs lm", variable)
|
|
|
}
|
|
|
|
|
|
# Determine y-axis label
|
|
|
if (plot_type == "Avg_Zscore_vs_lm") {
|
|
|
- y_label <- paste("Z lm", var)
|
|
|
+ y_label <- paste("Z lm", variable)
|
|
|
} else {
|
|
|
- y_label <- paste("Rank lm", var)
|
|
|
+ y_label <- paste("Rank lm", variable)
|
|
|
}
|
|
|
|
|
|
# Determine correlation text (R-squared)
|