#!/usr/bin/env Rscript ######################################################### # TASK: Barplots for mCSM DUET, ligand affinity, and foldX # basic barplots with count of mutations # basic barplots with frequency of count of mutations # , df_colname = "" # , leg_title = "" # , ats = 25 # axis text size # , als = 22 # axis label size # , lts = 20 # legend text size # , ltis = 22 # label title size # , geom_ls = 10 # geom_label size # , yaxis_title = "Number of nsSNPs" # , bp_plot_title = "" # , label_categories = c("Destabilising", "Stabilising") # , title_colour = "chocolate4" # , subtitle_text = NULL # , sts = 20 # , subtitle_colour = "pink" # #, leg_position = c(0.73,0.8) # within plot area # , leg_position = "top" # , bar_fill_values = c("#F8766D", "#00BFC4") ######################################################### #============= # Data: Input #============== #source("~/git/LSHTM_analysis/config/pnca.R") #source("~/git/LSHTM_analysis/config/embb.R") #source("~/git/LSHTM_analysis/config/gid.R") source("~/git/LSHTM_analysis/config/alr.R") #source("~/git/LSHTM_analysis/config/katg.R") #source("~/git/LSHTM_analysis/config/rpob.R") source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") #source("~/git/LSHTM_analysis/scripts/plotting/plotting_colnames.R") sourced by above # sanity check cat("\nSourced plotting cols as well:", length(plotting_cols)) #################################################### class(merged_df3) merged_df3 = as.data.frame(merged_df3) class(merged_df3) head(merged_df3$pos_count) nc_pc_CHANGE = which(colnames(merged_df3)== "pos_count"); nc_pc_CHANGE colnames(merged_df3)[nc_pc_CHANGE] = "df2_pos_count_all" head(merged_df3$pos_count) head(merged_df3$df2_pos_count_all) # DROP pos_count column # merged_df3$pos_count <-NULL merged_df3 = merged_df3[, !colnames(merged_df3)%in%c("pos_count")] head(merged_df3$pos_count) df3 = merged_df3[, colnames(merged_df3)%in%plotting_cols] "nca_distance"%in%colnames(df3) #======= # output #======= outdir_images = paste0("~/git/Writing/thesis/images/results/", tolower(gene), "/") cat("plots will output to:", outdir_images) ########################################################### #------------------------------ # plot default sizes #------------------------------ #========================= # Affinity outcome # check this var: outcome_cols_affinity # get from preformatting or put in globals #========================== DistCutOff LigDist_colname # = "ligand_distance" # from globals ppi2Dist_colname naDist_colname ########################################################### # get plotting data within the distance df3_lig = df3[df3[[LigDist_colname]]