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