12
12
# '
13
13
# ' @param data_path \strong{character} \cr
14
14
# ' The path to an .xlsx file containing the input data.
15
+ # '
16
+ # '
17
+ # ' @param filetype **character(1)** \cr Type of input file: "csv" or "tsv" or "txt" or "xlsx".
18
+ # ' @param sep **character(1)** \cr The field separator, e.g. " " for blanks, "," for comma or "\\t" for tab. Default is ",".
19
+ # ' @param dec **character(1)** \cr Decimal separator, e.g. "," for comma or "." for dot. Default is ".".
20
+ # ' @param header **logical(1)** \cr If TRUE, first line is counted as column names.
21
+ # ' @param sheet **integer(1)** \cr Sheet number (only needed for xlsx files, default is to use the first sheet).
15
22
# ' @param output_path \strong{character} \cr
16
23
# ' The path to the output folder.
24
+ # ' @param output_type **character(1)** \cr Type of input file: "csv" or "tsv" or "xlsx".
17
25
# '
18
26
# mandatory parameters
19
27
# ' @param intensity_columns \strong{integer vector} \cr
131
139
132
140
133
141
workflow_QC <- function (data_path ,
142
+ filetype = " xlsx" ,
143
+ sep = " ," ,
144
+ dec = " ." ,
145
+ header = TRUE ,
146
+ sheet = 1 ,
134
147
output_path ,
148
+ output_type = " xlsx" ,
135
149
136
150
intensity_columns ,
137
151
normalization_method = " loess" ,
@@ -180,7 +194,13 @@ workflow_QC <- function(data_path,
180
194
181
195
# ### Prepare Data ####
182
196
183
- prepared_data <- prepareData(data_path = data_path , intensity_columns = intensity_columns ,
197
+ prepared_data <- prepareData(data_path = data_path ,
198
+ filetype = filetype ,
199
+ sep = sep ,
200
+ dec = dec ,
201
+ header = header ,
202
+ sheet = sheet ,
203
+ intensity_columns = intensity_columns ,
184
204
na_strings = na_strings , zero_to_NA = zero_to_NA ,
185
205
do_log_transformation = do_log_transformation , log_base = log_base ,
186
206
use_groups = use_groups , group_colours = group_colours ,
@@ -195,9 +215,19 @@ workflow_QC <- function(data_path,
195
215
utils :: write.csv(x = prepared_data $ D , file = paste0(output_path , " /D_norm_wide" , suffix , " .csv" ), row.names = FALSE )
196
216
utils :: write.csv(x = prepared_data $ D_long , file = paste0(output_path , " /D_norm_long" , suffix , " .csv" ), row.names = FALSE )
197
217
198
- openxlsx :: write.xlsx(x = cbind(prepared_data $ ID , prepared_data $ D ), file = paste0(output_path , " /D_norm_ID" , suffix , " .xlsx" ),
199
- rowNames = FALSE , overwrite = TRUE , keepNA = TRUE )
200
218
219
+ if (output_type == " xlsx" ) {
220
+ openxlsx :: write.xlsx(x = cbind(prepared_data $ ID , prepared_data $ D ), file = paste0(output_path , " /D_norm_ID" , suffix , " .xlsx" ),
221
+ rowNames = FALSE , overwrite = TRUE , keepNA = TRUE )
222
+ }
223
+ if (output_type == " csv" ) {
224
+ utils :: write.csv(x = cbind(prepared_data $ ID , prepared_data $ D ), file = paste0(output_path , " /D_norm_ID" , suffix , " .csv" ),
225
+ row.names = FALSE )
226
+ }
227
+ if (output_type == " tsv" ) {
228
+ utils :: write.table(x = cbind(prepared_data $ ID , prepared_data $ D ), file = paste0(output_path , " /D_norm_ID" , suffix , " .tsv" ),
229
+ row.names = FALSE , sep = " \t " )
230
+ }
201
231
202
232
203
233
# ### Calculate Valid Value Plot ####
0 commit comments