From a6d93b3fa8542305ce01e693ee3cb48169d96ee4 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Tue, 9 Aug 2022 21:55:24 +0100 Subject: [PATCH] starting corr plots --- scripts/functions/corr_plot_data.R | 24 --- .../plotting_thesis/corr_plots_thesis.R | 175 +++++++++--------- 2 files changed, 92 insertions(+), 107 deletions(-) diff --git a/scripts/functions/corr_plot_data.R b/scripts/functions/corr_plot_data.R index 970910f..e6aff38 100644 --- a/scripts/functions/corr_plot_data.R +++ b/scripts/functions/corr_plot_data.R @@ -1,28 +1,7 @@ #!/usr/bin/env Rscript ######################################################### # TASK: Script to format data for Correlation plots: - # corr_data_extract() -# INPUT: - # df: data with all parameters (my_use case) - # merged_df3 or merged_df2!? - # gene: [sanity check] - # drug: relates to a column name that will need to extracted - # ligand_dist_colname = LigDist_colname (variable from plotting_globals() - -# colnames_to_extract = c("mutationinformation", "duet_affinity_change") -# display_colnames_key = c(mutationinformation = "MUT" , duet_affinity_change = "DUET") -# extract_scaled_cols = T or F, so that parameters with the _scaled suffix can be extracted. - # NOTE*: No formatting applied to these cols i.e display name - -# RETURNS: DF - # containing all the columns required for generating downstream correlation plots - -# TODO: ADD -#lineage_count_all -#lineage_count_unique -#my_df['lineage_proportion'] = my_df['lineage_count_unique']/my_df['lineage_count_all'] -#my_df['dist_lineage_proportion'] = my_df['lineage_count_unique']/total_mtblineage_uc ################################################################## # LigDist_colname #from globals: plotting_globals.R @@ -31,14 +10,11 @@ corr_data_extract <- function(df , gene , drug - #, ligand_dist_colname = LigDist_colname , colnames_to_extract , colnames_display_key , extract_scaled_cols = F){ if ( missing(colnames_to_extract) || missing(colnames_display_key) ){ - #if ( missing(colnames_to_extract) ){ - cat("\n==========================================" , "\nCORR PLOTS data: ALL params" , "\n=========================================") diff --git a/scripts/plotting/plotting_thesis/corr_plots_thesis.R b/scripts/plotting/plotting_thesis/corr_plots_thesis.R index 1470076..348b8cb 100644 --- a/scripts/plotting/plotting_thesis/corr_plots_thesis.R +++ b/scripts/plotting/plotting_thesis/corr_plots_thesis.R @@ -127,48 +127,50 @@ dev.off() #================ # ppi2 affinity #================ -corr_ppi2_colnames = c("mCSM-PPI2" - , "MAF" - , "Log(OR)" - , "-Log(P)" - , "PPI-Dist" # "interface_dist" - , "dst_mode" - , drug) - -corr_ppi2_colnames%in%colnames(corr_plotdf) -corr_df_ppi2 = corr_plotdf[, corr_ppi2_colnames] -corr_df_ppi2 = corr_df_ppi2[corr_df_ppi2["PPI-Dist"]