comparison ena_upload.xml @ 4:26ccb678abc8 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ena_upload commit ba358013c83e7dfffec895946d36585f237e54c5"
author iuc
date Tue, 19 Oct 2021 15:57:14 +0000
parents 59bb6d34fca6
children e1b3b37aa69f
comparison
equal deleted inserted replaced
3:59bb6d34fca6 4:26ccb678abc8
1 <tool id="ena_upload" name="ENA Upload tool" version="0.3.3" profile="20.01" license="MIT"> 1 <tool id="ena_upload" name="ENA Upload tool" version="@VERSION@" profile="20.01" license="MIT">
2 <macros> 2 <macros>
3 <token name="@VERSION@">0.3.1</token> 3 <token name="@VERSION@">0.4.1</token>
4 <import>samples_macros.xml</import> 4 <import>samples_macros.xml</import>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
7 <requirement type="package" version="@VERSION@">ena-upload-cli</requirement> 7 <requirement type="package" version="@VERSION@">ena-upload-cli</requirement>
8 <requirement type="package" version="1.2.0">xlrd</requirement> 8 <requirement type="package" version="1.2.0">xlrd</requirement>
31 #if $action_options.input_format_conditional.input_format == "excel_tables": 31 #if $action_options.input_format_conditional.input_format == "excel_tables":
32 python '$__tool_directory__/process_xlsx.py' 32 python '$__tool_directory__/process_xlsx.py'
33 #if $action_options.input_format_conditional.viral_submission == "true": 33 #if $action_options.input_format_conditional.viral_submission == "true":
34 --vir 34 --vir
35 #end if 35 #end if
36 #if $action_options.test_submit_parameters.submit_dev == "true":
37 --dev
38 #end if
36 --action '$action_options.action' --form '$action_options.input_format_conditional.xlsx_file' --out_dir ./submission_files --verbose > '$output'; 39 --action '$action_options.action' --form '$action_options.input_format_conditional.xlsx_file' --out_dir ./submission_files --verbose > '$output';
37 #end if 40 #end if
38 41
39 #if $action_options.input_format_conditional.input_format != "user_generated_tables": 42 #if $action_options.input_format_conditional.input_format != "user_generated_tables":
40 cp $studies_table_path $studies_table_out && 43 cp $studies_table_path $studies_table_out &&
82 #for $sample in $study.rep_sample: 85 #for $sample in $study.rep_sample:
83 #for $experiment in $sample.rep_experiment: 86 #for $experiment in $sample.rep_experiment:
84 #for $run in $experiment.rep_runs: 87 #for $run in $experiment.rep_runs:
85 #for $file in $run.upload_files: 88 #for $file in $run.upload_files:
86 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier) 89 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier)
87 ln -s '$file' $safename_reads_file && 90 #if $action_options.input_format_conditional.add_extension == "true":
91 #set $extension = '.fastq'
92 #else
93 #set $extension = ''
94 #end if
95 #if $file.is_of_type('fastq', 'fastqsanger'):
96 ## compression output is defined as safename_reads_file so no need to symlink
97 #set $safename_reads_file = $safename_reads_file + $extension + '.gz'
98 gzip -c '$file' > $safename_reads_file &&
99 #else:
100 #if $action_options.input_format_conditional.add_extension == "true":
101 #if $file.is_of_type('fastq.gz', 'fastqsanger.gz'):
102 #set $compression = '.gz'
103 #elif $file.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
104 #set $compression = '.bz2'
105 #end if
106 #set $safename_reads_file = $safename_reads_file + $extension + $compression
107 #end if
108 ln -s '$file' $safename_reads_file &&
109 #end if
88 $files_to_upload.append(str($safename_reads_file)) 110 $files_to_upload.append(str($safename_reads_file))
89 #end for 111 #end for
90 #end for 112 #end for
91 #end for 113 #end for
92 #end for 114 #end for
93 #end for 115 #end for
94 #else: 116 #else:
95 #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'paired_list': 117 #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'paired_list':
96 #for $pair in $action_options.input_format_conditional.run_input_format_conditional.paired_end_collection: 118 #for $pair in $action_options.input_format_conditional.run_input_format_conditional.paired_end_collection:
97 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $pair.name) 119 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $pair.name)
98 #if $pair.forward.is_of_type('fastq.gz', 'fastqsanger.gz'): 120 ## Always need to add .fastq + compression suffix because the name is based on the pair name which has no extensions
99 #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq.gz' 121 #if $pair.forward.is_of_type('fastq', 'fastqsanger'):
100 #elif $pair.forward.is_of_type('fastqsanger.bz2', 'fastq.bz2'): 122 ## compress the file, no need to create the link then
101 #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq.bz2' 123 ## always add the compression suffix (.gz)
102 #else: 124 #set $safename_fwd_reads_file = $safename_reads_file + '_1' + 'fastq' + '.gz'
103 #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq' 125 gzip -c '$file' > $safename_fwd_reads_file &&
126 #else
127 #if $pair.forward.is_of_type('fastq.gz', 'fastqsanger.gz'):
128 #set $compression = '.gz'
129 #elif $pair.forward.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
130 #set $compression = '.bz2'
131 #end if
132 #set $safename_fwd_reads_file = $safename_reads_file + '_1' + '.fastq' + $compression
133 ln -s '$pair.forward' $safename_fwd_reads_file &&
104 #end if 134 #end if
105 #if $pair.reverse.is_of_type('fastq.gz', 'fastqsanger.gz'): 135
106 #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq.gz' 136 #if $pair.reverse.is_of_type('fastq', 'fastqsanger'):
107 #elif $pair.reverse.is_of_type('fastqsanger.bz2', 'fastq.bz2'): 137 ## compress the file, no need to create the link then
108 #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq.bz2' 138 #set $safename_reverse_reads_file = $safename_reads_file + '_1' + '.fastq' + '.gz'
109 #else: 139 gzip -c '$file' > $safename_rev_reads_file &&
110 #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq' 140 #else
141 #if $pair.reverse.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
142 #set $compression = '.bz2'
143 #elif $pair.reverse.is_of_type('fastqsanger.gz', 'fastq.gz'):
144 #set $compression = '.gz'
145 #end if
146 #set $safename_rev_reads_file = $safename_reads_file + '_2' + '.fastq' + $compression
147 ln -s '$pair.reverse' $safename_rev_reads_file &&
111 #end if 148 #end if
112
113 ln -s '$pair.forward' $safename_fwd_reads_file &&
114 $files_to_upload.append(str($safename_fwd_reads_file)) 149 $files_to_upload.append(str($safename_fwd_reads_file))
115 ln -s '$pair.reverse' $safename_rev_reads_file &&
116 $files_to_upload.append(str($safename_rev_reads_file)) 150 $files_to_upload.append(str($safename_rev_reads_file))
117 #end for 151 #end for
118 #end if 152 #end if
119 #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'multiple_selection_list': 153 #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'multiple_selection_list':
120 #for $file in $action_options.input_format_conditional.run_input_format_conditional.data: 154 #for $file in $action_options.input_format_conditional.run_input_format_conditional.data:
121 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier) 155 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier)
122 ln -s '$file' $safename_reads_file && 156 #if $file.is_of_type('fastq', 'fastqsanger'):
157 ## always compress add the gz extension
158 #if $action_options.input_format_conditional.run_input_format_conditional.add_extension == "true":
159 #set $safename_reads_file = $safename_reads_file + 'fastq.gz'
160 #else
161 #set $safename_reads_file = $safename_reads_file + '.gz'
162 #end if
163 gzip -c '$file' > $safename_reads_file &&
164 #else
165 #if $action_options.input_format_conditional.run_input_format_conditional.add_extension == "true":
166 #if $file.is_of_type('fastq.gz', 'fastqsanger.gz'):
167 #set $extension = 'fastq.gz'
168 #elif $file.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
169 #set $extension = 'fastq.bz2'
170 #end if
171 #set $safename_reads_file = $safename_reads_file + $extension
172 #end if
173 ln -s '$file' $safename_reads_file &&
174 #end if
123 $files_to_upload.append(str($safename_reads_file)) 175 $files_to_upload.append(str($safename_reads_file))
124 #end for 176 #end for
125 #end if 177 #end if
126 #end if 178 #end if
127 179
128 180
129 #if $action_options.test_submit_parameters.dry_run == "false": 181 #if $action_options.test_submit_parameters.dry_run == "false":
182 #if $action_options.action == "add":
130 ena-upload-cli 183 ena-upload-cli
131 --tool 'ena-upload-cli v@VERSION@ @ Galaxy' 184 --tool 'ena-upload-cli v@VERSION@ @ Galaxy'
132 --action '$action_options.action' 185 --action '$action_options.action'
133 --center '$action_options.center' 186 --center '$action_options.center'
134 --secret \${credentials_path} 187 --secret \${credentials_path}
135 --data 188 --data
136 #for $dataset in $files_to_upload: 189 #for $dataset in $files_to_upload:
137 '$dataset' 190 '$dataset'
138 #end for 191 #end for
192 --action add
139 --experiment '$experiments_table_path' 193 --experiment '$experiments_table_path'
140 --study '$studies_table_path' 194 --study '$studies_table_path'
141 --run '$runs_table_path' 195 --run '$runs_table_path'
142 --sample '$samples_table_path' 196 --sample '$samples_table_path'
143 #if $action_options.input_format_conditional.input_format == "user_generated_tables": 197 #if $action_options.input_format_conditional.input_format == "user_generated_tables":
144 #if "$action_options.input_format_conditional.viral_submission" == "true": 198 #if "$action_options.input_format_conditional.viral_submission" == "true":
145 --vir 199 --checklist ERC000033
146 #end if 200 #end if
147 #else: 201 #else:
148 #if $action_options.input_format_conditional.input_format == "build_tables": 202 #if $action_options.input_format_conditional.input_format == "build_tables":
149 #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "true": 203 #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "true":
150 --vir 204 --checklist ERC000033
151 #end if 205 #end if
152 #else: 206 #else:
153 #if $action_options.input_format_conditional.viral_submission == "true": 207 #if $action_options.input_format_conditional.viral_submission == "true":
154 --vir 208 --checklist ERC000033
155 #end if 209 #end if
156 #end if 210 #end if
157 #end if 211 #end if
158 212
159 #if $action_options.test_submit_parameters.submit_dev == "true": 213 #if $action_options.test_submit_parameters.submit_dev == "true":
160 -d 214 -d
161 #end if 215 #end if
162 >> '$output'; 216 >> '$output';
217 #end if
218
219 #if $action_options.action == "modify":
220 ena-upload-cli
221 --tool 'ena-upload-cli v@VERSION@ @ Galaxy'
222 --action '$action_options.action'
223 --center '$action_options.center'
224 --secret \${credentials_path}
225 --data
226 #for $dataset in $files_to_upload:
227 '$dataset'
228 #end for
229 --action 'modify'
230 --experiment '$experiments_table_path'
231 --study '$studies_table_path'
232 --run '$runs_table_path'
233 --sample '$samples_table_path'
234 #if $action_options.input_format_conditional.input_format == "user_generated_tables":
235 #if "$action_options.input_format_conditional.viral_submission" == "true":
236 --checklist ERC000033
237 #end if
238 #else:
239 #if $action_options.input_format_conditional.input_format == "build_tables":
240 #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "true":
241 --checklist ERC000033
242 #end if
243 #else:
244 #if $action_options.input_format_conditional.viral_submission == "true":
245 --checklist ERC000033
246 #end if
247 #end if
248 #end if
249 >> '$output';
250 #end if
163 echo -e 'center_name\t$action_options.center' >> '$output'; 251 echo -e 'center_name\t$action_options.center' >> '$output';
164 echo -e 'action_option\t$action_options.action' >> '$output'; 252 echo -e 'action_option\t$action_options.action' >> '$output';
165 #if $action_options.input_format_conditional.input_format != "user_generated_tables": 253 #if $action_options.input_format_conditional.input_format != "user_generated_tables":
166 cp $studies_table_path_updated $studies_table_out 2>/dev/null; 254 cp $studies_table_path_updated $studies_table_out 2>/dev/null;
167 cp $samples_table_path_updated $samples_table_out 2>/dev/null; 255 cp $samples_table_path_updated $samples_table_out 2>/dev/null;
230 <param name="test_submit" type="hidden" value="False" /> 318 <param name="test_submit" type="hidden" value="False" />
231 <expand macro="table_inputs_macro" /> 319 <expand macro="table_inputs_macro" />
232 </when> 320 </when>
233 <when value="modify"> 321 <when value="modify">
234 <expand macro="test_submit_section"/> 322 <expand macro="test_submit_section"/>
323 <param name="test_submit" type="hidden" value="False" />
235 <expand macro="table_inputs_macro" /> 324 <expand macro="table_inputs_macro" />
236 </when> 325 </when>
237 </conditional> 326 </conditional>
238 </inputs> 327 </inputs>
239 <outputs> 328 <outputs>
250 <data name="runs_table_out" format="tabular" label="Runs table"> 339 <data name="runs_table_out" format="tabular" label="Runs table">
251 <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter> 340 <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter>
252 </data> 341 </data>
253 </outputs> 342 </outputs>
254 <tests> 343 <tests>
255 <!--Test excel input of VIRAL samples --> 344 <!--Test 1: excel input of VIRAL samples -->
256 <test> 345 <test>
257 <conditional name="action_options"> 346 <conditional name="action_options">
258 <param name="action" value="add"/> 347 <param name="action" value="add"/>
259 <section name="test_submit_parameters"> 348 <section name="test_submit_parameters">
260 <param name="submit_dev" value="false" /> 349 <param name="submit_dev" value="false" />
263 <conditional name="input_format_conditional"> 352 <conditional name="input_format_conditional">
264 <param name="input_format" value="excel_tables"/> 353 <param name="input_format" value="excel_tables"/>
265 <param name="viral_submission" value="True"/> 354 <param name="viral_submission" value="True"/>
266 <param name="xlsx_file" value="metadata_test_viral.xlsx"/> 355 <param name="xlsx_file" value="metadata_test_viral.xlsx"/>
267 <conditional name="run_input_format_conditional"> 356 <conditional name="run_input_format_conditional">
357 <param name="add_extension" value="true"/>
268 <param name="run_input_format" value="multiple_selection_list"/> 358 <param name="run_input_format" value="multiple_selection_list"/>
269 <param name="data" value="sample.fq"/> 359 <param name="data" value="sample.fq"/>
270 </conditional> 360 </conditional>
271 </conditional> 361 </conditional>
272 </conditional> 362 </conditional>
274 <output name="experiments_table_out"> 364 <output name="experiments_table_out">
275 <assert_contents> 365 <assert_contents>
276 <has_n_lines n="5"/> 366 <has_n_lines n="5"/>
277 <has_n_columns n="17"/> 367 <has_n_columns n="17"/>
278 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_alias\tsample_alias\tdesign_description\tlibrary_name\tlibrary_strategy\tlibrary_source\tlibrary_selection\tlibrary_layout\tinsert_size\tlibrary_construction_protocol\tplatform\tinstrument_model\tsubmission_date" /> 368 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_alias\tsample_alias\tdesign_description\tlibrary_name\tlibrary_strategy\tlibrary_source\tlibrary_selection\tlibrary_layout\tinsert_size\tlibrary_construction_protocol\tplatform\tinstrument_model\tsubmission_date" />
279 <has_line_matching expression="e_(.*)_026\tadd\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/> 369 <has_line_matching expression="e_(.*)_026\tmodify\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
280 </assert_contents> 370 </assert_contents>
281 </output> 371 </output>
282 <output name="studies_table_out"> 372 <output name="studies_table_out">
283 <assert_contents> 373 <assert_contents>
284 <has_n_lines n="2"/> 374 <has_n_lines n="2"/>
285 <has_n_columns n="8"/> 375 <has_n_columns n="8"/>
286 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/> 376 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/>
287 <has_line_matching expression="SARS-CoV-2_genomes_01\tadd\tENA_accession\tWhole-genome sequencing of SARS-CoV-2 from Covid-19 patients\tWhole Genome Sequencing\tWhole-genome sequences of SARS-CoV-2 from oro-pharyngeal swabs obtained from Covid-19 patients(.*)"/> 377 <has_line_matching expression="SARS-CoV-2_genomes_01\tmodify\tENA_accession\tWhole-genome sequencing of SARS-CoV-2 from Covid-19 patients\tWhole Genome Sequencing\tWhole-genome sequences of SARS-CoV-2 from oro-pharyngeal swabs obtained from Covid-19 patients(.*)"/>
288 </assert_contents> 378 </assert_contents>
289 </output> 379 </output>
290 <output name="samples_table_out"> 380 <output name="samples_table_out">
291 <assert_contents> 381 <assert_contents>
292 <has_n_lines n="5"/> 382 <has_n_lines n="5"/>
293 <has_n_columns n="18"/> 383 <has_n_columns n="18"/>
294 <has_line_matching expression="alias\ttitle\tscientific_name\tsample_description\tstatus\taccession\ttaxon_id\tsubmission_date\tgeographic_location\thost_common_name\thost_subject_id\thost_health_state\thost_sex\thost_scientific_name\tcollector_name\tcollecting_institution\tisolate\tcollection_date"/>
295 </assert_contents> 384 </assert_contents>
296 </output> 385 </output>
297 <output name="runs_table_out"> 386 <output name="runs_table_out">
298 <assert_contents> 387 <assert_contents>
299 <has_n_lines n="5"/> 388 <has_n_lines n="5"/>
300 <has_n_columns n="8"/> 389 <has_n_columns n="8"/>
301 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/> 390 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
302 <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/> 391 <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
303 </assert_contents> 392 </assert_contents>
304 </output> 393 </output>
305 </test> 394 </test>
306 <!--Test excel input of VIRAL samples with extended columns--> 395 <!--Test 2: excel input of VIRAL samples with extended columns-->
307 <test> 396 <test>
308 <conditional name="action_options"> 397 <conditional name="action_options">
309 <param name="action" value="add"/> 398 <param name="action" value="add"/>
310 <section name="test_submit_parameters"> 399 <section name="test_submit_parameters">
311 <param name="submit_dev" value="false" /> 400 <param name="submit_dev" value="false" />
314 <conditional name="input_format_conditional"> 403 <conditional name="input_format_conditional">
315 <param name="input_format" value="excel_tables"/> 404 <param name="input_format" value="excel_tables"/>
316 <param name="viral_submission" value="True"/> 405 <param name="viral_submission" value="True"/>
317 <param name="xlsx_file" value="metadata_test_viral_optional_columns.xlsx"/> 406 <param name="xlsx_file" value="metadata_test_viral_optional_columns.xlsx"/>
318 <conditional name="run_input_format_conditional"> 407 <conditional name="run_input_format_conditional">
408 <param name="add_extension" value="true"/>
319 <param name="run_input_format" value="multiple_selection_list"/> 409 <param name="run_input_format" value="multiple_selection_list"/>
320 <param name="data" value="sample.fq"/> 410 <param name="data" value="sample.fq"/>
321 </conditional> 411 </conditional>
322 </conditional> 412 </conditional>
323 </conditional> 413 </conditional>
325 <output name="experiments_table_out"> 415 <output name="experiments_table_out">
326 <assert_contents> 416 <assert_contents>
327 <has_n_lines n="5"/> 417 <has_n_lines n="5"/>
328 <has_n_columns n="17"/> 418 <has_n_columns n="17"/>
329 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_alias\tsample_alias\tdesign_description\tlibrary_name\tlibrary_strategy\tlibrary_source\tlibrary_selection\tlibrary_layout\tinsert_size\tlibrary_construction_protocol\tplatform\tinstrument_model\tsubmission_date" /> 419 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_alias\tsample_alias\tdesign_description\tlibrary_name\tlibrary_strategy\tlibrary_source\tlibrary_selection\tlibrary_layout\tinsert_size\tlibrary_construction_protocol\tplatform\tinstrument_model\tsubmission_date" />
330 <has_line_matching expression="e_(.*)_026\tadd\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/> 420 <has_line_matching expression="e_(.*)_026\tmodify\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
331 </assert_contents> 421 </assert_contents>
332 </output> 422 </output>
333 <output name="studies_table_out"> 423 <output name="studies_table_out">
334 <assert_contents> 424 <assert_contents>
335 <has_n_lines n="2"/> 425 <has_n_lines n="2"/>
336 <has_n_columns n="8"/> 426 <has_n_columns n="8"/>
337 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/> 427 <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/>
338 <has_line_matching expression="SARS-CoV-2_genomes_01\tadd\tENA_accession\tWhole-genome sequencing of SARS-CoV-2 from Covid-19 patients\tWhole Genome Sequencing\tWhole-genome sequences of SARS-CoV-2 from oro-pharyngeal swabs obtained from Covid-19 patients(.*)"/> 428 <has_line_matching expression="SARS-CoV-2_genomes_01\tmodify\tENA_accession\tWhole-genome sequencing of SARS-CoV-2 from Covid-19 patients\tWhole Genome Sequencing\tWhole-genome sequences of SARS-CoV-2 from oro-pharyngeal swabs obtained from Covid-19 patients(.*)"/>
339 </assert_contents> 429 </assert_contents>
340 </output> 430 </output>
341 <output name="samples_table_out"> 431 <output name="samples_table_out">
342 <assert_contents> 432 <assert_contents>
343 <has_n_lines n="5"/> 433 <has_n_lines n="5"/>
344 <has_n_columns n="42"/> 434 <has_n_columns n="42"/>
345 <has_line_matching expression="alias\ttitle\tscientific_name\tsample_description\tstatus\taccession\ttaxon_id\tsubmission_date\tgeographic_location\thost_common_name\thost_subject_id\thost_health_state\thost_sex\thost_scientific_name\tcollector_name\tcollecting_institution\tisolate\tcollection_date\tgeographic_location_latitude\tgeographic_location_longitude\tsample_capture_status\thost_disease_outcome\thost_age\tvirus_identifier\treceipt_date\tdefinition_for_seropositive_sample\tserotype\thost_habitat\tisolation_source_host_associated\thost_behaviour\tisolation_source_non_host_associated\tsubject_exposure\tsubject_exposure_duration\ttype_exposure\tpersonal_protective_equipment\thospitalisation\tillness_duration\tillness_symptoms\tsample_storage_conditions\tstrain\thost_description\tgravidity"/>
346 </assert_contents> 435 </assert_contents>
347 </output> 436 </output>
348 <output name="runs_table_out"> 437 <output name="runs_table_out">
349 <assert_contents> 438 <assert_contents>
350 <has_n_lines n="5"/> 439 <has_n_lines n="5"/>
351 <has_n_columns n="8"/> 440 <has_n_columns n="8"/>
352 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/> 441 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
353 <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/> 442 <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
354 </assert_contents> 443 </assert_contents>
355 </output> 444 </output>
356 </test> 445 </test>
357 <!--Test excel input of NON-VIRAL samples--> 446 <!--Test 3: excel input of NON-VIRAL samples-->
358 <test> 447 <test>
359 <conditional name="action_options"> 448 <conditional name="action_options">
360 <param name="action" value="add"/> 449 <param name="action" value="add"/>
361 <section name="test_submit_parameters"> 450 <section name="test_submit_parameters">
362 <param name="submit_dev" value="false" /> 451 <param name="submit_dev" value="false" />
365 <conditional name="input_format_conditional"> 454 <conditional name="input_format_conditional">
366 <param name="input_format" value="excel_tables"/> 455 <param name="input_format" value="excel_tables"/>
367 <param name="viral_submission" value="False"/> 456 <param name="viral_submission" value="False"/>
368 <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/> 457 <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/>
369 <conditional name="run_input_format_conditional"> 458 <conditional name="run_input_format_conditional">
459 <param name="add_extension" value="true"/>
370 <param name="run_input_format" value="multiple_selection_list"/> 460 <param name="run_input_format" value="multiple_selection_list"/>
371 <param name="data" value="sample.fq"/> 461 <param name="data" value="sample.fq"/>
372 </conditional> 462 </conditional>
373 </conditional> 463 </conditional>
374 </conditional> 464 </conditional>
397 <output name="runs_table_out"> 487 <output name="runs_table_out">
398 <assert_contents> 488 <assert_contents>
399 <has_n_lines n="5"/> 489 <has_n_lines n="5"/>
400 <has_n_columns n="8"/> 490 <has_n_columns n="8"/>
401 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/> 491 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
402 <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/> 492 <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
403 </assert_contents> 493 </assert_contents>
404 </output> 494 </output>
405 </test> 495 </test>
406 <!--Test failure on excel input of NON-VIRAL samples with runs PAIRED collection --> 496 <!--Test 4: failure on excel input of NON-VIRAL samples with runs PAIRED collection -->
407 <test expect_failure="true"> 497 <test expect_failure="true">
408 <conditional name="action_options"> 498 <conditional name="action_options">
409 <param name="action" value="add"/> 499 <param name="action" value="add"/>
410 <section name="test_submit_parameters"> 500 <section name="test_submit_parameters">
411 <param name="submit_dev" value="false" /> 501 <param name="submit_dev" value="false" />
412 <param name="dry_run" value="false" /> 502 <param name="dry_run" value="false" />
413 </section> 503 </section>
414 <conditional name="input_format_conditional"> 504 <conditional name="input_format_conditional">
505 <param name="add_extension" value="true"/>
415 <param name="input_format" value="excel_tables"/> 506 <param name="input_format" value="excel_tables"/>
416 <param name="viral_submission" value="False"/> 507 <param name="viral_submission" value="False"/>
417 <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/> 508 <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/>
418 <conditional name="run_input_format_conditional"> 509 <conditional name="run_input_format_conditional">
419 <param name="run_input_format" value="paired_list"/> 510 <param name="run_input_format" value="paired_list"/>
435 <has_text_matching expression="ena-upload-cli"/> 526 <has_text_matching expression="ena-upload-cli"/>
436 <has_text_matching expression="--data 'paired_run_name_1.fastq.gz' 'paired_run_name_2.fastq.gz'"/> 527 <has_text_matching expression="--data 'paired_run_name_1.fastq.gz' 'paired_run_name_2.fastq.gz'"/>
437 <has_text_matching expression="--action 'add' --center 'Some research center'"/> 528 <has_text_matching expression="--action 'add' --center 'Some research center'"/>
438 </assert_command> 529 </assert_command>
439 </test> 530 </test>
440 <!--Test build tables from user input fields NON-VIRAL samples--> 531 <!--Test 5: build tables from user input fields NON-VIRAL samples-->
441 <test> 532 <test>
442 <conditional name="action_options"> 533 <conditional name="action_options">
443 <param name="action" value="add"/> 534 <param name="action" value="add"/>
444 <section name="test_submit_parameters"> 535 <section name="test_submit_parameters">
445 <param name="submit_dev" value="false" /> 536 <param name="submit_dev" value="false" />
446 <param name="dry_run" value="true" /> 537 <param name="dry_run" value="true" />
447 </section> 538 </section>
448 <conditional name="input_format_conditional"> 539 <conditional name="input_format_conditional">
449 <param name="input_format" value="build_tables"/> 540 <param name="input_format" value="build_tables"/>
541 <param name="add_extension" value="true"/>
450 <conditional name="conditional_viral_metadata"> 542 <conditional name="conditional_viral_metadata">
451 <param name="viral_sample" value="False"/> 543 <param name="viral_sample" value="False"/>
452 <repeat name="rep_study"> 544 <repeat name="rep_study">
453 <param name="study_title" value="Test study title"/> 545 <param name="study_title" value="Test study title"/>
454 <param name="study_abstract" value="Test study abstract"/> 546 <param name="study_abstract" value="Test study abstract"/>
505 <has_n_columns n="8"/> 597 <has_n_columns n="8"/>
506 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/> 598 <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
507 </assert_contents> 599 </assert_contents>
508 </output> 600 </output>
509 </test> 601 </test>
510 <!--Test RUN failing build tables from user input fields NON-VIRAL samples--> 602 <!--Test 6: RUN failing build tables from user input fields NON-VIRAL samples-->
511 <test expect_failure="true"> 603 <test expect_failure="true">
512 <conditional name="action_options"> 604 <conditional name="action_options">
513 <param name="action" value="add"/> 605 <param name="action" value="add"/>
514 <section name="test_submit_parameters"> 606 <section name="test_submit_parameters">
515 <param name="submit_dev" value="true" /> 607 <param name="submit_dev" value="true" />
516 <param name="dry_run" value="false" /> 608 <param name="dry_run" value="false" />
517 </section> 609 </section>
518 <conditional name="input_format_conditional"> 610 <conditional name="input_format_conditional">
519 <param name="input_format" value="build_tables"/> 611 <param name="input_format" value="build_tables"/>
612 <param name="add_extension" value="true"/>
520 <conditional name="conditional_viral_metadata"> 613 <conditional name="conditional_viral_metadata">
521 <param name="viral_sample" value="false"/> 614 <param name="viral_sample" value="false"/>
522 <repeat name="rep_study"> 615 <repeat name="rep_study">
523 <param name="study_title" value="Test study title"/> 616 <param name="study_title" value="Test study title"/>
524 <param name="study_abstract" value="Test study abstract"/> 617 <param name="study_abstract" value="Test study abstract"/>
552 <param name="center" value="Some research center"/> 645 <param name="center" value="Some research center"/>
553 <assert_stdout> 646 <assert_stdout>
554 <has_text_matching expression="No ENA credentials defined"/> 647 <has_text_matching expression="No ENA credentials defined"/>
555 </assert_stdout> 648 </assert_stdout>
556 </test> 649 </test>
557 <!--Test with submit_test to skip credentials checksRUN failing build tables from user input fields NON-VIRAL samples--> 650 <!--Test 7: with submit_test to skip credentials checksRUN failing build tables from user input fields NON-VIRAL samples
651 also tests compression of uncompressed inputs and adding the .gz suffix -->
558 <test expect_failure="true"> 652 <test expect_failure="true">
559 <conditional name="action_options"> 653 <conditional name="action_options">
560 <param name="action" value="add"/> 654 <param name="action" value="add"/>
561 <section name="test_submit_parameters"> 655 <section name="test_submit_parameters">
562 <param name="submit_dev" value="true" /> 656 <param name="submit_dev" value="true" />
563 <param name="dry_run" value="false" /> 657 <param name="dry_run" value="false" />
564 </section> 658 </section>
565 <param name="test_submit" value="True"/> 659 <param name="test_submit" value="True"/>
566 <conditional name="input_format_conditional"> 660 <conditional name="input_format_conditional">
661 <param name="add_extension" value="true"/>
567 <param name="input_format" value="build_tables"/> 662 <param name="input_format" value="build_tables"/>
568 <conditional name="conditional_viral_metadata"> 663 <conditional name="conditional_viral_metadata">
569 <param name="viral_sample" value="false"/> 664 <param name="viral_sample" value="false"/>
570 <repeat name="rep_study"> 665 <repeat name="rep_study">
571 <param name="study_title" value="Test study title"/> 666 <param name="study_title" value="Test study title"/>
588 <param name="library_construction_protocol" value="Test library construction"/> 683 <param name="library_construction_protocol" value="Test library construction"/>
589 <param name="platform" value="ILLUMINA"/> 684 <param name="platform" value="ILLUMINA"/>
590 <param name="instrument_model" value="Illumina HiSeq 4000"/> 685 <param name="instrument_model" value="Illumina HiSeq 4000"/>
591 <repeat name="rep_runs"> 686 <repeat name="rep_runs">
592 <param name="run_base_name" value="run_from_hospital_X"/> 687 <param name="run_base_name" value="run_from_hospital_X"/>
593 <param name="upload_files" value="1.fastqsanger.gz,sample.fq" ftype="fastqsanger"/> 688 <param name="upload_files" value="sample.fq,sample.fq" ftype="fastqsanger"/>
594 </repeat> 689 </repeat>
595 </repeat> 690 </repeat>
596 </repeat> 691 </repeat>
597 </repeat> 692 </repeat>
598 </conditional> 693 </conditional>
599 </conditional> 694 </conditional>
600 </conditional> 695 </conditional>
601 <param name="center" value="Some research center"/> 696 <param name="center" value="Some research center"/>
602 <assert_command> 697 <assert_command>
603 <has_text_matching expression="ena-upload-cli"/> 698 <has_text_matching expression="ena-upload-cli"/>
604 <has_text_matching expression="--data '1.fastqsanger.gz' 'sample.fq'"/> 699 <has_text_matching expression="--data 'sample.fq.fastq.gz' 'sample.fq.fastq.gz'"/>
605 <has_text_matching expression="--action 'add' --center 'Some research center'"/> 700 <has_text_matching expression="--action 'add' --center 'Some research center'"/>
701 <not_has_text text="modify" />
606 </assert_command> 702 </assert_command>
607 <assert_stderr> 703 <assert_stderr>
608 <has_text_matching expression="Oops, the file test_fake_path does not exist"/> 704 <has_text_matching expression="Oops, the file test_fake_path does not exist"/>
609 </assert_stderr> 705 </assert_stderr>
610 </test> 706 </test>
611 <!--test viral submission - User input metadata--> 707 <!--Test 8: viral submission - User input metadata - Add extension = False-->
612 <test expect_failure="true"> 708 <test expect_failure="true">
613 <conditional name="action_options"> 709 <conditional name="action_options">
614 <param name="action" value="add"/> 710 <param name="action" value="add"/>
615 <section name="test_submit_parameters"> 711 <section name="test_submit_parameters">
616 <param name="submit_dev" value="false" /> 712 <param name="submit_dev" value="false" />
617 <param name="dry_run" value="false" /> 713 <param name="dry_run" value="false" />
618 </section> 714 </section>
619 <param name="test_submit" value="True"/> 715 <param name="test_submit" value="True"/>
620 <conditional name="input_format_conditional"> 716 <conditional name="input_format_conditional">
717 <param name="add_extension" value="False"/>
718 <param name="input_format" value="build_tables"/>
719 <conditional name="conditional_viral_metadata">
720 <param name="viral_sample" value="true"/>
721 <repeat name="rep_study">
722 <param name="study_title" value="Test study title"/>
723 <param name="study_abstract" value="Test study abstract"/>
724 <param name="study_type" value="Epigenetics"/>
725 <param name="study_pubmed_id" value="Test study pubmedID"/>
726 <repeat name="rep_sample">
727 <param name="sample_title" value="Test Sample title"/>
728 <param name="sample_description" value="Test Sample description"/>
729 <param name="scientific_name" value="Test Sample scientific name"/>
730 <param name="tax_id" value="Test Sample tax_id"/>
731 <param name="collection_date" value="2020"/>
732 <param name="geo_location_country" value="Belgium"/>
733 <param name="host_common_name" value="Human"/>
734 <param name="host_subject_id" value="Patient_001"/>
735 <param name="host_health_state" value="healthy"/>
736 <param name="host_sex" value="female"/>
737 <param name="host_scientific_name" value="homo sapiens"/>
738 <param name="collector_name" value="John The Collector"/>
739 <param name="collecting_institution" value="Hospital 01"/>
740 <param name="isolate" value="sample_001"/>
741 <repeat name="rep_experiment">
742 <param name="experiment_title" value="Test experiment title"/>
743 <param name="experiment_design" value="Test experiment design description"/>
744 <param name="library_strategy" value="CTS"/>
745 <param name="library_source" value="GENOMIC"/>
746 <param name="library_selection" value="PCR"/>
747 <param name="library_layout" value="SINGLE"/>
748 <param name="insert_size" value="150"/>
749 <param name="library_construction_protocol" value="Test library construction"/>
750 <param name="platform" value="ILLUMINA"/>
751 <param name="instrument_model" value="Illumina HiSeq 4000"/>
752 <repeat name="rep_runs">
753 <param name="run_base_name" value="run_from_hospital_X"/>
754 <param name="upload_files" value="1.fastqsanger.gz,2.fastqsanger.gz" ftype="fastqsanger.gz"/>
755 </repeat>
756 </repeat>
757 </repeat>
758 </repeat>
759 </conditional>
760 </conditional>
761 </conditional>
762 <param name="center" value="Some research center"/>
763 <assert_command>
764 <has_text_matching expression="ena-upload-cli"/>
765 <has_text_matching expression="--data '1.fastqsanger.gz' '2.fastqsanger.gz'"/>
766 <has_text_matching expression="--action 'add' --center 'Some research center'"/>
767 <has_text_matching expression="--checklist ERC000033"/>
768 </assert_command>
769 <assert_stderr>
770 <has_text_matching expression="Oops, the file test_fake_path does not exist"/>
771 </assert_stderr>
772 </test>
773 <!--Test 9: modify option and auto compression - viral submission - User input metadata-->
774 <test expect_failure="true">
775 <conditional name="action_options">
776 <param name="action" value="modify"/>
777 <section name="test_submit_parameters">
778 <param name="submit_dev" value="false" />
779 <param name="dry_run" value="false" />
780 </section>
781 <param name="test_submit" value="True"/>
782 <conditional name="input_format_conditional">
783 <param name="add_extension" value="False"/>
621 <param name="input_format" value="build_tables"/> 784 <param name="input_format" value="build_tables"/>
622 <conditional name="conditional_viral_metadata"> 785 <conditional name="conditional_viral_metadata">
623 <param name="viral_sample" value="True"/> 786 <param name="viral_sample" value="True"/>
624 <repeat name="rep_study"> 787 <repeat name="rep_study">
625 <param name="study_title" value="Test study title"/> 788 <param name="study_title" value="Test study title"/>
652 <param name="library_construction_protocol" value="Test library construction"/> 815 <param name="library_construction_protocol" value="Test library construction"/>
653 <param name="platform" value="ILLUMINA"/> 816 <param name="platform" value="ILLUMINA"/>
654 <param name="instrument_model" value="Illumina HiSeq 4000"/> 817 <param name="instrument_model" value="Illumina HiSeq 4000"/>
655 <repeat name="rep_runs"> 818 <repeat name="rep_runs">
656 <param name="run_base_name" value="run_from_hospital_X"/> 819 <param name="run_base_name" value="run_from_hospital_X"/>
657 <param name="upload_files" value="1.fastqsanger.gz,sample.fq" ftype="fastqsanger"/> 820 <param name="upload_files" value="sample.fq" ftype="fastqsanger"/>
658 </repeat> 821 </repeat>
659 </repeat> 822 </repeat>
660 </repeat> 823 </repeat>
661 </repeat> 824 </repeat>
662 </conditional> 825 </conditional>
663 </conditional> 826 </conditional>
664 </conditional> 827 </conditional>
665 <param name="center" value="Some research center"/> 828 <param name="center" value="Some research center"/>
666 <assert_command> 829 <assert_command>
667 <has_text_matching expression="ena-upload-cli"/> 830 <has_text_matching expression="ena-upload-cli"/>
668 <has_text_matching expression="--data '1.fastqsanger.gz' 'sample.fq'"/> 831 <has_text_matching expression="--data 'sample.fq.gz'"/>
669 <has_text_matching expression="--action 'add' --center 'Some research center'"/> 832 <has_text_matching expression="--action 'modify' --center 'Some research center'"/>
670 <has_text_matching expression="--vir"/> 833 <has_text_matching expression="--checklist ERC000033"/>
834 <not_has_text text="add" />
671 </assert_command> 835 </assert_command>
672 <assert_stderr> 836 <assert_stderr>
673 <has_text_matching expression="Oops, the file test_fake_path does not exist"/> 837 <has_text_matching expression="Oops, the file test_fake_path does not exist"/>
674 </assert_stderr> 838 </assert_stderr>
675 </test> 839 </test>