diff options
| author | Alexander_Kabui | 2024-10-29 20:28:28 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2024-10-29 20:28:28 +0300 |
| commit | 82ae3c5c7efa710d34b11e28c89c608a475e9071 (patch) | |
| tree | 163ccfc2f73a1b38e2e6a15a76844ad89a4078ea /scripts | |
| parent | 99ba5e9fc76cf0334a5c7537ea55c8367e40414d (diff) | |
| download | genenetwork3-82ae3c5c7efa710d34b11e28c89c608a475e9071.tar.gz | |
feat: add output_file as a command line argument.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/rqtl2_wrapper.R | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/rqtl2_wrapper.R b/scripts/rqtl2_wrapper.R index eca1c2a..cdbbd17 100644 --- a/scripts/rqtl2_wrapper.R +++ b/scripts/rqtl2_wrapper.R @@ -16,8 +16,8 @@ option_list <- list( make_option(c("-i", "--input_file"), action="store", default=NULL, type='character', help="a yaml or json file with required data to create the cross file"), make_option(c("-p", "--nperm"), type="integer", default= 1, action="store_true", help="No of permutations "), make_option(c("-d", "--directory"), action = "store", default = NULL, type = "character", help="Temporary working directory: should also host the input file ."), - make_option(c("-m", "--method"), action = "store", default = "HK", type = "character", help="Scan Mapping Method - HK (Haley Knott), LMM( Linear Mixed Model ), LOCO (Leave one Chromosome Out)") - + make_option(c("-m", "--method"), action = "store", default = "HK", type = "character", help="Scan Mapping Method - HK (Haley Knott), LMM( Linear Mixed Model ), LOCO (Leave one Chromosome Out)"), +make_option(c("-o", "--output_file"), action="store", default=NULL, type='character', help="a file name of where to write the output json results") ) @@ -39,6 +39,9 @@ if (is.null(opt$input_file)) { } else { input_file = opt$input_file } +(is.null(opt$output_file)){ +stop("You need to provide an output file to write the ouput data") +} # file_path @@ -452,8 +455,7 @@ output = list(lod_peaks = lod_peaks, ) output_json_data <-toJSON(output) -file_name = genRandomFileName(prefix = "RQTL_output_", file_ext = ".json") -output_file_path = file.path("." , file_name) +output_file_path = file.path(opt$directory , opt$output_file) str_glue("The output file path is {output_file_path}") cat("Writing to the output file\n") write(output_json_data, file=output_file_path) |
