From 4ce2087224e54f6e629be386b52dfa8d8cd6a25f Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 8 Aug 2022 16:48:40 +0100 Subject: [PATCH] various changes --- scripts/functions/bp_subcolours.R | 4 ++-- scripts/functions/generate_distance_colour_map.R | 1 - scripts/functions/wideP_consurf.R | 12 +++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/functions/bp_subcolours.R b/scripts/functions/bp_subcolours.R index 5adc071..9dc7607 100755 --- a/scripts/functions/bp_subcolours.R +++ b/scripts/functions/bp_subcolours.R @@ -68,7 +68,7 @@ bp_stability_hmap <- function(plotdf = merged_df3 # Build data with colours # ~ ligand distance #========================= - plotdf = generate_distance_colour_map(plotdf, yvar_colname = stability_colname, debug=TRUE) + plotdf = generate_distance_colour_map(plotdf, debug=TRUE) # order the df by position and ensure it is a factor plotdf = plotdf[order(plotdf[[xvar_colname]]), ] @@ -131,7 +131,7 @@ bp_stability_hmap <- function(plotdf = merged_df3 labs(title = p_title , x = my_xlab , y = my_ylab), - generate_distance_legend(plotdf, yvar_colname = stability_colname), + generate_distance_legend(plotdf), ncol = 2, #align = "hv", rel_widths = c(9/10, 0.4/10) diff --git a/scripts/functions/generate_distance_colour_map.R b/scripts/functions/generate_distance_colour_map.R index 8110676..75a2d46 100644 --- a/scripts/functions/generate_distance_colour_map.R +++ b/scripts/functions/generate_distance_colour_map.R @@ -55,7 +55,6 @@ generate_distance_colour_map = function(plot_df, } generate_distance_legend = function(plot_df, - yvar_colname, xvar_colname = 'position', lig_dist_colname = "ligand_distance", legend_title = "Ligand\nDistance" diff --git a/scripts/functions/wideP_consurf.R b/scripts/functions/wideP_consurf.R index 28fc2de..31c7ab0 100644 --- a/scripts/functions/wideP_consurf.R +++ b/scripts/functions/wideP_consurf.R @@ -13,6 +13,11 @@ # input args #========================================================== wideP_consurf2 <- function(plot_df + , aa_pos_drug = NULL + , aa_pos_lig1 = NULL + , aa_pos_lig2 = NULL + , aa_pos_lig3 = NULL + , xvar_colname = "position" , yvar_colname = "consurf_score" , yvar_colourN_colname = "consurf_colour_rev" # num from 0-1 @@ -66,20 +71,17 @@ wideP_consurf2 <- function(plot_df # Custom 3: x-axis: geom tiles ~ active sites and ligand , annotate_active_sites = F - , aa_pos_drug = aa_pos_drug + , drug_aa_colour = "purple" , active_aa_pos = NULL , active_aa_colour = "brown" - , aa_pos_lig1 = NULL , aa_colour_lig1 = "blue" , tpos1 = 0 - , aa_pos_lig2 = NULL , aa_colour_lig2 = "cyan" , tpos2 = 0 - , aa_pos_lig3 = NULL , aa_colour_lig3 = "cornflowerblue" , tpos3 = 0 @@ -487,7 +489,7 @@ wideP_consurf2 <- function(plot_df if (annotate_ligand_distance){ cat('\nOutput: Plot + distance heat-bar + other stuff') legs = cowplot::plot_grid(legend1 - , generate_distance_legend(plot_df, yvar_colname = yvar_colname) + , generate_distance_legend(plot_df) , ncol = 1 , align = "hv" , rel_heights = c(2/4,3/4))