From bb022470d9625269ea80bf0d0674b9b5d12d1830 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 5 Sep 2022 19:27:11 +0100 Subject: [PATCH] stuff --- .../plotting_thesis/alr/basic_barplots_alr.R | 3 +- .../pnca/basic_barplots_pnca_layout.R | 34 ++++++++++++++++--- .../pnca/pe_sens_site_count_pnca.R | 18 +++++----- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/scripts/plotting/plotting_thesis/alr/basic_barplots_alr.R b/scripts/plotting/plotting_thesis/alr/basic_barplots_alr.R index 0d5ce2a..e75e8d8 100644 --- a/scripts/plotting/plotting_thesis/alr/basic_barplots_alr.R +++ b/scripts/plotting/plotting_thesis/alr/basic_barplots_alr.R @@ -228,6 +228,7 @@ posC_all = site_snp_count_bp(plotdf = df3 , axis_label_size = axis_label_size) posC_all ################################################################## +# consurf_colours_no_isd consurfP = stability_count_bp(plotdf = df3 , df_colname = "consurf_outcome" #, leg_title = "ConSurf" @@ -235,7 +236,7 @@ consurfP = stability_count_bp(plotdf = df3 , yaxis_title = "Number of nsSNPs" , leg_position = "top" , subtitle_text = "ConSurf" - , bar_fill_values = consurf_colours # from globals + , bar_fill_values = consurf_colours_no_isd # from globals , subtitle_colour= "black" , sts = sts , lts = lts diff --git a/scripts/plotting/plotting_thesis/pnca/basic_barplots_pnca_layout.R b/scripts/plotting/plotting_thesis/pnca/basic_barplots_pnca_layout.R index 5be5f44..5e45805 100644 --- a/scripts/plotting/plotting_thesis/pnca/basic_barplots_pnca_layout.R +++ b/scripts/plotting/plotting_thesis/pnca/basic_barplots_pnca_layout.R @@ -162,9 +162,34 @@ p1 = cowplot::plot_grid(cowplot::plot_grid(lig_affT ) p1 +# PE + All position count +peT_allT = ggdraw() + + draw_label( + paste0("All mutation sites"), + fontfamily = title_theme$family, + fontface = title_theme$face, + #size = title_theme$size + size = 8 + ) + +p4 = cowplot::plot_grid(cowplot::plot_grid(peT_allT, nrow = 2 + , rel_widths = c(1,3),axis = "lr"), + cowplot::plot_grid( + peP2, posC_all, + nrow = 2, + rel_widths = c(1,1), + align = "v", + axis = "lr", + rel_heights = c(1,8) + ), + rel_heights = c(1,18), + nrow = 2,axis = "lr") +p4 + + #### Combine p1 #### w = 11.79 -h = 3.5 +h = 4 mut_impact_CLP = paste0(outdir_images ,tolower(gene) ,"_mut_impactCLP.png") @@ -174,16 +199,16 @@ print(paste0("plot filename:", mut_impact_CLP)) png(mut_impact_CLP, units = "in", width = w, height = h, res = 300 ) cowplot::plot_grid(p1, + p4, nrow = 1, labels = "AUTO", label_size = 12, - rel_widths = c(2.5,2,2) + rel_widths = c(2.5,2) #, rel_heights = c(1) ) dev.off() -w = 11.79 -h = 3.5 + mut_impact_CLP = paste0(outdir_images ,tolower(gene) ,"_mut_impactCLP.png") @@ -193,6 +218,7 @@ print(paste0("plot filename:", mut_impact_CLP)) png(mut_impact_CLP, units = "in", width = w, height = h, res = 300 ) cowplot::plot_grid(p1, + p4, nrow = 1, labels = "AUTO", label_size = 12, diff --git a/scripts/plotting/plotting_thesis/pnca/pe_sens_site_count_pnca.R b/scripts/plotting/plotting_thesis/pnca/pe_sens_site_count_pnca.R index 1deed2f..8713a29 100644 --- a/scripts/plotting/plotting_thesis/pnca/pe_sens_site_count_pnca.R +++ b/scripts/plotting/plotting_thesis/pnca/pe_sens_site_count_pnca.R @@ -20,12 +20,12 @@ table(str_df_plot_cols$pe_effect_outcome) #PE count: # lig, ppi2, stability #=========== -rects <- data.frame(x=1:6, +rects <- data.frame(x=1:4, colors = c("#f0e68c" , "#ffd700" , - "#da70d6" , - "#ff1493" , + # "#da70d6" , + # "#ff1493" , "#f8766d" , "#00BFC4") @@ -34,21 +34,21 @@ rects <- data.frame(x=1:6, rects$text = c("-ve Lig" , "+ve Lig" - , "-ve PPI2" - , "+ve PPI2" + #, "-ve PPI2" + #, "+ve PPI2" , "-ve stability" , "+ve stability" ) cell1 = table(str_df_plot_cols$pe_effect_outcome)[["DD_lig"]] -cell2 = 0 +cell2 = table(str_df_plot_cols$pe_effect_outcome)[["SS_lig"]] #cell3 = table(str_df_plot_cols$pe_effect_outcome)[["DD_nucleic_acid"]] #cell4 = table(str_df_plot_cols$pe_effect_outcome)[["SS_nucleic_acid"]] -cell5 = table(str_df_plot_cols$pe_effect_outcome)[["DD_ppi2"]] -cell6 = table(str_df_plot_cols$pe_effect_outcome)[["SS_ppi2"]] +# cell5 = table(str_df_plot_cols$pe_effect_outcome)[["DD_ppi2"]] +# cell6 = table(str_df_plot_cols$pe_effect_outcome)[["SS_ppi2"]] cell7 = table(str_df_plot_cols$pe_effect_outcome)[["DD_stability"]] cell8 = table(str_df_plot_cols$pe_effect_outcome)[["SS_stability"]] @@ -57,7 +57,7 @@ cell8 = table(str_df_plot_cols$pe_effect_outcome)[["SS_stability"]] #rects$numbers = c(38, 0, 22, 9, 108, 681) #for embb rects$numbers = c(cell1, cell2, #cell3, cell4, - cell5, cell6, + #cell5, cell6, cell7, cell8) rects$num_labels = paste0("n=", rects$numbers)