added barplot_subcolours_aa_combined.R to combine and label these plots

This commit is contained in:
Tanushree Tunstall 2020-10-06 18:43:20 +01:00
parent 18b6407539
commit 4285bbd59f

View file

@ -0,0 +1,54 @@
#!/usr/bin/env Rscript getwd()
setwd("~/git/LSHTM_analysis/scripts/plotting")
getwd()
#########################################################
# TASK: combined barplots_subcols_aa plots: PS and LIG
#########################################################
#=======================================================================
############################################################
# 1: Installing and loading required packages and functions
############################################################
source("barplots_subcolours_aa_PS.R")
source("barplots_subcolours_aa_LIG.R")
source("dirs.R")
#=======
# output
#=======
# plot name and location
print(paste0("plot will be in:", plotdir))
bp_aa_subcols_combined = "barplot_acoloured_combined.svg"
plot_bp_aa_subcols_combined = paste0(plotdir, "/", bp_aa_subcols_combined )
plot_bp_aa_subcols_combined
bp_aa_subcols_combined_labelled = "barplot_acoloured_combined_labelled.svg"
plot_bp_aa_subcols_combined_labelled = paste0(plotdir, "/", bp_aa_subcols_combined_labelled)
plot_bp_aa_subcols_combined_labelled
#=======================================================================
#============================
# combined plot 2: UNlabelled
#============================
svg(plot_bp_aa_subcols_combined, width = 26, height = 8)
OutPlot_aa_subcols_combined = cowplot::plot_grid(OutPlot_aa_PS, OutPlot_aa_LIG
, ncol = 1
, align = 'v')
OutPlot_aa_subcols_combined
dev.off()
#============================
# combined plot 2: labelled
#============================
svg(plot_bp_aa_subcols_combined_labelled, width = 26, height = 8)
OutPlot_aa_subcols_combined_labelled = cowplot::plot_grid(OutPlot_aa_PS, OutPlot_aa_LIG
, ncol = 1
, labels = c("(c)", "(d)")
, label_size = 20
, align = 'v'
, hjust = -0.1)
#, vjust = 0)
OutPlot_aa_subcols_combined_labelled
dev.off()