comparison jbrowse2/jbrowse2.xml @ 0:cd5d63cd0eb5 draft

Uploaded
author fubar
date Wed, 03 Jan 2024 01:36:39 +0000
parents
children 52842c3f2dda
comparison
equal deleted inserted replaced
-1:000000000000 0:cd5d63cd0eb5
1 <tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+@WRAPPER_VERSION@" profile="22.05">
2 <description>genome browser</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="edamInc"/>
7 <xrefs>
8 <xref type="bio.tools">jbrowse2</xref>
9 </xrefs>
10 <expand macro="requirements"/>
11 <version_command>python '${__tool_directory__}/jbrowse2.py' --version</version_command>
12 <command detect_errors="aggressive"><![CDATA[
13 mkdir -p '$output.files_path' &&
14 ## Copy the XML file into the directory, mostly for debugging
15 ## but nice if users want to reproduce locally
16 cp '$trackxml' '$output.files_path/galaxy.xml' &&
17
18 export JBROWSE_SOURCE_DIR=\$(dirname \$(which jbrowse))/../opt/jbrowse2 &&
19
20 ## Once that's done, we run the python script to handle the real work
21 python '$__tool_directory__/jbrowse2.py'
22
23 --jbrowse \${JBROWSE_SOURCE_DIR}
24 --standalone '$standalone'
25
26 --outdir '$output.files_path'
27 '$trackxml' &&
28
29 #if str($standalone) != "data":
30 cp '$output.files_path/index.html' '$output'
31 #else:
32 cp '$dummyIndex' '$output'
33 #end if
34
35 ## Ugly testing hack since I cannot get <extra_files> to test the files I want to test. Hmph.
36 #if str($uglyTestingHack) == "enabled":
37 && cp '$trackxml' '$output'
38 #end if
39 ]]></command>
40 <configfiles>
41 <configfile name="dummyIndex"><![CDATA[
42 <html>
43 <head>
44 </head>
45 <body>
46 <h1>JBrowse Data Directory</h1>
47 <p>
48 Hi! This is not a full JBrowse instance. JBrowse v0.4(+?)
49 started shipping with the ability to produce just the
50 "data" directory from a JBrowse instance, rather than a
51 complete, standalone instance. This was intended to be used
52 with the in-development Apollo integration, but may have other
53 uses as well.
54 </p>
55 </body>
56 </html>
57 ]]></configfile>
58 <configfile name="trackxml"><![CDATA[<?xml version="1.0"?>
59 <root>
60 <metadata>
61 <genomes>
62 #if str($reference_genome.genome_type_select) == "indexed":
63 <genome path="${reference_genome.genome.fields.path}">
64 <metadata>
65 <dataset id="${__app__.security.encode_id($dataset.id)}" hid="${dataset.hid}"
66 size="${dataset.get_size(nice_size=True)}"
67 edam_format="${dataset.datatype.edam_format}"
68 file_ext="${dataset.ext}" />
69 </metadata>
70 </genome>
71 #else
72 <genome path="$reference_genome.genome">
73 <metadata>
74 <dataset id="${__app__.security.encode_id($reference_genome.genome.id)}" hid="${reference_genome.genome.hid}"
75 size="${reference_genome.genome.get_size(nice_size=True)}"
76 edam_format="${reference_genome.genome.datatype.edam_format}"
77 file_ext="${reference_genome.genome.ext}"
78 dname="${reference_genome.genome.element_identifier}" />
79 <history id="${__app__.security.encode_id($reference_genome.genome.history_id)}"
80 #if $reference_genome.genome.history.user:
81 user_email="${reference_genome.genome.history.user.email}"
82 user_id="${reference_genome.genome.history.user_id}"
83 display_name="${reference_genome.genome.history.get_display_name()}"/>
84 #else
85 user_email="anonymous"
86 user_id="-1"
87 display_name="Unnamed History"
88 />
89 #end if
90 <metadata
91 #for (key, value) in $reference_genome.genome.get_metadata().items():
92 #if "_types" not in $key:
93 ${key}="${value}"
94 #end if
95 #end for
96 />
97 <tool
98 tool_id="${reference_genome.genome.creating_job.tool_id}"
99 tool_version="${reference_genome.genome.creating_job.tool_version}"
100 />
101 </metadata>
102 </genome>
103 #end if
104 </genomes>
105 <galaxyUrl>${__app__.config.galaxy_infrastructure_url}</galaxyUrl>
106 </metadata>
107 <tracks>
108 #for $tg in $track_groups:
109 #for $track in $tg.data_tracks:
110 <track cat="${tg.category}" format="${track.data_format.data_format_select}" >
111 #if $track.data_format.data_format_select != "rest" and $track.data_format.data_format_select != "sparql":
112 <files>
113 #for $dataset in $track.data_format.annotation:
114 <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.element_identifier}">
115 <metadata>
116 <dataset id="${__app__.security.encode_id($dataset.id)}" hid="${dataset.hid}"
117 size="${dataset.get_size(nice_size=True)}"
118 edam_format="${dataset.datatype.edam_format}"
119 file_ext="${dataset.ext}" />
120 <history id="${__app__.security.encode_id($dataset.history_id)}"
121 #if $dataset.history.user:
122 user_email="${dataset.history.user.email}"
123 user_id="${dataset.history.user_id}"
124 display_name="${dataset.history.get_display_name()}"/>
125 #else
126 user_email="anonymous"
127 user_id="-1"
128 display_name="Unnamed History"/>
129 #end if
130 <metadata
131 #for (key, value) in $dataset.get_metadata().items():
132 #if "_types" not in $key and $value is not None and len(str($value)) < 5000:
133 ${key}="${value}"
134 #end if
135 #end for
136 />
137 <tool
138 tool_id="${dataset.creating_job.tool_id}"
139 tool_version="${dataset.creating_job.tool_version}"
140 />
141 </metadata>
142 </trackFile>
143 #end for
144 </files>
145 #end if
146
147 <options>
148 #if str($track.data_format.data_format_select) == "gene_calls" or str($track.data_format.data_format_select) == "blast" :
149 <style>
150 <className>${track.data_format.jbstyle.style_classname}</className>
151 <description>${track.data_format.jbstyle.style_description}</description>
152 <label>${track.data_format.jbstyle.style_label}</label>
153 <height>${track.data_format.jbstyle.style_height}</height>
154 <maxHeight>${track.data_format.jbstyle.max_height}</maxHeight>
155 </style>
156 #else if str($track.data_format.data_format_select) == "pileup":
157 <pileup>
158 <bam_indices>
159 #for $dataset in $track.data_format.annotation:
160 <bam_index>${dataset.metadata.bam_index}</bam_index>
161 #end for
162 </bam_indices>
163 <chunkSizeLimit>${track.data_format.chunkSizeLimit}</chunkSizeLimit>
164 </pileup>
165 #end if
166 #if str($track.data_format.data_format_select) == "blast":
167 <blast>
168 #if str($track.data_format.blast_parent) != "":
169 <parent>${track.data_format.blast_parent}</parent>
170 #end if
171 <protein>${track.data_format.is_protein}</protein>
172 <min_gap>${track.data_format.min_gap}</min_gap>
173 <index>${track.data_format.index}</index>
174 </blast>
175 #end if
176 </options>
177 </track>
178 #end for
179 #end for
180 </tracks>
181 <plugins>
182 </plugins>
183 </root>
184 ]]></configfile>
185 </configfiles>
186 <inputs>
187 <conditional name="reference_genome">
188 <param help="Built-in references" label="Reference genome to display" name="genome_type_select" type="select">
189 <option selected="True" value="indexed">Use a built-in genome</option>
190 <option value="history">Use a genome from history</option>
191 </param>
192 <when value="indexed">
193 <param
194 help="If your genome of interest is not listed, contact the Galaxy team"
195 label="Select a reference genome"
196 name="genome"
197 type="select">
198 <options from_data_table="all_fasta">
199 <filter column="2" type="sort_by"/>
200 <validator message="No genomes are available for the selected input dataset" type="no_options">
201 </validator>
202 </options>
203 </param>
204 </when>
205 <when value="history">
206 <param
207 format="fasta"
208 label="Select the reference genome"
209 name="genome"
210 type="data">
211 </param>
212 </when>
213 </conditional>
214
215 <param name="standalone" label="Output JBrowse" type="select">
216 <option value="complete">Complete, for viewing and further local development (JBrowse, tools, documentation, etc.)
217 </option>
218 <option value="minimal" selected="true">Minimal for viewing (Documentation removed)
219 </option>
220 </param>
221
222 <repeat name="track_groups" title="Track Group">
223 <param label="Track Category"
224 name="category"
225 type="text"
226 value="Default"
227 help="Organise your tracks into Categories for a nicer end-user experience. You can use #date# and it will be replaced with the current date in 'yyyy-mm-dd' format, which is very useful for repeatedly updating a JBrowse instance when member databases / underlying tool versions are updated." optional="False">
228 </param>
229 <repeat name="data_tracks" title="Annotation Track">
230 <conditional name="data_format" label="Track Options">
231 <param type="select" label="Track Type" name="data_format_select">
232 <option value="blast">Blast XML</option>
233 <option value="gene_calls">GFF/GFF3/BED Features</option>
234 <option value="hic">HiC data (convert .cool with hicexplorer)</option>
235 <option value="pileup">BAM Pileups</option>
236 <option value="vcf">VCF SNPs</option>
237 <option value="wiggle">BigWig XY</option>
238 </param>
239 <when value="hic">
240 <expand macro="input_conditional" label="HiC Track Data" format="hic" help="Cool files must be converted first with hicexplorer" />
241 </when>
242 <when value="blast">
243 <expand macro="input_conditional" label="BlastXML Track Data" format="blastxml" />
244 <expand macro="track_styling"
245 classname="feature"
246 label="description"
247 description="Hit_titles"
248 height="600px"/>
249 <param label="Features used in Blast Search"
250 help="in GFF3. This is used so we know where to map features. E.g. where results of which CDS Protein32 match up to. The query IDs in your blast results should MATCH some feature IDs in your GFF3 file. This is an optional field and is most useful if using JBrowse to display protein blast results on a DNA genome. blastn results don't need this, blastp results on a protein sequence don't need this."
251 format="gff3"
252 name="blast_parent"
253 optional="true"
254 type="data"/>
255
256 <param label="Minimum Gap Size"
257 help="before a new match_part feature is created"
258 name="min_gap"
259 type="integer"
260 value="10"
261 min="2" />
262 <param label="Is this a protein blast search?"
263 type="boolean"
264 name="is_protein"
265 truevalue="true"
266 falsevalue="false" />
267
268 <param label="Index this track" name="index" type="boolean" checked="false" truevalue="true" falsevalue="false" />
269 </when>
270 <when value="vcf">
271 <expand macro="input_conditional" label="SNP Track Data" format="vcf" />
272 </when>
273 <when value="gene_calls">
274 <expand macro="input_conditional" label="GFF/GFF3/BED Track Data" format="gff,gff3,bed" />
275 <expand macro="track_styling"
276 classname="feature"
277 label="product,name,id"
278 description="note,description"
279 height="10px"/>
280 <conditional name="match_part" label="match/match_part data">
281 <param type="select" label="Match part" name="matchp">
282 <option value="false" selected="True">"No"</option>
283 <option value="true">"Yes"</option>
284 </param>
285 <when value="true">
286 <param label="Match Part Feature Type"
287 name="name"
288 type="text"
289 value="match"
290 help="Match_parts have several options for the parent feature type, such as cDNA_match, match, translated_nucleotide_match, etc. Please select the appropriate one here. You can leave empty to try autodetection (only works with CanvasFeatures track type)."
291 optional="True"/>
292 </when>
293 <when value="false" />
294 </conditional>
295 </when>
296 <when value="pileup">
297 <expand macro="input_conditional" label="BAM Track Data" format="bam" />
298 <param type="select" label="Autogenerate SNP Track"
299 help="Not recommended for deep coverage BAM files" name="autogen">
300 <option value="false" selected="True">"No"</option>
301 <option value="true">"Yes"</option>
302 </param>
303 <param label="Maximum size of BAM chunks"
304 name="chunkSizeLimit"
305 type="integer"
306 help="Maximum size in bytes of BAM chunks that the browser will try to deal with. When this is exceeded, most tracks will display 'Too much data' message."
307 value="5000000" />
308 </when>
309 <when value="wiggle">
310 <expand macro="input_conditional" label="BigWig Track Data" format="bigwig" />
311 </when>
312 </conditional>
313 </repeat>
314 </repeat>
315 <param type="hidden" name="uglyTestingHack" value="" />
316 </inputs>
317 <outputs>
318 <data format="html" name="output" label="JBrowse on $on_string - $standalone"/>
319 </outputs>
320 <tests>
321 <test>
322 <param name="reference_genome|genome_type_select" value="history"/>
323 <param name="reference_genome|genome" value="merlin.fa"/>
324 <param name="standalone" value="minimal" />
325 <param name="uglyTestingHack" value="enabled" />
326 <output name="output">
327 <assert_contents>
328 <has_text text="genome path="></has_text>
329 <has_text text="dataset id="></has_text>
330 <has_text text="history id="></has_text>
331 <has_text text="metadata"></has_text>
332 <has_text text="tool_id"></has_text>
333 </assert_contents>
334 </output>
335 </test>
336 <test>
337 <param name="reference_genome|genome_type_select" value="history"/>
338 <param name="reference_genome|genome" value="merlin.fa"/>
339 <param name="standalone" value="minimal" />
340 <repeat name="track_groups">
341 <param name="category" value="Default" />
342 <repeat name="data_tracks">
343 <conditional name="data_format">
344 <param name="data_format_select" value="gene_calls"/>
345 <param name="annotation" value="bed/test-3.bed,bed/test-6.bed"/>
346 </conditional>
347 </repeat>
348 </repeat>
349 <param name="uglyTestingHack" value="enabled" />
350 <output name="output">
351 <assert_contents>
352 <has_text text="genome path="></has_text>
353 <has_text text="dataset id="></has_text>
354 <has_text text="history id="></has_text>
355 <has_text text="metadata"></has_text>
356 <has_text text="tool_id"></has_text>
357 <has_text text="ext=&quot;bed&quot; label=&quot;test-3.bed&quot;"></has_text>
358 </assert_contents>
359 </output>
360 </test>
361 <test>
362 <conditional name="reference_genome">
363 <param name="genome_type_select" value="history"/>
364 <param name="genome" value="merlin.fa"/>
365 </conditional>
366 <param name="standalone" value="minimal" />
367 <repeat name="track_groups">
368 <param name="category" value="Auto Coloured" />
369 <repeat name="data_tracks">
370 <conditional name="data_format">
371 <param name="data_format_select" value="pileup"/>
372 <param name="annotation" value="bam/merlin-sample.bam"/>
373 </conditional>
374 </repeat>
375 </repeat>
376
377 <param name="uglyTestingHack" value="enabled" />
378 <output name="output">
379 <assert_contents>
380 <has_text text="merlin-sample.bam"/>
381 <has_text text="dname=&quot;merlin.fa&quot;"/>
382 <has_text text="bam_index"/>
383 </assert_contents>
384 </output>
385 </test>
386
387 <test>
388 <param name="reference_genome|genome_type_select" value="history"/>
389 <param name="reference_genome|genome" value="merlin.fa"/>
390 <param name="standalone" value="minimal" />
391 <param name="uglyTestingHack" value="enabled" />
392 <output name="output">
393 <assert_contents>
394 <has_text text="merlin.fa"/>
395 </assert_contents>
396 </output>
397 </test>
398
399 </tests>
400 <help><![CDATA[
401
402 JBrowse2-in-Galaxy
403 ==================
404
405 JBrowse2-in-Galaxy offers a highly configurable, workflow-compatible
406 alternative to JBrowse1-in-Galaxy and Trackster.
407
408 Compared to JBrowse1-in-Galaxy, there is no support for alternative codons for unusual genomes,
409 and detailed track styling is not yet implemented. Send code.
410 JBrowse1 development has now ceased in favour of JBrowse2.
411
412
413 Overview
414 --------
415
416 JBrowse is a fast, embeddable genome browser built completely with
417 JavaScript and HTML5.
418
419 The JBrowse-in-Galaxy (JiG) tool was written to help build complex
420 JBrowse installations straight from Galaxy, taking advantage of the
421 latest Galaxy features such as dataset collections, sections, and colour
422 pickers. It allows you to build up a JBrowse instance without worrying
423 about how to run the command line tools to format your data, and which
424 options need to be supplied and where. Additionally it comes with many
425 javascript functions to handle colouring of features which would be
426 nearly impossible to write without the assistance of this tool.
427
428 The JBrowse-in-Galaxy tool is maintained by `the Galaxy IUC
429 <https://github.com/galaxyproject/tools-iuc/issues>`__, who you can help you
430 with missing features or bugs in the tool.
431
432 Options
433 -------
434
435 The first option you encounter is the **Fasta Sequence(s)**. This option
436 now accepts multiple fasta files, allowing you to build JBrowse
437 instances that contain data for multiple genomes or chrosomomes
438 (generally known as "landmark features" in gff3 terminology.) Up to 30
439 will be shown from the dropdown selector within JBrowse, this is a known
440 issue.
441
442 **Track Groups** represent a set of tracks in a single category. These
443 can be used to let your users understand relationships between large
444 groups of tracks.
445
446 .. image:: sections.png
447
448 Annotation Tracks
449 -----------------
450
451 Within Track Groups, you have one or more **Annotation Tracks**. Each
452 Annotation Track is a groups of datasets which have similar styling.
453 This allows you to rapidly build up JBrowse instances without having to
454 configure tracks individually. A massive improvement over previous
455 versions. For example, if you have five different GFF3 files from
456 various gene callers that you wish to display, you can take advantage of
457 this feature to style all of them similarly.
458
459 There are a few different types of tracks supported, each with their own
460 set of options:
461
462 GFF3/BED
463 ~~~~~~~~
464
465 These are your standard feature tracks. They usually highlight genes,
466 mRNAs and other features of interest along a genomic region. The
467 underlying tool and this help documentation focus primarily on GFF3
468 data, and have not been tested extensively with other formats. Automatic
469 min/max detection will fail under BED datasets.
470
471 BAM Pileups
472 ~~~~~~~~~~~
473
474 We support BAM files and can automatically generate SNP tracks based on
475 that bam data.
476
477 .. image:: bam.png
478
479 This is *strongly discouraged* for high coverage density datasets.
480 Unfortunately there are no other configuration options exposed for bam
481 files.
482
483 BlastXML
484 ~~~~~~~~
485
486 .. image:: blast.png
487
488 JiG now supports both blastn and blastp datasets. JiG internally uses a
489 blastXML to gapped GFF3 tool to convert your blastxml datasets into a
490 format amenable to visualization in JBrowse. This tool is also
491 available separately from the IUC on the toolshed.
492
493 **Minimum Gap Size** reflects how long a gap must be before it becomes a
494 real gap in the processed gff3 file. In the picture above, various sizes
495 of gaps can be seen. If the minimum gap size was set much higher, say
496 100nt, many of the smaller gaps would disappear, and the features on
497 both sides would be merged into one, longer feature. This setting is
498 inversely proportional to runtime and output file size. *Do not set this
499 to a low value for large datasets*. By setting this number lower, you
500 will have extremely large outputs and extremely long runtimes. The
501 default was configured based off of the author's experience, but the
502 author only works on small viruses. It is *strongly* recommended that
503 you filter your blast results before display, e.g. picking out the top
504 10 hits or so.
505
506 **Protein blast search** option merely informs underlying tools that
507 they should adjust feature locations by 3x.
508
509 Bigwig XY
510 ~~~~~~~~~
511
512 .. image:: bigwig.png
513
514 **XYPlot**
515
516 BigWig tracks can be displayed as a "density" plot which is a continuous
517 line which varies in colour, or as an "XYplot." XYplots are preferable
518 for users to visually identify specific features in a bigwig track,
519 however density tracks are more visually compact.
520
521 VCFs/SNPs
522 ~~~~~~~~~
523
524 These tracks do not support any special configuration.
525
526 @ATTRIBUTION@
527 ]]></help>
528 <expand macro="citations"/>
529 </tool>