comparison tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml @ 11:4c4a0da938ff draft

Uploaded v0.0.22, now wraps BLAST+ 2.2.28 allowing extended tabular output to include the hit descriptions as column 25. Supports $GALAXY_SLOTS. Includes more tests and heavy use of macros.
author peterjc
date Thu, 05 Dec 2013 06:55:59 -0500
parents 70e7dcbf6573
children 623f727cdff1
comparison
equal deleted inserted replaced
10:70e7dcbf6573 11:4c4a0da938ff
1 <tool id="ncbi_tblastn_wrapper" name="NCBI BLAST+ tblastn" version="0.0.20"> 1 <tool id="ncbi_tblastn_wrapper" name="NCBI BLAST+ tblastn" version="0.0.22">
2 <description>Search translated nucleotide database with protein query sequence(s)</description> 2 <description>Search translated nucleotide database with protein query sequence(s)</description>
3 <!-- If job splitting is enabled, break up the query file into parts --> 3 <!-- If job splitting is enabled, break up the query file into parts -->
4 <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject,histdb" merge_outputs="output1"></parallelism> 4 <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" merge_outputs="output1"></parallelism>
5 <requirements> 5 <macros>
6 <requirement type="binary">tblastn</requirement> 6 <token name="@BINARY@">tblastn</token>
7 <requirement type="package" version="2.2.26+">blast+</requirement> 7 <import>ncbi_macros.xml</import>
8 </requirements> 8 </macros>
9 <version_command>tblastn -version</version_command> 9 <expand macro="requirements" />
10 <command> 10 <command>
11 ## The command is a Cheetah template which allows some Python based syntax. 11 ## The command is a Cheetah template which allows some Python based syntax.
12 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces 12 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
13 tblastn 13 tblastn
14 -query "$query" 14 -query "$query"
15 #if $db_opts.db_opts_selector == "db": 15 @BLAST_DB_SUBJECT@
16 -db "${db_opts.database.fields.path}"
17 #elif $db_opts.db_opts_selector == "histdb":
18 -db "${os.path.join($db_opts.histdb.extra_files_path,'blastdb')}"
19 #else:
20 -subject "$db_opts.subject"
21 #end if
22 -evalue $evalue_cutoff 16 -evalue $evalue_cutoff
23 -out "$output1" 17 @BLAST_OUTPUT@
24 ##Set the extended list here so if/when we add things, saved workflows are not affected 18 @THREADS@
25 #if str($out_format)=="ext":
26 -outfmt "6 std sallseqid score nident positive gaps ppos qframe sframe qseq sseq qlen slen"
27 #else:
28 -outfmt $out_format
29 #end if
30 -num_threads 8
31 #if $adv_opts.adv_opts_selector=="advanced": 19 #if $adv_opts.adv_opts_selector=="advanced":
32 -db_gencode $adv_opts.db_gencode 20 -db_gencode $adv_opts.db_gencode
33 $adv_opts.filter_query
34 -matrix $adv_opts.matrix 21 -matrix $adv_opts.matrix
35 ## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string 22 @ADVANCED_OPTIONS@
36 ## Note -max_target_seqs overrides -num_descriptions and -num_alignments
37 #if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0):
38 -max_target_seqs $adv_opts.max_hits
39 #end if
40 #if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
41 -word_size $adv_opts.word_size
42 #end if
43 ##Ungapped disabled for now - see comments below 23 ##Ungapped disabled for now - see comments below
44 ##$adv_opts.ungapped 24 ##$adv_opts.ungapped
45 $adv_opts.parse_deflines
46 ## End of advanced options: 25 ## End of advanced options:
47 #end if 26 #end if
48 </command> 27 </command>
49 <stdio> 28
50 <!-- Anything other than zero is an error --> 29 <expand macro="stdio" />
51 <exit_code range="1:" /> 30
52 <exit_code range=":-1" />
53 <!-- In case the return code has not been set propery check stderr too -->
54 <regex match="Error:" />
55 <regex match="Exception:" />
56 </stdio>
57 <inputs> 31 <inputs>
58 <param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> 32 <param name="query" type="data" format="fasta" label="Protein query sequence(s)"/>
59 <conditional name="db_opts"> 33
60 <param name="db_opts_selector" type="select" label="Subject database/sequences"> 34 <expand macro="input_conditional_nucleotide_db" />
61 <option value="db" selected="True">Locally installed BLAST database</option> 35 <expand macro="input_out_format" />
62 <option value="histdb">BLAST database from your history</option> 36 <expand macro="input_evalue" />
63 <option value="file">FASTA file from your history (see warning note below)</option> 37 <expand macro="advanced_options">
64 </param> 38 <expand macro="input_db_gencode" />
65 <when value="db"> 39
66 <param name="database" type="select" label="Nucleotide BLAST database"> 40 <!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
67 <options from_file="blastdb.loc"> 41 <expand macro="input_filter_query_default_true" />
68 <column name="value" index="0"/> 42 <expand macro="input_scoring_matrix" />
69 <column name="name" index="1"/> 43 <expand macro="input_max_hits" />
70 <column name="path" index="2"/> 44 <expand macro="input_word_size" />
71 </options>
72 </param>
73 <param name="histdb" type="hidden" value="" />
74 <param name="subject" type="hidden" value="" />
75 </when>
76 <when value="histdb">
77 <param name="database" type="hidden" value="" />
78 <param name="histdb" type="data" format="blastdbn" label="Nucleotide BLAST database" />
79 <param name="subject" type="hidden" value="" />
80 </when>
81 <when value="file">
82 <param name="database" type="hidden" value="" />
83 <param name="histdb" type="hidden" value="" />
84 <param name="subject" type="data" format="fasta" label="Nucleotide FASTA file to use as database"/>
85 </when>
86 </conditional>
87 <param name="evalue_cutoff" type="float" size="15" value="0.001" label="Set expectation value cutoff" />
88 <param name="out_format" type="select" label="Output format">
89 <option value="6">Tabular (standard 12 columns)</option>
90 <option value="ext" selected="True">Tabular (extended 24 columns)</option>
91 <option value="5">BLAST XML</option>
92 <option value="0">Pairwise text</option>
93 <option value="0 -html">Pairwise HTML</option>
94 <option value="2">Query-anchored text</option>
95 <option value="2 -html">Query-anchored HTML</option>
96 <option value="4">Flat query-anchored text</option>
97 <option value="4 -html">Flat query-anchored HTML</option>
98 <!-- 45 <!--
99 <option value="-outfmt 11">BLAST archive format (ASN.1)</option> 46 Can't use '-ungapped' on its own, error back is:
47 Composition-adjusted searched are not supported with an ungapped search, please add -comp_based_stats F or do a gapped search
48 Tried using '-ungapped -comp_based_stats F' and tblastn crashed with 'Attempt to access NULL pointer.'
49 <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped -comp_based_stats F" falsevalue="" checked="false" />
100 --> 50 -->
101 </param> 51 <expand macro="input_parse_deflines" />
102 <conditional name="adv_opts"> 52 </expand>
103 <param name="adv_opts_selector" type="select" label="Advanced Options">
104 <option value="basic" selected="True">Hide Advanced Options</option>
105 <option value="advanced">Show Advanced Options</option>
106 </param>
107 <when value="basic" />
108 <when value="advanced">
109 <param name="db_gencode" type="select" label="Database/subject genetic code">
110 <!-- See http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for details -->
111 <option value="1" select="True">1. Standard</option>
112 <option value="2">2. Vertebrate Mitochondrial</option>
113 <option value="3">3. Yeast Mitochondrial</option>
114 <option value="4">4. Mold, Protozoan, and Coelenterate Mitochondrial Code and the Mycoplasma/Spiroplasma Code</option>
115 <option value="5">5. Invertebrate Mitochondrial</option>
116 <option value="6">6. Ciliate, Dasycladacean and Hexamita Nuclear Code</option>
117 <option value="9">9. Echinoderm Mitochondrial</option>
118 <option value="10">10. Euplotid Nuclear</option>
119 <option value="11">11. Bacteria and Archaea</option>
120 <option value="12">12. Alternative Yeast Nuclear</option>
121 <option value="13">13. Ascidian Mitochondrial</option>
122 <option value="14">14. Flatworm Mitochondrial</option>
123 <option value="15">15. Blepharisma Macronuclear</option>
124 <option value="16">16. Chlorophycean Mitochondrial Code</option>
125 <option value="21">21. Trematode Mitochondrial Code</option>
126 <option value="22">22. Scenedesmus obliquus mitochondrial Code</option>
127 <option value="23">23. Thraustochytrium Mitochondrial Code</option>
128 <option value="24">24. Pterobranchia mitochondrial code</option>
129 </param>
130 <!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
131 <param name="filter_query" type="boolean" label="Filter out low complexity regions (with SEG)" truevalue="-seg yes" falsevalue="-seg no" checked="true" />
132 <param name="matrix" type="select" label="Scoring matrix">
133 <option value="BLOSUM90">BLOSUM90</option>
134 <option value="BLOSUM80">BLOSUM80</option>
135 <option value="BLOSUM62" selected="true">BLOSUM62 (default)</option>
136 <option value="BLOSUM50">BLOSUM50</option>
137 <option value="BLOSUM45">BLOSUM45</option>
138 <option value="PAM250">PAM250</option>
139 <option value="PAM70">PAM70</option>
140 <option value="PAM30">PAM30</option>
141 </param>
142 <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer -->
143 <param name="max_hits" type="integer" value="0" label="Maximum hits to show" help="Use zero for default limits">
144 <validator type="in_range" min="0" />
145 </param>
146 <!-- I'd like word_size to be optional, with minimum 2 for blastp -->
147 <param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2.">
148 <validator type="in_range" min="0" />
149 </param>
150 <!--
151 Can't use '-ungapped' on its own, error back is:
152 Composition-adjusted searched are not supported with an ungapped search, please add -comp_based_stats F or do a gapped search
153 Tried using '-ungapped -comp_based_stats F' and tblastn crashed with 'Attempt to access NULL pointer.'
154 <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped -comp_based_stats F" falsevalue="" checked="false" />
155 -->
156 <param name="parse_deflines" type="boolean" label="Should the query and subject defline(s) be parsed?" truevalue="-parse_deflines" falsevalue="" checked="false" help="This affects the formatting of the query/subject ID strings"/>
157 </when>
158 </conditional>
159 </inputs> 53 </inputs>
160 <outputs> 54 <outputs>
161 <data name="output1" format="tabular" label="tblastn on ${on_string}"> 55 <data name="output1" format="tabular" label="tblastn $query.name vs @ON_DB_SUBJECT@">
162 <change_format> 56 <expand macro="output_change_format" />
163 <when input="out_format" value="0" format="txt"/>
164 <when input="out_format" value="0 -html" format="html"/>
165 <when input="out_format" value="2" format="txt"/>
166 <when input="out_format" value="2 -html" format="html"/>
167 <when input="out_format" value="4" format="txt"/>
168 <when input="out_format" value="4 -html" format="html"/>
169 <when input="out_format" value="5" format="blastxml"/>
170 </change_format>
171 </data> 57 </data>
172 </outputs> 58 </outputs>
173 <tests> 59 <tests>
174 <test> 60 <test>
175 <param name="query" value="four_human_proteins.fasta" ftype="fasta" /> 61 <param name="query" value="four_human_proteins.fasta" ftype="fasta" />
248 <output name="output1" file="tblastn_four_human_vs_rhodopsin.html" ftype="html" /> 134 <output name="output1" file="tblastn_four_human_vs_rhodopsin.html" ftype="html" />
249 </test> 135 </test>
250 </tests> 136 </tests>
251 <help> 137 <help>
252 138
253 .. class:: warningmark 139 @SEARCH_TIME_WARNING@
254
255 **Note**. Database searches may take a substantial amount of time.
256 For large input datasets it is advisable to allow overnight processing.
257
258 -----
259 140
260 **What it does** 141 **What it does**
261 142
262 Search a *translated nucleotide database* using a *protein query*, 143 Search a *translated nucleotide database* using a *protein query*,
263 using the NCBI BLAST+ tblastn command line tool. 144 using the NCBI BLAST+ tblastn command line tool.
264 145
265 .. class:: warningmark 146 @FASTA_WARNING@
266
267 You can also search against a FASTA file of subject nucleotide
268 sequences. This is *not* advised because it is slower (only one
269 CPU is used), but more importantly gives e-values for pairwise
270 searches (very small e-values which will look overly signficiant).
271 In most cases you should instead turn the other FASTA file into a
272 database first using *makeblastdb* and search against that.
273 147
274 ----- 148 -----
275 149
276 **Output format** 150 @OUTPUT_FORMAT@
277
278 Because Galaxy focuses on processing tabular data, the default output of this
279 tool is tabular. The standard BLAST+ tabular output contains 12 columns:
280
281 ====== ========= ============================================
282 Column NCBI name Description
283 ------ --------- --------------------------------------------
284 1 qseqid Query Seq-id (ID of your sequence)
285 2 sseqid Subject Seq-id (ID of the database hit)
286 3 pident Percentage of identical matches
287 4 length Alignment length
288 5 mismatch Number of mismatches
289 6 gapopen Number of gap openings
290 7 qstart Start of alignment in query
291 8 qend End of alignment in query
292 9 sstart Start of alignment in subject (database hit)
293 10 send End of alignment in subject (database hit)
294 11 evalue Expectation value (E-value)
295 12 bitscore Bit score
296 ====== ========= ============================================
297
298 The BLAST+ tools can optionally output additional columns of information,
299 but this takes longer to calculate. Most (but not all) of these columns are
300 included by selecting the extended tabular output. The extra columns are
301 included *after* the standard 12 columns. This is so that you can write
302 workflow filtering steps that accept either the 12 or 24 column tabular
303 BLAST output. Galaxy now uses this extended 24 column output by default.
304
305 ====== ============= ===========================================
306 Column NCBI name Description
307 ------ ------------- -------------------------------------------
308 13 sallseqid All subject Seq-id(s), separated by a ';'
309 14 score Raw score
310 15 nident Number of identical matches
311 16 positive Number of positive-scoring matches
312 17 gaps Total number of gaps
313 18 ppos Percentage of positive-scoring matches
314 19 qframe Query frame
315 20 sframe Subject frame
316 21 qseq Aligned part of query sequence
317 22 sseq Aligned part of subject sequence
318 23 qlen Query sequence length
319 24 slen Subject sequence length
320 ====== ============= ===========================================
321
322 The third option is BLAST XML output, which is designed to be parsed by
323 another program, and is understood by some Galaxy tools.
324
325 You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
326 The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
327 The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
328 The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
329 and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
330 151
331 ------- 152 -------
332 153
333 **References** 154 **References**
334 155
335 If you use this Galaxy tool in work leading to a scientific publication please 156 If you use this Galaxy tool in work leading to a scientific publication please
336 cite the following papers: 157 cite the following papers:
337 158
338 Peter J.A. Cock, Björn A. Grüning, Konrad Paszkiewicz and Leighton Pritchard (2013). 159 @REFERENCES@
339 Galaxy tools and workflows for sequence analysis with applications
340 in molecular plant pathology. PeerJ 1:e167
341 http://dx.doi.org/10.7717/peerj.167
342
343 Christiam Camacho et al. (2009).
344 BLAST+: architecture and applications.
345 BMC Bioinformatics. 15;10:421.
346 http://dx.doi.org/10.1186/1471-2105-10-421
347
348 This wrapper is available to install into other Galaxy Instances via the Galaxy
349 Tool Shed at http://toolshed.g2.bx.psu.edu/view/devteam/ncbi_blast_plus
350 </help> 160 </help>
351 </tool> 161 </tool>