diff options
author | Alexander Kabui | 2021-09-23 12:47:27 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-09-23 12:47:27 +0300 |
commit | 4a8e40f7331f61ba8b7038e8ad48f86018ac7dc6 (patch) | |
tree | cf0a0983561179bee5786079acbb18be52db586f | |
parent | 95620e1aef5a9c56875845769d58d2aab20dacca (diff) | |
download | genenetwork3-4a8e40f7331f61ba8b7038e8ad48f86018ac7dc6.tar.gz |
pass json file path as an arg
-rw-r--r-- | scripts/wgcna_analysis.R | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/wgcna_analysis.R b/scripts/wgcna_analysis.R index 73d0e3f..53b59d5 100644 --- a/scripts/wgcna_analysis.R +++ b/scripts/wgcna_analysis.R @@ -7,11 +7,20 @@ library(rjson) options(stringsAsFactors = FALSE); imgDir = Sys.getenv("GENERATED_IMAGE_DIR") - # load expression data **assumes from json files row(traits)(columns info+samples) # pass the file_path as arg +# pass the file path to read json data + +args = commandArgs(trailingOnly=TRUE) + +if (length(args)==0) { + stop("Argument for the file location is requires", call.=FALSE) +} else { + # default output file + json_file_path = args[1] +} -results <- fromJSON(file = "file_path.json") +results <- fromJSON(file = json_file_path) # parse the json data input |