From 599a350235287f5dd41f65bd8b703b87239c106a Mon Sep 17 00:00:00 2001 From: pirese <44398219+pirese@users.noreply.github.com> Date: Thu, 20 Feb 2020 15:38:07 +0000 Subject: [PATCH 1/2] Fixes off-by-one error in argument checking --- DISH/DISH.r | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DISH/DISH.r b/DISH/DISH.r index 96a579a..b9cf708 100644 --- a/DISH/DISH.r +++ b/DISH/DISH.r @@ -22,8 +22,8 @@ start = Sys.time() print("reading arguments...") args = commandArgs(TRUE) argsLen <- length(args) -if (argsLen > 7) stop('error: You added too many arguments - usage: Rscript DISH.v2.r input_file MAF ethnicity(European/Asian) output') -if (argsLen < 6) stop('error: You need more auguments. check the usage - usage: Rscript DISH.v2.r input_file MAF ethnicity(European/Asian) output') +if (argsLen > 8) stop('error: You added too many arguments - usage: Rscript DISH.v2.r input_file input_type hg_version ethnicity MAF_threshold stat_type output (lambda)') +if (argsLen < 7) stop('error: You need more auguments. check the usage - usage: Rscript DISH.v2.r input_file input_type hg_version ethnicity MAF_threshold stat_type output (lambda)') study_map_file = args[1] if(!file.exists(study_map_file)){stop('error: The incorrect path of your input file')} From 2d727eb703a8db83aa3d102d2b10cd71eda552fd Mon Sep 17 00:00:00 2001 From: Ellis Pires Date: Tue, 25 Feb 2020 14:37:24 +0000 Subject: [PATCH 2/2] Fixes study_map data type error in the case where input_type is equal to T --- DISH/DISH.r | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DISH/DISH.r b/DISH/DISH.r index b9cf708..5bb1805 100644 --- a/DISH/DISH.r +++ b/DISH/DISH.r @@ -77,7 +77,8 @@ if(hg_ver == "hg18"){ ## Check & Read the user defined input file print("reading your input file...") if(input_type=="T"){ - study_map = complete.cases(read.table(study_map_file, header=T, sep="\t", stringsAsFactors=F)) + data <- read.table(study_map_file, header=T, sep="\t", stringsAsFactors=F) + study_map <- data[complete.cases(data),] }else if(input_type=="P"){ print("Merge your .frq file with your statistics information") Ffile = read.table(pasete0(study_map_file,".frq",collapse=NULL), header=T,stringsAsFactors=F)