`resolved ambiguous muts and generated clean output. Also seaprated dir.R

This commit is contained in:
Tanushree Tunstall 2020-09-09 11:26:13 +01:00
parent f10f8f6d2a
commit 8dbe532937
5 changed files with 49 additions and 23 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
#======
@ -53,15 +43,14 @@ infile_params = paste0(outdir, "/", in_filename_params)
cat(paste0("Input file 1:", infile_params) )
dr_muts_col = paste0('dr_mutations_', drug)
dr_muts_col = paste0('other_mutations_', drug)
cat('Extracting columns based on variables:\n'
cat('columns based on variables:\n'
, drug
, '\n'
, dr_muts_col
, '\n'
, other_muts_col
, "\n"
, resistance_col
, '\n===============================================================')
#%%===============================================================
@ -74,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