Parcourir la source

Add annotations

Bryan Roessler il y a 7 mois
Parent
commit
2531a739dd
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      qhtcp-workflow/apps/r/calculate_interaction_zscores.R

+ 8 - 0
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)
 }