comparison waveica_wrapper.R @ 3:dbbedb14b44c draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/waveica commit b1cc1aebf796f170d93e3dd46ffcdefdc7b8018a
author recetox
date Thu, 12 Oct 2023 13:45:41 +0000
parents 6480c6d5fa36
children 425c0494ec2d
comparison
equal deleted inserted replaced
2:6480c6d5fa36 3:dbbedb14b44c
107 107
108 data <- verify_input_dataframe(data, required_columns) 108 data <- verify_input_dataframe(data, required_columns)
109 109
110 data <- sort_by_injection_order(data) 110 data <- sort_by_injection_order(data)
111 111
112 feature_columns <- colnames(data)[!colnames(data) %in% 112 feature_columns <- colnames(data)[!colnames(data) %in% c(required_columns, optional_columns)]
113 c(required_columns, optional_columns)]
114 features <- data[, feature_columns] 113 features <- data[, feature_columns]
115 injection_order <- data$injectionOrder 114 injection_order <- data$injectionOrder
116 115
117 # run WaveICA 116 # run WaveICA
118 features <- recetox.waveica::waveica_nonbatchwise( 117 features <- recetox.waveica::waveica_nonbatchwise(
135 } 134 }
136 135
137 136
138 sort_by_injection_order <- function(data) { 137 sort_by_injection_order <- function(data) {
139 if ("batch" %in% colnames(data)) { 138 if ("batch" %in% colnames(data)) {
140 data <- data[order(data[, "batch"], 139 data <- data[order(data[, "batch"], data[, "injectionOrder"], decreasing = FALSE), ]
141 data[, "injectionOrder"], 140 } else {
142 decreasing = FALSE 141 data <- data[order(data[, "injectionOrder"], decreasing = FALSE), ]
143 ), ]
144 } else {
145 data <- data[order(data[, "injectionOrder"],
146 decreasing = FALSE
147 ), ]
148 } 142 }
149 return(data) 143 return(data)
150 } 144 }
151 145
152 146