Mercurial > repos > ethevenot > multivariate
annotate multivariate_wrapper.R @ 1:60c360e466a8 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit 0f382a5296aae9bfc77df06b0a5ad493eb3c01f3
| author | ethevenot | 
|---|---|
| date | Wed, 28 Feb 2018 10:04:14 -0500 | 
| parents | 4b9488602d57 | 
| children | 
| rev | line source | 
|---|---|
| 0 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 1 #!/usr/bin/env Rscript | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 2 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 3 library(batch) ## parseCommandArgs | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 4 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 5 # Constants | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 6 argv <- commandArgs(trailingOnly = FALSE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 7 script.path <- sub("--file=","",argv[grep("--file=",argv)]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 8 prog.name <- basename(script.path) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 9 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 10 # Print help | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 11 if (length(grep('-h', argv)) >0) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 12 cat("Usage:", prog.name, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 13 "dataMatrix_in myDataMatrix.tsv", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 14 "sampleMetadata_in mySampleData.tsv", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 15 "variableMetadata_in myVariableMetadata.tsv", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 16 "respC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 17 "predI ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 18 "orthoI ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 19 "testL ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 20 "typeC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 21 "parAsColC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 22 "parCexN ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 23 "parPc1I ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 24 "parPc2I ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 25 "parMahalC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 26 "parLabVc ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 27 "algoC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 28 "crossvalI ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 29 "log10L ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 30 "permI ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 31 "scaleC ...", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 32 "sampleMetadata_out mySampleMetadata_out.tsv", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 33 "variableMetadata_out myVariableMetadata_out.tsv", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 34 "figure figure.pdf", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 35 "information information.txt", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 36 "\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 37 quit(status = 0) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 38 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 39 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 40 ######## | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 41 # MAIN # | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 42 ######## | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 43 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 44 argVc <- unlist(parseCommandArgs(evaluate=FALSE)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 45 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 46 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 47 ## Initializing | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 48 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 49 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 50 ## options | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 51 ##-------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 52 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 53 strAsFacL <- options()$stringsAsFactors | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 54 options(stringsAsFactors = FALSE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 55 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 56 ## libraries | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 57 ##---------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 58 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 59 suppressMessages(library(ropls)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 60 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 61 if(packageVersion("ropls") < "1.4.0") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 62 stop("Please use 'ropls' versions of 1.4.0 and above") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 63 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 64 ## constants | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 65 ##---------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 66 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 67 modNamC <- "Multivariate" ## module name | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 68 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 69 topEnvC <- environment() | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 70 flgC <- "\n" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 71 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 72 ## functions | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 73 ##---------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 74 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 75 flgF <- function(tesC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 76 envC = topEnvC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 77 txtC = NA) { ## management of warning and error messages | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 78 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 79 tesL <- eval(parse(text = tesC), envir = envC) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 80 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 81 if(!tesL) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 82 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 83 sink() | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 84 stpTxtC <- ifelse(is.na(txtC), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 85 paste0(tesC, " is FALSE"), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 86 txtC) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 87 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 88 stop(stpTxtC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 89 call. = FALSE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 90 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 91 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 92 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 93 } ## flgF | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 94 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 95 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 96 ## log file | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 97 ##--------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 98 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 99 sink(argVc["information"]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 100 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 101 cat("\nStart of the '", modNamC, "' Galaxy module call: ", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 102 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 103 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 104 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 105 ## arguments | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 106 ##---------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 107 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 108 xMN <- t(as.matrix(read.table(argVc["dataMatrix_in"], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 109 check.names = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 110 header = TRUE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 111 row.names = 1, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 112 sep = "\t", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 113 comment.char = ""))) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 114 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 115 samDF <- read.table(argVc["sampleMetadata_in"], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 116 check.names = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 117 header = TRUE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 118 row.names = 1, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 119 sep = "\t", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 120 comment.char = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 121 flgF("identical(rownames(xMN), rownames(samDF))", txtC = "Sample names (or number) in the data matrix (first row) and sample metadata (first column) are not identical; use the 'Check Format' module in the 'Quality Control' section") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 122 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 123 varDF <- read.table(argVc["variableMetadata_in"], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 124 check.names = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 125 header = TRUE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 126 row.names = 1, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 127 sep = "\t", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 128 comment.char = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 129 flgF("identical(colnames(xMN), rownames(varDF))", txtC = "Variable names (or number) in the data matrix (first column) and sample metadata (first column) are not identical; use the 'Check Format' module in the 'Quality Control' section") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 130 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 131 flgF("argVc['respC'] == 'none' || (argVc['respC'] %in% colnames(samDF))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 132 txtC = paste0("Y Response argument (", argVc['respC'], ") must be either none or one of the column names (first row) of your sample metadata")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 133 if(argVc["respC"] != "none") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 134 yMCN <- matrix(samDF[, argVc['respC']], ncol = 1, dimnames = list(rownames(xMN), argVc['respC'])) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 135 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 136 yMCN <- NULL | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 137 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 138 if(argVc["testL"] == "TRUE") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 139 flgF("!is.null(yMCN)", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 140 txtC = "Predictions cannot be peformed with PCA models") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 141 flgF("'test.' %in% colnames(samDF)", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 142 txtC = "No 'test.' column found in the sample metadata") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 143 flgF("identical(sort(unique(samDF[, 'test.'])), c('no', 'yes'))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 144 txtC = "'test.' column of sample metadata must contain both 'yes' (tested samples) and 'no' (samples to be used for model training) values, and nothing else") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 145 flgF("identical(sort(unique(samDF[, 'test.'])), c('no', 'yes'))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 146 txtC = "'test.' column of sample metadata must contain both 'yes' (tested samples) and 'no' (samples to be used for model training) values, and nothing else") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 147 flgF("!any(is.na(yMCN[samDF[, 'test.'] == 'no', ]))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 148 txtC = "samples for model training (i.e. 'no' value in the 'test.' column) should not contain NA in the response") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 149 tesVl <- samDF[, "test."] == "yes" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 150 xTesMN <- xMN[tesVl, , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 151 xMN <- xMN[!tesVl, , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 152 yMCN <- yMCN[!tesVl, , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 153 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 154 tesVl <- NULL | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 155 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 156 if(!('parAsColC' %in% names(argVc))) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 157 argVc["parAsColC"] <- "none" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 158 flgF("argVc['parAsColC'] == 'none' || argVc['parAsColC'] %in% colnames(samDF)", txtC = paste0("Sample color argument (", argVc['parAsColC'], ") must be either none or one of the column names (first row) of your sample metadata")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 159 if(argVc["parAsColC"] != "none") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 160 parAsColFcVn <- samDF[, argVc['parAsColC']] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 161 if(is.character(parAsColFcVn)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 162 parAsColFcVn <- factor(parAsColFcVn) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 163 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 164 parAsColFcVn <- NA | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 165 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 166 if(!('parMahalC' %in% names(argVc)) || argVc["parMahalC"] == "NA") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 167 if(!is.null(yMCN) && ncol(yMCN) == 1 && mode(yMCN) == "character") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 168 argVc["parMahalC"] <- argVc["respC"] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 169 else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 170 argVc["parMahalC"] <- "none" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 171 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 172 flgF("argVc['parMahalC'] == 'none' || (argVc['parMahalC'] %in% colnames(samDF))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 173 txtC = paste0("Mahalanobis argument (", argVc['parMahalC'], ") must be either 'NA', 'none' or one of the column names (first row) of your sample metadata")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 174 if(argVc["parMahalC"] == "none") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 175 parEllipsesL <- FALSE | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 176 } else { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 177 if(is.null(yMCN)) { ## PCA case | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 178 flgF("mode(samDF[, argVc['parMahalC']]) == 'character'", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 179 txtC = paste0("Mahalanobis argument (", argVc['parMahalC'], ") must correspond to a column of characters in your sampleMetadata")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 180 parAsColFcVn <- factor(samDF[, argVc["parMahalC"]]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 181 parEllipsesL <- TRUE | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 182 } else { ## (O)PLS-DA case | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 183 flgF("identical(as.character(argVc['respC']), as.character(argVc['parMahalC']))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 184 txtC = paste0("The Mahalanobis argument (", argVc['parMahalC'], ") must be identical to the Y response argument (", argVc['respC'], ")")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 185 parEllipsesL <- TRUE | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 186 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 187 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 188 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 189 if(!('parLabVc' %in% names(argVc))) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 190 argVc["parLabVc"] <- "none" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 191 flgF("argVc['parLabVc'] == 'none' || (argVc['parLabVc'] %in% colnames(samDF))", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 192 txtC = paste0("Sample labels argument (", argVc['parLabVc'], ") must be either none or one of the column names (first row) of your sample metadata")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 193 if('parLabVc' %in% names(argVc)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 194 if(argVc["parLabVc"] != "none") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 195 flgF("mode(samDF[, argVc['parLabVc']]) == 'character'", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 196 txtC = paste0("The sample label argument (", argVc['parLabVc'], ") must correspond to a sample metadata column of characters (not numerics)")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 197 parLabVc <- samDF[, argVc['parLabVc']] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 198 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 199 parLabVc <- NA | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 200 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 201 if('parPc1I' %in% names(argVc)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 202 parCompVi <- as.numeric(c(argVc["parPc1I"], argVc["parPc2I"])) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 203 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 204 parCompVi <- c(1, 2) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 205 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 206 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 207 ## checking | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 208 ##--------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 209 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 210 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 211 flgF("argVc['predI'] == 'NA' || argVc['orthoI'] == 'NA' || as.numeric(argVc['orthoI']) > 0 || parCompVi[2] <= as.numeric(argVc['predI'])", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 212 txtC = paste0("The highest component to display (", parCompVi[2], ") must not exceed the number of predictive components of the model (", argVc['predI'], ")")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 213 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 214 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 215 if(argVc["orthoI"] == "NA" || argVc["orthoI"] != "0") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 216 if(argVc["predI"] == "NA" || argVc["predI"] != "0") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 217 argVc["predI"] <- "1" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 218 cat("\nWarning: OPLS: number of predictive components ('predI' argument) set to 1\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 219 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 220 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 221 if(argVc["predI"] != "NA") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 222 if(as.numeric(argVc["predI"]) > min(nrow(xMN), ncol(xMN))) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 223 argVc["predI"] <- as.character(min(nrow(xMN), ncol(xMN))) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 224 cat("\nWarning: 'predI' set to the minimum of the dataMatrix dimensions: ", as.numeric(argVc["predI"]), "\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 225 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 226 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 227 if("algoC" %in% names(argVc) && argVc["algoC"] == "svd" && length(which(is.na(c(xMN)))) > 0) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 228 minN <- min(c(xMN[!is.na(xMN)])) / 2 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 229 cat("\nWarning: Missing values set to ", round(minN, 1), " (half minimum value) for 'svd' algorithm to be used\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 230 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 231 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 232 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 233 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 234 ## Computation and plot | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 235 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 236 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 237 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 238 sink() | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 239 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 240 optWrnN <- options()$warn | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 241 options(warn = -1) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 242 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 243 ropLs <- opls(x = xMN, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 244 y = yMCN, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 245 predI = ifelse(argVc["predI"] == "NA", NA, as.numeric(argVc["predI"])), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 246 orthoI = ifelse(argVc["orthoI"] == "NA", NA, as.numeric(argVc["orthoI"])), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 247 algoC = ifelse('algoC' %in% names(argVc), argVc["algoC"], "default"), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 248 crossvalI = ifelse('crossvalI' %in% names(argVc), as.numeric(argVc["crossvalI"]), 7), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 249 log10L = ifelse('log10L' %in% names(argVc), as.logical(argVc["log10L"]), FALSE), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 250 permI = ifelse('permI' %in% names(argVc), as.numeric(argVc["permI"]), 20), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 251 scaleC = ifelse('scaleC' %in% names(argVc), argVc["scaleC"], "standard"), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 252 subset = NULL, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 253 printL = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 254 plotL = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 255 .sinkC = argVc['information']) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 256 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 257 modC <- ropLs@typeC | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 258 sumDF <- getSummaryDF(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 259 desMC <- ropLs@descriptionMC | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 260 scoreMN <- getScoreMN(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 261 loadingMN <- getLoadingMN(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 262 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 263 vipVn <- coeMN <- orthoScoreMN <- orthoLoadingMN <- orthoVipVn <- NULL | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 264 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 265 if(grepl("PLS", modC)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 266 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 267 vipVn <- getVipVn(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 268 coeMN <- coef(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 269 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 270 if(grepl("OPLS", modC)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 271 orthoScoreMN <- getScoreMN(ropLs, orthoL = TRUE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 272 orthoLoadingMN <- getLoadingMN(ropLs, orthoL = TRUE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 273 orthoVipVn <- getVipVn(ropLs, orthoL = TRUE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 274 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 275 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 276 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 277 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 278 ploC <- ifelse('typeC' %in% names(argVc), argVc["typeC"], "summary") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 279 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 280 if(sumDF[, "pre"] + sumDF[, "ort"] < 2) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 281 if(!(ploC %in% c("permutation", "overview"))) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 282 ploC <- "summary" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 283 plotWarnL <- TRUE | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 284 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 285 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 286 plotWarnL <- FALSE | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 287 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 288 plot(ropLs, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 289 typeVc = ploC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 290 parAsColFcVn = parAsColFcVn, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 291 parCexN = ifelse('parCexN' %in% names(argVc), as.numeric(argVc["parCexN"]), 0.8), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 292 parCompVi = parCompVi, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 293 parEllipsesL = parEllipsesL, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 294 parLabVc = parLabVc, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 295 file.pdfC = argVc['figure'], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 296 .sinkC = argVc['information']) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 297 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 298 options(warn = optWrnN) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 299 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 300 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 301 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 302 ## Print | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 303 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 304 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 305 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 306 sink(argVc["information"], append = TRUE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 307 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 308 if(plotWarnL) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 309 cat("\nWarning: For single component models, only 'overview' (and 'permutation' in case of single response (O)PLS(-DA)) plot(s) are available\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 310 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 311 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 312 cat("\n", modC, "\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 313 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 314 cat("\n", desMC["samples", ], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 315 " samples x ", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 316 desMC["X_variables", ], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 317 " variables", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 318 ifelse(modC != "PCA", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 319 " and 1 response", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 320 ""), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 321 "\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 322 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 323 cat("\n", ropLs@suppLs[["scaleC"]], " scaling of dataMatrix", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 324 ifelse(modC == "PCA", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 325 "", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 326 paste0(" and ", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 327 ifelse(mode(ropLs@suppLs[["yMCN"]]) == "character" && ropLs@suppLs[["scaleC"]] != "standard", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 328 "standard scaling of ", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 329 ""), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 330 "response\n")), sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 331 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 332 if(substr(desMC["missing_values", ], 1, 1) != "0") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 333 cat("\n", desMC["missing_values", ], " NAs\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 334 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 335 if(substr(desMC["near_zero_excluded_X_variables", ], 1, 1) != "0") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 336 cat("\n", desMC["near_zero_excluded_X_variables", ], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 337 " excluded variables during model building (because of near zero variance)\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 338 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 339 cat("\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 340 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 341 optDigN <- options()[["digits"]] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 342 options(digits = 3) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 343 print(ropLs@modelDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 344 options(digits = optDigN) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 345 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 346 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 347 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 348 ## Ending | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 349 ##------------------------------ | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 350 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 351 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 352 ## Saving | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 353 ##------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 354 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 355 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 356 rspModC <- gsub("-", "", modC) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 357 if(rspModC != "PCA") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 358 rspModC <- paste0(make.names(argVc['respC']), "_", rspModC) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 359 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 360 if(sumDF[, "pre"] + sumDF[, "ort"] < 2) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 361 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 362 tCompMN <- scoreMN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 363 pCompMN <- loadingMN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 364 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 365 } else { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 366 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 367 if(sumDF[, "ort"] > 0) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 368 if(parCompVi[2] > sumDF[, "ort"] + 1) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 369 stop("Selected orthogonal component for plotting (ordinate) exceeds the total number of orthogonal components of the model", call. = FALSE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 370 tCompMN <- cbind(scoreMN[, 1], orthoScoreMN[, parCompVi[2] - 1]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 371 pCompMN <- cbind(loadingMN[, 1], orthoLoadingMN[, parCompVi[2] - 1]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 372 colnames(pCompMN) <- colnames(tCompMN) <- c("h1", paste("o", parCompVi[2] - 1, sep = "")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 373 } else { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 374 if(max(parCompVi) > sumDF[, "pre"]) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 375 stop("Selected component for plotting as ordinate exceeds the total number of predictive components of the model", call. = FALSE) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 376 tCompMN <- scoreMN[, parCompVi, drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 377 pCompMN <- loadingMN[, parCompVi, drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 378 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 379 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 380 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 381 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 382 ## x-scores and prediction | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 383 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 384 colnames(tCompMN) <- paste0(rspModC, "_XSCOR-", colnames(tCompMN)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 385 tCompDF <- as.data.frame(tCompMN)[rownames(samDF), , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 386 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 387 if(modC != "PCA") { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 388 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 389 if(!is.null(tesVl)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 390 tCompFulMN <- matrix(NA, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 391 nrow = nrow(samDF), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 392 ncol = ncol(tCompMN), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 393 dimnames = list(rownames(samDF), colnames(tCompMN))) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 394 mode(tCompFulMN) <- "numeric" | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 395 tCompFulMN[rownames(tCompMN), ] <- tCompMN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 396 tCompMN <- tCompFulMN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 397 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 398 fitMCN <- fitted(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 399 fitFulMCN <- matrix(NA, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 400 nrow = nrow(samDF), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 401 ncol = 1, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 402 dimnames = list(rownames(samDF), NULL)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 403 mode(fitFulMCN) <- mode(fitMCN) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 404 fitFulMCN[rownames(fitMCN), ] <- fitMCN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 405 yPreMCN <- predict(ropLs, newdata = as.data.frame(xTesMN)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 406 fitFulMCN[rownames(yPreMCN), ] <- yPreMCN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 407 fitMCN <- fitFulMCN | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 408 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 409 } else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 410 fitMCN <- fitted(ropLs) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 411 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 412 colnames(fitMCN) <- paste0(rspModC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 413 "_predictions") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 414 fitDF <- as.data.frame(fitMCN)[rownames(samDF), , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 415 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 416 tCompDF <- cbind.data.frame(tCompDF, fitDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 417 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 418 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 419 samDF <- cbind.data.frame(samDF, tCompDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 420 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 421 ## x-loadings and VIP | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 422 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 423 colnames(pCompMN) <- paste0(rspModC, "_XLOAD-", colnames(pCompMN)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 424 if(!is.null(vipVn)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 425 pCompMN <- cbind(pCompMN, vipVn) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 426 colnames(pCompMN)[ncol(pCompMN)] <- paste0(rspModC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 427 "_VIP", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 428 ifelse(!is.null(orthoVipVn), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 429 "_pred", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 430 "")) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 431 if(!is.null(orthoVipVn)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 432 pCompMN <- cbind(pCompMN, orthoVipVn) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 433 colnames(pCompMN)[ncol(pCompMN)] <- paste0(rspModC, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 434 "_VIP_ortho") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 435 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 436 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 437 if(!is.null(coeMN)) { | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 438 pCompMN <- cbind(pCompMN, coeMN) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 439 if(ncol(coeMN) == 1) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 440 colnames(pCompMN)[ncol(pCompMN)] <- paste0(rspModC, "_COEFF") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 441 else | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 442 colnames(pCompMN)[(ncol(pCompMN) - ncol(coeMN) + 1):ncol(pCompMN)] <- paste0(rspModC, "_", colnames(coeMN), "-COEFF") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 443 } | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 444 pCompDF <- as.data.frame(pCompMN)[rownames(varDF), , drop = FALSE] | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 445 varDF <- cbind.data.frame(varDF, pCompDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 446 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 447 ## sampleMetadata | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 448 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 449 samDF <- cbind.data.frame(sampleMetadata = rownames(samDF), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 450 samDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 451 write.table(samDF, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 452 file = argVc["sampleMetadata_out"], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 453 quote = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 454 row.names = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 455 sep = "\t") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 456 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 457 ## variableMetadata | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 458 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 459 varDF <- cbind.data.frame(variableMetadata = rownames(varDF), | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 460 varDF) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 461 write.table(varDF, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 462 file = argVc["variableMetadata_out"], | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 463 quote = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 464 row.names = FALSE, | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 465 sep = "\t") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 466 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 467 # Output ropLs | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 468 if (!is.null(argVc['ropls_out']) && !is.na(argVc['ropls_out'])) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 469 save(ropLs, file = argVc['ropls_out']) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 470 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 471 ## Closing | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 472 ##-------- | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 473 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 474 cat("\nEnd of '", modNamC, "' Galaxy module call: ", | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 475 as.character(Sys.time()), "\n", sep = "") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 476 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 477 cat("\n\n\n============================================================================") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 478 cat("\nAdditional information about the call:\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 479 cat("\n1) Parameters:\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 480 print(cbind(value = argVc)) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 481 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 482 cat("\n2) Session Info:\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 483 sessioninfo <- sessionInfo() | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 484 cat(sessioninfo$R.version$version.string,"\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 485 cat("Main packages:\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 486 for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 487 cat("Other loaded packages:\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 488 for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 489 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 490 cat("============================================================================\n") | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 491 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 492 sink() | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 493 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 494 options(stringsAsFactors = strAsFacL) | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 495 | 
| 
4b9488602d57
planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
 ethevenot parents: diff
changeset | 496 rm(list = ls()) | 
