0
|
1 <tool id="hubArchiveCreator" name="Hub Archive Creator" version="2.0.2">
|
|
2 <description>
|
|
3 This Galaxy tool permits to prepare your files to be ready for
|
|
4 Assembly Hub visualization.
|
|
5 </description>
|
|
6
|
|
7 <requirements>
|
|
8 <requirement type="package" version="312">ucsc_tools</requirement>
|
|
9 <requirement type="package" version="0.0.1">gff3ToGenePred</requirement>
|
|
10 <requirement type="package" version="0.0.1">gtfToGenePred</requirement>
|
|
11 <requirement type="package" version="0.0.1">genePredToBed</requirement>
|
|
12 <requirement type="package" version="1.2">samtools</requirement>
|
|
13 <!-- Conda dependencies -->
|
|
14 <requirement type="package" version="324">ucsc-gff3togenepred</requirement>
|
|
15 <requirement type="package" version="324">ucsc-gtftogenepred</requirement>
|
|
16 <requirement type="package" version="324">ucsc-genepredtobed</requirement>
|
|
17 <requirement type="package" version="1.3.1">samtools</requirement>
|
|
18 </requirements>
|
|
19
|
|
20 <stdio>
|
|
21 <regex match="^pass1"
|
|
22 source="stderr"
|
|
23 level="log"
|
|
24 description="bedToBigBed"/>
|
|
25 <!-- TODO: Add the case pass1 and 0 chroms -->
|
|
26 <!-- TODO: Add the case pass2 and 0 records or 0 fields -->
|
|
27 </stdio>
|
|
28
|
|
29 <!-- Idea: python \ -augustus [parameters] \ -trfBig [parameters] -->
|
|
30 <command detect_errors="exit_code"><![CDATA[
|
|
31 mkdir -p $output.extra_files_path;
|
|
32 python $__tool_directory__/hubArchiveCreator.py
|
|
33
|
|
34 #import json
|
|
35
|
|
36 #set global data_parameter_dict = {}
|
|
37
|
|
38 ## Function to retrieve the data of the inputs
|
|
39 #def prepare_json($input_to_prepare, $order_index, $extra_data_dict={})
|
|
40 #set false_path = str($input_to_prepare)
|
|
41 #set name = $input_to_prepare.name
|
|
42
|
|
43 #set data_dict = {"name": $name}
|
|
44 #silent data_dict.update($extra_data_dict)
|
|
45
|
|
46 ## Add the ordering by taking the tool form indexes
|
|
47 #silent $data_dict.update({"order_index": $order_index + 1})
|
|
48
|
|
49 #silent $data_parameter_dict.update({$false_path: $data_dict})
|
|
50
|
|
51 #end def
|
|
52
|
|
53 #for $i, $f in enumerate( $format )
|
|
54 #if $f.formatChoice.format_select == "bam"
|
|
55 --bam $f.formatChoice.BAM
|
|
56 #set bam_index = $f.formatChoice.BAM.metadata.bam_index
|
|
57 #silent $prepare_json($f.formatChoice.BAM, $i, {"index": $bam_index})
|
|
58 #end if
|
|
59 #if $f.formatChoice.format_select == "bed"
|
|
60 #if $f.formatChoice.bedChoice.bed_select == "bed"
|
|
61 --bed $f.formatChoice.bedChoice.BED
|
|
62 #silent $prepare_json($f.formatChoice.bedChoice.BED, $i)
|
|
63 #end if
|
|
64 #if $f.formatChoice.bedChoice.bed_select == "bed_simple_repeats_option"
|
|
65 --bedSimpleRepeats $f.formatChoice.bedChoice.BED_simple_repeats
|
|
66 #silent $prepare_json($f.formatChoice.bedChoice.BED_simple_repeats, $i)
|
|
67 #end if
|
|
68 #end if
|
|
69 #if $f.formatChoice.format_select == "bigwig"
|
|
70 --bigwig $f.formatChoice.BIGWIG
|
|
71 #silent $prepare_json($f.formatChoice.BIGWIG, $i)
|
|
72 #end if
|
|
73 #if $f.formatChoice.format_select == "gff3"
|
|
74 --gff3 $f.formatChoice.GFF3
|
|
75 #silent $prepare_json($f.formatChoice.GFF3, $i)
|
|
76 #end if
|
|
77 #if $f.formatChoice.format_select == "gtf"
|
|
78 ## Add also GTF from Agustus? See https://github.com/ENCODE-DCC/kentUtils/issues/8
|
|
79 --gtf $f.formatChoice.GTF
|
|
80 #silent $prepare_json($f.formatChoice.GTF, $i)
|
|
81 #end if
|
|
82 #end for
|
|
83
|
|
84 ## Dump the final json
|
|
85 #set all_data_json = json.dumps($data_parameter_dict)
|
|
86
|
|
87 -f $Fasta_File
|
|
88 --data_json '$all_data_json'
|
|
89
|
|
90 -d $__tool_directory__ -e $output.files_path -o $output;
|
|
91 ]]></command>
|
|
92
|
|
93 <inputs>
|
|
94 <param
|
|
95 format="fasta"
|
|
96 name="Fasta_File"
|
|
97 type="data"
|
|
98 label="Reference genome"
|
|
99 />
|
|
100 <repeat name="format" title="Formats">
|
|
101 <conditional name="formatChoice">
|
|
102 <param name="format_select" type="select" label="Format">
|
|
103 <option value="bam" selected="true">BAM</option>
|
|
104 <option value="bed">BED</option>
|
|
105 <option value="bigwig">BIGWIG</option>
|
|
106 <option value="gff3">GFF3</option>
|
|
107 <option value="gtf">GTF</option>
|
|
108 </param>
|
|
109
|
|
110 <when value="bam">
|
|
111 <param
|
|
112 format="bam"
|
|
113 name="BAM"
|
|
114 type="data"
|
|
115 label="BAM File"
|
|
116 />
|
|
117 </when>
|
|
118 <when value="bigwig">
|
|
119 <param
|
|
120 format="bigwig"
|
|
121 name="BIGWIG"
|
|
122 type="data"
|
|
123 label="BIGWIG File"
|
|
124 />
|
|
125 </when>
|
|
126 <when value="gff3">
|
|
127 <param
|
|
128 format="gff3"
|
|
129 name="GFF3"
|
|
130 type="data"
|
|
131 label="GFF3 File"
|
|
132 />
|
|
133 </when>
|
|
134 <when value="gtf">
|
|
135 <param
|
|
136 format="gtf"
|
|
137 name="GTF"
|
|
138 type="data"
|
|
139 label="GTF File"
|
|
140 />
|
|
141 </when>
|
|
142 <when value="bed">
|
|
143 <conditional name="bedChoice">
|
|
144 <param name="bed_select" type="select" label="Bed Choice">
|
|
145 <option value="bed" selected="true">Generic BED</option>
|
|
146 <option value="bed_simple_repeats_option">BED simple repeats</option>
|
|
147 </param>
|
|
148 <when value="bed">
|
|
149 <param
|
|
150 format="bed"
|
|
151 name="BED"
|
|
152 type="data"
|
|
153 label="Generic Bed File Choice"
|
|
154 />
|
|
155 </when>
|
|
156 <when value="bed_simple_repeats_option">
|
|
157 <param
|
|
158 format="bed"
|
|
159 name="BED_simple_repeats"
|
|
160 type="data"
|
|
161 label="Bed Simple Repeats (Bed4+12) File"
|
|
162 />
|
|
163 </when>
|
|
164 </conditional>
|
|
165 </when>
|
|
166 </conditional>
|
|
167 </repeat>
|
|
168 </inputs>
|
|
169
|
|
170 <outputs>
|
|
171 <data format="trackhub" name="output"/>
|
|
172 </outputs>
|
|
173
|
|
174 <tests>
|
|
175 <!-- Can also use assert_command to test command -->
|
|
176 <!-- Testing GFF3 input -->
|
|
177 <test>
|
|
178 <param name="Fasta_File" value="dbia3.fa"/>
|
|
179 <repeat name="format">
|
|
180 <conditional name="formatChoice">
|
|
181 <param name="format_select" value="gff3"/>
|
|
182 <param name="GFF3" value="augustusDbia3.gff3"/>
|
|
183 </conditional>
|
|
184 </repeat>
|
|
185 <repeat name="format">
|
|
186 <param name="BED_simple_repeats" value="dbia3_trfBig_unsorted.bed"/>
|
|
187 <!-- TODO: Ask why the tests are not passing with this xml:
|
|
188 Error creating a job for these tool inputs - Error executing tool: 'NoneType' object has no attribute 'current_history'
|
|
189 <conditional name="formatChoice">
|
|
190 <param name="format_select" value="bed"/>
|
|
191 <conditional name="bedChoice">
|
|
192 <param name="bed_select" value="bed_simple_repeats_option"/>
|
|
193 <param name="BED_simple_repeats" value="dbia3_trfBig_unsorted.bed"/>
|
|
194 </conditional>
|
|
195 </conditional>
|
|
196 -->
|
|
197 </repeat>
|
|
198
|
|
199 <output name="output">
|
|
200 <assert_contents>
|
|
201 <has_text text="myHub"/>
|
|
202 </assert_contents>
|
|
203 <assert_contents>
|
|
204 <has_text text="dbia3_trfBig.bb"/>
|
|
205 </assert_contents>
|
|
206 <assert_contents>
|
|
207 <has_text text="SAODOAii qwwqod92921"/>
|
|
208 </assert_contents>
|
|
209 </output>
|
|
210 </test>
|
|
211 <test>
|
|
212 <param name="Fasta_File" value="dbia3.fa"/>
|
|
213 <param name="GFF3" value="augustusDbia3.gff3"/>
|
|
214 <output name="output" file="augustusOutput.html" lines_diff="2">
|
|
215 <extra_files type="directory" value="myHub"/>
|
|
216 <extra_files type="file" name="myHub/dbia3/tracks/augustusDbia3.bb" value="augustusDbia3.bb"/>
|
|
217 </output>
|
|
218 </test>
|
|
219 <!-- Testing Generic BED input -->
|
|
220 <!-- Testing Bed Simple repeat input -->
|
|
221 </tests>
|
|
222
|
|
223 <help>
|
|
224 This Galaxy tool permits to prepare your files to be ready for
|
|
225 Assembly Hub visualization.
|
|
226 </help>
|
|
227 </tool>
|