From b8d0bc416ad29bb58ad977a230f2b0f91ca2d583 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Fri, 4 Jun 2021 17:26:01 +0100 Subject: [PATCH] added plotting_globals and text file with info on how to run plotting scripst --- scripts/plotting/plotting_globals.R | 54 +++++++++++++++++++ scripts/plotting/running_plotting_scripts.txt | 24 +++++++++ 2 files changed, 78 insertions(+) create mode 100644 scripts/plotting/plotting_globals.R create mode 100644 scripts/plotting/running_plotting_scripts.txt diff --git a/scripts/plotting/plotting_globals.R b/scripts/plotting/plotting_globals.R new file mode 100644 index 0000000..a074f52 --- /dev/null +++ b/scripts/plotting/plotting_globals.R @@ -0,0 +1,54 @@ +#!/usr/bin/env Rscript +######################################################### +# TASK: importing dir str +# create a function that takes 'drug' and 'gene' as args, +# This script is sourced by plotting.R to import dir str +# for various plots, etc. +######################################################### +import_dirs <- function(drug, gene) { + gene_match = paste0(gene,"_p.") + cat(gene_match) + + #============= + # directories and variables + #============= + datadir <<- paste0("~/git/Data/") + indir <<- paste0(datadir, drug, "/input") + outdir <<- paste0("~/git/Data/", drug, "/output") + plotdir <<- paste0("~/git/Data/", drug, "/output/plots") + + dr_muts_col <<- paste0('dr_mutations_', drug) + other_muts_col <<- paste0('other_mutations_', drug) + resistance_col <<- "drtype" + +} + +#================== +# mcsm ligand distance cut off +#================== +mcsm_lig_cutoff <<- 10 + +#================== +# Angstroms symbol +#================== + +angstroms_symbol <<- "\u212b" +#cat(paste0("There are ", nrow(my_df_u_lig), " sites lying within 10", angstroms_symbol, " of the ligand\n")) + +#================== +# Delta symbol +#================== + +delta_symbol <<- "\u0394"; delta_symbol + +########################### +# variables for my cols +########################### + +mcsm_red2 <<- "#ae301e" # most negative +mcsm_red1 <<- "#f8766d" + +mcsm_mid <<- "white" # middle + +mcsm_blue1 <<- "#00bfc4" +mcsm_blue2 <<- "#007d85" # most positive \ No newline at end of file diff --git a/scripts/plotting/running_plotting_scripts.txt b/scripts/plotting/running_plotting_scripts.txt new file mode 100644 index 0000000..8555354 --- /dev/null +++ b/scripts/plotting/running_plotting_scripts.txt @@ -0,0 +1,24 @@ +#======== +# basic_barplots_PS.R: +#======== +Rscript basic_barplots_PS.R +# Calls 'plotting_data.R' --> calls 'dirs.R' + 'Plotting_data.R': +#drug = opt$drug +#gene = opt$gene + +# hardcoding when not using cmd +drug = "streptomycin" +gene = "gid" + +#TODO +making such that cmd line agrs are passed to basic_barplots_PS.R for gene, drug and maybe input file +and then these call functions + +Delete: dirs.R +after grepping +barplots_subcolours_aa_combined.R:source("dirs.R") +basic_barplots_PS.R:source("dirs.R") +resolving_ambiguous_muts.R:source("dirs.R") + +#=======================================================================