comparison export_to_spreadsheet.xml @ 5:d0178bdcd00e draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 7d7a519c3a2cc612d38695b335d0f6c75a099de3"
author bgruening
date Fri, 26 Feb 2021 14:12:26 +0000
parents 72a7f23f3a79
children f24c370e5ea4
comparison
equal deleted inserted replaced
4:f8fa0f6718a3 5:d0178bdcd00e
1 <tool id="cp_export_to_spreadsheet" name="ExportToSpreadsheet" version="@CP_VERSION@"> 1 <tool id="cp_export_to_spreadsheet" name="ExportToSpreadsheet" version="@CP_VERSION@+galaxy@VERSION_SUFFIX@">
2 <description>export measurements into one or more files</description> 2 <description>export measurements into one or more files</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 <token name="@VERSION_SUFFIX@">1</token>
5 <xml name="metadata_sample_row" > 6 <xml name="metadata_sample_row" >
6 <param name="metadata_category" type="select" label="Select the metadata to use as the identifier"> 7 <param name="metadata_category" type="select" label="Select the metadata to use as the identifier">
7 <option value="FileName">File name</option> 8 <option value="FileName">File name</option>
8 9
9 <option value="Frame">Frame</option> 10 <option value="Frame">Frame</option>
74 _str += FOURSPACES + "Select source of sample row name:%s\n" % source_sample_row 75 _str += FOURSPACES + "Select source of sample row name:%s\n" % source_sample_row
75 _str += FOURSPACES + "Select the image to use as the identifier:%s\n" % image_as_id 76 _str += FOURSPACES + "Select the image to use as the identifier:%s\n" % image_as_id
76 _str += FOURSPACES + "Select the metadata to use as the identifier:%s\n" % metadata_as_id 77 _str += FOURSPACES + "Select the metadata to use as the identifier:%s\n" % metadata_as_id
77 78
78 79
79 export_all_measurements = params["con_export_all_measurements"]["export_all_measurements"] 80 export_all_measurements = "Yes" # always export all
80 81
81 _str += FOURSPACES + "Export all measurement types?:%s\n" % export_all_measurements 82 _str += FOURSPACES + "Export all measurement types?:%s\n" % export_all_measurements
82 83
83 _str += FOURSPACES + "Press button to select measurements:\n" 84 _str += FOURSPACES + "Press button to select measurements:\n"
84 85
93 _str += FOURSPACES + "Overwrite existing files without warning?:%s\n" % params["overwrite_existing_file"] 94 _str += FOURSPACES + "Overwrite existing files without warning?:%s\n" % params["overwrite_existing_file"]
94 95
95 96
96 use_as_filename = "Yes" 97 use_as_filename = "Yes"
97 98
98 if export_all_measurements == "Yes": 99 _str += FOURSPACES + "Data to export:Do not use\n"
99 _str += FOURSPACES + "Data to export:Do not use\n" 100 _str += FOURSPACES + "Combine these object measurements with those of the previous object?:No\n"
100 _str += FOURSPACES + "Combine these object measurements with those of the previous object?:No\n" 101 _str += FOURSPACES + "File name:DATA.csv\n"
101 _str += FOURSPACES + "File name:DATA.csv\n" 102 _str += FOURSPACES + "Use the object name for the file name?:Yes\n"
102 _str += FOURSPACES + "Use the object name for the file name?:Yes\n"
103 else:
104 for dte in params["con_export_all_measurements"]["r_data_to_export"]:
105 _str += FOURSPACES + "Data to export:%s\n" % dte["data_to_export"]
106 _str += FOURSPACES + "Combine these object measurements with those of the previous object?:No\n"
107
108 use_as_filename = dte["con_obj_name_for_filename"]["use_as_filename"]
109
110 if use_as_filename == "No":
111 file_name = dte["con_obj_name_for_filename"]["file_name"]
112 else:
113 file_name = "DATA.csv"
114
115 _str += FOURSPACES + "File name:%s\n" % file_name
116 _str += FOURSPACES + "Use the object name for the file name?:%s\n" % use_as_filename
117 103
118 return _str 104 return _str
119 105
120 with open(input_pipeline) as fin: 106 with open(input_pipeline) as fin:
121 lines = fin.readlines() 107 lines = fin.readlines()
202 </when> 188 </when>
203 </conditional> 189 </conditional>
204 </when> 190 </when>
205 <when value="No" /> 191 <when value="No" />
206 </conditional> 192 </conditional>
207 <conditional name="con_export_all_measurements"> 193
208 <param name="export_all_measurements" type="select" display="radio" label="Export all measurement types?" help="Select 'Yes' to export every category of measurement. ExportToSpreadsheet will create one data file for each object produced in the pipeline, as well as per-image, per-experiment and object relationships, if relevant.">
209 <option value="Yes">Yes</option>
210 <option value="No">No</option>
211 </param>
212 <when value="No">
213 <repeat name="r_data_to_export" title="another data set" min="1">
214 <param name="data_to_export" type="select" label="Data to export" help="This option will writ out a file of measurements for the given category.">
215 <option value="Image">Image</option>
216 <option value="Experiment">Experiment</option>
217 <option value="Object relationship">Object relationship</option>
218 <option value="Do not use">Do not use</option>
219 </param>
220 <conditional name="con_obj_name_for_filename">
221 <param name="use_as_filename" type="select" display="radio" label="Use the object name for the file name?" help="Select 'Yes' to use the object name as selected above to generate a file name for the spreadsheet.">
222 <option value="Yes">Yes</option>
223 <option value="No">No</option>
224 </param>
225 <when value="No">
226 <param name="file_name" type="text" label="File name" />
227 </when>
228 <when value="Yes" />
229 </conditional>
230 </repeat>
231 </when>
232 <when value="Yes" />
233 </conditional>
234 </inputs> 194 </inputs>
235 195
236 <outputs> 196 <outputs>
237 <expand macro="output_pipeline_param" /> 197 <expand macro="output_pipeline_param" />
238 </outputs> 198 </outputs>
247 <param name="add_prefix" value="No"/> 207 <param name="add_prefix" value="No"/>
248 </conditional> 208 </conditional>
249 <param name="overwrite_existing_file" value="Yes" /> 209 <param name="overwrite_existing_file" value="Yes" />
250 <param name="add_metadata_column_to_object" value="Yes" /> 210 <param name="add_metadata_column_to_object" value="Yes" />
251 <param name="represent_nan" value="NaN" /> 211 <param name="represent_nan" value="NaN" />
252 <conditional name="con_measurement_export">
253 <param name="export_measurement" value="No" />
254 </conditional>
255 <param name="calc_mean" value="Yes" /> 212 <param name="calc_mean" value="Yes" />
256 <param name="calc_median" value="Yes" /> 213 <param name="calc_median" value="Yes" />
257 <param name="calc_standard_deviation" value="Yes" /> 214 <param name="calc_standard_deviation" value="Yes" />
258 <conditional name="con_create_gene_pattern"> 215 <conditional name="con_create_gene_pattern">
259 <param name="create_gene_pattern" value="No" /> 216 <param name="create_gene_pattern" value="No" />
260 </conditional>
261 <conditional name="con_export_all_measurements">
262 <param name="export_all_measurements" value="Yes" />
263 </conditional> 217 </conditional>
264 <expand macro="test_out_file" file="export_to_spreadsheet.cppipe" /> 218 <expand macro="test_out_file" file="export_to_spreadsheet.cppipe" />
265 </test> 219 </test>
266 220
267 <test> 221 <test>
273 <param name="add_prefix" value="No"/> 227 <param name="add_prefix" value="No"/>
274 </conditional> 228 </conditional>
275 <param name="overwrite_existing_file" value="Yes" /> 229 <param name="overwrite_existing_file" value="Yes" />
276 <param name="add_metadata_column_to_object" value="Yes" /> 230 <param name="add_metadata_column_to_object" value="Yes" />
277 <param name="represent_nan" value="NaN" /> 231 <param name="represent_nan" value="NaN" />
278 <conditional name="con_measurement_export">
279 <param name="export_measurement" value="No" />
280 </conditional>
281 <param name="calc_mean" value="Yes" /> 232 <param name="calc_mean" value="Yes" />
282 <param name="calc_median" value="Yes" /> 233 <param name="calc_median" value="Yes" />
283 <param name="calc_standard_deviation" value="Yes" /> 234 <param name="calc_standard_deviation" value="Yes" />
284 <conditional name="con_create_gene_pattern"> 235 <conditional name="con_create_gene_pattern">
285 <param name="create_gene_pattern" value="Yes" /> 236 <param name="create_gene_pattern" value="Yes" />
287 <param name="select_source_sample_row_name" value="Metadata" /> 238 <param name="select_source_sample_row_name" value="Metadata" />
288 <param name="metadata_category" value="FileName" /> 239 <param name="metadata_category" value="FileName" />
289 <param name="metadata_measurement" value="DNA" /> 240 <param name="metadata_measurement" value="DNA" />
290 </conditional> 241 </conditional>
291 </conditional> 242 </conditional>
292 <conditional name="con_export_all_measurements">
293 <param name="export_all_measurements" value="Yes" />
294 </conditional>
295 <expand macro="test_out_file" file="export_to_spreadsheet_create_gene_metadata.cppipe" /> 243 <expand macro="test_out_file" file="export_to_spreadsheet_create_gene_metadata.cppipe" />
296 </test> 244 </test>
297 <test> 245 <test>
298 <!-- create gene=yes , source of sampe row name= image filename, export all = no--> 246 <!-- create gene=yes , source of sampe row name= image filename-->
299 <expand macro="test_input_pipeline_param" /> 247 <expand macro="test_input_pipeline_param" />
300 <param name="delimiter" value="Tab" /> 248 <param name="delimiter" value="Tab" />
301 <param name="output_file_location" value="Default Output Folder" /> 249 <param name="output_file_location" value="Default Output Folder" />
302 <conditional name="con_prefix"> 250 <conditional name="con_prefix">
303 <param name="add_prefix" value="Yes"/> 251 <param name="add_prefix" value="Yes"/>
304 <param name="filename_prefix" value="MyExpt_" /> 252 <param name="filename_prefix" value="MyExpt_" />
305 </conditional> 253 </conditional>
306 <param name="overwrite_existing_file" value="Yes" /> 254 <param name="overwrite_existing_file" value="Yes" />
307 <param name="add_metadata_column_to_object" value="Yes" /> 255 <param name="add_metadata_column_to_object" value="Yes" />
308 <param name="represent_nan" value="NaN" /> 256 <param name="represent_nan" value="NaN" />
309 <conditional name="con_measurement_export">
310 <param name="export_measurement" value="No" />
311 </conditional>
312 <param name="calc_mean" value="Yes" /> 257 <param name="calc_mean" value="Yes" />
313 <param name="calc_median" value="Yes" /> 258 <param name="calc_median" value="Yes" />
314 <param name="calc_standard_deviation" value="Yes" /> 259 <param name="calc_standard_deviation" value="Yes" />
315 <conditional name="con_create_gene_pattern"> 260 <conditional name="con_create_gene_pattern">
316 <param name="create_gene_pattern" value="Yes" /> 261 <param name="create_gene_pattern" value="Yes" />
317 <conditional name="con_source_sample_row"> 262 <conditional name="con_source_sample_row">
318 <param name="select_source_sample_row_name" value="Image filename" /> 263 <param name="select_source_sample_row_name" value="Image filename" />
319 <param name="image_filename_cat" value="DNA" /> 264 <param name="image_filename_cat" value="DNA" />
320 </conditional> 265 </conditional>
321 </conditional> 266 </conditional>
322 <conditional name="con_export_all_measurements">
323 <param name="export_all_measurements" value="No" />
324 <repeat name="r_data_to_export">
325 <param name="data_to_export" value="Image" />
326 <conditional name="con_obj_name_for_filename">
327 <param name="use_as_filename" value="No" />
328 <param name="file_name" value="data.csv" />
329 </conditional>
330 </repeat>
331 </conditional>
332 <expand macro="test_out_file" file="export_to_spreadsheet_create_gene_image_filename.cppipe" /> 267 <expand macro="test_out_file" file="export_to_spreadsheet_create_gene_image_filename.cppipe" />
333 </test> 268 </test>
334 269
335 <test> 270 <test>
336 <!--repeat test for multiple data export. create gene=yes , source of sampe row name= image filename, export all = no--> 271 <!--repeat test for multiple data export. create gene=yes , source of sampe row name= image filename-->
337 <expand macro="test_input_pipeline_param" /> 272 <expand macro="test_input_pipeline_param" />
338 <param name="delimiter" value="Tab" /> 273 <param name="delimiter" value="Tab" />
339 <param name="output_file_location" value="Default Output Folder" /> 274 <param name="output_file_location" value="Default Output Folder" />
340 <conditional name="con_prefix"> 275 <conditional name="con_prefix">
341 <param name="add_prefix" value="Yes"/> 276 <param name="add_prefix" value="Yes"/>
342 <param name="filename_prefix" value="MyExpt_" /> 277 <param name="filename_prefix" value="MyExpt_" />
343 </conditional> 278 </conditional>
344 <param name="overwrite_existing_file" value="Yes" /> 279 <param name="overwrite_existing_file" value="Yes" />
345 <param name="add_metadata_column_to_object" value="Yes" /> 280 <param name="add_metadata_column_to_object" value="Yes" />
346 <param name="represent_nan" value="NaN" /> 281 <param name="represent_nan" value="NaN" />
347 <conditional name="con_measurement_export">
348 <param name="export_measurement" value="No" />
349 </conditional>
350 <param name="calc_mean" value="Yes" /> 282 <param name="calc_mean" value="Yes" />
351 <param name="calc_median" value="Yes" /> 283 <param name="calc_median" value="Yes" />
352 <param name="calc_standard_deviation" value="Yes" /> 284 <param name="calc_standard_deviation" value="Yes" />
353 <conditional name="con_create_gene_pattern"> 285 <conditional name="con_create_gene_pattern">
354 <param name="create_gene_pattern" value="Yes" /> 286 <param name="create_gene_pattern" value="Yes" />
355 <conditional name="con_source_sample_row"> 287 <conditional name="con_source_sample_row">
356 <param name="select_source_sample_row_name" value="Image filename" /> 288 <param name="select_source_sample_row_name" value="Image filename" />
357 <param name="image_filename_cat" value="DNA" /> 289 <param name="image_filename_cat" value="DNA" />
358 </conditional> 290 </conditional>
359 </conditional> 291 </conditional>
360 <conditional name="con_export_all_measurements">
361 <param name="export_all_measurements" value="No" />
362 <repeat name="r_data_to_export">
363 <param name="data_to_export" value="Image" />
364 <conditional name="con_obj_name_for_filename">
365 <param name="use_as_filename" value="No" />
366 <param name="file_name" value="data.csv" />
367 </conditional>
368 </repeat>
369 <repeat name="r_data_to_export">
370 <param name="data_to_export" value="Experiment" />
371 <conditional name="con_obj_name_for_filename">
372 <param name="use_as_filename" value="Yes" />
373 </conditional>
374 </repeat>
375 </conditional>
376 <expand macro="test_out_file" file="export_to_spreadsheet_multi.cppipe" /> 292 <expand macro="test_out_file" file="export_to_spreadsheet_multi.cppipe" />
377 </test> 293 </test>
378 </tests> 294 </tests>
379 295
380 <help> 296 <help>