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