From 182465d5794cee6b7f38b788491268d61d5aa403 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Fri, 20 Aug 2021 18:52:47 +0100 Subject: [PATCH] added corr plots as function for interactive graphs on shiny --- scripts/functions/my_pairs_panel.R | 25 +++++++++++++++++++++++++ scripts/plotting/get_plotting_dfs.R | 6 +++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/scripts/functions/my_pairs_panel.R b/scripts/functions/my_pairs_panel.R index 8380f1f..0c73192 100644 --- a/scripts/functions/my_pairs_panel.R +++ b/scripts/functions/my_pairs_panel.R @@ -1,3 +1,28 @@ +my_corr_pairs <- function (corr_data){ + + OutPlot_corr = pairs.panels(corr_data + , method = "spearman" # correlation method + , hist.col = "grey" ##00AFBB + , density = TRUE # show density plots + , ellipses = F # show correlation ellipses + , stars = T + , rug = F + , breaks = "Sturges" + , show.points = T + #, bg = c("#f8766d", "#00bfc4")[unclass(factor(corr_ps$duet_outcome))] # foldx colours are reveresed + #, pch = 21 # for bg + , jitter = T + , alpha = 1 + , cex = 1.8 + , cex.axis = 2 + , cex.labels = 3.5 + , cex.cor = 1 + , smooth = F) + return(OutPlot_corr) + +} + +###################################################################### my_pp = function (x, smooth = TRUE, scale = FALSE, density = TRUE, ellipses = TRUE, digits = 2, method = "pearson", pch = 20, lm = FALSE, cor = TRUE, jiggle = FALSE, factor = 2, hist.col = "cyan", show.points = TRUE, diff --git a/scripts/plotting/get_plotting_dfs.R b/scripts/plotting/get_plotting_dfs.R index e8cddd3..0babc1a 100644 --- a/scripts/plotting/get_plotting_dfs.R +++ b/scripts/plotting/get_plotting_dfs.R @@ -415,7 +415,7 @@ dim(corr_data_ps) #-------------------------------------- my_corr_colnames = c("Mutation" , "DUET" - , "Foldx" + , "FoldX" #, "Mutation class" , "ASA" , "RSA" @@ -476,7 +476,7 @@ if (nrow(corr_ps_df3) == nrow(merged_df3) && nrow(merged_df3_comp) == check1) { # Data for Correlation plots: LIG #================================= cat("\n==========================================" - , "\nCORR PLOTS data: PS" + , "\nCORR PLOTS data: LIG" , "\n===========================================") df_lig = merged_df2_lig @@ -577,7 +577,7 @@ if (nrow(corr_lig_df3) == nrow(merged_df3_lig) && nrow(merged_df3_comp_lig) == c identical(corr_data_lig, corr_lig_df2) identical(corr_data_ps, corr_ps_df2) -rm(df_ps, df_lig, corr_data_ps, corr_data_lig) +#rm(df_ps, df_lig, corr_data_ps, corr_data_lig) ######################################################################## # End of script