Mercurial > repos > eschen42 > w4mclassfilter
annotate w4mclassfilter_wrapper.R @ 14:87ec0d3c2266 draft
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
author | eschen42 |
---|---|
date | Fri, 03 Jan 2020 11:07:39 -0500 |
parents | c18040b6e8b9 |
children |
rev | line source |
---|---|
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
1 #!/usr/bin/env Rscript |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
2 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
3 library(batch) ## parseCommandArgs |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
4 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
5 ######## |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
6 # MAIN # |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
7 ######## |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
8 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
9 argVc <- unlist(parseCommandArgs(evaluate=FALSE)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
10 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
11 ##------------------------------ |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
12 ## Initializing |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
13 ##------------------------------ |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
14 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
15 ## options |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
16 ##-------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
17 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
18 strAsFacL <- options()$stringsAsFactors |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
19 options(stringsAsFactors = FALSE) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
20 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
21 ## libraries |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
22 ##---------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
23 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
24 suppressMessages(library(w4mclassfilter)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
25 |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
26 expected_version <- "0.98.18" |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
27 actual_version <- packageVersion("w4mclassfilter") |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
28 if(packageVersion("w4mclassfilter") < expected_version) { |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
29 stop( |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
30 sprintf( |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
31 "Unrecoverable error: Version %s of the 'w4mclassfilter' R package was loaded instead of expected version %s", |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
32 actual_version, expected_version |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
33 ) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
34 ) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
35 } |
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
36 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
37 ## constants |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
38 ##---------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
39 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
40 modNamC <- "w4mclassfilter" ## module name |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
41 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
42 topEnvC <- environment() |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
43 flgC <- "\n" |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
44 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
45 ## functions |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
46 ##---------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
47 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
48 flgF <- function(tesC, |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
49 envC = topEnvC, |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
50 txtC = NA) { ## management of warning and error messages |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
51 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
52 tesL <- eval(parse(text = tesC), envir = envC) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
53 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
54 if(!tesL) { |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
55 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
56 #sink(NULL) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
57 stpTxtC <- ifelse(is.na(txtC), |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
58 paste0(tesC, " is FALSE"), |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
59 txtC) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
60 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
61 stop(stpTxtC, |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
62 call. = FALSE) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
63 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
64 } |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
65 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
66 } ## flgF |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
67 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
68 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
69 ## log file |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
70 ##--------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
71 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
72 my_print <- function(x, ...) { cat(c(x, ...))} |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
73 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
74 my_print("\nStart of the '", modNamC, "' Galaxy module call: ", |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
75 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="") |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
76 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
77 ## arguments |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
78 ##---------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
79 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
80 # files |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
81 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
82 dataMatrix_in <- as.character(argVc["dataMatrix_in"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
83 dataMatrix_out <- as.character(argVc["dataMatrix_out"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
84 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
85 sampleMetadata_in <- as.character(argVc["sampleMetadata_in"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
86 sampleMetadata_out <- as.character(argVc["sampleMetadata_out"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
87 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
88 variableMetadata_in <- as.character(argVc["variableMetadata_in"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
89 variableMetadata_out <- as.character(argVc["variableMetadata_out"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
90 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
91 # other parameters |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
92 |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
93 transformation <- as.character(argVc["transformation"]) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
94 my_imputation_label <- as.character(argVc["imputation"]) |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
95 my_imputation_function <- if (my_imputation_label == "zero") { |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
96 w4m_filter_zero_imputation |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
97 } else if (my_imputation_label == "center") { |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
98 w4m_filter_median_imputation |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
99 } else if (my_imputation_label == "none") { |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
100 w4m_filter_no_imputation |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
101 } else { |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
102 stop(sprintf("Unknown value %s supplied for 'imputation' parameter. Expected one of {zero,center,none}.")) |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
103 } |
6
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
104 wildcards <- as.logical(argVc["wildcards"]) |
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
105 sampleclassNames <- as.character(argVc["sampleclassNames"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
106 sampleclassNames <- strsplit(x = sampleclassNames, split = ",", fixed = TRUE)[[1]] |
4
499c7ecfa834
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7049f74a86f6e47565a68336d6496d112713cbba
eschen42
parents:
2
diff
changeset
|
107 if (wildcards) { |
499c7ecfa834
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7049f74a86f6e47565a68336d6496d112713cbba
eschen42
parents:
2
diff
changeset
|
108 sampleclassNames <- gsub("[.]", "[.]", sampleclassNames) |
499c7ecfa834
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7049f74a86f6e47565a68336d6496d112713cbba
eschen42
parents:
2
diff
changeset
|
109 sampleclassNames <- utils::glob2rx(sampleclassNames, trim.tail = FALSE) |
499c7ecfa834
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7049f74a86f6e47565a68336d6496d112713cbba
eschen42
parents:
2
diff
changeset
|
110 } |
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
111 inclusive <- as.logical(argVc["inclusive"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
112 classnameColumn <- as.character(argVc["classnameColumn"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
113 samplenameColumn <- as.character(argVc["samplenameColumn"]) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
114 |
13
c18040b6e8b9
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 1a5dd14c3697516bc55950bd6e46c978af7c19cf"
eschen42
parents:
12
diff
changeset
|
115 order_vrbl <- as.character(argVc["order_vrbl"]) |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
116 centering <- as.character(argVc["centering"]) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
117 order_smpl <- |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
118 if (centering == 'centroid' || centering == 'median') { |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
119 "sampleMetadata" |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
120 } else { |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
121 as.character(argVc["order_smpl"]) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
122 } |
13
c18040b6e8b9
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 1a5dd14c3697516bc55950bd6e46c978af7c19cf"
eschen42
parents:
12
diff
changeset
|
123 |
6
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
124 variable_range_filter <- as.character(argVc["variable_range_filter"]) |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
125 variable_range_filter <- strsplit(x = variable_range_filter, split = ",", fixed = TRUE)[[1]] |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
126 |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
127 ## ----------------------------- |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
128 ## Transformation and imputation |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
129 ## ----------------------------- |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
130 my_transformation_and_imputation <- if (transformation == "log10") { |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
131 function(m) { |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
132 # convert negative intensities to missing values |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
133 m[m < 0] <- NA |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
134 if (!is.matrix(m)) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
135 stop("Cannot transform and impute data - the supplied data is not in matrix form") |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
136 if (nrow(m) == 0) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
137 stop("Cannot transform and impute data - data matrix has no rows") |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
138 if (ncol(m) == 0) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
139 stop("Cannot transform and impute data - data matrix has no columns") |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
140 suppressWarnings({ |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
141 # suppress warnings here since non-positive values will produce NaN's that will be fixed in the next step |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
142 m <- log10(m) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
143 m[is.na(m)] <- NA |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
144 }) |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
145 return ( my_imputation_function(m) ) |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
146 } |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
147 } else if (transformation == "log2") { |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
148 function(m) { |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
149 # convert negative intensities to missing values |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
150 m[m < 0] <- NA |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
151 if (!is.matrix(m)) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
152 stop("Cannot transform and impute data - the supplied data is not in matrix form") |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
153 if (nrow(m) == 0) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
154 stop("Cannot transform and impute data - data matrix has no rows") |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
155 if (ncol(m) == 0) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
156 stop("Cannot transform and impute data - data matrix has no columns") |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
157 suppressWarnings({ |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
158 # suppress warnings here since non-positive values will produce NaN's that will be fixed in the next step |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
159 m <- log2(m) |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
160 m[is.na(m)] <- NA |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
161 }) |
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
162 return ( my_imputation_function(m) ) |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
163 } |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
164 } else { |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
165 function(m) { |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
166 # convert negative intensities to missing values |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
167 m[m < 0] <- NA |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
168 if (!is.matrix(m)) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
169 stop("Cannot transform and impute data - the supplied data is not in matrix form") |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
170 if (nrow(m) == 0) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
171 stop("Cannot transform and impute data - data matrix has no rows") |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
172 if (ncol(m) == 0) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
173 stop("Cannot transform and impute data - data matrix has no columns") |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
174 suppressWarnings({ |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
175 # suppress warnings here since non-positive values will produce NaN's that will be fixed in the next step |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
176 m[is.na(m)] <- NA |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
177 }) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
178 return ( my_imputation_function(m) ) |
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
179 } |
8
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
180 } |
d5cf23369d12
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 7b824bc01884125dc8bb2e4c9ef70fb0a6d88db1
eschen42
parents:
6
diff
changeset
|
181 |
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
182 ##------------------------------ |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
183 ## Computation |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
184 ##------------------------------ |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
185 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
186 result <- w4m_filter_by_sample_class( |
6
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
187 dataMatrix_in = dataMatrix_in |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
188 , sampleMetadata_in = sampleMetadata_in |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
189 , variableMetadata_in = variableMetadata_in |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
190 , dataMatrix_out = dataMatrix_out |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
191 , sampleMetadata_out = sampleMetadata_out |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
192 , variableMetadata_out = variableMetadata_out |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
193 , classes = sampleclassNames |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
194 , include = inclusive |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
195 , class_column = classnameColumn |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
196 , samplename_column = samplenameColumn |
13
c18040b6e8b9
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 1a5dd14c3697516bc55950bd6e46c978af7c19cf"
eschen42
parents:
12
diff
changeset
|
197 , order_vrbl = order_vrbl |
c18040b6e8b9
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 1a5dd14c3697516bc55950bd6e46c978af7c19cf"
eschen42
parents:
12
diff
changeset
|
198 , order_smpl = order_smpl |
14
87ec0d3c2266
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a9664e9a04e49d436ebbb643ba1755397ab759dc"
eschen42
parents:
13
diff
changeset
|
199 , centering = centering |
6
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
200 , variable_range_filter = variable_range_filter |
38ccf6722d54
planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
eschen42
parents:
4
diff
changeset
|
201 , failure_action = my_print |
12
38f509903a0b
"planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit b9712e554d16ed26f6c6d0c2e8cd74552b49f694"
eschen42
parents:
8
diff
changeset
|
202 , data_imputation = my_transformation_and_imputation |
0
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
203 ) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
204 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
205 my_print("\nResult of '", modNamC, "' Galaxy module call to 'w4mclassfilter::w4m_filter_by_sample_class' R function: ", |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
206 as.character(result), "\n", sep = "") |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
207 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
208 ##-------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
209 ## Closing |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
210 ##-------- |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
211 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
212 my_print("\nEnd of '", modNamC, "' Galaxy module call: ", |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
213 as.character(Sys.time()), "\n", sep = "") |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
214 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
215 #sink() |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
216 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
217 if (!file.exists(dataMatrix_out)) { |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
218 print(sprintf("ERROR %s::w4m_filter_by_sample_class - file '%s' was not created", modNamC, dataMatrix_out)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
219 }# else { print(sprintf("INFO %s::w4m_filter_by_sample_class - file '%s' was exists", modNamC, dataMatrix_out)) } |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
220 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
221 if (!file.exists(variableMetadata_out)) { |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
222 print(sprintf("ERROR %s::w4m_filter_by_sample_class - file '%s' was not created", modNamC, variableMetadata_out)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
223 } # else { print(sprintf("INFO %s::w4m_filter_by_sample_class - file '%s' was exists", modNamC, variableMetadata_out)) } |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
224 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
225 if (!file.exists(sampleMetadata_out)) { |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
226 print(sprintf("ERROR %s::w4m_filter_by_sample_class - file '%s' was not created", modNamC, sampleMetadata_out)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
227 } # else { print(sprintf("INFO %s::w4m_filter_by_sample_class - file '%s' was exists", modNamC, sampleMetadata_out)) } |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
228 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
229 if( !result ) { |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
230 stop(sprintf("ERROR %s::w4m_filter_by_sample_class - method failed", modNamC)) |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
231 } |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
232 |
bab3a658f74e
planemo upload commit 91805bf8e8ce26193ffc4cc2f3dca56ce4addf79
eschen42
parents:
diff
changeset
|
233 rm(list = ls()) |