comparison ena_consensus_submit.xml @ 3:7d751b5943b0 draft default tip

Uploaded
author ieguinoa
date Tue, 22 Feb 2022 11:03:34 +0000
parents 1ecd8ce07db4
children
comparison
equal deleted inserted replaced
2:1ecd8ce07db4 3:7d751b5943b0
49 echo -e 'MINGAPLENGTH\t$min_gap_length' >> $manifest_base; 49 echo -e 'MINGAPLENGTH\t$min_gap_length' >> $manifest_base;
50 #end if 50 #end if
51 echo -e 'MOLECULETYPE\t$molecule_type' >> $manifest_base; 51 echo -e 'MOLECULETYPE\t$molecule_type' >> $manifest_base;
52 52
53 #if $metadata_file_or_form.metadata_format == "file": 53 #if $metadata_file_or_form.metadata_format == "file":
54 #import re
55 #for $file in $metadata_file_or_form.genome_fasta:
56 #if $file.is_of_type('fasta'):
57 #set $full_name = $file.element_identifier + '.gz'
58 gzip -c $file > './fasta/$full_name';
59 #else:
60 ln -s $file './fasta/$file.element_identifier';
61 #end if
62
63 #end for
54 ## process the input tables, this creates an intermediate file with information 64 ## process the input tables, this creates an intermediate file with information
55 python3 '$__tool_directory__/process_input.py' $metadata_file_or_form.ena_receipt $genome_fasta './manifests' './fasta' $manifest_base; 65 python3 '$__tool_directory__/process_input.py' $metadata_file_or_form.ena_receipt $genome_fasta_files './manifests' $manifest_base >> $webin_cli_log;
56 center_name=`grep 'center_name' $metadata_file_or_form.ena_receipt | cut -f2,2 | tr -d '\n'`; 66 center_name=`grep 'center_name' $metadata_file_or_form.ena_receipt | cut -f2,2 | tr -d '\n'`;
57 #else: 67 #else:
58 #set $generated_manifest='./manifests/generated_manifest.txt' 68 #set $generated_manifest='./manifests/generated_manifest.txt'
59 cp $manifest_base $generated_manifest; 69 cp $manifest_base $generated_manifest;
60 #set $study_id = $metadata_file_or_form.study_accession 70 #set $study_id = $metadata_file_or_form.study_accession
62 echo -e 'STUDY\t$study_id' >> $generated_manifest; 72 echo -e 'STUDY\t$study_id' >> $generated_manifest;
63 echo -e 'SAMPLE\t$sample_id' >> $generated_manifest; 73 echo -e 'SAMPLE\t$sample_id' >> $generated_manifest;
64 center_name='$metadata_file_or_form.center_name'; 74 center_name='$metadata_file_or_form.center_name';
65 echo -e 'NAME\t$metadata_file_or_form.assembly_name' >> $generated_manifest; 75 echo -e 'NAME\t$metadata_file_or_form.assembly_name' >> $generated_manifest;
66 echo -e 'PLATFORM\t$metadata_file_or_form.sequencing_platform' >> $generated_manifest; 76 echo -e 'PLATFORM\t$metadata_file_or_form.sequencing_platform' >> $generated_manifest;
77 #if $metadata_file_or_form.genome_fasta.is_of_type('fasta'):
78 gzip -c $metadata_file_or_form.genome_fasta > consensus.fasta.gz;
79 #else:
80 ln -s $metadata_file_or_form.genome_fasta consensus.fasta.gz;
81 #end if
82 echo -e 'FASTA\tconsensus.fasta.gz' >> $generated_manifest;
67 #end if 83 #end if
68 84
69 #set $outputs_dir = 'outputs' 85 #set $outputs_dir = 'outputs'
70 mkdir $outputs_dir; 86 mkdir $outputs_dir;
71 #if $metadata_file_or_form.metadata_format == "file": 87 #if $metadata_file_or_form.metadata_format == "file":
72 ## iterate over the list of manifest - fasta generated by the process_input 88 ## iterate over the list of manifest - fasta generated by the process_input
73 ## in case of errors, this list is empty 89 ## in case of errors, this list is empty
74 while read line; do 90 while read line; do
75 manifest=`echo \$line | cut -d' ' -f1,1`; 91 manifest=`echo \$line | cut -d' ' -f1,1`;
92 echo "Submitting manifest \$manifest" >> $webin_cli_log;
76 ena-webin-cli 93 ena-webin-cli
77 -context genome 94 -context genome
78 -userName "'\$webin_id'" 95 -userName "'\$webin_id'"
79 -password "'\$password'" 96 -password "'\$password'"
80 -centerName "'\$center_name'" 97 -centerName "'\$center_name'"
82 -inputDir './fasta' 99 -inputDir './fasta'
83 #if $dry_run == "true": 100 #if $dry_run == "true":
84 -validate 101 -validate
85 #end if 102 #end if
86 -outputDir $outputs_dir 103 -outputDir $outputs_dir
87 >> $webin_cli_log ; 104 >> $webin_cli_log;
88 done < submit_list.tab 105 done < submit_list.tab;
89 106
90 #else: 107 #else:
91 gzip -c $genome_fasta > consensus.fasta.gz;
92 echo -e 'FASTA\tconsensus.fasta.gz' >> $generated_manifest;
93 ena-webin-cli 108 ena-webin-cli
94 #if $submit_test == "true": 109 #if $submit_test == "true":
95 -test 110 -test
96 #end if 111 #end if
97 #if $dry_run == "true": 112 #if $dry_run == "true":
107 -centerName "'\$center_name'" 122 -centerName "'\$center_name'"
108 -outputDir $outputs_dir 123 -outputDir $outputs_dir
109 >> $webin_cli_log ; 124 >> $webin_cli_log ;
110 ##cp ./genome/$metadata_file_or_form.assembly_name/validate/webin-cli.report $validate_output 125 ##cp ./genome/$metadata_file_or_form.assembly_name/validate/webin-cli.report $validate_output
111 #end if 126 #end if
112 tar -cf $webin_cli_outputs $outputs_dir; 127 tar -cf $webin_cli_outputs $outputs_dir ;
113 ]]></command> 128 ]]></command>
114 <configfiles> 129 <configfiles>
115 <configfile name="credentials"><![CDATA[ 130 <configfile name="credentials"><![CDATA[
116 #set $webin_id = $__user__.extra_preferences.get('ena_webin_account|webin_id', "").strip() 131 #set $webin_id = $__user__.extra_preferences.get('ena_webin_account|webin_id', "").strip()
117 #set $password = $__user__.extra_preferences.get('ena_webin_account|password', "").strip() 132 #set $password = $__user__.extra_preferences.get('ena_webin_account|password', "").strip()
119 username:$webin_id 134 username:$webin_id
120 password:$password 135 password:$password
121 #end if 136 #end if
122 137
123 ]]></configfile> 138 ]]></configfile>
139 <configfile name="genome_fasta_files">
140 #import json
141 #import re
142 #if $metadata_file_or_form.metadata_format == "file":
143 #set $fasta_files_list = list()
144 #for $file in $metadata_file_or_form.genome_fasta:
145 $fasta_files_list.append(str($file.element_identifier))
146 #end for
147 #echo json.dumps($fasta_files_list)
148 #end if
149 </configfile>
124 </configfiles> 150 </configfiles>
125 <inputs> 151 <inputs>
126 <param name="test_submit" type="hidden" value="False" /> 152 <param name="test_submit" type="hidden" value="False" />
127 <param name="submit_test" type="boolean" truevalue="true" falsevalue="false" label="Submit to test server" help="use Webin test service instead of the production service. Please note that the Webin upload area is shared between test and production services, and that test submission files will not be archived." /> 153 <param name="submit_test" type="boolean" truevalue="true" falsevalue="false" label="Submit to test server" help="use Webin test service instead of the production service. Please note that the Webin upload area is shared between test and production services, and that test submission files will not be archived." />
128 <param name="dry_run" type="boolean" truevalue="true" falsevalue="false" label="Validate files and metadata but do not submit" help="Generate input files and run Webin-CLI with -validate option. If 'No' is selected then it will validate and submit (-submit flag)"/> 154 <param name="dry_run" type="boolean" truevalue="true" falsevalue="false" label="Validate files and metadata but do not submit" help="Generate input files and run Webin-CLI with -validate option. If 'No' is selected then it will validate and submit (-submit flag)"/>
129 <param name="genome_fasta" type="data" label="Select the consensus sequence assembly file" format="fasta"/>
130 <param name="assembly_type" type="select" label="Assembly type"> 155 <param name="assembly_type" type="select" label="Assembly type">
131 <option value="clone">Clone</option> 156 <option value="clone">Clone</option>
132 <option value="isolate">Isolate</option> 157 <option value="isolate">Isolate</option>
158 <option value="COVID-19 outbreak">COVID-19 outbreak</option>
133 </param> 159 </param>
134 <param name="assembly_program" type="text" optional="False" label="Assembly program"/> 160 <param name="assembly_program" type="text" optional="False" label="Assembly program"/>
135 <param name="molecule_type" type="select" label="Molecule type"> 161 <param name="molecule_type" type="select" label="Molecule type">
136 <option value="genomic RNA" selected="True">genomic RNA</option> 162 <option value="genomic RNA" selected="True">genomic RNA</option>
137 <option value="viral cRNA">viral cRNA</option> 163 <option value="viral cRNA">viral cRNA</option>
143 <option value="form" selected="True">Fill in required submission metadata</option> 169 <option value="form" selected="True">Fill in required submission metadata</option>
144 <option value="file">(Beta) I used the Galaxy ENA upload tool to submit the raw data: parse the received submission receipt</option> 170 <option value="file">(Beta) I used the Galaxy ENA upload tool to submit the raw data: parse the received submission receipt</option>
145 </param> 171 </param>
146 <when value="file"> 172 <when value="file">
147 <param type="data" format="txt" name="ena_receipt" label="Submission receipt obtained from ENA upload tool"/> 173 <param type="data" format="txt" name="ena_receipt" label="Submission receipt obtained from ENA upload tool"/>
174 <param name="genome_fasta" type="data" label="Select the consensus sequence assembly files or a collection of them" format="fasta,fasta.gz" multiple="true"/>
148 </when> 175 </when>
149 <when value="form"> 176 <when value="form">
150 <param name="assembly_name" type="text" optional="False" label="Assembly name"/> 177 <param name="assembly_name" type="text" optional="False" label="Assembly name"/>
151 <param name="study_accession" type="text" optional="False" label="Study accession or unique name (alias)"/> 178 <param name="study_accession" type="text" optional="False" label="Study accession"/>
152 <param name="sample_accession" type="text" optional="False" label="Sample accession or unique name (alias)"/> 179 <param name="sample_accession" type="text" optional="False" label="Sample accession"/>
153 <param name="sequencing_platform" type="text" optional="False" label="Sequencing platform"/> 180 <param name="sequencing_platform" type="text" optional="False" label="Sequencing platform"/>
154 <param name="description" type="text" optional="True" value="" label="Description" help="Free text description of the genome assembly (optional)"/> 181 <param name="description" type="text" optional="True" value="" label="Description" help="Free text description of the genome assembly (optional)"/>
155 <param name="center_name" type="text" optional="False" label="Center name"/> 182 <param name="center_name" type="text" optional="False" label="Center name"/>
183 <param name="genome_fasta" type="data" label="Select the consensus sequence assembly file" format="fasta,fasta.gz"/>
156 </when> 184 </when>
157 </conditional> 185 </conditional>
158 <param name="min_gap_length" type="text" optional="True" label="Minimum gap length (optional)"/> 186 <param name="min_gap_length" type="text" optional="True" label="Minimum gap length (optional)"/>
159 </inputs> 187 </inputs>
160 <outputs> 188 <outputs>
168 <tests> 196 <tests>
169 <test> 197 <test>
170 <param name="submit_test" value="true" /> 198 <param name="submit_test" value="true" />
171 <param name="dry_run" value="true" /> 199 <param name="dry_run" value="true" />
172 <param name="test_submit" value="True" /> 200 <param name="test_submit" value="True" />
173 <param name="genome_fasta" value="phiX2.fasta"/>
174 <param name="assembly_type" value="isolate"/> 201 <param name="assembly_type" value="isolate"/>
175 <param name="assembly_program" value="Test assembly program"/> 202 <param name="assembly_program" value="Test assembly program"/>
176 <param name="molecule_type" value="viral cRNA"/> 203 <param name="molecule_type" value="viral cRNA"/>
177 <param name="coverage" value="10000"/> 204 <param name="coverage" value="10000"/>
178 <conditional name="metadata_file_or_form"> 205 <conditional name="metadata_file_or_form">
181 <param name="study_accession" value="PRJEB49173"/> 208 <param name="study_accession" value="PRJEB49173"/>
182 <param name="sample_accession" value="SAMEA11953908"/> 209 <param name="sample_accession" value="SAMEA11953908"/>
183 <param name="sequencing_platform" value="Nanopore 0011"/> 210 <param name="sequencing_platform" value="Nanopore 0011"/>
184 <param name="description" value="Test Description"/> 211 <param name="description" value="Test Description"/>
185 <param name="center_name" value="Test center name"/> 212 <param name="center_name" value="Test center name"/>
213 <param name="genome_fasta" value="phiX2.fasta"/>
186 </conditional> 214 </conditional>
187 <param name="min_gap_length" value="30"/> 215 <param name="min_gap_length" value="30"/>
188 <output name="webin_cli_log"> 216 <output name="webin_cli_log">
189 <assert_contents> 217 <assert_contents>
190 <has_n_lines n="4"/> 218 <has_n_lines n="4"/>
191 <has_text_matching expression="ERROR: Invalid submission account user name or password."/> 219 <has_text_matching expression="ERROR: Invalid submission account user name or password."/>
192 </assert_contents> 220 </assert_contents>
193 </output> 221 </output>
194 </test> 222 </test>
223 <test>
224 <param name="submit_test" value="true" />
225 <param name="dry_run" value="true" />
226 <param name="test_submit" value="True" />
227 <param name="assembly_type" value="isolate"/>
228 <param name="assembly_program" value="Test assembly program"/>
229 <param name="molecule_type" value="viral cRNA"/>
230 <param name="coverage" value="10000"/>
231 <conditional name="metadata_file_or_form">
232 <param name="metadata_format" value="file"/>
233 <param name="ena_receipt" value="receipt_sample_noPhiX.txt"/>
234 <param name="genome_fasta" value="phiX2.fasta.gz,sample_alias_001.fasta.gz"/>
235 </conditional>
236 <param name="min_gap_length" value="30"/>
237 <output name="webin_cli_log">
238 <assert_contents>
239 <has_text_matching expression="Processing phiX2"/>
240 <has_text_matching expression="No metadata found for sample phiX2"/>
241 <has_text_matching expression="Processing sample_alias_001"/>
242 <has_text_matching expression="Submitting manifest ./manifests/sample_alias_001.manifest.txt"/>
243 <has_text_matching expression="ERROR: Invalid submission account user name or password. Please try enclosing your password in single quotes."/>
244 </assert_contents>
245 </output>
246 </test>
247 <test>
248 <param name="submit_test" value="true" />
249 <param name="dry_run" value="true" />
250 <param name="test_submit" value="True" />
251 <param name="assembly_type" value="isolate"/>
252 <param name="assembly_program" value="Test assembly program"/>
253 <param name="molecule_type" value="viral cRNA"/>
254 <param name="coverage" value="10000"/>
255 <conditional name="metadata_file_or_form">
256 <param name="metadata_format" value="file"/>
257 <param name="ena_receipt" value="receipt_sample.txt"/>
258 <param name="genome_fasta" value="sample_alias_001.fasta.gz"/>
259 </conditional>
260 <param name="min_gap_length" value="30"/>
261 <output name="webin_cli_log">
262 <assert_contents>
263 <has_text_matching expression="ERROR: Invalid submission account user name or password. Please try enclosing your password in single quotes."/>
264 </assert_contents>
265 </output>
266 </test>
195 </tests> 267 </tests>
196 <help><![CDATA[ 268 <help><![CDATA[
197 TODO: Fill in help. 269 This tool is a wrapper for the ENA Webin CLI submission tool (https://ena-docs.readthedocs.io/en/latest/submit/general-guide/webin-cli.html).
198 ]]></help> 270 ]]></help>
199 </tool> 271 </tool>