From 2531a739dd2242b74b3c07cd534d45058dc7e771 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sun, 15 Sep 2024 10:59:27 -0400 Subject: [PATCH] Add annotations --- qhtcp-workflow/apps/r/calculate_interaction_zscores.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R index 2b58cb00..7a68c633 100644 --- a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R +++ b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R @@ -281,6 +281,7 @@ calculate_interaction_scores <- function(df, max_conc, variables, group_vars = c lm_AUC <- lm(Delta_AUC ~ conc_num_factor, data = stats) interactions <- stats %>% + group_by(OrfRep, Gene, num) %>% summarise( OrfRep = first(OrfRep), Gene = first(Gene), @@ -571,6 +572,13 @@ generate_scatter_plot <- function(plot, config, interactive = FALSE) { plot <- plot + scale_y_continuous(limits = config$ylim_vals) } + # Add annotations if provided + if (!is.null(config$annotations)) { + for (annotation in config$annotations) { + plot <- plot + annotate("text", x = annotation$x, y = annotation$y, label = annotation$label) + } + } + return(plot) }