####---- Upstream Regulators (Boxplots) ----####

plot_height = 250
plot_width = 1000
box_transparency = 0.75
box_line_thickness = 0.75
box_colours = default_sample_group_colours 	# note: changing this won't change the order the groups appear in the x axis. Merely what they are coloured as.
box_labels = default_sample_group_labels	# note: changing this won't change the order the groups appear in the x axis. Merely what they are named as.
x_axis_label = ""
y_axis_label = "expression (z-score)"
legend_position = "right"

<*per_ura*>
top_10_upstream_regulators = get_top10_ura_function(<*type*>_all_gene_sets,<*type*>_enriched_gene_sets,"enriched")
for(upstream_regulator_index in 1:10)
{
  upstream_regulator = top_10_upstream_regulators[upstream_regulator_index,]
  plot_title = upstream_regulator[["gene_set"]]
  ggp = make_ora_boxplot(upstream_regulator,plot_title,box_transparency,box_line_thickness,box_colours,box_labels,x_axis_label,y_axis_label,legend_position)
  save_plot(ggp,plot_height,plot_width,paste("<*path*>plots/upstream_regulator_analysis/<*type*>/enriched/no.",upstream_regulator_index,"_most_enriched_upstream_regulator.png<*/path*>",sep=""))
}

top_10_upstream_regulators = get_top10_ura_function(<*type*>_all_gene_sets,<*type*>_activated_gene_sets, "activated")
for(upstream_regulator_index in 1:10)
{
  upstream_regulator = top_10_upstream_regulators[upstream_regulator_index,]
  plot_title = upstream_regulator[["upstream_regulator"]]
  ggp = make_IPA_upstream_regulator_boxplot(upstream_regulator,plot_title,box_transparency,box_line_thickness,box_colours,box_labels,x_axis_label,y_axis_label,legend_position)
  save_plot(ggp,plot_height,plot_width,paste("<*path*>plots/upstream_regulator_analysis/<*type*>/activated/no.",upstream_regulator_index,"_most_activated_upstream_regulator.png<*/path*>",sep=""))
}

top_10_upstream_regulators = get_top10_ura_function(<*type*>_all_gene_sets,<*type*>_activated_gene_sets, "inhibited")
for(upstream_regulator_index in 1:10)
{
  upstream_regulator = top_10_upstream_regulators[upstream_regulator_index,]
  plot_title = upstream_regulator[["upstream_regulator"]]
  ggp = make_IPA_upstream_regulator_boxplot(upstream_regulator,plot_title,box_transparency,box_line_thickness,box_colours,box_labels,x_axis_label,y_axis_label,legend_position)
  save_plot(ggp,plot_height,plot_width,paste("<*path*>plots/upstream_regulator_analysis/<*type*>/inhibited/no.",upstream_regulator_index,"_most_inhibited_upstream_regulator.png<*/path*>",sep=""))
}
<*/per_ura*>

