aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2022-01-31 00:35:34 +0300
committerBonfaceKilz2022-02-02 10:59:34 +0300
commitf92f8eccc39dc190cb7c8dd1c99f2bd57c3d2323 (patch)
tree06fdd5ea64174669668b762011403ea9f999eedd
parent233490ab0169bd2d2bda8a210fcc4c3e690d6cdf (diff)
downloadgenenetwork3-f92f8eccc39dc190cb7c8dd1c99f2bd57c3d2323.tar.gz
match case string input to boolean
-rw-r--r--scripts/ctl_analysis.R11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/ctl_analysis.R b/scripts/ctl_analysis.R
index 175feed..9d27ffe 100644
--- a/scripts/ctl_analysis.R
+++ b/scripts/ctl_analysis.R
@@ -22,12 +22,19 @@ json_file_path
# add validation for the files
input <- fromJSON(file = json_file_path)
-cat("The input data is \n")
+cat("The input data is \n")
genoData <- input$genoData
phenoData <- input$phenoData
+
+parametric <- switch(
+ input$parametric,
+ "True" = TRUE,
+ "False" = FALSE
+
+ )
# create the matixes
# genotypes Matrix of genotypes. (individuals x markers)
@@ -44,7 +51,7 @@ pheno_matrix = t(matrix(as.numeric(unlist(phenoData$traits)), nrow=length(phenoD
# # Use a data frame to store the objects
-ctls <- CTLscan(geno_matrix,pheno_matrix,nperm=input$nperm,strategy=input$strategy,parametric=input$parametric,nthreads=3,verbose=TRUE)
+ctls <- CTLscan(geno_matrix,pheno_matrix,nperm=input$nperm,strategy=input$strategy,parametric=parametric,nthreads=3,verbose=TRUE)