diff 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
line wrap: on
line diff
--- a/ena_upload.xml	Wed Aug 18 19:42:49 2021 +0000
+++ b/ena_upload.xml	Tue Oct 19 15:57:14 2021 +0000
@@ -1,6 +1,6 @@
-<tool id="ena_upload" name="ENA Upload tool" version="0.3.3" profile="20.01" license="MIT">
+<tool id="ena_upload" name="ENA Upload tool" version="@VERSION@" profile="20.01" license="MIT">
     <macros>
-        <token name="@VERSION@">0.3.1</token>
+        <token name="@VERSION@">0.4.1</token>
         <import>samples_macros.xml</import>
     </macros>
     <requirements>
@@ -33,6 +33,9 @@
     #if $action_options.input_format_conditional.viral_submission == "true":
         --vir 
     #end if
+    #if $action_options.test_submit_parameters.submit_dev == "true":
+        --dev
+    #end if
     --action '$action_options.action' --form '$action_options.input_format_conditional.xlsx_file' --out_dir ./submission_files --verbose > '$output';
 #end if
 
@@ -84,7 +87,26 @@
           #for $run in $experiment.rep_runs:
             #for $file in $run.upload_files:
                 #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier)
-                ln -s '$file' $safename_reads_file &&
+                #if $action_options.input_format_conditional.add_extension == "true":
+                    #set $extension = '.fastq'
+                #else
+                    #set $extension = ''
+                #end if
+                #if $file.is_of_type('fastq', 'fastqsanger'):
+                    ## compression output is defined as safename_reads_file so no need to symlink
+                    #set $safename_reads_file = $safename_reads_file + $extension + '.gz'
+                    gzip -c '$file' > $safename_reads_file &&
+                #else:
+                    #if $action_options.input_format_conditional.add_extension == "true":
+                        #if $file.is_of_type('fastq.gz', 'fastqsanger.gz'):
+                            #set $compression = '.gz' 
+                        #elif $file.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
+                            #set $compression = '.bz2' 
+                        #end if
+                        #set $safename_reads_file = $safename_reads_file + $extension + $compression 
+                    #end if
+                    ln -s '$file' $safename_reads_file &&
+                #end if
                 $files_to_upload.append(str($safename_reads_file))
             #end for
           #end for
@@ -95,31 +117,61 @@
     #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'paired_list':
         #for $pair in $action_options.input_format_conditional.run_input_format_conditional.paired_end_collection:
             #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $pair.name)
-            #if $pair.forward.is_of_type('fastq.gz', 'fastqsanger.gz'):
-                #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq.gz'
-            #elif $pair.forward.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
-                #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq.bz2'
-            #else:
-                #set $safename_fwd_reads_file = $safename_reads_file + '_1.fastq'
-            #end if
-            #if $pair.reverse.is_of_type('fastq.gz', 'fastqsanger.gz'):
-                #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq.gz'
-            #elif $pair.reverse.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
-                #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq.bz2'
-            #else:
-                #set $safename_rev_reads_file = $safename_reads_file + '_2.fastq'
+            ## Always need to add .fastq + compression suffix because the name is based on the pair name which has no extensions
+            #if $pair.forward.is_of_type('fastq', 'fastqsanger'):
+                ## compress the file, no need to create the link then
+                ## always add the compression suffix (.gz)
+                #set $safename_fwd_reads_file = $safename_reads_file + '_1' + 'fastq' + '.gz'
+                gzip -c '$file' > $safename_fwd_reads_file &&
+            #else
+                #if $pair.forward.is_of_type('fastq.gz', 'fastqsanger.gz'):
+                    #set $compression = '.gz'
+                #elif $pair.forward.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
+                    #set $compression = '.bz2'
+                #end if
+                #set $safename_fwd_reads_file = $safename_reads_file + '_1' + '.fastq' + $compression
+                ln -s '$pair.forward' $safename_fwd_reads_file &&
             #end if
 
-            ln -s '$pair.forward' $safename_fwd_reads_file &&
+            #if $pair.reverse.is_of_type('fastq', 'fastqsanger'):
+                ## compress the file, no need to create the link then
+                #set $safename_reverse_reads_file = $safename_reads_file + '_1' + '.fastq' + '.gz'
+                gzip -c '$file' > $safename_rev_reads_file &&
+            #else
+                #if $pair.reverse.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
+                    #set $compression = '.bz2'
+                #elif $pair.reverse.is_of_type('fastqsanger.gz', 'fastq.gz'):
+                    #set $compression = '.gz'
+                #end if
+                #set $safename_rev_reads_file = $safename_reads_file + '_2' + '.fastq' + $compression
+                ln -s '$pair.reverse' $safename_rev_reads_file &&
+            #end if
             $files_to_upload.append(str($safename_fwd_reads_file))
-            ln -s '$pair.reverse' $safename_rev_reads_file &&
             $files_to_upload.append(str($safename_rev_reads_file))
         #end for
     #end if
     #if $action_options.input_format_conditional.run_input_format_conditional.run_input_format == 'multiple_selection_list':
         #for $file in $action_options.input_format_conditional.run_input_format_conditional.data:
             #set $safename_reads_file = re.sub('[^\w\-_\.]', '_', $file.element_identifier)
-            ln -s '$file' $safename_reads_file &&
+            #if $file.is_of_type('fastq', 'fastqsanger'):
+                ## always compress add the gz extension
+                #if $action_options.input_format_conditional.run_input_format_conditional.add_extension == "true":
+                    #set $safename_reads_file = $safename_reads_file + 'fastq.gz'
+                #else
+                    #set $safename_reads_file = $safename_reads_file + '.gz'
+                #end if   
+                gzip -c '$file' > $safename_reads_file &&
+            #else
+                #if $action_options.input_format_conditional.run_input_format_conditional.add_extension == "true":
+                    #if $file.is_of_type('fastq.gz', 'fastqsanger.gz'):
+                        #set $extension = 'fastq.gz'
+                    #elif $file.is_of_type('fastqsanger.bz2', 'fastq.bz2'):
+                        #set $extension = 'fastq.bz2'
+                    #end if
+                    #set $safename_reads_file = $safename_reads_file + $extension
+                #end if
+                ln -s '$file' $safename_reads_file &&
+            #end if      
             $files_to_upload.append(str($safename_reads_file))
         #end for
     #end if
@@ -127,6 +179,7 @@
 
 
 #if $action_options.test_submit_parameters.dry_run == "false":
+#if $action_options.action == "add":
 ena-upload-cli
     --tool 'ena-upload-cli v@VERSION@ @ Galaxy'
     --action '$action_options.action'
@@ -136,22 +189,23 @@
     #for $dataset in $files_to_upload:
         '$dataset'
     #end for
+--action add
 --experiment '$experiments_table_path'
 --study '$studies_table_path'
 --run '$runs_table_path'
 --sample '$samples_table_path'
 #if $action_options.input_format_conditional.input_format == "user_generated_tables":
     #if "$action_options.input_format_conditional.viral_submission" == "true":
-        --vir
+        --checklist ERC000033
     #end if
 #else:
     #if $action_options.input_format_conditional.input_format == "build_tables":
         #if $action_options.input_format_conditional.conditional_viral_metadata.viral_sample == "true":
-          --vir
+          --checklist ERC000033
         #end if
     #else:
         #if $action_options.input_format_conditional.viral_submission == "true":
-          --vir
+          --checklist ERC000033
         #end if
     #end if
 #end if
@@ -160,6 +214,40 @@
     -d
 #end if
     >> '$output';
+#end if
+
+#if $action_options.action == "modify":
+    ena-upload-cli
+    --tool 'ena-upload-cli v@VERSION@ @ Galaxy'
+    --action '$action_options.action'
+    --center '$action_options.center'
+    --secret \${credentials_path}
+    --data
+    #for $dataset in $files_to_upload:
+        '$dataset'
+    #end for
+--action 'modify'
+--experiment '$experiments_table_path'
+--study '$studies_table_path'
+--run '$runs_table_path'
+--sample '$samples_table_path'
+#if $action_options.input_format_conditional.input_format == "user_generated_tables":
+    #if "$action_options.input_format_conditional.viral_submission" == "true":
+        --checklist ERC000033
+    #end if
+#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:
+        #if $action_options.input_format_conditional.viral_submission == "true":
+          --checklist ERC000033
+        #end if
+    #end if
+#end if
+    >> '$output';
+#end if
     echo -e 'center_name\t$action_options.center' >> '$output';
     echo -e 'action_option\t$action_options.action' >> '$output';
     #if $action_options.input_format_conditional.input_format != "user_generated_tables":
@@ -232,6 +320,7 @@
             </when>
             <when value="modify">
                 <expand macro="test_submit_section"/>    
+                <param name="test_submit" type="hidden" value="False" />
                 <expand macro="table_inputs_macro" />
             </when>
         </conditional>
@@ -252,7 +341,7 @@
         </data>
     </outputs>
     <tests>
-        <!--Test excel input of VIRAL samples -->
+        <!--Test 1:  excel input of VIRAL samples -->
         <test>
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -265,6 +354,7 @@
                     <param name="viral_submission" value="True"/>
                     <param name="xlsx_file" value="metadata_test_viral.xlsx"/>
                     <conditional name="run_input_format_conditional">
+                        <param name="add_extension" value="true"/>
                         <param name="run_input_format" value="multiple_selection_list"/>
                         <param name="data" value="sample.fq"/>
                     </conditional>
@@ -276,7 +366,7 @@
                     <has_n_lines n="5"/>
                     <has_n_columns n="17"/>
                     <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" />
-                    <has_line_matching expression="e_(.*)_026\tadd\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
+                    <has_line_matching expression="e_(.*)_026\tmodify\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
                 </assert_contents>
             </output>
             <output name="studies_table_out">
@@ -284,14 +374,13 @@
                     <has_n_lines n="2"/>
                     <has_n_columns n="8"/>
                     <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/>
-                    <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(.*)"/>
+                    <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(.*)"/>
                 </assert_contents>
             </output>
             <output name="samples_table_out">
                 <assert_contents>
                     <has_n_lines n="5"/>
                     <has_n_columns n="18"/>
-                    <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"/>
                 </assert_contents>
             </output>
             <output name="runs_table_out">
@@ -299,11 +388,11 @@
                     <has_n_lines n="5"/>
                     <has_n_columns n="8"/>
                     <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
-                    <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/>
+                    <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
                 </assert_contents>
             </output>
         </test>
-        <!--Test excel input of VIRAL samples with extended columns-->
+        <!--Test 2: excel input of VIRAL samples with extended columns-->
         <test>
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -316,6 +405,7 @@
                     <param name="viral_submission" value="True"/>
                     <param name="xlsx_file" value="metadata_test_viral_optional_columns.xlsx"/>
                     <conditional name="run_input_format_conditional">
+                        <param name="add_extension" value="true"/>
                         <param name="run_input_format" value="multiple_selection_list"/>
                         <param name="data" value="sample.fq"/>
                     </conditional>
@@ -327,7 +417,7 @@
                     <has_n_lines n="5"/>
                     <has_n_columns n="17"/>
                     <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" />
-                    <has_line_matching expression="e_(.*)_026\tadd\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
+                    <has_line_matching expression="e_(.*)_026\tmodify\taccession_ena\tNanopore sequencing\tSARS-CoV-2_genomes_01\ts_(.*)"/>
                 </assert_contents>
             </output>
             <output name="studies_table_out">
@@ -335,14 +425,13 @@
                     <has_n_lines n="2"/>
                     <has_n_columns n="8"/>
                     <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/>
-                    <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(.*)"/>
+                    <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(.*)"/>
                 </assert_contents>
             </output>
             <output name="samples_table_out">
                 <assert_contents>
                     <has_n_lines n="5"/>
                     <has_n_columns n="42"/>
-                    <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"/>
                 </assert_contents>
             </output>
             <output name="runs_table_out">
@@ -350,11 +439,11 @@
                     <has_n_lines n="5"/>
                     <has_n_columns n="8"/>
                     <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
-                    <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/>
+                    <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
                 </assert_contents>
             </output>
         </test>
-        <!--Test excel input of NON-VIRAL samples-->
+        <!--Test 3: excel input of NON-VIRAL samples-->
         <test>
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -367,6 +456,7 @@
                     <param name="viral_submission" value="False"/>
                     <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/>
                     <conditional name="run_input_format_conditional">
+                        <param name="add_extension" value="true"/>
                         <param name="run_input_format" value="multiple_selection_list"/>
                         <param name="data" value="sample.fq"/>
                     </conditional>
@@ -399,11 +489,11 @@
                     <has_n_lines n="5"/>
                     <has_n_columns n="8"/>
                     <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/>
-                    <has_line_matching expression="r_(.*)_026\tadd\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\tfile_checksum\tsubmission_date_ENA"/>
+                    <has_line_matching expression="r_(.*)_026\tmodify\tena_run_accession\te_(.*)_026\tC026_exp5_clean.fastq.gz\tfastq\t\tsubmission_date_ENA"/>
                 </assert_contents>
             </output>
         </test>
-        <!--Test failure on excel input of NON-VIRAL samples with runs PAIRED collection -->
+        <!--Test 4: 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"/>
@@ -412,6 +502,7 @@
                     <param name="dry_run" value="false" />
                 </section>
                 <conditional name="input_format_conditional">
+                    <param name="add_extension" value="true"/>
                     <param name="input_format" value="excel_tables"/>
                     <param name="viral_submission" value="False"/>
                     <param name="xlsx_file" value="metadata_test_nonviral.xlsx"/>
@@ -437,7 +528,7 @@
                 <has_text_matching expression="--action 'add' --center 'Some research center'"/>
             </assert_command>
         </test>
-        <!--Test build tables from user input fields NON-VIRAL samples-->
+        <!--Test 5: build tables from user input fields NON-VIRAL samples-->
         <test>
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -447,6 +538,7 @@
                 </section>
                 <conditional name="input_format_conditional">
                     <param name="input_format" value="build_tables"/>
+                    <param name="add_extension" value="true"/>
                     <conditional name="conditional_viral_metadata">
                         <param name="viral_sample" value="False"/>
                         <repeat name="rep_study">
@@ -507,7 +599,7 @@
                 </assert_contents>
             </output>
         </test>
-        <!--Test RUN failing build tables from user input fields NON-VIRAL samples-->
+        <!--Test 6: RUN failing build tables from user input fields NON-VIRAL samples-->
         <test expect_failure="true">
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -517,6 +609,7 @@
                 </section>
                 <conditional name="input_format_conditional">
                     <param name="input_format" value="build_tables"/>
+                    <param name="add_extension" value="true"/>
                     <conditional name="conditional_viral_metadata">
                         <param name="viral_sample" value="false"/>
                         <repeat name="rep_study">
@@ -554,7 +647,8 @@
                 <has_text_matching expression="No ENA credentials defined"/>
             </assert_stdout>
         </test>
-        <!--Test with submit_test to skip credentials checksRUN failing build tables from user input fields NON-VIRAL samples-->
+        <!--Test 7: with submit_test to skip credentials checksRUN failing build tables from user input fields NON-VIRAL samples
+            also tests compression of uncompressed inputs and adding the .gz suffix -->
         <test expect_failure="true">
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -564,6 +658,7 @@
                 </section>
                 <param name="test_submit" value="True"/>
                 <conditional name="input_format_conditional">
+                    <param name="add_extension" value="true"/>
                     <param name="input_format" value="build_tables"/>
                     <conditional name="conditional_viral_metadata">
                         <param name="viral_sample" value="false"/>
@@ -590,7 +685,7 @@
                                     <param name="instrument_model" value="Illumina HiSeq 4000"/>
                                     <repeat name="rep_runs">
                                         <param name="run_base_name" value="run_from_hospital_X"/>
-                                        <param name="upload_files" value="1.fastqsanger.gz,sample.fq" ftype="fastqsanger"/>
+                                        <param name="upload_files" value="sample.fq,sample.fq" ftype="fastqsanger"/>
                                     </repeat>
                                 </repeat>
                             </repeat>
@@ -601,14 +696,15 @@
             <param name="center" value="Some research center"/>
             <assert_command>
                 <has_text_matching expression="ena-upload-cli"/>
-                <has_text_matching expression="--data '1.fastqsanger.gz' 'sample.fq'"/>
+                <has_text_matching expression="--data 'sample.fq.fastq.gz' 'sample.fq.fastq.gz'"/>
                 <has_text_matching expression="--action 'add' --center 'Some research center'"/>
+                <not_has_text text="modify" />
             </assert_command>
             <assert_stderr>
                 <has_text_matching expression="Oops, the file test_fake_path does not exist"/>
             </assert_stderr>
         </test>
-        <!--test viral submission - User input metadata-->
+        <!--Test 8: viral submission - User input metadata - Add extension = False-->
         <test expect_failure="true">
             <conditional name="action_options">
                 <param name="action" value="add"/>
@@ -618,6 +714,73 @@
                 </section>
                 <param name="test_submit" value="True"/>
                 <conditional name="input_format_conditional">
+                    <param name="add_extension" value="False"/>
+                    <param name="input_format" value="build_tables"/>
+                    <conditional name="conditional_viral_metadata">
+                        <param name="viral_sample" value="true"/>
+                        <repeat name="rep_study">
+                            <param name="study_title" value="Test study title"/>
+                            <param name="study_abstract" value="Test study abstract"/>
+                            <param name="study_type" value="Epigenetics"/>
+                            <param name="study_pubmed_id" value="Test study pubmedID"/>
+                            <repeat name="rep_sample">
+                                <param name="sample_title" value="Test Sample title"/>
+                                <param name="sample_description" value="Test Sample description"/>
+                                <param name="scientific_name" value="Test Sample scientific name"/>
+                                <param name="tax_id" value="Test Sample tax_id"/>
+                                <param name="collection_date" value="2020"/>
+                                <param name="geo_location_country" value="Belgium"/>
+                                <param name="host_common_name" value="Human"/>
+                                <param name="host_subject_id" value="Patient_001"/>
+                                <param name="host_health_state" value="healthy"/>
+                                <param name="host_sex" value="female"/>
+                                <param name="host_scientific_name" value="homo sapiens"/>
+                                <param name="collector_name" value="John The Collector"/>
+                                <param name="collecting_institution" value="Hospital 01"/>
+                                <param name="isolate" value="sample_001"/>
+                                <repeat name="rep_experiment">
+                                    <param name="experiment_title" value="Test experiment title"/>
+                                    <param name="experiment_design" value="Test experiment design description"/>
+                                    <param name="library_strategy" value="CTS"/>
+                                    <param name="library_source" value="GENOMIC"/>
+                                    <param name="library_selection" value="PCR"/>
+                                    <param name="library_layout" value="SINGLE"/>
+                                    <param name="insert_size" value="150"/>
+                                    <param name="library_construction_protocol" value="Test library construction"/>
+                                    <param name="platform" value="ILLUMINA"/>
+                                    <param name="instrument_model" value="Illumina HiSeq 4000"/>
+                                    <repeat name="rep_runs">
+                                        <param name="run_base_name" value="run_from_hospital_X"/>
+                                        <param name="upload_files" value="1.fastqsanger.gz,2.fastqsanger.gz" ftype="fastqsanger.gz"/>
+                                    </repeat>
+                                </repeat>
+                            </repeat>
+                        </repeat>
+                    </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'"/>
+                <has_text_matching expression="--action 'add' --center 'Some research center'"/>
+                <has_text_matching expression="--checklist ERC000033"/>
+            </assert_command>
+            <assert_stderr>
+                <has_text_matching expression="Oops, the file test_fake_path does not exist"/>
+            </assert_stderr>
+        </test>
+        <!--Test 9: modify option and auto compression - viral submission - User input metadata-->
+        <test expect_failure="true">
+            <conditional name="action_options">
+                <param name="action" value="modify"/>
+                <section name="test_submit_parameters">
+                    <param name="submit_dev" value="false" />
+                    <param name="dry_run" value="false" />
+                </section>
+                <param name="test_submit" value="True"/>
+                <conditional name="input_format_conditional">
+                    <param name="add_extension" value="False"/>
                     <param name="input_format" value="build_tables"/>
                     <conditional name="conditional_viral_metadata">
                         <param name="viral_sample" value="True"/>
@@ -654,7 +817,7 @@
                                     <param name="instrument_model" value="Illumina HiSeq 4000"/>
                                     <repeat name="rep_runs">
                                         <param name="run_base_name" value="run_from_hospital_X"/>
-                                        <param name="upload_files" value="1.fastqsanger.gz,sample.fq" ftype="fastqsanger"/>
+                                        <param name="upload_files" value="sample.fq" ftype="fastqsanger"/>
                                     </repeat>
                                 </repeat>
                             </repeat>
@@ -665,9 +828,10 @@
             <param name="center" value="Some research center"/>
             <assert_command>
                 <has_text_matching expression="ena-upload-cli"/>
-                <has_text_matching expression="--data '1.fastqsanger.gz' 'sample.fq'"/>
-                <has_text_matching expression="--action 'add' --center 'Some research center'"/>
-                <has_text_matching expression="--vir"/>
+                <has_text_matching expression="--data 'sample.fq.gz'"/>
+                <has_text_matching expression="--action 'modify' --center 'Some research center'"/>
+                <has_text_matching expression="--checklist ERC000033"/>
+                <not_has_text text="add" />
             </assert_command>
             <assert_stderr>
                 <has_text_matching expression="Oops, the file test_fake_path does not exist"/>