From d7f348318cc45a13ac054d18ace21a9d4efe9b48 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 29 Aug 2022 23:28:53 +0100 Subject: [PATCH] removed template files from rpob --- .../rpob/TEMP_Ppi2_appendix_tables.R | 460 ------------------ .../rpob/TEMp_na_appendix_tables.R | 441 ----------------- 2 files changed, 901 deletions(-) delete mode 100644 scripts/plotting/plotting_thesis/rpob/TEMP_Ppi2_appendix_tables.R delete mode 100644 scripts/plotting/plotting_thesis/rpob/TEMp_na_appendix_tables.R diff --git a/scripts/plotting/plotting_thesis/rpob/TEMP_Ppi2_appendix_tables.R b/scripts/plotting/plotting_thesis/rpob/TEMP_Ppi2_appendix_tables.R deleted file mode 100644 index bf1e0f6..0000000 --- a/scripts/plotting/plotting_thesis/rpob/TEMP_Ppi2_appendix_tables.R +++ /dev/null @@ -1,460 +0,0 @@ -#!/usr/bin/env Rscript -#source("~/git/LSHTM_analysis/config/katg.R") -#source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") - -#======= -# output -#======= -outdir_images = paste0("~/git/Writing/thesis/images/results/", tolower(gene), "/") -outdir_stats = paste0(outdir_images,"stats/") -cat("\nOutput dir for stats:", outdir_stats) -################################################################### -geneL_normal = c("pnca") -#geneL_na = c("gid", "rpob") -geneL_na_v2 = c("gid") -geneL_ppi2 = c("alr", "embb", "katg", "rpob") -geneL_both = c("rpob") - -if (tolower(gene)%in%geneL_na_v2) { - gene_colnames = c("mcsm_na_affinity", "mcsm_na_outcome") -} - -if (tolower(gene)%in%geneL_ppi2) { - gene_colnames = c("mcsm_ppi2_affinity", "mcsm_ppi2_outcome") -} - -#from plotting_globals() -LigDist_colname -ppi2Dist_colname -naDist_colname - -delta_symbol #delta_symbol = "\u0394"; delta_symbol -angstroms_symbol - -cat("\nAffinity Distance colnames:", length(affinity_dist_colnames) - , "\nThese are:", affinity_dist_colnames) -#=========== -# Data used -#=========== -df3 = merged_df3 - -cols_to_output = c("position" - , "sensitivity" - , "mutationinformation" - , affinity_dist_colnames[1] - , "ligand_affinity_change" - , "ligand_outcome" - , "mmcsm_lig" - , "mmcsm_lig_outcome" - , affinity_dist_colnames[2] - # #, affinity_dist_colnames[3] - # , "mcsm_na_affinity" - # , "mcsm_na_outcome" - # #, "mcsm_nca_affinity" - # #, "mcsm_nca_outcome" - , gene_colnames - , "maf" - , "or_mychisq" - , "pval_fisher") - -cols_to_output -df3_output = df3[, cols_to_output] -colnames(df3_output) -cat("\nSelecting columns:", length(colnames(df3_output))) -#=============================================== -# Add COLS and rounding: adjusted P-values + MAF -#============================================== -#----------------------------- -# adjusted P-values -#----------------------------- -# add cols: p_adj_fdr and signif_fdr -df3_output$p_adj_fdr = p.adjust(df3_output$pval_fisher, method = "fdr") -df3_output$signif_fdr = df3_output$p_adj_fdr -df3_output = dplyr::mutate(df3_output - , signif_fdr = case_when(signif_fdr == 0.05 ~ "." - , signif_fdr <=0.0001 ~ '****' - , signif_fdr <=0.001 ~ '***' - , signif_fdr <=0.01 ~ '**' - , signif_fdr <0.05 ~ '*' - , TRUE ~ 'ns')) -# rounding -df3_output$or_mychisq = round(df3_output$or_mychisq,2) -df3_output$p_adj_fdr = round(df3_output$p_adj_fdr,2) -head(df3_output) - -#---------- -# MAF (%) -#---------- -# add col maf_percent -df3_output$maf_percent = df3_output$maf*100 - -# rounding -df3_output$maf_percent = round(df3_output$maf_percent,2) -head(df3_output$af); head(df3_output$maf);head(df3_output$maf_percent) - -#---------- -# P-value -#---------- -df3_output$pval_fisher = round(df3_output$pval_fisher,2) - -class(df3_output) -head(df3_output) - -#################################### -# Appendix: ligand affinity -#################################### -df_lig = df3_output[df3_output[[LigDist_colname]]