Ver Fonte

Make title size customizable

Bryan Roessler há 7 meses atrás
pai
commit
876970924b
1 ficheiros alterados com 8 adições e 2 exclusões
  1. 8 2
      qhtcp-workflow/apps/r/calculate_interaction_zscores.R

+ 8 - 2
qhtcp-workflow/apps/r/calculate_interaction_zscores.R

@@ -613,7 +613,12 @@ generate_and_save_plots <- function(out_dir, filename, plot_configs, page_width
       )
 
       # Add labels and title
-      if (!is.null(config$title)) plot <- plot + ggtitle(config$title)
+      if (!is.null(config$title)) {
+        plot <- plot + ggtitle(config$title)
+        if (!is.null(config$title_size)) {
+          plot <- plot + theme(plot.title = element_text(size = config$title_size))
+        }
+      }
       if (!is.null(config$x_label)) plot <- plot + xlab(config$x_label)
       if (!is.null(config$y_label)) plot <- plot + ylab(config$y_label)
       if (!is.null(config$coord_cartesian)) plot <- plot + coord_cartesian(ylim = config$coord_cartesian)
@@ -1001,7 +1006,8 @@ generate_interaction_plot_configs <- function(df, type) {
         x_var = "conc_num_factor_factor",
         y_var = paste0("Delta_", var),
         x_label = unique(group_data$Drug)[1],
-        title = paste(OrfRepTitle, Gene, num, sep = "      "),
+        title = paste(OrfRepTitle, Gene, sep = "      "),
+        title_size = rel(1.2),
         coord_cartesian = y_limits,
         annotations = list(
           list(x = 1, y = y_limits[2] - 0.2 * y_span, label = paste("ZShift =", Z_Shift_value)),