diff options
author | Alexander Kabui | 2021-10-14 10:49:41 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-01-22 09:23:14 +0300 |
commit | 8da922d6835097c53d6d434cf6661027b15399a8 (patch) | |
tree | 1a52400b59b4aa7f9dd193a1b3c2e7c48b2b6ad1 | |
parent | 7ba5a5554845a5e08da40cf1c00853c1c798f7b6 (diff) | |
download | genenetwork3-8da922d6835097c53d6d434cf6661027b15399a8.tar.gz |
generate lineplot
-rw-r--r-- | scripts/ctl_analysis.R | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/scripts/ctl_analysis.R b/scripts/ctl_analysis.R index 738ad04..d9a937f 100644 --- a/scripts/ctl_analysis.R +++ b/scripts/ctl_analysis.R @@ -8,7 +8,7 @@ options(stringsAsFactors = FALSE); args = commandArgs(trailingOnly=TRUE) if (length(args)==0) { - stop("Argument for the geno and pheno file location is required", call.=FALSE) + stop("Argument for the data file", call.=FALSE) } else { # default output file json_file_path = args[1] @@ -28,13 +28,26 @@ ctls <- CTLscan(geno,traits,strategy=input$strategy, nthreads=6,verbose=TRUE) +# same function used in a different script:refactor +genImageRandStr <- function(prefix){ + + randStr <- paste(prefix,stri_rand_strings(1, 9, pattern = "[A-Za-z0-9]"),sep="_") + + return(paste(randStr,".png",sep="")) +} + #output matrix significant CTL interactions with 4 columns: trait, marker, trait, lod sign <- CTLsignificant(ctls,significance = input$significance) + +# Create the lineplot +imageLoc = file.path(imgDir,genImageRandStr("CTLline")) + +png(imageLoc,width=1000,height=600,type='cairo-png') -# add plots +lineplot(res, significance=input$significance) json_data <- list(significance=signs, - images=lists("image_1":"image_location"), + images=lists("image_1"=imageLoc), network_figure_location="/location")
\ No newline at end of file |