Mercurial > repos > eschen42 > w4mcorcov
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 6:0b49916c5c52 | 7:ca9938f2eb6a |
|---|---|
| 2 | 2 |
| 3 # This script assumes that it is being executed in a current working directory containing the following files: | 3 # This script assumes that it is being executed in a current working directory containing the following files: |
| 4 # - w4mcorcov_lib.R | 4 # - w4mcorcov_lib.R |
| 5 # - w4mcorcov_input.R | 5 # - w4mcorcov_input.R |
| 6 # - w4mcorcov_calc.R | 6 # - w4mcorcov_calc.R |
| 7 | 7 options(warn=1) |
| 8 ## constants | 8 ## constants |
| 9 ##---------- | 9 ##---------- |
| 10 | 10 |
| 11 modNamC <- "w4mcorcov" ## module name | 11 modNamC <- "w4mcorcov" ## module name |
| 12 | 12 |
| 71 ######## | 71 ######## |
| 72 # MAIN # | 72 # MAIN # |
| 73 ######## | 73 ######## |
| 74 | 74 |
| 75 errorPrint(sessionInfo()) | 75 errorPrint(sessionInfo()) |
| 76 errorCat("\nsearch path:") | |
| 77 errorPrint(search()) | |
| 78 # errorCat("\nCurrently loaded namespaces:\n") | |
| 79 # errorPrint(loadedNamespaces()) | |
| 76 | 80 |
| 77 argVc <- unlist(parseCommandArgs(evaluate=FALSE)) | 81 argVc <- unlist(parseCommandArgs(evaluate=FALSE)) |
| 78 errorCat("\n\n---\n\nArguments that were passed to R are as follows:\n") | 82 errorCat("\n\n---\n\nArguments that were passed to R are as follows:\n") |
| 79 errorPrint(argVc) | 83 errorPrint(argVc) |
| 80 | 84 |
| 102 my_env$facC <- as.character(argVc["facC"]) | 106 my_env$facC <- as.character(argVc["facC"]) |
| 103 my_env$pairSigFeatOnly <- as.logical(argVc["pairSigFeatOnly"]) | 107 my_env$pairSigFeatOnly <- as.logical(argVc["pairSigFeatOnly"]) |
| 104 my_env$levCSV <- as.character(argVc["levCSV"]) | 108 my_env$levCSV <- as.character(argVc["levCSV"]) |
| 105 my_env$matchingC <- as.character(argVc["matchingC"]) | 109 my_env$matchingC <- as.character(argVc["matchingC"]) |
| 106 my_env$labelFeatures <- as.character(argVc["labelFeatures"]) # number of features to label at each extreme of the loadings or 'ALL' | 110 my_env$labelFeatures <- as.character(argVc["labelFeatures"]) # number of features to label at each extreme of the loadings or 'ALL' |
| 111 my_env$min_crossval_i <- as.character(argVc["min_crossval_i"]) # Minumum number of samples for OPLS-DA cross-validation | |
| 112 my_env$fdr_features <- as.character(argVc["fdr_features"]) # number of features to consider when adjusting p-value, or 'ALL' | |
| 107 my_env$cplot_o <- as.logical(argVc["cplot_o"]) # TRUE if orthogonal C-plot is requested | 113 my_env$cplot_o <- as.logical(argVc["cplot_o"]) # TRUE if orthogonal C-plot is requested |
| 108 my_env$cplot_p <- as.logical(argVc["cplot_p"]) # TRUE if parallel C-plot is requested | 114 my_env$cplot_p <- as.logical(argVc["cplot_p"]) # TRUE if parallel C-plot is requested |
| 109 my_env$cplot_y <- as.character(argVc["cplot_y"]) # Choice of covariance/correlation for Y-axis on C-plot | 115 my_env$cplot_y <- as.character(argVc["cplot_y"]) # Choice of covariance/correlation for Y-axis on C-plot |
| 110 | 116 |
| 111 label_features <- my_env$labelFeatures | 117 label_features <- my_env$labelFeatures |
| 121 labelfeatures_check <- FALSE | 127 labelfeatures_check <- FALSE |
| 122 } | 128 } |
| 123 if ( !labelfeatures_check ) { | 129 if ( !labelfeatures_check ) { |
| 124 my_log("invalid argument: labelFeatures") | 130 my_log("invalid argument: labelFeatures") |
| 125 print(label_features) | 131 print(label_features) |
| 132 quit(save = "no", status = 10, runLast = TRUE) | |
| 133 } | |
| 134 | |
| 135 min_crossval_i <- my_env$min_crossval_i | |
| 136 crossval_check <- TRUE | |
| 137 if ( is.na(min_crossval_i) ) { | |
| 138 crossval_check <- FALSE | |
| 139 } else if ( is.null(min_crossval_i) ) { | |
| 140 crossval_check <- FALSE | |
| 141 } else { | |
| 142 if ( is.na(as.numeric(min_crossval_i)) ) | |
| 143 crossval_check <- FALSE | |
| 144 else if ( as.numeric(min_crossval_i) < 0 ) | |
| 145 crossval_check <- FALSE | |
| 146 } | |
| 147 if ( !crossval_check ) { | |
| 148 my_log("invalid argument: min_crossval_i") | |
| 149 print(min_crossval_i) | |
| 126 quit(save = "no", status = 10, runLast = TRUE) | 150 quit(save = "no", status = 10, runLast = TRUE) |
| 127 } | 151 } |
| 128 | 152 |
| 129 corcov_tsv_colnames <- TRUE | 153 corcov_tsv_colnames <- TRUE |
| 130 corcov_tsv_append <- FALSE | 154 corcov_tsv_append <- FALSE |
