lots of per-plot configs

This commit is contained in:
Tanushree Tunstall 2022-08-22 21:56:13 +01:00
parent 13999a477d
commit 04253b961f
36 changed files with 5121 additions and 540 deletions

View file

@ -34,7 +34,12 @@ if ( all(table(nsample_lin$sensitivity)== table(nsample_lin$mutation_info_labels
###################################################
# Lineage barplots #
###################################################
my_xats = 8 # x axis text size # were 25
my_yats = 8# y axis text sized_lab_size
my_xals = 8 # x axis label size
my_yals = 8 # y axis label size
my_lls = 8 # legend label size
d_lab_size = 2.3
#===============================
# lineage sample and SNP count
#===============================
@ -46,13 +51,13 @@ lin_countP = lin_count_bp(lf_data = lineage_dfL[['lin_lf']]
, bar_fill_categ = "count_categ"
, display_label_col = "p_count"
, bar_stat_stype = "identity"
, d_lab_size = 8
, d_lab_size = d_lab_size
, d_lab_col = "black"
, my_xats = 25 # x axis text size
, my_yats = 25 # y axis text sized_lab_size
, my_xals = 25 # x axis label size
, my_yals = 25 # y axis label size
, my_lls = 25 # legend label size
, my_xats = my_xats # x axis text size
, my_yats = my_yats # y axis text sized_lab_size
, my_xals = my_xals # x axis label size
, my_yals = my_yals # y axis label size
, my_lls = my_lls # legend label size
, bar_col_labels = c("SNPs", "Total Samples")
, bar_col_values = c("grey50", "gray75")
, bar_leg_name = ""
@ -73,12 +78,12 @@ lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, display_label_col = "snp_diversity_f"
, bar_stat_stype = "identity"
, x_lab_angle = 90
, d_lab_size =9
, my_xats = 25 # x axis text size
, my_yats = 25 # y axis text size
, my_xals = 25 # x axis label size
, my_yals = 25 # y axis label size
, my_lls = 25 # legend label size
, d_lab_size = d_lab_size
, my_xats = my_xats # x axis text size
, my_yats = my_yats # y axis text sized_lab_size
, my_xals = my_xals # x axis label size
, my_yals = my_yals # y axis label size
, my_lls = my_lls # legend label size
, y_log10 = F
, y_scale_percent = F
, leg_location = "top"
@ -86,28 +91,9 @@ lin_diversityP = lin_count_bp_diversity(lf_data = lineage_dfL[['lin_wf']]
, bp_plot_title = "nsSNP diversity"
, title_colour = "black" #"chocolate4"
, subtitle_text = NULL
, sts = 20
, sts = 10
, subtitle_colour = "#350E20FF")
lin_diversityP
#=============================================
# Output plots: Lineage count and Diversity
#=============================================
# lineage_bp_CL = paste0(outdir_images
# ,tolower(gene)
# ,"_lineage_bp_CL_Tall.svg")
#
# cat("Lineage barplots:", lineage_bp_CL)
# svg(lineage_bp_CL, width = 8, height = 15)
#
# cowplot::plot_grid(lin_countP, lin_diversityP
# #, labels = c("(a)", "(b)", "(c)", "(d)")
# , nrow = 2
# # , ncols = 2
# , labels = "AUTO"
# , label_size = 25)
#
# dev.off()
########################################################################
###################################################
@ -119,6 +105,13 @@ lin_diversityP
# , "foldx_scaled"
# , "avg_stability_scaled")
my_ats = 8 # x axis text size # were 25
my_als = 8# y axis text sized_lab_size
my_leg_ts = 8 # x axis label size
my_leg_title = 8 # y axis label size
my_strip_ts = 8 #
my_xlabel = paste0("Average stability ", "(", stability_suffix, ")"); my_xlabel
#plotdf = merged_df2[merged_df2$lineage%in%c("L1", "L2", "L3", "L4"),]
@ -133,11 +126,11 @@ linP_dm_om = lineage_distP(merged_df2
, fill_categ_cols = c("red", "blue")
, label_categories = c("Resistant", "Sensitive")
, leg_label = "Mutation group"
, my_ats = 22 # axis text size
, my_als = 22 # axis label size
, my_leg_ts = 22
, my_leg_title = 22
, my_strip_ts = 22
, my_ats = my_ats # axis text size
, my_als = my_als # axis label size
, my_leg_ts = my_leg_ts
, my_leg_title = my_leg_title
, my_strip_ts = my_strip_ts
, alpha = 0.56
)