From fa2bcb5f05617d299b7e376ee90d208e2e591c3f Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Thu, 18 Jun 2020 18:37:55 +0100 Subject: [PATCH] updated Af and OR calcs script with argeparse and minor tidyup --- scripts/AF_and_OR_calcs.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/AF_and_OR_calcs.R b/scripts/AF_and_OR_calcs.R index be06ed5..c373dbd 100755 --- a/scripts/AF_and_OR_calcs.R +++ b/scripts/AF_and_OR_calcs.R @@ -23,7 +23,7 @@ drug = opt$drug gene = opt$gene if(is.null(drug)|is.null(gene)) { - stop('--drug and --gene must both be specified (case-sensitive)') + stop('Missing arguments: --drug and --gene must both be specified (case-sensitive)') } #options(scipen = 999) #disabling scientific notation in R. @@ -59,8 +59,7 @@ cat(paste0('Reading infile2: gene associated metadata:', infile_metadata)) # outdir = 'git/Data/pyrazinamide/output' outdir = paste0('~/git/Data', '/', drug, '/', 'output') #out_filename = paste0(tolower(gene), '_meta_data_with_AF_OR.csv') -#out_filename = paste0(tolower(gene), '_AF_OR.csv') -out_filename = paste0(tolower(gene), '_XXXXX_AF_OR.csv') +out_filename = paste0(tolower(gene), '_AF_OR.csv') outfile = paste0(outdir, '/', out_filename) cat(paste0('Output file with full path:', outfile)) #%% end of variable assignment for input and output files @@ -493,7 +492,7 @@ cat(paste0('Finished writing:' , '\nNo. of rows: ', nrow(comb_AF_and_OR) , '\nNo. of cols: ', ncol(comb_AF_and_OR))) #************************************************ -cat('======================================================================') +cat('\n======================================================================\n') rm(out_filename) cat('End of script: calculated AF, OR, pvalues and saved file')