This commit is contained in:
Tanushree Tunstall 2022-09-05 19:27:11 +01:00
parent 4a34d7a94d
commit bb022470d9
3 changed files with 41 additions and 14 deletions

View file

@ -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

View file

@ -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,

View file

@ -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)