From f92f8eccc39dc190cb7c8dd1c99f2bd57c3d2323 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 31 Jan 2022 00:35:34 +0300 Subject: match case string input to boolean --- scripts/ctl_analysis.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.3