Merge branch 'master' of github.com:tgttunstall/LSHTM_analysis

This commit is contained in:
Tanushree Tunstall 2020-09-10 16:14:46 +01:00
commit 5102bbea1b
21 changed files with 2132 additions and 243 deletions

View file

@ -15,7 +15,10 @@ library(ggplot2)
library(data.table)
library(dplyr)
source("dirs.R")
require("getopt", quietly = TRUE) #cmd parse arguments
#========================================================
# command line args
#spec = matrix(c(
@ -31,19 +34,6 @@ require("getopt", quietly = TRUE) #cmd parse arguments
# stop("Missing arguments: --drug and --gene must both be specified (case-sensitive)")
#}
#========================================================
#%% variable assignment: input and output paths & filenames
drug = "pyrazinamide"
gene = "pncA"
gene_match = paste0(gene,"_p.")
cat(gene_match)
#=============
# directories
#=============
datadir = paste0("~/git/Data")
indir = paste0(datadir, "/", drug, "/input")
outdir = paste0("~/git/Data", "/", drug, "/output")
plotdir = paste0("~/git/Data", "/", drug, "/output/plots")
#======
# input
#======
@ -52,6 +42,17 @@ in_filename_params = paste0(tolower(gene), "_all_params.csv")
infile_params = paste0(outdir, "/", in_filename_params)
cat(paste0("Input file 1:", infile_params) )
cat('columns based on variables:\n'
, drug
, '\n'
, dr_muts_col
, '\n'
, other_muts_col
, "\n"
, resistance_col
, '\n===============================================================')
#%%===============================================================
###########################
# Read file: struct params
@ -62,9 +63,6 @@ my_df = read.csv(infile_params, header = T)
cat("\nInput dimensions:", dim(my_df))
# quick checks
#colnames(my_df)
#str(my_df)
###########################
# extract unique mutation entries