-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblast_reporting.xml
301 lines (258 loc) · 11.7 KB
/
blast_reporting.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<tool id="blast_reporting" name="BLAST Reporting" version="1.0.7">
<description>BLAST search results reporting tool</description>
<command interpreter="python"><![CDATA[
blast_reporting.py
$blastxml_file
$out_format
$tabular_file
$html_file
$selection_file:$selection_file.hid:$selection_file.dataset_id:$selection_file.id
$html_template
-f "
#for $my_repeat in $filter_num
$my_repeat.filter_column:
#for $my_repeat2 in $my_repeat.constraint
$my_repeat2.filter_comparison $my_repeat2.filter_value,
#end for
;
#end for
#for $my_repeat in $filter_text
$my_repeat.filter_column2:
#for $my_repeat2 in $my_repeat.constraint2
$my_repeat2.filter_comparison2 $my_repeat2.filter_value2.replace(',','|'),
#end for
;
#end for
"
#if len($bins)
-b "
#for $my_repeat in $bins
$my_repeat.bin_column:$my_repeat.group:$my_repeat.filter:$my_repeat.description;
#end for
"
#end if
#if $drop_redundant_hits
-r
#end if
#if $column_labels
-l "${column_labels}"
#end if
#if len($fields)
-c "
#for $my_repeat in $fields
$my_repeat.field:$my_repeat.group:$my_repeat.sort:$my_repeat.label;
#end for
"
#end if
#if not str($row_limit) == "None"
-n "${row_limit}"
#end if
#if len($bins)
-B "
#for $my_repeat in $bins
$my_repeat.library_dataset.get_file_name()
$my_repeat.library_dataset.id
#end for
"
#end if
]]></command>
<!-- target base="${GALAXY_DATA_MANAGER_DATA_PATH}">${dbkey}/seq/${path}</target -->
<inputs>
<param name="blastxml_file" type="data" format="blastxml" label="BLAST results as XML"/>
<repeat name="filter_num" title="Numeric Filter" min="0" max="4">
<!-- TRIED conditional here, but it does not allow for <repeat> children. -->
<param name="filter_column" type="select" label="Col">
<options from_data_table="blast_reporting_fields">
<filter type="static_value" value="numeric" column="type" />
<filter type="sort_by" column="name"/>
</options>
</param>
<repeat name="constraint" title="Constraint" min="1" max="3">
<param name="filter_comparison" type="select" label="Comparison">
<option value="gte">>= </option>
<option value="gt">></option>
<option value="lt">< </option>
<option value="lte"><= </option>
<option value="==">equal to </option>
<option value="!=">not equal to </option>
</param>
<param name="filter_value" type="text" value="" label="Value">
<validator type="regex" message="Please input a number">([0-9]+|[0-9]*\.[0-9]+)</validator>
</param>
</repeat>
</repeat>
<repeat name="filter_text" title="Text Filter" min="0" max="3">
<param name="filter_column2" type="select" label="Column">
<options from_data_table="blast_reporting_fields">
<filter type="sort_by" column="name"/>
<filter type="static_value" value="text" column="type" />
</options>
</param>
<repeat name="constraint2" title="Constraint" min="1" max="6">
<param name="filter_comparison2" type="select" label="Comparison">
<option value="includes">has text</option>
<option value="excludes">excludes text</option>
</param>
<param name="filter_value2" type="text" size="25" label="Phrase(s), comma separated" value=""/>
</repeat>
</repeat>
<param name="drop_redundant_hits" type="boolean" checked="true" label="Throw out redundant hits" help="Keep only the best hit when query matches multiple locales in a subject sequence." />
<param name="row_limit" type="integer" label="Row limit (per query)" help="Limit each query's results to this many rows. 0=unlimited." value="0" />
<param name="out_format" type="select" label="Basic Report Field Output" help="Use the field selectors below to add or customize fields that end up in the output HTML or tabular report. By default results are presented by query, with table data sorted by score, descending. Enter a preferred label in the text field to override the default field labeling.">
<option value="std" selected="True">Standard 12 columns</option>
<option value="std+seqs">Standard 12 columns + sequences (qseq and sseq)</option>
<option value="ext">Extended 25 columns</option>
<option value="ext+">Extended 26 columns</option>
<option value="custom">Only field selections below</option>
</param>
<repeat name="fields" title="Field" min="0">
<!-- acc, descr, score, p_cov, p_ident, -->
<param name="field" type="select" label="Include">
<options from_data_table="blast_reporting_fields">
<filter type="sort_by" column="name"/>
<filter type="static_value" value="1" column="choose" />
</options>
</param>
<param name="group" type="select" label="Group">
<option value="column" selected="true">A column</option>
<option value="hidden">A hidden column</option>
<option value="table">A table section</option>
<option value="section">A report section</option>
</param>
<param name="sort" type="select" label="Sort">
<option value="" selected="true">no sorting</option>
<option value="desc">descend</option>
<option value="asc">ascend</option>
</param>
<param name="label" type="text" label="Customize label for this column or section" size="15" value=""/>
</repeat>
<repeat name="bins" title="Reference Bin" min="0" max="5">
<!-- Introduced in may 2015 Galaxy. -->
<param name="library_dataset" type="library_data" label="Reference bin file" help="Select a reference bin from the popup window's Reference Bin library." multiple="false" />
<param name="bin_column" type="select" label="Sort by database bin match">
<options from_data_table="fasta_reference_dbs"></options>
</param>
<param name="group" type="select" label="Grouping">
<option value="column" selected="true">A column</option>
<option value="hidden">A hidden column</option>
<option value="table">A table section</option>
</param>
<param name="filter" type="select" label="Filtering">
<option value="" selected="true">No filtering </option>
<option value="include">keep only matches </option>
<option value="exclude">Exclude matches </option>
</param>
<param name="description" type="boolean" checked="true" label="Show Description" help="Show description" />
</repeat>
<param name="column_labels" type="select" label="Tabular Report Column Labels" help="">
<option value="label" selected="True">Short name</option>
<option value="field">Field name</option>
<option value="">No labels</option>
</param>
<param name="html_template" type="select" optional="true" label="HTML Report template">
<options from_data_table="blast_reporting_templates"/>
</param>
</inputs>
<outputs>
<data format="tabular" name="tabular_file" label="Tabular report for data $blastxml_file.hid" />
<data format="html" name="html_file" label="HTML report for data $blastxml_file.hid">
<filter>html_template</filter>
</data>
<data format="tabular" name="selection_file" label="Sequence Selection List for data $blastxml_file.hid">
<filter>(out_format != "std")</filter>
<filter>html_template</filter>
</data>
</outputs>
<tests>
<test><!-- Test taken from original BLAST to xml tool -->
<param name="blastxml_file" value="blastx_sample.xml"/>
<output name="tabular_file" file="blastx_sample_converted.tabular"/>
<param name="out_format" value="std"/>
<param name="column_labels" value="" />
<param name="drop_redundant_hits" value="False"/>
</test>
<test>
<param name="blastxml_file" value="blast_reporting_1.blastxml"/>
<output name="tabular_file" file="blast_reporting_1a.tabular"/>
<param name="out_format" value="std"/>
<param name="column_labels" value="" />
<param name="drop_redundant_hits" value="True"/>
</test>
<test>
<param name="blastxml_file" value="blast_reporting_1.blastxml"/>
<output name="tabular_file" file="blast_reporting_1b.tabular"/>
<param name="out_format" value="std"/>
<param name="column_labels" value="" />
<param name="drop_redundant_hits" value="True"/>
<param name="filter_num_0|filter_column" value="pident"/>
<param name="filter_num_0|constraint_0|filter_comparison" value="gte"/>
<param name="filter_num_0|constraint_0|filter_value" value="97"/>
</test>
<test>
<param name="blastxml_file" value="blast_reporting_1.blastxml"/>
<output name="tabular_file" file="blast_reporting_1c.tabular"/>
<output name="selection_file" file="blast_reporting_1c1.tabular"/>
<param name="out_format" value="ext"/>
<param name="column_labels" value="" />
<param name="drop_redundant_hits" value="True"/>
<param name="filter_num_0|filter_column" value="pident"/>
<param name="filter_num_0|constraint_0|filter_comparison" value="gte"/>
<param name="filter_num_0|constraint_0|filter_value" value="97"/>
<param name="fields_0|field" value="pident"/>
<param name="fields_0|group" value="column"/>
<param name="fields_0|sort" value="asc"/>
<param name="column_labels" value="label"/>
</test>
</tests>
<help><![CDATA[
.. class:: infomark
**What it does**
NCBI BLAST+ searches can output in a range of formats, but in the past only
the XML format included fields like sequence description.
This tool converts the BLAST XML report into 12, 25, 26 or custom column tabular
and HTML reports. This tool is loosely based on the ''BLAST XML to tabular'' tool
available in main toolshed. For the default 12 and 25 column reports, it should
produce the same output although whitespace differences may exist.
====== ============= ============================================
Column NCBI name Description
====== ============= ============================================
1 qseqid Query Seq-id (ID of your sequence)
2 sseqid Subject Seq-id (ID of the database hit)
3 pident Percentage of identical matches
4 length Alignment length
5 mismatch Number of mismatches
6 gapopen Number of gap openings
7 qstart Start of alignment in query
8 qend End of alignment in query
9 sstart Start of alignment in subject (database hit)
10 send End of alignment in subject (database hit)
11 evalue Expectation value (E-value)
12 bitscore Bit score
.
13 sallseqid All subject Seq-id(s), separated by a ';'
14 score Raw score
15 nident Number of identical matches
16 positive Number of positive-scoring matches
17 gaps Total number of gaps
18 ppos Percentage of positive-scoring matches
19 qframe Query frame
20 sframe Subject frame
21 qseq Aligned part of query sequence
22 sseq Aligned part of subject sequence
23 qlen Query sequence length
24 slen Subject sequence length
.
25 salltitles All subject title(s), separated by '<>'
26 pcov Percentage coverage
====== ============= ============================================
An option also exists to select particular columns for the output
report, and to cross-reference each result with one or more reference bins.
A command line version can be used. Type blast_reporting.py -h for help.
**python blast_reporting.py in_file out_file out_format [options]**
.. class:: warningmark
As noted in the original BLAST XML to tabular tool, ''Be aware that the XML file (and thus the conversion) and the tabular output direct from BLAST+ may differ in the presence of XXXX masking on regions low complexity (columns 21 and 22), and thus also calculated figures like the percentage identity (column 3) and gap openings.''
]]></help>
<citations>
<citation type="doi">10.7717/peerj.167</citation>
</citations>
</tool>