added separate scripts for layout for convinience

This commit is contained in:
Tanushree Tunstall 2022-08-09 21:47:24 +01:00
parent d78b072732
commit cd86fcf8e8
6 changed files with 468 additions and 78 deletions

View file

@ -326,15 +326,13 @@ snap2P = stability_count_bp(plotdf = df3
#
# dev.off()
#####################################################################
# LAYOUT
my_label_size = 25
#ratio 11.69 by 8.27
w = 8.27*2
h = 11.69*2
#============
# Plot labels
#============
tit1 = "Stability outcome"
tit2 = "Affinity outcome"
tit3 = "Conservation outcome"
pt_size = 30
theme_georgia <- function(...) {
@ -351,7 +349,7 @@ pt1 = ggdraw() +
fontfamily = title_theme$family,
fontface = title_theme$face,
#size = title_theme$size
size = 30
size = pt_size
)
pt2 = ggdraw() +
@ -359,7 +357,7 @@ pt2 = ggdraw() +
tit2,
fontfamily = title_theme$family,
fontface = title_theme$face,
size = 30
size = pt_size
)
pt3 = ggdraw() +
@ -367,7 +365,7 @@ pt3 = ggdraw() +
tit3,
fontfamily = title_theme$family,
fontface = title_theme$face,
size = 30
size = pt_size
)
# extract common legend
@ -376,9 +374,11 @@ common_legend_outcome = get_legend(mLigP +
theme(legend.position = "top"))
#=============
# Output plot
#=============
my_label_size = 25
#======================
# Output plot function
#======================
OutPlotBP = function(x){
cowplot::plot_grid(
cowplot::plot_grid(pt1,
@ -422,25 +422,35 @@ cowplot::plot_grid(
)
}
#=====================
# OutPlot: svg and png
#======================
#ratio 11.69 by 8.27
w = 8.27*2
h = 11.69*2
#svg
bp_all_CLP = paste0(outdir_images
,tolower(gene)
,"_bp_all_CL.svg"); print(paste0("plot filename:", bp_all_CLP))
bp_all_CLP_png = paste0(outdir_images
,tolower(gene)
,"_bp_all_CL.png"); print(paste0("plot filename:", bp_all_CLP_png))
,"_bp_all_CL.svg")
cat(paste0("plot filename:", bp_all_CLP))
svg(bp_all_CLP, width = w, height = h)
OutPlotBP()
dev.off()
#png
bp_all_CLP_png = paste0(outdir_images
,tolower(gene)
,"_bp_all_CL.png")
cat(paste0("plot filename:", bp_all_CLP_png))
png(bp_all_CLP_png, width = w, height = h, units = "in", res = 300 )
OutPlotBP()
dev.off()
#####################################################################
#===============================================================
#####################################################################
# ------------------------------
# bp site site count: ALL
# <10 Ang ligand
@ -505,7 +515,6 @@ cowplot::plot_grid(posC_all, posC_lig, posC_ppi2
#, posC_na
, nrow = 1
, ncol = 3
#, labels = c("(a)", "(b)", "(c)", "(d)")
, labels = "AUTO"
, label_size = my_label_size)