Mercurial > repos > eschen42 > w4mcorcov
diff w4mcorcov_wrapper.R @ 7:ca9938f2eb6a draft default tip
"planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 5fd9687d543a48a715b1180caf93abebebd58b0e"
author | eschen42 |
---|---|
date | Tue, 17 Nov 2020 23:29:59 +0000 |
parents | 0b49916c5c52 |
children |
line wrap: on
line diff
--- a/w4mcorcov_wrapper.R Wed Sep 05 19:24:47 2018 -0400 +++ b/w4mcorcov_wrapper.R Tue Nov 17 23:29:59 2020 +0000 @@ -4,7 +4,7 @@ # - w4mcorcov_lib.R # - w4mcorcov_input.R # - w4mcorcov_calc.R - +options(warn=1) ## constants ##---------- @@ -73,6 +73,10 @@ ######## errorPrint(sessionInfo()) +errorCat("\nsearch path:") +errorPrint(search()) +# errorCat("\nCurrently loaded namespaces:\n") +# errorPrint(loadedNamespaces()) argVc <- unlist(parseCommandArgs(evaluate=FALSE)) errorCat("\n\n---\n\nArguments that were passed to R are as follows:\n") @@ -104,6 +108,8 @@ my_env$levCSV <- as.character(argVc["levCSV"]) my_env$matchingC <- as.character(argVc["matchingC"]) my_env$labelFeatures <- as.character(argVc["labelFeatures"]) # number of features to label at each extreme of the loadings or 'ALL' +my_env$min_crossval_i <- as.character(argVc["min_crossval_i"]) # Minumum number of samples for OPLS-DA cross-validation +my_env$fdr_features <- as.character(argVc["fdr_features"]) # number of features to consider when adjusting p-value, or 'ALL' my_env$cplot_o <- as.logical(argVc["cplot_o"]) # TRUE if orthogonal C-plot is requested my_env$cplot_p <- as.logical(argVc["cplot_p"]) # TRUE if parallel C-plot is requested my_env$cplot_y <- as.character(argVc["cplot_y"]) # Choice of covariance/correlation for Y-axis on C-plot @@ -126,6 +132,24 @@ quit(save = "no", status = 10, runLast = TRUE) } +min_crossval_i <- my_env$min_crossval_i +crossval_check <- TRUE +if ( is.na(min_crossval_i) ) { + crossval_check <- FALSE +} else if ( is.null(min_crossval_i) ) { + crossval_check <- FALSE +} else { + if ( is.na(as.numeric(min_crossval_i)) ) + crossval_check <- FALSE + else if ( as.numeric(min_crossval_i) < 0 ) + crossval_check <- FALSE +} +if ( !crossval_check ) { + my_log("invalid argument: min_crossval_i") + print(min_crossval_i) + quit(save = "no", status = 10, runLast = TRUE) +} + corcov_tsv_colnames <- TRUE corcov_tsv_append <- FALSE corcov_tsv_action <- function(tsv) {