Mercurial > repos > iuc > ena_upload
diff ena_upload.xml @ 11:f803a68fc9e5 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ena_upload commit c7f54e6e3b1ffad5631ff7c150449cb79bd3686d
author | iuc |
---|---|
date | Sat, 23 Mar 2024 22:06:45 +0000 |
parents | 480d9e9d156b |
children | ea5e944f447d |
line wrap: on
line diff
--- a/ena_upload.xml Fri Oct 27 19:44:40 2023 +0000 +++ b/ena_upload.xml Sat Mar 23 22:06:45 2024 +0000 @@ -1,6 +1,7 @@ -<tool id="ena_upload" name="ENA Upload tool" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05" license="MIT"> +<tool id="ena_upload" name="ENA Upload tool" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05" license="MIT"> + <description>Submission of (meta)data to the European Nucleotide Archive (ENA)</description> <macros> - <token name="@TOOL_VERSION@">0.6.3</token> + <token name="@TOOL_VERSION@">0.7.1</token> <token name="@VERSION_SUFFIX@">0</token> <import>samples_macros.xml</import> </macros> @@ -48,7 +49,10 @@ #if $action_options.input_format_conditional.input_format == "excel_tables": ln -s '$action_options.input_format_conditional.xlsx_file' ./xlsx_input.xlsx && #end if -#if $action_options.test_submit_parameters.dry_run == "False" and $action_options.test_submit == "False": +#if $action_options.input_format_conditional.input_format == "isa_json": + ln -s '$action_options.input_format_conditional.isa_json_file' ./isa_json_input.json && +#end if +#if $action_options.test_submit_parameters.dry_run == "False": webin_id=`grep 'username' $credentials`; if [ "\$webin_id" = "" ]; then ## No credentials in user defined preferences @@ -171,95 +175,52 @@ #end if #end if -#if $action_options.action == "add": ena-upload-cli --tool 'ena-upload-cli v@TOOL_VERSION@ @ Galaxy' --action '$action_options.action' - --center '$action_options.center' + --center '$action_options.test_submit_parameters.center' --secret \${credentials_path} --data - #for $dataset in $files_to_upload: - '$dataset' - #end for +#for $dataset in $files_to_upload: + '$dataset' +#end for #if $action_options.test_submit_parameters.dry_run == "True": --draft #end if -#if $action_options.input_format_conditional.input_format != "excel_tables": +#if $action_options.input_format_conditional.input_format == "excel_tables": + --xlsx ./xlsx_input.xlsx +#elif $action_options.input_format_conditional.input_format == "user_generated_tables" or $action_options.input_format_conditional.input_format == "build_tables": --experiment '$experiments_table_path' --study '$studies_table_path' --run '$runs_table_path' --sample '$samples_table_path' -#else - --xlsx ./xlsx_input.xlsx +#elif $action_options.input_format_conditional.input_format == "isa_json": + --isa_json ./isa_json_input.json + --isa_assay_stream '$isa_assay_stream' #end if ---action add -#if $action_options.input_format_conditional.input_format == "user_generated_tables": - --checklist $action_options.input_format_conditional.checklist_id +#if $action_options.input_format_conditional.input_format == "build_tables": + #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "True": + --checklist ERC000033 + #end if +#elif $action_options.input_format_conditional.input_format == "isa_json": + --checklist ERC000011 #else: - #if $action_options.input_format_conditional.input_format == "build_tables": - #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "True": - --checklist ERC000033 - #end if - #else: - --checklist $action_options.input_format_conditional.checklist_id - #end if -#end if -#if $action_options.idempotent == "True": - --auto_action + --checklist $action_options.input_format_conditional.checklist_id #end if #if $action_options.test_submit_parameters.submit_dev == "True": -d #end if - >> '$output'; -#end if - +>> '$output'; -#if $action_options.action == "modify": - ena-upload-cli - --tool 'ena-upload-cli v@TOOL_VERSION@ @ Galaxy' - --action '$action_options.action' - --center '$action_options.center' - --secret \${credentials_path} - --data - #for $dataset in $files_to_upload: - '$dataset' - #end for -#if $action_options.test_submit_parameters.dry_run == "True": - --draft -#end if -#if $action_options.input_format_conditional.input_format != "excel_tables": - --experiment '$experiments_table_path' - --study '$studies_table_path' - --run '$runs_table_path' - --sample '$samples_table_path' -#else - --xlsx ./xlsx_input.xlsx - --auto_action -#end if ---action 'modify' -#if $action_options.input_format_conditional.input_format == "user_generated_tables": - --checklist $action_options.input_format_conditional.checklist_id -#else: - #if $action_options.input_format_conditional.input_format == "build_tables": - #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "True": - --checklist ERC000033 - #end if - #else: - --checklist $action_options.input_format_conditional.checklist_id - #end if -#end if - >> '$output'; -#end if - #if $action_options.test_submit_parameters.dry_run == "False": - echo -e 'center_name\t$action_options.center' >> '$output'; + echo -e 'center_name\t$action_options.test_submit_parameters.center' >> '$output'; echo -e 'action_option\t$action_options.action' >> '$output'; #end if ## copy updated files -#if $action_options.input_format_conditional.input_format == "excel_tables": - ## for the excel input case, copy the upload-cli generated tables to the output files +#if $action_options.input_format_conditional.input_format == "excel_tables" or $action_options.input_format_conditional.input_format == "isa_json": + ## for the excel/ISA json input case, copy the upload-cli generated tables to the output files ## this applies for both draft and real submissions cp './ENA_template_experiment_updated.tsv' $experiments_table_out; cp './ENA_template_sample_updated.tsv' $samples_table_out; @@ -321,35 +282,34 @@ <inputs> <conditional name="action_options"> <param name="action" type="select" label="Action to execute"> - <option value="add" selected="True">Add new data</option> + <option value="add" selected="True">Add new (meta)data</option> <option value="modify">Modify metadata</option> </param> <when value="add"> - <param type="boolean" name="idempotent" checked="False" label="Idempotent submissions: only add the elements that were not submitted before" help="NOTE: this feature is based on a beta parameter of the CLI that checks the remote ENA repository for entries using the alias. This remote detection can have False positives, i.e assumes that it's present in the repository but it's not"/> - <expand macro="test_submit_section"/> + <param name="test_submit" type="hidden" value="False" /> + <expand macro="table_inputs_macro" /> + <expand macro="test_submit_section"/> + </when> + <when value="modify"> <param name="test_submit" type="hidden" value="False" /> <expand macro="table_inputs_macro" /> - </when> - <when value="modify"> - <expand macro="test_submit_section"/> - <param name="test_submit" type="hidden" value="False" /> - <expand macro="table_inputs_macro" /> + <expand macro="test_submit_section"/> </when> </conditional> </inputs> <outputs> <data name="output" format="txt" label="ENA submission receipt"/> <data name="studies_table_out" format="tabular" label="Studies table"> - <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter> + <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables" or action_options['input_format_conditional']['input_format'] == "isa_json"</filter> </data> <data name="samples_table_out" format="tabular" label="Samples table"> - <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter> + <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables" or action_options['input_format_conditional']['input_format'] == "isa_json"</filter> </data> <data name="experiments_table_out" format="tabular" label="Experiments table"> - <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter> + <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables" or action_options['input_format_conditional']['input_format'] == "isa_json"</filter> </data> <data name="runs_table_out" format="tabular" label="Runs table"> - <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables"</filter> + <filter> action_options['input_format_conditional']['input_format'] == "build_tables" or action_options['input_format_conditional']['input_format'] == "excel_tables" or action_options['input_format_conditional']['input_format'] == "isa_json"</filter> </data> </outputs> <tests> @@ -358,6 +318,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -372,7 +333,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <output name="experiments_table_out"> <assert_contents> <has_n_lines n="5"/> @@ -408,6 +368,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -422,7 +383,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <output name="experiments_table_out"> <assert_contents> <has_n_lines n="5"/> @@ -468,6 +428,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -482,7 +443,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <output name="experiments_table_out"> <assert_contents> <has_n_lines n="2"/> @@ -518,6 +478,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="False" /> </section> @@ -541,22 +502,21 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <assert_command> <has_text_matching expression="ena-upload-cli"/> <has_text_matching expression="--data 'paired_run_name_1.fastq.gz' 'paired_run_name_2.fastq.gz'"/> <has_text_matching expression="--action 'add' --center 'Some research center'"/> </assert_command> </test> - <!--Test 4b: failure on excel input of NON-VIRAL samples with runs PAIRED collection + Idempotent submission --> + <!--Test 4b: failure on excel input of NON-VIRAL samples with runs PAIRED collection --> <test expect_failure="True"> <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="False" /> </section> - <param name="idempotent" value="True"/> <conditional name="input_format_conditional"> <param name="add_extension" value="True"/> <param name="input_format" value="excel_tables"/> @@ -577,12 +537,10 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <assert_command> <has_text_matching expression="ena-upload-cli"/> <has_text_matching expression="--data 'paired_run_name_1.fastq.gz' 'paired_run_name_2.fastq.gz'"/> <has_text_matching expression="--action 'add' --center 'Some research center'"/> - <has_text_matching expression="--auto_action"/> </assert_command> </test> <!--Test 5: build tables from user input fields NON-VIRAL samples--> @@ -590,6 +548,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -630,7 +589,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <output name="experiments_table_out"> <assert_contents> <has_n_lines n="2"/> @@ -664,6 +622,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="True" /> <param name="dry_run" value="True" /> </section> @@ -706,7 +665,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <assert_command> <has_text_matching expression="ena-upload-cli"/> <has_text_matching expression="--data '1.fastqsanger.gz' '2.fastqsanger.gz'"/> @@ -719,6 +677,7 @@ <conditional name="action_options"> <param name="action" value="add"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -769,7 +728,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <assert_command> <has_text_matching expression="ena-upload-cli"/> <has_text_matching expression="--data '1.fastqsanger.gz' '2.fastqsanger.gz'"/> @@ -782,6 +740,7 @@ <conditional name="action_options"> <param name="action" value="modify"/> <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> <param name="submit_dev" value="False" /> <param name="dry_run" value="True" /> </section> @@ -832,7 +791,6 @@ </conditional> </conditional> </conditional> - <param name="center" value="Some research center"/> <assert_command> <has_text_matching expression="ena-upload-cli"/> <has_text_matching expression="--data '1.fastqsanger.gz' '2.fastqsanger.gz'"/> @@ -841,11 +799,60 @@ <not_has_text text="add" /> </assert_command> </test> + <!--Test 9: isa JSON input of NON-VIRAL samples--> + <test expect_num_outputs="5"> + <conditional name="action_options"> + <param name="action" value="add"/> + <section name="test_submit_parameters"> + <param name="center" value="Some research center"/> + <param name="submit_dev" value="True" /> + <param name="dry_run" value="True" /> + </section> + <conditional name="input_format_conditional"> + <param name="input_format" value="isa_json"/> + <param name="isa_json_file" value="simple_test_case_v2.json"/> + <param name="isa_assay_stream" value="Ena stream 1"/> + <conditional name="run_input_format_conditional"> + <param name="add_extension" value="False"/> + <param name="run_input_format" value="multiple_selection_list"/> + <param name="data" value="ENA_TEST1.R1.fastq.gz,ENA_TEST2.R1.fastq.gz,ENA_TEST2.R2.fastq.gz"/> + </conditional> + </conditional> + </conditional> + <output name="experiments_table_out"> + <assert_contents> + <has_n_lines n="4"/> + <has_n_columns n="17"/> + <has_line_matching expression="alias\tstudy_alias\tsample_alias\tlibrary_name\ttitle\taccession\tsubmission date\tstatus\tdesign_description\tlibrary_source\tlibrary_strategy\tlibrary_selection\tlibrary_layout\tinsert_size\tplatform\tinstrument_model\tsubmission_date"/> + </assert_contents> + </output> + <output name="studies_table_out"> + <assert_contents> + <has_n_lines n="2"/> + <has_n_columns n="9"/> + <has_line_matching expression="alias\ttitle\tstudy_type\tstudy_abstract\tnew_study_type\tpubmed_id\taccession\tsubmission_date\tstatus"/> + </assert_contents> + </output> + <output name="samples_table_out"> + <assert_contents> + <has_n_lines n="3"/> + <has_n_columns n="11"/> + </assert_contents> + </output> + <output name="runs_table_out"> + <assert_contents> + <has_n_lines n="4"/> + <has_n_columns n="10"/> + <has_line_matching expression="alias\texperiment_alias\tfile_name\tfile_type\tfile checksum\taccession\tsubmission date\tstatus\tsubmission_date\tfile_checksum"/> + </assert_contents> + </output> + </test> </tests> - <help><![CDATA[ - This is a wrapper for the ENA upload tool in https://github.com/usegalaxy-eu/ena-upload-cli - The input metadata can be submitted following the tabular format of the templates or their excel spreadsheet equivalent in https://github.com/ELIXIR-Belgium/ENA-metadata-templates. This template repo provides ready to use sheets for every ENA sample checklist and is automatically updated. - ]]></help> + <help><![CDATA[This is a wrapper for the ENA upload tool in https://github.com/usegalaxy-eu/ena-upload-cli. The input metadata can be submitted following the tabular format of the templates or their excel spreadsheet equivalent in https://github.com/ELIXIR-Belgium/ENA-metadata-templates. This template repo provides ready to use sheets for every ENA sample checklist and is automatically updated. + + .. class:: warningmark + + The ENA upload tool won't work unless you have provided an ENA Webin ID in User > Preferences > Manage Information > ENA Webin account details.]]></help> <citations> <citation type="doi">doi:10.1093/bioinformatics/btab421</citation> </citations>