comparison blobtoolkit.xml @ 0:7d9ee8cd14b8 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/blobtoolkit commit 7c0db48ffd4dbee68fb2320fc5a064bc9c3219d9
author bgruening
date Mon, 30 Jan 2023 12:39:40 +0000
parents
children 840822c1e84a
comparison
equal deleted inserted replaced
-1:000000000000 0:7d9ee8cd14b8
1 <tool id="blobtoolkit" name="BlobToolKit" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
2 <description>genome assembly QC</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro='requirements' />
7 <command detect_errors="exit_code"><![CDATA[
8 #if $mode_conditional.selector == 'create'
9 mkdir -p './Blobdir' &&
10 mkdir -p './taxdump' &&
11 ln -s '${mode_conditional.taxdump}' 'taxdump.tar' &&
12 tar -xf 'taxdump.tar' -C './taxdump' &&
13 ln -s '${mode_conditional.fasta}' 'assembly.fasta' &&
14 #if $mode_conditional.meta
15 ln -s '${mode_conditional.meta}' 'assembly.yaml' &&
16 #end if
17 blobtools create
18 --fasta 'assembly.fasta'
19 #if $mode_conditional.meta
20 --meta 'assembly.yaml'
21 #end if
22 --taxid $mode_conditional.taxid
23 --taxdump './taxdump'
24 './Blobdir'
25 && cp -r './taxdump' './Blobdir/'
26 && tar -zcf './Blobdir.tgz' './Blobdir'
27
28 #else if $mode_conditional.selector == 'add'
29 #if $mode_conditional.blobdir.is_of_type("tgz")
30 tar -zxf '${mode_conditional.blobdir}' -C './' &&
31 #else
32 tar -xf '${mode_conditional.blobdir}' -C './' &&
33 #end if
34 #if $mode_conditional.busco
35 ln -s '${mode_conditional.busco}' './busco_results.tab' &&
36 #end if
37 #if $mode_conditional.blast_input.selector == 'enabled'
38 ln -s '$mode_conditional.blast_input.hits' './blast_results.tab' &&
39 #end if
40 #if $mode_conditional.cov
41 ln -s '$mode_conditional.cov' './input.bam' &&
42 ln -s '$mode_conditional.cov.metadata.bam_index' './input.bam.bai' &&
43 #end if
44 #if $mode_conditional.bed
45 mkdir -p './bed_files' &&
46 #import re
47 #for $i, $input in enumerate($mode_conditional.bed):
48 #set $safename = re.sub('[^\w\-_]', '_', $input.element_identifier) + "." + str($i)
49 ln -sf '${input}' './bed_files/${safename}.bed' &&
50 #end for
51 #end if
52 blobtools add
53 --threads \${GALAXY_SLOTS:-8}
54 --taxdump './Blobdir/taxdump'
55 #if $mode_conditional.busco
56 --busco './busco_results.tab'
57 #end if
58 #if $mode_conditional.blast_input.selector == 'enabled'
59 --hits './blast_results.tab'
60 #if $mode_conditional.blast_input.hits_cols
61 --hits-cols '${$mode_conditional.blast_input.hits_cols}'
62 #end if
63 --taxrule $mode_conditional.blast_input.taxrule
64 --evalue $mode_conditional.blast_input.evalue
65 --hit-count $mode_conditional.blast_input.hit_count
66 --bitscore $mode_conditional.blast_input.bitscore
67 #end if
68 #if $mode_conditional.bed
69 --beddir './bed_files'
70 #end if
71 #if $mode_conditional.cov
72 --cov './input.bam'
73 #end if
74 #if $mode_conditional.fasta
75 --fasta '${mode_conditional.fasta}'
76 #end if
77 #if $mode_conditional.trnascan
78 --trnascan '${mode_conditional.trnascan}'
79 #end if
80 #if $mode_conditional.text_input.selector == 'enabled'
81 --text '${mode_conditional.text_input.text}'
82 --text-cols '${mode_conditional.text_input.text_cols}'
83 $mode_conditional.text_input.text_header
84 $mode_conditional.text_input.text_no_array
85 --text-delimiter $mode_conditional.text_input.text_delimiter
86 #end if
87 #if $mode_conditional.advanced_options.blobdb
88 --blobdb '${mode_conditional.advanced_options.blobdb}'
89 #end if
90 #if $mode_conditional.advanced_options.synonyms
91 --synonyms '${mode_conditional.advanced_options.synonyms}'
92 #end if
93 $mode_conditional.advanced_options.update_plot
94 #if $mode_conditional.advanced_options.pileup_args
95 --pileup-args '${mode_conditional.advanced_options.pileup_args}'
96 #end if
97 $mode_conditional.advanced_options.replace
98 './Blobdir'
99 && tar -zcf './Blobdir.tgz' './Blobdir'
100
101 #else if $mode_conditional.selector == 'filter'
102 #if $mode_conditional.blobdir.is_of_type("tgz")
103 tar -zxf '${mode_conditional.blobdir}' -C './' &&
104 #else
105 tar -xf '${mode_conditional.blobdir}' -C './' &&
106 #end if
107 #if $mode_conditional.filter_options.fasta
108 ln -s '${mode_conditional.filter_options.fasta}' './input.fasta' &&
109 #end if
110 #if $mode_conditional.filter_options.fastq_filter.selector == 'enabled'
111 ln -s '${mode_conditional.filter_options.fastq}' './input.fastq' &&
112 ln -s '$mode_conditional.filter_options.cov' './input.bam' &&
113 ln -s '$mode_conditional.filter_options.cov.metadata.bam_index' './input.bam.csi' &&
114 #end if
115 blobtools filter
116 #if $mode_conditional.filter_options.param
117 --param $mode_conditional.filter_options.param
118 #end if
119 #if $mode_conditional.filter_options.json
120 --json $mode_conditional.filter_options.json
121 #end if
122 #if $mode_conditional.filter_options.list
123 --list $mode_conditional.filter_options.list
124 #end if
125 $mode_conditional.filter_options.invert
126 #if $mode_conditional.filter_options.fasta
127 --fasta './input.fasta'
128 #end if
129 #if $mode_conditional.filter_options.fastq_filter.selector == 'enabled'
130 --fastq './input.fastq'
131 --cov './input.bam'
132 #end if
133 #if $mode_conditional.filter_options.text_input.selector == 'enabled'
134 --text '${mode_conditional.filter_options.text_input.text}'
135 --text-cols '${mode_conditional.filter_options.text_input.text_cols}'
136 $mode_conditional.filter_options.text_input.text_header
137 --text-delimiter $mode_conditional.filter_options.text_input.text_delimiter
138 #end if
139 ./Blobdir
140 #if $mode_conditional.remove_options.remove_selector or $mode_conditional.remove_options.field
141 && blobtools remove
142 #for $param in $mode_conditional.remove_options.remove_selector
143 $param
144 #end for
145 #if $mode_conditional.remove_options.field
146 --field $mode_conditional.remove_options.field
147 #end if
148 ./Blobdir
149 #end if
150 && tar -zcf './Blobdir.tgz' './Blobdir'
151
152 #else if $mode_conditional.selector == 'plots'
153 #if $mode_conditional.blobdir.is_of_type("tgz")
154 tar -zxf '${mode_conditional.blobdir}' -C './' &&
155 #else
156 tar -xf '${mode_conditional.blobdir}' -C './' &&
157 #end if
158 blobtools view
159 --format $mode_conditional.format
160 --view 'blob'
161 ./Blobdir
162 && mv ./Blobdir.blob.circle* ./Blobdir.blob.circle
163 && blobtools view
164 --format $mode_conditional.format
165 --view 'cumulative'
166 ./Blobdir
167 && mv ./Blobdir.cumulative* Blobdir.cumulative
168 && blobtools view
169 --format $mode_conditional.format
170 --view 'snail'
171 ./Blobdir
172 && mv ./Blobdir.snail* Blobdir.snail
173 #end if
174 ]]></command>
175 <inputs>
176 <conditional name="mode_conditional">
177 <param name="selector" type="select" label="Select mode" help="Select a BlobToolKit module">
178 <option value="create">Create a BlobToolKit dataset</option>
179 <option value="add">Add data to a BlobToolKit dataset</option>
180 <option value="filter">Edit a BlobToolKit dataset</option>
181 <option value="plots">Generate plots</option>
182 </param>
183 <when value="create">
184 <param argument="--fasta" type="data" format="fasta" label="Genome assembly file" help="FASTA sequence file" />
185 <param argument="--meta" type="data" format="yaml" label="Metadata file" optional="true" help="Optional metadata dataset"/>
186 <param argument="--taxid" type="integer" value="" label="NCBI taxonomy ID" help="Add ranks to metadata for a taxid"/>
187 <param argument="--taxdump" type="data" format="tar,tgz,gz" label="NCBI taxdump directory" help="It should be compressed in tar.gz format"/>
188 </when>
189 <when value="add">
190 <param name="blobdir" type="data" format="tgz" label="Blobdir.tgz file" help="This file should be generated by Blobtool create" />
191 <param argument="--busco" type="data" format="tsv,tabular,txt" optional="true" label="BUSCO full table file"/>
192 <conditional name="blast_input">
193 <param name="selector" type="select" label="BLAST/Diamond hits">
194 <option value="enabled">Enabled</option>
195 <option value="disabled" selected="true">Disabled</option>
196 </param>
197 <when value="enabled">
198 <param argument="--hits" type="data" format="tsv,tabular" optional="true" label="BLAST/Diamond hits dataset" help="Tabular BLAST/Diamond output file"/>
199 <param argument="--taxrule" type="select" label="BLAST hits to taxa rule" help="Rule to use when assigning BLAST hits to taxa">
200 <option value="bestsum">Bestsum</option>
201 <option value="bestsumorder">Bestsumorder</option>
202 <option value="bestdistsum">Bestdistsum</option>
203 <option value="bestdistsumorder">Bestdistsumorder</option>
204 <option value="blastp">Blastp</option>
205 </param>
206 <param argument="--evalue" type="float" min="0" value="1" label="E-value cutoff"
207 help="The smaller the E-value, the better the match. Any hits with an evalue weaker than the value specified will be excluded"/>
208 <param argument="--bitscore" type="float" min="0" value="1" label="Bitscore cutoff"
209 help="The higher the bit-score, the better the sequence similarity. Any hits with an bitscore lower the value specified will be excluded"/>
210 <param argument="--hit-count" type="integer" min="1" value="10" label="Hits to a given taxon" optional="true"
211 help="By default the 10 highest scoring hits to a given taxon will be used when applying the --taxrule"/>
212 <param argument="--hits-cols" type="text" value="1=qseqid,2=staxids,3=bitscore,5=sseqid,10=qstart,11=qend,14=evalue" optional="true"
213 label="BLAST/Diamond file column order" help="More information in the help section">
214 <sanitizer invalid_char="">
215 <valid initial="string.letters,string.digits">
216 <add value="=" />
217 <add value="," />
218 </valid>
219 </sanitizer>
220 <validator type="regex">[0-9a-z=,]+</validator>
221 </param>
222 </when>
223 <when value="disabled"/>
224 </conditional>
225 <param argument="--bed" type="data" format="bed" multiple="true" optional="true" label="BED file of coverages per scaffold"/>
226 <param argument="--cov" type="data" format="bam,sam,cram" optional="true" label="BAM/SAM/CRAM read alignment file"/>
227 <param argument="--fasta" type="data" format="fasta" optional="true" label="FASTA sequence" help="FASTA sequence file" />
228 <param argument="--trnascan" type="data" format="tsv,tabular" optional="true" label="tRNAscan2-SE" help="tRNAscan-SE is employed for identifying and annotating tRNA genes in genomes"/>
229 <expand macro="macro_text_input">
230 <param argument="--text-no-array" type="boolean" truevalue="--text-no-array" falsevalue="" checked="false" label="Prevent duplicated identifiers"
231 help="Prevent fields in files with duplicate identifiers being loaded as array fields" />
232 </expand>
233 <section name="advanced_options" title="Advanced options">
234 <param argument="--blobdb" type="data" format="json" optional="true" label="Blobtools v1 database" help="This file should have been generated with the previous Blobtools tool version"/>
235 <param argument="--synonyms" type="data" format="tsv" optional="true" label="Identifier and sinonyms" help="TSV file containing current identifiers and synonyms"/>
236 <param argument="--update-plot" type="boolean" truevalue="--update-plot" falsevalue="" checked="false" label="Update plot" help="Flag to use new taxrule as default category" />
237 <param argument="--pileup-args" type="text" value="" optional="true" label="Samtools Pileup" help="Key/value pairs to pass to samtools pileup">
238 <sanitizer invalid_char="">
239 <valid initial="string.letters,string.digits">
240 <add value="=" />
241 <add value="," />
242 <add value="-" />
243 </valid>
244 </sanitizer>
245 <validator type="regex">[0-9a-zA-Z=,-]+</validator>
246 </param>
247 <param argument="--replace" type="boolean" truevalue="--replace" falsevalue="" checked="false" label="Replace fields" help="Allow existing fields to be overwritten" />
248 </section>
249 </when>
250 <when value="filter">
251 <param name="blobdir" type="data" format="tgz" label="Blobdir file" help="This file should be generated by the moudule create" />
252 <section name="filter_options" title="Filter mode options" expanded="true">
253 <param argument="--param" type="text" value="" optional="true" label="Parameter value" help="String of type param=value. Individual param=value pairs can be specified to
254 filter based on Variable or Category fields">
255 <sanitizer invalid_char="">
256 <valid initial="string.letters,string.digits">
257 <add value="=" />
258 <add value="," />
259 <add value="-" />
260 </valid>
261 </sanitizer>
262 <validator type="regex">[0-9a-zA-Z=,-]+</validator>
263 </param>
264 <param argument="--list" type="text" value="" optional="true" label="List of identifiers" help="Space separated list of identifiers">
265 <sanitizer invalid_char="">
266 <valid initial="string.letters,string.digits">
267 <add value=" " />
268 <add value="-" />
269 <add value="_" />
270 </valid>
271 </sanitizer>
272 <validator type="regex">[0-9a-zA-Z _-]+</validator>
273 </param>
274 <param argument="--json" type="data" format="json" optional="true" label="JSON format list file" help="JSON format list file as generated by BlobtoolKit Viewer"/>
275 <param argument="--fasta" type="data" format="fasta" multiple="true" optional="true" label="Assembly to be filtered" help="FASTA format assembly file to be filtered"/>
276 <conditional name="fastq_filter">
277 <param name="selector" type="select" label="Filter FASTQ reads">
278 <option value="disabled">Disabled</option>
279 <option value="enabled">Enabled</option>
280 </param>
281 <when value="disabled"/>
282 <when value="enabled">
283 <param argument="--fastq" type="data" format="fastq" optional="true" label="Reads to be filtered" help="FASTQ format read file to be filtered"/>
284 <param argument="--cov" type="data" format="bam,sam,cram" optional="true" label="BAM/SAM/CRAM read alignment file" />
285 </when>
286 </conditional>
287 <expand macro="macro_text_input"/>
288 <param argument="--summary-rank" type="text" value="phylum" label="Sumamry rank" help="Taxonomic level for summary">
289 <sanitizer invalid_char="">
290 <valid initial="string.letters"/>
291 </sanitizer>
292 <validator type="regex">[a-zA-Z]+</validator>
293 </param>
294 <param argument="--invert" type="boolean" truevalue="--invert" falsevalue="" checked="false" label="Invert filter" help="Invert the filter (exclude matching records)"/>
295 </section>
296 <section name="remove_options" title="Remove mode options" expanded="true">
297 <param name="remove_selector" type="select" multiple="true" display="checkboxes" label="Fields to remove">
298 <option value="--all">Remove all fields except identifiers (--all)</option>
299 <option value="--busco">Remove all BUSCO fields (--busco)</option>
300 <option value="--cov">Remove all cov and read_cov fields (--cov)</option>
301 <option value="--fasta">Remove gc, length and ncount fields (--fasta)</option>
302 <option value="--hits">Remove all taxonomy fields (--hits)</option>
303 </param>
304 <param argument="--field" type="text" value="" optional="true" label="Remove fields by ID">
305 <sanitizer invalid_char="">
306 <valid initial="string.letters,string.digits"/>
307 </sanitizer>
308 <validator type="regex">[0-9a-zA-Z]+</validator>
309 </param>
310 </section>
311 </when>
312 <when value="plots">
313 <param name="blobdir" type="data" format="tgz" label="Blobdir file" help="This file should be generated by the moudule create" />
314 <param argument="--format" type="select" label="Image format">
315 <option value="png">PNG</option>
316 <option value="svg">SVG</option>
317 </param>
318 <param argument="--param" type="text" optional="true" label="Query parameter" help="Query string parameter."/>
319 </when>
320 </conditional>
321 </inputs>
322 <outputs>
323 <data name="blobdir" format="tgz" from_work_dir="./Blobdir.tgz" label="${tool.name} on ${on_string}: Blobdir.tgz">
324 <filter>mode_conditional['selector'] == 'create' or mode_conditional['selector'] == 'add' or mode_conditional['selector'] == 'filter'</filter>
325 </data>
326 <data name="plot_circle" format="png" from_work_dir="./Blobdir.blob.circle" label="${tool.name} on ${on_string}: blob plot">
327 <filter>mode_conditional['selector'] == 'plots'</filter>
328 <change_format>
329 <when input="$mode_conditional.format" value="svg" format="svg"/>
330 </change_format>
331 </data>
332 <data name="plot_cumulative" format="png" from_work_dir="./Blobdir.cumulative" label="${tool.name} on ${on_string}: cumulative plot">
333 <filter>mode_conditional['selector'] == 'plots'</filter>
334 <change_format>
335 <when input="$mode_conditional.format" value="svg" format="svg"/>
336 </change_format>
337 </data>
338 <data name="plot_snail" format="png" from_work_dir="./Blobdir.snail" label="${tool.name} on ${on_string}: snail plot">
339 <filter>mode_conditional['selector'] == 'plots'</filter>
340 <change_format>
341 <when input="$mode_conditional.format" value="svg" format="svg"/>
342 </change_format>
343 </data>
344 </outputs>
345 <tests>
346 <test expect_num_outputs="1">
347 <conditional name="mode_conditional">
348 <param name="selector" value="create"/>
349 <param name="fasta" value="assembly.fasta.gz"/>
350 <param name="meta" value="assembly.yaml"/>
351 <param name="taxid" value="801"/>
352 <param name="taxdump" value="small_taxdump.tar.gz"/>
353 </conditional>
354 <output name="blobdir" file="test01_blobdir.tar.gz" compare="sim_size" delta="1000"/>
355 </test>
356 <test expect_num_outputs="1">
357 <conditional name="mode_conditional">
358 <param name="selector" value="add"/>
359 <param name="blobdir" value="test01_blobdir.tar.gz"/>
360 <param name="busco" value="busco_full_table.tabular"/>
361 <param name="cov" value="bam_file.bam"/>
362 <param name="fasta" value="contig.fasta"/>
363 <section name="advanced_options">
364 <param name="update_plot" value="false"/>
365 </section>
366 <conditional name="blast_input">
367 <param name="selector" value="enabled"/>
368 <param name="hits" value="blast_results.tabular"/>
369 <param name="taxrule" value="bestsum"/>
370 <param name="evalue" value="1"/>
371 <param name="bitscore" value="1"/>
372 <param name="hit_count" value="10"/>
373 <param name="hits_cols" value="1=qseqid,2=staxids,3=bitscore,5=sseqid,10=qstart,11=qend,14=evalue"/>
374 </conditional>
375 </conditional>
376 <output name="blobdir" file="test02_blobdir.tar.gz" compare="sim_size" delta="1000"/>
377 </test>
378 <test expect_num_outputs="1">
379 <conditional name="mode_conditional">
380 <param name="selector" value="filter"/>
381 <param name="blobdir" value="test02_blobdir.tar.gz"/>
382 <section name="filter_options">
383 <param name="fasta" value="contig.fasta"/>
384 <param name="summary_rank" value="phylum"/>
385 <param name="invert" value="false"/>
386 </section>
387 <section name="remove_options">
388 <param name="remove_selector" value="--all"/>
389 </section>
390 </conditional>
391 <output name="blobdir">
392 <assert_contents>
393 <has_size value="672428" delta="1000"/>
394 </assert_contents>
395 </output>
396 </test>
397 <test expect_num_outputs="3">
398 <conditional name="mode_conditional">
399 <param name="selector" value="plots"/>
400 <param name="blobdir" value="test02_blobdir.tar.gz"/>
401 <param name="format" value="png"/>
402 </conditional>
403 <output name="plot_circle" file="test04_circle.png" ftype="png"/>
404 <output name="plot_cumulative" file="test04_cumulative.png" ftype="png"/>
405 <output name="plot_snail" file="test04_snail.png" ftype="png"/>
406 </test>
407 </tests>
408 <help><![CDATA[
409 BlobToolKit is a software suite to aid researchers in identifying and isolating non-target data in draft and publicly available genome assemblies. It can be used to process assembly,
410 read and analysis files for fully reproducible interactive exploration in the browser-based Viewer. BlobToolKit can be used during assembly to filter non-target DNA, helping researchers produce assemblies with high biological credibility.
411 ]]></help>
412 <expand macro="citations"/>
413 </tool>