diff --git a/scripts/plotting/plotting_thesis/alr/consurf-plot.R b/scripts/plotting/plotting_thesis/alr/consurf-plot.R new file mode 100644 index 0000000..eecf8ab --- /dev/null +++ b/scripts/plotting/plotting_thesis/alr/consurf-plot.R @@ -0,0 +1,54 @@ +# alr ONLY +source("~/git/LSHTM_analysis/config/alr.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/alr/basic_barplots_alr.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/alr/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/embb/consurf-plot.R b/scripts/plotting/plotting_thesis/embb/consurf-plot.R new file mode 100644 index 0000000..154f3f0 --- /dev/null +++ b/scripts/plotting/plotting_thesis/embb/consurf-plot.R @@ -0,0 +1,54 @@ +# embb ONLY +source("~/git/LSHTM_analysis/config/embb.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/embb/basic_barplots_embb.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/embb/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/gid/consurf-plot.R b/scripts/plotting/plotting_thesis/gid/consurf-plot.R new file mode 100644 index 0000000..e605061 --- /dev/null +++ b/scripts/plotting/plotting_thesis/gid/consurf-plot.R @@ -0,0 +1,54 @@ +# gid ONLY +source("~/git/LSHTM_analysis/config/gid.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/gid/basic_barplots_gid.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/gid/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/katg/consurf-plot.R b/scripts/plotting/plotting_thesis/katg/consurf-plot.R new file mode 100644 index 0000000..9b43e73 --- /dev/null +++ b/scripts/plotting/plotting_thesis/katg/consurf-plot.R @@ -0,0 +1,54 @@ +# katg ONLY +source("~/git/LSHTM_analysis/config/katg.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/katg/basic_barplots_katg.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/katg/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/pnca/consurf-plot.R b/scripts/plotting/plotting_thesis/pnca/consurf-plot.R new file mode 100644 index 0000000..45de83f --- /dev/null +++ b/scripts/plotting/plotting_thesis/pnca/consurf-plot.R @@ -0,0 +1,54 @@ +# pnca ONLY +source("~/git/LSHTM_analysis/config/pnca.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/pnca/basic_barplots_pnca.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/pnca/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/rpob/consurf-plot.R b/scripts/plotting/plotting_thesis/rpob/consurf-plot.R new file mode 100644 index 0000000..1519f0f --- /dev/null +++ b/scripts/plotting/plotting_thesis/rpob/consurf-plot.R @@ -0,0 +1,54 @@ +# rpob ONLY +source("~/git/LSHTM_analysis/config/rpob.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_thesis/rpob/basic_barplots_rpob.R") + +outdir_images="/home/sethp/git/Writing/thesis/tex/images-corrected/rpob/" + +w=4.5 +h=4.5 + +consurfP = stability_count_bp(plotdf = df3 + , df_colname = "consurf_outcome" + , yaxis_title = "Number of SAVs" + , leg_position = "none" + #, subtitle_text = "ConSurf" + , bar_fill_values = consurf_colours + , subtitle_colour= "black" + , sts = sts + , lts = lts + , ats = ats + , als = als + , ltis = ltis + , geom_ls = geom_ls) + +consurf_legend = get_legend( + ggplot(df3, aes(factor(consurf_outcome))) + + geom_tile(aes( + fill = consurf_outcome, y=0 + ) + )+ + + scale_fill_manual( + values=consurf_colours, + labels=c("0\nND","1\nVar","2","3","4","5\nAvg","6","7","8","9\nCons"), + guide=guide_legend(title="Consurf", + title.position = "top", + title.hjust = 0.5, + label.position = "bottom", + nrow = 1 + ) + ) +) + +consurf_out=cowplot::plot_grid(consurf_legend, consurfP,ncol=1,rel_heights = c(2.5,12)) + +conCLP = paste0(outdir_images + ,tolower(gene) + ,"_consurf_BP.jpg") + +print(paste0("plot filename:", conCLP)) +jpeg(conCLP, units = "in", width = w, height = h, res = 300 ) +consurf_out + +dev.off() diff --git a/scripts/plotting/plotting_thesis/thesis-figs-alr.R b/scripts/plotting/plotting_thesis/thesis-figs-alr.R index 7d41218..ab4afff 100644 --- a/scripts/plotting/plotting_thesis/thesis-figs-alr.R +++ b/scripts/plotting/plotting_thesis/thesis-figs-alr.R @@ -81,9 +81,9 @@ tile_legend=get_legend( legend.direction="horizontal", legend.text = element_text(size=10), legend.key.size = unit(10, "pt")) + - scale_colour_manual(name="Active Site" + scale_colour_manual(name="Active Site:" , values=tile_colour_map) + - scale_fill_manual(name="Active Site" + scale_fill_manual(name="Active Site:" , values = tile_colour_map) ) @@ -231,7 +231,7 @@ logo_or_centre = LogoPlotCustomH( lig3_colour = tile_map$tile_colour[4] ) -stability_centre = stab() +stability_centre = stab(my_ylab="SAV Count") # HIGH small_df3 = merged_df3[merged_df3['position'] > centre,] diff --git a/scripts/plotting/plotting_thesis/thesis-figs-embb.R b/scripts/plotting/plotting_thesis/thesis-figs-embb.R index 4d8d33e..0c2f5f6 100644 --- a/scripts/plotting/plotting_thesis/thesis-figs-embb.R +++ b/scripts/plotting/plotting_thesis/thesis-figs-embb.R @@ -7,8 +7,8 @@ # mutable_df3 = cbind(small_df3) # plot_df = cbind(small_df3) -#source("~/git/LSHTM_analysis/config/embb.R") -#source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/config/embb.R") +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") #outdir="/home/pub/Work/LSHTM/Thesis_Plots/" outdir="~/git/Writing/thesis/tex/images-corrected/embb/" @@ -122,9 +122,9 @@ tile_legend=get_legend( legend.direction="horizontal", legend.text = element_text(size=10), legend.key.size = unit(10, "pt")) + - scale_colour_manual(name="Active Site" + scale_colour_manual(name="Active Site:" , values=tile_colour_map) + - scale_fill_manual(name="Active Site" + scale_fill_manual(name="Active Site:" , values = tile_colour_map) ) diff --git a/scripts/plotting/plotting_thesis/thesis-figs-gid.R b/scripts/plotting/plotting_thesis/thesis-figs-gid.R index 428f35d..5d587f1 100644 --- a/scripts/plotting/plotting_thesis/thesis-figs-gid.R +++ b/scripts/plotting/plotting_thesis/thesis-figs-gid.R @@ -78,9 +78,9 @@ tile_legend=get_legend( legend.direction="horizontal", legend.text = element_text(size=10), legend.key.size = unit(10, "pt")) + - scale_colour_manual(name="Active Site" + scale_colour_manual(name="Active Site:" , values=tile_colour_map) + - scale_fill_manual(name="Active Site" + scale_fill_manual(name="Active Site:" , values = tile_colour_map) ) @@ -249,7 +249,7 @@ logo_p_snps_high = LogoPlotSnps( lig1_colour = tile_map$tile_colour[2], lig2_colour = tile_map$tile_colour[3], lig3_colour = tile_map$tile_colour[4] -) +)+ annotate(geom="text", label="Position",x=0.5,y=0.025, size=3) logo_or_high = LogoPlotCustomH( small_df3, @@ -265,7 +265,7 @@ logo_or_high = LogoPlotCustomH( lig1_colour = tile_map$tile_colour[2], lig2_colour = tile_map$tile_colour[3], lig3_colour = tile_map$tile_colour[4] -) +)+ annotate(geom="text", label="Position",x=0.5,y=0.025, size=3) stability_high = stab()+ annotate(geom="text", label="Position",x=0.5,y=0.025, size=3) diff --git a/scripts/plotting/plotting_thesis/thesis-figs-katg.R b/scripts/plotting/plotting_thesis/thesis-figs-katg.R index 6e7cb1e..682fe4a 100644 --- a/scripts/plotting/plotting_thesis/thesis-figs-katg.R +++ b/scripts/plotting/plotting_thesis/thesis-figs-katg.R @@ -80,9 +80,9 @@ tile_legend=get_legend( legend.direction="horizontal", legend.text = element_text(size=10), legend.key.size = unit(10, "pt")) + - scale_colour_manual(name="Active Site" + scale_colour_manual(name="Active Site:" , values=tile_colour_map) + - scale_fill_manual(name="Active Site" + scale_fill_manual(name="Active Site:" , values = tile_colour_map) ) diff --git a/scripts/plotting/plotting_thesis/thesis-figs-rpob.R b/scripts/plotting/plotting_thesis/thesis-figs-rpob.R index 2570c18..5857d52 100644 --- a/scripts/plotting/plotting_thesis/thesis-figs-rpob.R +++ b/scripts/plotting/plotting_thesis/thesis-figs-rpob.R @@ -79,9 +79,9 @@ tile_legend=get_legend( legend.direction="horizontal", legend.text = element_text(size=10), legend.key.size = unit(10, "pt")) + - scale_colour_manual(name="Active Site" + scale_colour_manual(name="Active Site:" , values=tile_colour_map) + - scale_fill_manual(name="Active Site" + scale_fill_manual(name="Active Site:" , values = tile_colour_map) )