add consurf-only scripts

This commit is contained in:
Tanushree Tunstall 2023-02-25 17:08:22 +00:00
parent 9bc18169cf
commit a405cd8035
11 changed files with 339 additions and 15 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -81,9 +81,9 @@ tile_legend=get_legend(
legend.direction="horizontal", legend.direction="horizontal",
legend.text = element_text(size=10), legend.text = element_text(size=10),
legend.key.size = unit(10, "pt")) + legend.key.size = unit(10, "pt")) +
scale_colour_manual(name="Active Site" scale_colour_manual(name="Active Site:"
, values=tile_colour_map) + , values=tile_colour_map) +
scale_fill_manual(name="Active Site" scale_fill_manual(name="Active Site:"
, values = tile_colour_map) , values = tile_colour_map)
) )
@ -231,7 +231,7 @@ logo_or_centre = LogoPlotCustomH(
lig3_colour = tile_map$tile_colour[4] lig3_colour = tile_map$tile_colour[4]
) )
stability_centre = stab() stability_centre = stab(my_ylab="SAV Count")
# HIGH # HIGH
small_df3 = merged_df3[merged_df3['position'] > centre,] small_df3 = merged_df3[merged_df3['position'] > centre,]

View file

@ -7,8 +7,8 @@
# mutable_df3 = cbind(small_df3) # mutable_df3 = cbind(small_df3)
# plot_df = cbind(small_df3) # plot_df = cbind(small_df3)
#source("~/git/LSHTM_analysis/config/embb.R") source("~/git/LSHTM_analysis/config/embb.R")
#source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
#outdir="/home/pub/Work/LSHTM/Thesis_Plots/" #outdir="/home/pub/Work/LSHTM/Thesis_Plots/"
outdir="~/git/Writing/thesis/tex/images-corrected/embb/" outdir="~/git/Writing/thesis/tex/images-corrected/embb/"
@ -122,9 +122,9 @@ tile_legend=get_legend(
legend.direction="horizontal", legend.direction="horizontal",
legend.text = element_text(size=10), legend.text = element_text(size=10),
legend.key.size = unit(10, "pt")) + legend.key.size = unit(10, "pt")) +
scale_colour_manual(name="Active Site" scale_colour_manual(name="Active Site:"
, values=tile_colour_map) + , values=tile_colour_map) +
scale_fill_manual(name="Active Site" scale_fill_manual(name="Active Site:"
, values = tile_colour_map) , values = tile_colour_map)
) )

View file

@ -78,9 +78,9 @@ tile_legend=get_legend(
legend.direction="horizontal", legend.direction="horizontal",
legend.text = element_text(size=10), legend.text = element_text(size=10),
legend.key.size = unit(10, "pt")) + legend.key.size = unit(10, "pt")) +
scale_colour_manual(name="Active Site" scale_colour_manual(name="Active Site:"
, values=tile_colour_map) + , values=tile_colour_map) +
scale_fill_manual(name="Active Site" scale_fill_manual(name="Active Site:"
, values = tile_colour_map) , values = tile_colour_map)
) )
@ -249,7 +249,7 @@ logo_p_snps_high = LogoPlotSnps(
lig1_colour = tile_map$tile_colour[2], lig1_colour = tile_map$tile_colour[2],
lig2_colour = tile_map$tile_colour[3], lig2_colour = tile_map$tile_colour[3],
lig3_colour = tile_map$tile_colour[4] lig3_colour = tile_map$tile_colour[4]
) )+ annotate(geom="text", label="Position",x=0.5,y=0.025, size=3)
logo_or_high = LogoPlotCustomH( logo_or_high = LogoPlotCustomH(
small_df3, small_df3,
@ -265,7 +265,7 @@ logo_or_high = LogoPlotCustomH(
lig1_colour = tile_map$tile_colour[2], lig1_colour = tile_map$tile_colour[2],
lig2_colour = tile_map$tile_colour[3], lig2_colour = tile_map$tile_colour[3],
lig3_colour = tile_map$tile_colour[4] 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) stability_high = stab()+ annotate(geom="text", label="Position",x=0.5,y=0.025, size=3)

View file

@ -80,9 +80,9 @@ tile_legend=get_legend(
legend.direction="horizontal", legend.direction="horizontal",
legend.text = element_text(size=10), legend.text = element_text(size=10),
legend.key.size = unit(10, "pt")) + legend.key.size = unit(10, "pt")) +
scale_colour_manual(name="Active Site" scale_colour_manual(name="Active Site:"
, values=tile_colour_map) + , values=tile_colour_map) +
scale_fill_manual(name="Active Site" scale_fill_manual(name="Active Site:"
, values = tile_colour_map) , values = tile_colour_map)
) )

View file

@ -79,9 +79,9 @@ tile_legend=get_legend(
legend.direction="horizontal", legend.direction="horizontal",
legend.text = element_text(size=10), legend.text = element_text(size=10),
legend.key.size = unit(10, "pt")) + legend.key.size = unit(10, "pt")) +
scale_colour_manual(name="Active Site" scale_colour_manual(name="Active Site:"
, values=tile_colour_map) + , values=tile_colour_map) +
scale_fill_manual(name="Active Site" scale_fill_manual(name="Active Site:"
, values = tile_colour_map) , values = tile_colour_map)
) )