comparison ena_webin_cli.xml @ 1:93fac0ae859f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/ena_webin_cli commit abb15194a196267142d88b9348facf9e85e601ef
author iuc
date Mon, 06 Oct 2025 12:13:19 +0000
parents c9f87770ba8f
children 361a6693aa25
comparison
equal deleted inserted replaced
0:c9f87770ba8f 1:93fac0ae859f
1 <tool id="ena_webin_cli" name="ENA Webin CLI" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="MIT" profile="24.2"> 1 <tool id="ena_webin_cli" name="ENA Webin CLI" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="MIT" profile="24.2">
2 <description>Submission of consensus sequences to the European Nucleotide Archive (ENA)</description> 2 <description>Submission of consensus sequences to the European Nucleotide Archive (ENA)</description>
3 <macros> 3 <macros>
4 <token name="@TOOL_VERSION@">8.1.1</token> 4 <token name="@TOOL_VERSION@">9.0.1</token>
5 <token name="@VERSION_SUFFIX@">0</token> 5 <token name="@VERSION_SUFFIX@">0</token>
6 </macros> 6 </macros>
7 <requirements> 7 <requirements>
8 <requirement type="package" version="@TOOL_VERSION@">ena-webin-cli</requirement> 8 <requirement type="package" version="@TOOL_VERSION@">ena-webin-cli</requirement>
9 <requirement type="package" version="1.76">biopython</requirement>
10 <requirement type="package" version="5.3">pyyaml</requirement> 9 <requirement type="package" version="5.3">pyyaml</requirement>
11 </requirements> 10 </requirements>
11
12 <command detect_errors="exit_code"><![CDATA[ 12 <command detect_errors="exit_code"><![CDATA[
13 #if $dry_run == "True": 13 ## -----------------------------------------------------------------------------
14 #set $credentials='./test_fake_path'; 14 ## 1) Initialize log and credentials
15 ## -----------------------------------------------------------------------------
16
17 ## Truncate (or create) the Galaxy-captured Webin-CLI log dataset.
18 : > "$webin_cli_log";
19
20 ## Default path where the <configfile name="credentials"> content will be written.
21 ## In dry-run we override this with a fake file so tests don’t require real creds.
22 #set $credentials = 'credentials'
23 #if $dry_run == "true":
24 #set $credentials = './test_fake_path'
15 touch $credentials; 25 touch $credentials;
16 echo "username:test_user" >> $credentials; 26 echo "username:test_user" >> "$credentials";
17 echo "password:test_password" >> $credentials; 27 echo "password:test_password" >> "$credentials";
18 #end if 28 #end if
19 29
30 ## Extract username/password from the credentials file.
31 ## NOTE: $webin_id appears in bash, so we escape it as \$webin_id.
20 webin_id=`grep 'username' $credentials | cut -d':' -f2,2`; 32 webin_id=`grep 'username' $credentials | cut -d':' -f2,2`;
21 if [ "\$webin_id" = "" ]; then 33 if [ -z "\$webin_id" ]; then
22 ## No credentials in user defined preferences 34 ## Fail early with guidance if no username is present.
23 ## Fallback to global defined credentials (if exist) 35 echo "No ENA credentials defined. Set your credentials via: User -> Preferences -> Manage Information" >&2;
24 #import os 36 exit 1;
25 #if os.path.isfile(os.environ.get('GALAXY_ENA_SECRETS', '')):
26 credentials_path=\${GALAXY_ENA_SECRETS};
27 webin_id=`grep 'username' \$GALAXY_ENA_SECRETS | cut -d':' -f2,2` | sed -e 's/^[[:space:]]*//'`;
28 password=`grep 'password' \$GALAXY_ENA_SECRETS | cut -d':' -f2,2` | sed -e 's/^[[:space:]]*//'`;
29 if [ "\$webin_id" = "" ]; then
30 echo "No global credentials defined. Check your GALAXY_ENA_SECRETS file or set your credentials via: User -> Preferences -> Manage Information";
31 exit 1;
32 fi;
33 #else:
34 echo "No ENA credentials defined. Set your credentials via: User -> Preferences -> Manage Information";
35 exit 1;
36 #end if
37 else 37 else
38 ## Pull the password similarly.
38 password=`grep 'password' $credentials | cut -d':' -f2,2`; 39 password=`grep 'password' $credentials | cut -d':' -f2,2`;
39 fi; 40 fi;
40 41
41 42 ## -----------------------------------------------------------------------------
42 ## create a manifest base file with the parameters that are identical for all sequences that will be submited (if submitting a multifasta) 43 ## 2) Create a base manifest (fields common to all submissions)
44 ## -----------------------------------------------------------------------------
45
46 ## Name of the base manifest template (we append more fields later).
43 #set $manifest_base = 'manifest_base.tab' 47 #set $manifest_base = 'manifest_base.tab'
44 mkdir manifests; 48
45 mkdir fasta; 49 ## Working dirs: per-sample manifests and input sequences.
46 50 mkdir -p manifests;
51 mkdir -p fasta;
52
53 ## Write assembly-level fields to the base manifest.
47 echo -e 'ASSEMBLY_TYPE\t$assembly_type' > $manifest_base; 54 echo -e 'ASSEMBLY_TYPE\t$assembly_type' > $manifest_base;
48 echo -e 'COVERAGE\t$coverage' >> $manifest_base; 55 echo -e 'COVERAGE\t$coverage' >> $manifest_base;
49 echo -e 'PROGRAM\t$assembly_program' >> $manifest_base; 56 echo -e 'PROGRAM\t$assembly_program' >> $manifest_base;
50 #if $min_gap_length: 57 #if $min_gap_length:
51 echo -e 'MINGAPLENGTH\t$min_gap_length' >> $manifest_base; 58 echo -e 'MINGAPLENGTH\t$min_gap_length' >> $manifest_base;
52 #end if 59 #end if
53 echo -e 'MOLECULETYPE\t$molecule_type' >> $manifest_base; 60 echo -e 'MOLECULETYPE\t$molecule_type' >> $manifest_base;
54 61
62 ## -----------------------------------------------------------------------------
63 ## 3) Build per-sample manifests depending on metadata workflow
64 ## -----------------------------------------------------------------------------
65
55 #if $metadata_file_or_form.metadata_format == "file": 66 #if $metadata_file_or_form.metadata_format == "file":
67 ## --------------------------- FILE-DRIVEN WORKFLOW ------------------------
68 ## For each selected FASTA:
69 ## - if uncompressed (.fasta), gzip it into ./fasta/<name>.fasta.gz
70 ## - if already .fasta.gz, symlink it into ./fasta
56 #import re 71 #import re
57 #for $file in $metadata_file_or_form.genome_fasta: 72 #for $file in $metadata_file_or_form.genome_fasta:
58 #if $file.is_of_type('fasta'): 73 #if $file.is_of_type('fasta'):
59 #set $full_name = $file.element_identifier + '.gz' 74 #set $full_name = $file.element_identifier + '.gz'
60 gzip -c '$file' > './fasta/$full_name'; 75 gzip -c '$file' > './fasta/$full_name';
61 #else: 76 #else:
62 ln -s '$file' './fasta/$file.element_identifier'; 77 ln -s '$file' './fasta/$file.element_identifier';
63 #end if 78 #end if
64
65 #end for 79 #end for
66 ## process the input tables, this creates an intermediate file with information 80
67 python3 '$__tool_directory__/process_input.py' $metadata_file_or_form.ena_receipt $genome_fasta_files './manifests' $manifest_base >> $webin_cli_log; 81 ## Optionally link AGP and chromosome list files if provided (one per sample).
82 #if $metadata_file_or_form.agp_file:
83 #for $file in $metadata_file_or_form.agp_file:
84 ln -s '$file' './fasta/$file.element_identifier';
85 #end for
86 #end if
87 #if $metadata_file_or_form.chr_list_file:
88 #for $file in $metadata_file_or_form.chr_list_file:
89 #set $chr_name = $file.element_identifier + '.gz'
90 gzip -c '$file' > './fasta/$chr_name';
91 #end for
92 #end if
93
94 ## Helper script:
95 ## - parses ENA receipt (study/sample accessions, platform),
96 ## - writes per-sample manifests into ./manifests using $manifest_base,
97 ## - emits "submit_list.tab" (one manifest path per line).
98 python3 '$__tool_directory__/process_input.py' $metadata_file_or_form.ena_receipt $genome_fasta_files './manifests' $manifest_base >> "$webin_cli_log" 2>&1;
99
100 ## Extract center name from the receipt (used as -centerName).
68 center_name=`grep 'center_name' $metadata_file_or_form.ena_receipt | cut -f2,2 | tr -d '\n'`; 101 center_name=`grep 'center_name' $metadata_file_or_form.ena_receipt | cut -f2,2 | tr -d '\n'`;
102
103 ## Log if submit_list.tab exists, and dump its content for debugging.
104 if [ -s submit_list.tab ]; then
105 echo "submit_list.tab present:" >> "$webin_cli_log" 2>&1;
106 cat submit_list.tab >> "$webin_cli_log" 2>&1;
107 else
108 echo "submit_list.tab is missing or empty" >> "$webin_cli_log" 2>&1;
109 fi;
110
69 #else: 111 #else:
112 ## --------------------------- FORM-DRIVEN WORKFLOW ------------------------
113 ## Single-manifest flow: copy base, then append form fields.
70 #set $generated_manifest='./manifests/generated_manifest.txt' 114 #set $generated_manifest='./manifests/generated_manifest.txt'
71 cp $manifest_base $generated_manifest; 115 cp $manifest_base $generated_manifest;
116
117 ## Use local Cheetah vars for readability.
72 #set $study_id = $metadata_file_or_form.study_accession 118 #set $study_id = $metadata_file_or_form.study_accession
73 #set $sample_id = $metadata_file_or_form.sample_accession 119 #set $sample_id = $metadata_file_or_form.sample_accession
120
121 ## Required accessions.
74 echo -e 'STUDY\t$study_id' >> $generated_manifest; 122 echo -e 'STUDY\t$study_id' >> $generated_manifest;
75 echo -e 'SAMPLE\t$sample_id' >> $generated_manifest; 123 echo -e 'SAMPLE\t$sample_id' >> $generated_manifest;
124
125 ## center_name is given by the user in this path.
76 center_name='$metadata_file_or_form.center_name'; 126 center_name='$metadata_file_or_form.center_name';
127
128 ## Assembly name and platform.
77 echo -e 'NAME\t$metadata_file_or_form.assembly_name' >> $generated_manifest; 129 echo -e 'NAME\t$metadata_file_or_form.assembly_name' >> $generated_manifest;
78 echo -e 'PLATFORM\t$metadata_file_or_form.sequencing_platform' >> $generated_manifest; 130 echo -e 'PLATFORM\t$metadata_file_or_form.sequencing_platform' >> $generated_manifest;
131
132 ## Normalize FASTA name referenced by the manifest.
79 #if $metadata_file_or_form.genome_fasta.is_of_type('fasta'): 133 #if $metadata_file_or_form.genome_fasta.is_of_type('fasta'):
80 gzip -c $metadata_file_or_form.genome_fasta > consensus.fasta.gz; 134 #set $fasta_file_name = $metadata_file_or_form.genome_fasta.element_identifier + '.gz'
135 gzip -c '$metadata_file_or_form.genome_fasta' > $fasta_file_name;
81 #else: 136 #else:
82 ln -s $metadata_file_or_form.genome_fasta consensus.fasta.gz; 137 #set $fasta_file_name = $metadata_file_or_form.genome_fasta.element_identifier
83 #end if 138 #end if
84 echo -e 'FASTA\tconsensus.fasta.gz' >> $generated_manifest; 139 echo -e 'FASTA\t$fasta_file_name' >> $generated_manifest;
85 #end if 140
86 141 ## Optional extras for chromosome-scale assemblies.
142 #if $metadata_file_or_form.agp_file:
143 echo -e 'AGP\t$metadata_file_or_form.agp_file.element_identifier' >> $generated_manifest;
144 #end if
145 #if $metadata_file_or_form.chr_list_file:
146 ## If the name ends with .tsv, gzip it and reference the .gz; else use as-is.
147 #set $chr_file_name = $metadata_file_or_form.chr_list_file.element_identifier + '.gz'
148 gzip -c '$metadata_file_or_form.chr_list_file' > $chr_file_name;
149 echo -e 'CHROMOSOME_LIST\t$chr_file_name' >> $generated_manifest;
150 #end if
151 #end if
152
153 ## -----------------------------------------------------------------------------
154 ## 4) Prepare output directory and build CLI flags safely with Cheetah
155 ## -----------------------------------------------------------------------------
156
157 ## Webin-CLI will write receipts/logs under this directory (we later tar it).
87 #set $outputs_dir = 'outputs' 158 #set $outputs_dir = 'outputs'
88 mkdir $outputs_dir; 159 mkdir -p "$outputs_dir";
160
161 ## Build flags using #set (safer than inline #if within a single shell line).
162 #set $test_flag = ''
163 #if $submit_test == "true":
164 #set $test_flag = ' -test'
165 #end if
166
167 ## By default we submit; in dry_run we validate instead.
168 #set $action_flag = ' -submit'
169 #if $dry_run == "true":
170 #set $action_flag = ' -validate'
171 #end if
172
173 ## -----------------------------------------------------------------------------
174 ## 5) Execute Webin-CLI
175 ## -----------------------------------------------------------------------------
176
89 #if $metadata_file_or_form.metadata_format == "file": 177 #if $metadata_file_or_form.metadata_format == "file":
90 ## iterate over the list of manifest - fasta generated by the process_input 178 ## Loop over each manifest written by process_input.py (submit_list.tab).
91 ## in case of errors, this list is empty 179 while IFS= read -r line; do
92 while read line; do 180 ## Extract the manifest path (first whitespace-delimited field).
93 manifest=`echo \$line | cut -d' ' -f1,1`; 181 manifest=`echo "\$line" | cut -d' ' -f1`;
94 echo "Submitting manifest \$manifest" >> $webin_cli_log; 182
95 ena-webin-cli 183 ## Log which manifest we are submitting.
96 -context genome 184 echo "Submitting manifest \$manifest" >> "$webin_cli_log" 2>&1;
97 -userName "'\$webin_id'" 185
98 -password "'\$password'" 186 ## Invoke Webin-CLI with computed flags.
99 -centerName "'\$center_name'" 187 ena-webin-cli -context genome -manifest "\$manifest" -userName "'\$webin_id'" -password "'\$password'" -centerName "'\$center_name'" -inputDir './fasta' $test_flag $action_flag -outputDir $outputs_dir >> '$webin_cli_log' 2>&1 || true;
100 -manifest \$manifest
101 -inputDir './fasta'
102 #if $submit_test == "true":
103 -test
104 #end if
105 #if $dry_run == "true":
106 -validate
107 #else:
108 -submit
109 #end if
110 -outputDir $outputs_dir
111 >> $webin_cli_log;
112 done < submit_list.tab; 188 done < submit_list.tab;
113 189
114 #else: 190 #else:
115 ena-webin-cli 191 ## Single run in "form" mode with the one generated manifest.
116 #if $submit_test == "true": 192 ena-webin-cli -context genome -manifest $generated_manifest -userName "'\$webin_id'" -password "'\$password'" -centerName "'\$center_name'" -inputDir ./ $test_flag $action_flag -outputDir $outputs_dir >> "$webin_cli_log" 2>&1 || true;
117 -test 193 #end if
118 #end if 194
119 #if $dry_run == "true": 195 ## -----------------------------------------------------------------------------
120 -validate 196 ## 6) Package outputs for Galaxy
121 #else: 197 ## -----------------------------------------------------------------------------
122 -submit 198
123 #end if 199 ## Tar up the Webin-CLI output directory so Galaxy can collect a single dataset.
124 -context genome
125 -manifest $generated_manifest
126 -password "'\$password'"
127 -userName "'\$webin_id'"
128 -inputDir "./"
129 -centerName "'\$center_name'"
130 -outputDir $outputs_dir
131 >> $webin_cli_log ;
132 #end if
133 tar -cf $webin_cli_outputs $outputs_dir ; 200 tar -cf $webin_cli_outputs $outputs_dir ;
134 ]]></command> 201 ]]></command>
202
203 <!--
204 Config files rendered by Galaxy *before* the command runs.
205 They are plain text files placed in the job working directory and referenced above.
206 -->
135 <configfiles> 207 <configfiles>
208 <!-- Credentials file:
209 Pulls stored ENA Webin details (if set) from the Galaxy user preferences and writes
210 simple "username:..." and "password:..." lines. The command reads from this file. -->
136 <configfile name="credentials"><![CDATA[ 211 <configfile name="credentials"><![CDATA[
137 #set $webin_id = $__user__.extra_preferences.get('ena_webin_account|webin_id', "").strip() 212 #set $webin_id = $__user__.extra_preferences.get('ena_webin_account|webin_id', "").strip()
138 #set $password = $__user__.extra_preferences.get('ena_webin_account|password', "").strip() 213 #set $password = $__user__.extra_preferences.get('ena_webin_account|password', "").strip()
139 #if $webin_id != "": 214 #if $webin_id != "":
140 username:$webin_id 215 username:$webin_id
141 password:$password 216 password:$password
142 #end if 217 #end if
143
144 ]]></configfile> 218 ]]></configfile>
145 <configfile name="genome_fasta_files"> 219
220 <!-- genome_fasta_files:
221 In "file" mode, build a JSON array containing the *element_identifier* (dataset name)
222 for each selected FASTA. process_input.py uses these names to derive sample aliases. -->
223 <configfile name="genome_fasta_files">
146 #import json 224 #import json
147 #import re 225 #import re
148 #if $metadata_file_or_form.metadata_format == "file": 226 #if $metadata_file_or_form.metadata_format == "file":
149 #set $fasta_files_list = list() 227 #set $fasta_files_list = list()
150 #for $file in $metadata_file_or_form.genome_fasta: 228 #for $file in $metadata_file_or_form.genome_fasta:
152 #end for 230 #end for
153 #echo json.dumps($fasta_files_list) 231 #echo json.dumps($fasta_files_list)
154 #end if 232 #end if
155 </configfile> 233 </configfile>
156 </configfiles> 234 </configfiles>
157 <inputs> 235
158 <param name="assembly_type" type="select" label="Assembly type"> 236 <!--
159 <option value="clone">Clone</option> 237 User-facing inputs:
160 <option value="isolate">Isolate</option> 238 - Assembly-level parameters
161 <option value="COVID-19 outbreak">COVID-19 outbreak</option> 239 - Choice of metadata workflow (file vs form) with corresponding fields
162 </param> 240 - Submission toggles for ENA test server and validation-only
163 <param name="assembly_program" type="text" optional="False" label="Assembly program"/> 241 -->
164 <param name="molecule_type" type="select" label="Molecule type"> 242 <inputs>
165 <option value="genomic RNA" selected="True">genomic RNA</option> 243 <param name="assembly_type" type="select" label="Assembly type">
166 <option value="viral cRNA">viral cRNA</option> 244 <option value="clone">Clone</option>
167 <option value="genomic DNA">genomic DNA</option> 245 <option value="isolate">Isolate</option>
168 </param> 246 <option value="COVID-19 outbreak">COVID-19 outbreak</option>
169 <param name="coverage" type="float" optional="False" value="10000" label="Coverage"/>
170 <param name="min_gap_length" type="text" optional="True" label="Minimum gap length (optional)"/>
171 <conditional name="metadata_file_or_form">
172 <param name="metadata_format" type="select" label="Select the method to load study and sample metadata">
173 <option value="form" selected="True">Fill in required submission metadata</option>
174 <option value="file">I used the Galaxy ENA upload tool to submit the raw data: parse the received submission receipt</option>
175 </param> 247 </param>
176 <when value="file"> 248 <param name="assembly_program" type="text" optional="False" label="Assembly program"/>
177 <param type="data" format="txt" name="ena_receipt" label="Submission receipt obtained from ENA upload tool"/> 249 <param name="molecule_type" type="select" label="Molecule type">
178 <param name="genome_fasta" type="data" label="Select the consensus sequence assembly files or a collection of them" format="fasta,fasta.gz" multiple="true"/> 250 <option value="genomic RNA" selected="True">genomic RNA</option>
179 </when> 251 <option value="viral cRNA">viral cRNA</option>
180 <when value="form"> 252 <option value="genomic DNA">genomic DNA</option>
181 <param name="assembly_name" type="text" optional="False" label="Assembly name"/> 253 </param>
182 <param name="study_accession" type="text" optional="False" label="Study accession"/> 254 <param name="coverage" type="float" optional="False" value="10000" label="Coverage"/>
183 <param name="sample_accession" type="text" optional="False" label="Sample accession"/> 255 <param name="min_gap_length" type="text" optional="True" label="Minimum gap length (optional)"/>
184 <param name="sequencing_platform" type="text" optional="False" label="Sequencing platform"/> 256
185 <param name="description" type="text" optional="True" value="" label="Description" help="Free text description of the genome assembly (optional)"/> 257 <conditional name="metadata_file_or_form">
186 <param name="center_name" type="text" optional="False" label="Center name"/> 258 <param name="metadata_format" type="select" label="Select the method to load study and sample metadata">
187 <param name="genome_fasta" type="data" label="Select the consensus sequence assembly file" format="fasta,fasta.gz"/> 259 <option value="form" selected="True">Fill in required submission metadata</option>
188 </when> 260 <option value="file">I used the Galaxy ENA upload tool to submit the raw data: parse the received submission receipt</option>
189 </conditional> 261 </param>
190 <param name="submit_test" type="boolean" truevalue="true" falsevalue="false" label="Submit to ENA test server" help="Uploads to the test server of ENA will not be made public and will be removed automatically in 24 hours. Performing a preliminary test upload is advised to check for errors with metadata structure. You can find these uploads at https://wwwdev.ebi.ac.uk/ena/." /> 262
191 <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)"/> 263 <!-- FILE workflow: receipt + multiple FASTA (+ optional AGP/TSV) -->
264 <when value="file">
265 <param type="data" format="txt" name="ena_receipt" optional="False" label="Submission receipt obtained from ENA upload tool"/>
266 <param name="genome_fasta" type="data" optional="False" label="Select the consensus sequence assembly files or a collection of them. Use following syntax: sample_alias.fasta or sample_alias.fasta.gz" format="fasta,fasta.gz" multiple="true"/>
267 <param name="agp_file" type="data" optional="True" label="Sequences in AGP format. Use following syntax: sample_alias.agp" format="agp" multiple="true"/>
268 <param name="chr_list_file" type="data" optional="True" label="Chromosome List File, must be provided when the submission contains assembled chromosomes. Use following syntax: sample_alias.tsv" format="tsv" multiple="true"/>
269 </when>
270
271 <!-- FORM workflow: single, user-specified submission -->
272 <when value="form">
273 <param name="assembly_name" type="text" optional="False" label="Assembly name"/>
274 <param name="study_accession" type="text" optional="False" label="Study accession"/>
275 <param name="sample_accession" type="text" optional="False" label="Sample accession"/>
276 <param name="sequencing_platform" type="text" optional="False" label="Sequencing platform"/>
277 <param name="description" type="text" optional="True" value="" label="Description" help="Free text description of the genome assembly (optional)"/>
278 <param name="center_name" type="text" optional="False" label="Center name"/>
279 <param name="genome_fasta" type="data" optional="False" label="Select the consensus sequence assembly file" format="fasta,fasta.gz"/>
280 <param name="agp_file" type="data" optional="True" label="Sequences in AGP format." format="agp"/>
281 <param name="chr_list_file" type="data" optional="True" label="Chromosome List File, must be provided when the submission contains assembled chromosomes." format="tsv"/>
282 </when>
283 </conditional>
284
285 <!-- Submission controls -->
286 <param name="submit_test" type="boolean" truevalue="true" falsevalue="false" label="Submit to ENA test server" help="Uploads to the test server of ENA will not be made public and will be removed automatically in 24 hours. Performing a preliminary test upload is advised to check for errors with metadata structure. You can find these uploads at https://wwwdev.ebi.ac.uk/ena/." />
287 <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)"/>
192 </inputs> 288 </inputs>
289
290 <!--
291 Outputs:
292 - generated_manifests: discovered in manifests/ (via regex) for transparency
293 - webin_cli_log: combined stdout/stderr + helper echo statements
294 - webin_cli_outputs: tar archive of the Webin-CLI output directory
295 -->
193 <outputs> 296 <outputs>
194 <collection name="generated_manifests" type="list" label="Generated manifests"> 297 <collection name="generated_manifests" type="list" label="Generated manifests">
195 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.txt" ext="txt" directory="manifests/"/> 298 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.txt" ext="txt" directory="manifests/"/>
196 </collection> 299 </collection>
197 <data name="webin_cli_log" label="ENA submission log" format="txt"/> 300 <data name="webin_cli_log" label="ENA submission log" format="txt"/>
198 <data name="webin_cli_outputs" label="Webin cli outputs" format="tar"/> 301 <data name="webin_cli_outputs" label="Webin cli outputs" format="tar"/>
199 302
200 </outputs> 303 </outputs>
304
201 <tests> 305 <tests>
306 <!-- Test 1: FORM workflow, no chr/AGP -->
202 <test> 307 <test>
203 <param name="submit_test" value="true" /> 308 <param name="submit_test" value="true" />
204 <param name="dry_run" value="true" /> 309 <param name="dry_run" value="true" />
205 <param name="assembly_type" value="isolate"/> 310 <param name="assembly_type" value="isolate"/>
206 <param name="assembly_program" value="Test assembly program"/> 311 <param name="assembly_program" value="Test assembly program"/>
217 <param name="genome_fasta" value="phiX2.fasta"/> 322 <param name="genome_fasta" value="phiX2.fasta"/>
218 </conditional> 323 </conditional>
219 <param name="min_gap_length" value="30"/> 324 <param name="min_gap_length" value="30"/>
220 <output name="webin_cli_log"> 325 <output name="webin_cli_log">
221 <assert_contents> 326 <assert_contents>
222 <has_n_lines n="4"/> 327 <has_text_matching expression="ERROR: Invalid submission account user name or password\."/>
223 <has_text_matching expression="ERROR: Invalid submission account user name or password."/>
224 </assert_contents> 328 </assert_contents>
225 </output> 329 </output>
330 <output_collection name="generated_manifests">
331 <element name="generated_manifest">
332 <assert_contents>
333 <has_text_matching expression="(?m)^FASTA\tphiX2\.fasta\.gz$"/>
334 <has_text_matching expression="(?m)^CHROMOSOME_LIST\t" negate="true"/>
335 <has_text_matching expression="(?m)^AGP\t" negate="true"/>
336 </assert_contents>
337 </element>
338 </output_collection>
226 </test> 339 </test>
340
341 <!-- Test 2: FORM workflow, chr list present -->
342 <test>
343 <param name="submit_test" value="true" />
344 <param name="dry_run" value="true" />
345 <param name="assembly_type" value="isolate"/>
346 <param name="assembly_program" value="Test assembly program"/>
347 <param name="molecule_type" value="genomic DNA"/>
348 <param name="coverage" value="10000"/>
349 <conditional name="metadata_file_or_form">
350 <param name="metadata_format" value="form"/>
351 <param name="assembly_name" value="Test assembly name"/>
352 <param name="study_accession" value="PRJEB49173"/>
353 <param name="sample_accession" value="SAMEA11953908"/>
354 <param name="sequencing_platform" value="Nanopore 0011"/>
355 <param name="description" value="Test Description"/>
356 <param name="center_name" value="Test center name"/>
357 <param name="genome_fasta" value="phiX3.fasta"/>
358 <param name="chr_list_file" value="phiX3.tsv"/>
359 </conditional>
360 <param name="min_gap_length" value="30"/>
361 <output name="webin_cli_log">
362 <assert_contents>
363 <has_text_matching expression="ERROR: Invalid submission account user name or password\."/>
364 </assert_contents>
365 </output>
366 <output_collection name="generated_manifests">
367 <element name="generated_manifest">
368 <assert_contents>
369 <has_text_matching expression="(?m)^FASTA\tphiX3\.fasta\.gz$"/>
370 <has_text_matching expression="(?m)^CHROMOSOME_LIST\tphiX3\.tsv\.gz$"/>
371 <has_text_matching expression="(?m)^AGP\t" negate="true"/>
372 </assert_contents>
373 </element>
374 </output_collection>
375 </test>
376
377 <!-- Test 3: FILE workflow, two FASTAs; one missing metadata -->
227 <test> 378 <test>
228 <param name="submit_test" value="true" /> 379 <param name="submit_test" value="true" />
229 <param name="dry_run" value="true" /> 380 <param name="dry_run" value="true" />
230 <param name="assembly_type" value="isolate"/> 381 <param name="assembly_type" value="isolate"/>
231 <param name="assembly_program" value="Test assembly program"/> 382 <param name="assembly_program" value="Test assembly program"/>
232 <param name="molecule_type" value="viral cRNA"/> 383 <param name="molecule_type" value="viral cRNA"/>
233 <param name="coverage" value="10000"/> 384 <param name="coverage" value="10000"/>
234 <conditional name="metadata_file_or_form"> 385 <conditional name="metadata_file_or_form">
235 <param name="metadata_format" value="file"/> 386 <param name="metadata_format" value="file"/>
236 <param name="ena_receipt" value="receipt_sample_noPhiX.txt"/> 387 <param name="ena_receipt" value="receipt_sample_nophiX2.txt"/>
237 <param name="genome_fasta" value="phiX2.fasta.gz,sample_alias_001.fasta.gz"/> 388 <param name="genome_fasta" value="phiX2.fasta.gz,sample_alias_001.fasta.gz"/>
238 </conditional> 389 </conditional>
239 <param name="min_gap_length" value="30"/> 390 <param name="min_gap_length" value="30"/>
240 <output name="webin_cli_log"> 391 <output name="webin_cli_log">
241 <assert_contents> 392 <assert_contents>
242 <has_text_matching expression="Processing phiX2"/> 393 <has_text_matching expression="Processing phiX2"/>
243 <has_text_matching expression="No metadata found for sample phiX2"/> 394 <has_text_matching expression="No metadata found for sample phiX2"/>
244 <has_text_matching expression="Processing sample_alias_001"/> 395 <has_text_matching expression="Processing sample_alias_001"/>
245 <has_text_matching expression="Submitting manifest ./manifests/sample_alias_001.manifest.txt"/> 396 <has_text_matching expression="Submitting manifest .*manifests/sample_alias_001\.manifest\.txt"/>
246 <has_text_matching expression="ERROR: Invalid submission account user name or password. Please try enclosing your password in single quotes."/> 397 <has_text_matching expression="ERROR: Invalid submission account user name or password\. Please try enclosing your password in single quotes\."/>
247 </assert_contents> 398 </assert_contents>
248 </output> 399 </output>
400 <output_collection name="generated_manifests">
401 <element name="sample_alias_001.manifest">
402 <assert_contents>
403 <has_text_matching expression="(?m)^FASTA\tsample_alias_001\.fasta\.gz$"/>
404 <has_text_matching expression="(?m)^CHROMOSOME_LIST\t" negate="true"/>
405 <has_text_matching expression="(?m)^AGP\t" negate="true"/>
406 </assert_contents>
407 </element>
408 </output_collection>
249 </test> 409 </test>
410
411 <!-- Test 4: FILE workflow, single FASTA with metadata -->
250 <test> 412 <test>
251 <param name="submit_test" value="true" /> 413 <param name="submit_test" value="true" />
252 <param name="dry_run" value="true" /> 414 <param name="dry_run" value="true" />
253 <param name="assembly_type" value="isolate"/> 415 <param name="assembly_type" value="isolate"/>
254 <param name="assembly_program" value="Test assembly program"/> 416 <param name="assembly_program" value="Test assembly program"/>
260 <param name="genome_fasta" value="sample_alias_001.fasta.gz"/> 422 <param name="genome_fasta" value="sample_alias_001.fasta.gz"/>
261 </conditional> 423 </conditional>
262 <param name="min_gap_length" value="30"/> 424 <param name="min_gap_length" value="30"/>
263 <output name="webin_cli_log"> 425 <output name="webin_cli_log">
264 <assert_contents> 426 <assert_contents>
265 <has_text_matching expression="ERROR: Invalid submission account user name or password. Please try enclosing your password in single quotes."/> 427 <has_text_matching expression="Processing sample_alias_001"/>
428 <has_text_matching expression="ERROR: Invalid submission account user name or password\. Please try enclosing your password in single quotes\."/>
266 </assert_contents> 429 </assert_contents>
267 </output> 430 </output>
268 </test> 431 </test>
432
433 <!-- Test 5: FILE workflow, AGP for phiX2 -->
434 <test>
435 <param name="submit_test" value="true" />
436 <param name="dry_run" value="true" />
437 <param name="assembly_type" value="isolate"/>
438 <param name="assembly_program" value="Test assembly program"/>
439 <param name="molecule_type" value="genomic DNA"/>
440 <param name="coverage" value="10000"/>
441 <conditional name="metadata_file_or_form">
442 <param name="metadata_format" value="file"/>
443 <param name="ena_receipt" value="receipt_sample.txt"/>
444 <param name="genome_fasta" value="phiX2.fasta"/>
445 <param name="agp_file" value="phiX2.agp"/>
446 </conditional>
447 <param name="min_gap_length" value="30"/>
448 <output name="webin_cli_log">
449 <assert_contents>
450 <has_text_matching expression="Processing phiX2"/>
451 <has_text_matching expression="ERROR: Invalid submission account user name or password\. Please try enclosing your password in single quotes\."/>
452 </assert_contents>
453 </output>
454 <output_collection name="generated_manifests">
455 <element name="phiX2.manifest">
456 <assert_contents>
457 <has_text_matching expression="(?m)^FASTA\tphiX2\.fasta\.gz$"/>
458 <has_text_matching expression="(?m)^AGP\tphiX2\.agp$"/>
459 <has_text_matching expression="(?m)^CHROMOSOME_LIST\t" negate="true"/>
460 </assert_contents>
461 </element>
462 </output_collection>
463 </test>
464
465 <!-- Test 6: FILE workflow, chr list for phiX3 + extra fasta -->
466 <test>
467 <param name="submit_test" value="true" />
468 <param name="dry_run" value="true" />
469 <param name="assembly_type" value="isolate"/>
470 <param name="assembly_program" value="Test assembly program"/>
471 <param name="molecule_type" value="genomic DNA"/>
472 <param name="coverage" value="10000"/>
473 <conditional name="metadata_file_or_form">
474 <param name="metadata_format" value="file"/>
475 <param name="ena_receipt" value="receipt_sample_phiX3.txt"/>
476 <param name="genome_fasta" value="phiX3.fasta,phiX2.fasta.gz"/>
477 <param name="chr_list_file" value="phiX3.tsv"/>
478 </conditional>
479 <param name="min_gap_length" value="30"/>
480 <output name="webin_cli_log">
481 <assert_contents>
482 <has_text_matching expression="Processing phiX3"/>
483 <has_text_matching expression="ERROR: Invalid submission account user name or password\. Please try enclosing your password in single quotes\."/>
484 </assert_contents>
485 </output>
486 <output_collection name="generated_manifests">
487 <element name="phiX2.manifest">
488 <assert_contents>
489 <has_text_matching expression="(?m)^FASTA\tphiX2\.fasta\.gz$"/>
490 <has_text_matching expression="(?m)^CHROMOSOME_LIST\t" negate="true"/>
491 <has_text_matching expression="(?m)^AGP\t" negate="true"/>
492 </assert_contents>
493 </element>
494 <element name="phiX3.manifest">
495 <assert_contents>
496 <has_text_matching expression="(?m)^FASTA\tphiX3\.fasta\.gz$"/>
497 <has_text_matching expression="(?m)^CHROMOSOME_LIST\tphiX3\.tsv\.gz$"/>
498 <has_text_matching expression="(?m)^AGP\t" negate="true"/>
499 </assert_contents>
500 </element>
501 </output_collection>
502 </test>
269 </tests> 503 </tests>
504
505
506
507 <!-- Help text + citation -->
270 <help><![CDATA[ 508 <help><![CDATA[
271 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). 509 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).
272 510
273 .. class:: warningmark 511 .. class:: warningmark
274 512
275 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> 513 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>
514
276 <citations> 515 <citations>
277 <citation type="doi">10.1093/nar/gkac1051</citation> 516 <citation type="doi">10.1093/nar/gkac1051</citation>
278 </citations> 517 </citations>
279 </tool> 518 </tool>