Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/galaxy/tool_util/xsd/galaxy.xsd @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author | guerler |
---|---|
date | Fri, 31 Jul 2020 00:32:28 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:d30785e31577 | 1:56ad4e20f292 |
---|---|
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <xs:schema | |
3 xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
4 xmlns:gxdocs="http://galaxyproject.org/xml/1.0" | |
5 elementFormDefault="qualified" | |
6 attributeFormDefault="unqualified" | |
7 > | |
8 <xs:annotation> | |
9 <xs:appinfo>Galaxy Schema</xs:appinfo> | |
10 <xs:documentation xml:lang="en">A Galaxy XML tool wrapper</xs:documentation> | |
11 </xs:annotation> | |
12 | |
13 <xs:element name="tool"> | |
14 <xs:annotation gxdocs:best_practices="tools"> | |
15 <xs:documentation xml:lang="en"><![CDATA[ | |
16 The outer-most tag set of tool XML files. Attributes on this tag apply to the | |
17 tool as a whole. | |
18 | |
19 ### Examples | |
20 | |
21 A normal tool: | |
22 | |
23 ```xml | |
24 <tool id="seqtk_seq" | |
25 name="Convert FASTQ to FASTA" | |
26 version="1.0.0" | |
27 profile="16.04" | |
28 > | |
29 ``` | |
30 | |
31 A ``data_source`` tool contains a few more relevant attributes. | |
32 | |
33 ```xml | |
34 <tool id="ucsc_table_direct1" | |
35 name="UCSC Main" | |
36 version="1.0.0" | |
37 hidden="false" | |
38 profile="16.01" | |
39 tool_type="data_source" | |
40 URL_method="post"> | |
41 ``` | |
42 ]]></xs:documentation> | |
43 </xs:annotation> | |
44 <xs:complexType> | |
45 <xs:all> | |
46 <!-- TODO: Move the anyType further into macros def... --> | |
47 <xs:element name="macros" type="Macros" minOccurs="0"/> | |
48 <xs:element name="edam_topics" type="EdamTopics" minOccurs="0"/> | |
49 <xs:element name="edam_operations" type="EdamOperations" minOccurs="0"/> | |
50 <xs:element name="xrefs" type="xrefs" minOccurs="0" /> | |
51 <xs:element name="requirements" type="Requirements" minOccurs="0"/> | |
52 <xs:element name="entry_points" type="EntryPoints" minOccurs="0" maxOccurs="1" /> | |
53 <xs:element name="description" type="xs:string" minOccurs="0"> | |
54 <xs:annotation gxdocs:best_practices="tool-descriptions"> | |
55 <xs:documentation xml:lang="en"><![CDATA[The value is displayed in | |
56 the tool menu immediately following the hyperlink for the tool (based on the | |
57 ``name`` attribute of the ``<tool>`` tag set described above). | |
58 | |
59 ### Example | |
60 | |
61 ```xml | |
62 <description>table browser</description> | |
63 ``` | |
64 ]]></xs:documentation> | |
65 </xs:annotation> | |
66 </xs:element> | |
67 <xs:element name="parallelism" type="Parallelism" minOccurs="0"/> | |
68 <xs:element name="version_command" type="VersionCommand" minOccurs="0"> | |
69 </xs:element> | |
70 <xs:element name="action" type="ToolAction" minOccurs="0" maxOccurs="1" /> | |
71 <xs:element name="environment_variables" type="EnvironmentVariables" minOccurs="0" maxOccurs="1"/> | |
72 <xs:element name="command" type="Command" minOccurs="0" maxOccurs="1"/> | |
73 <xs:element name="expression" type="Expression" minOccurs="0" maxOccurs="1"/> | |
74 <xs:element name="request_param_translation" type="RequestParameterTranslation" minOccurs="0"/> | |
75 <xs:element name="configfiles" type="ConfigFiles" minOccurs="0"/> | |
76 <xs:element name="outputs" type="Outputs" minOccurs="0"/> | |
77 <xs:element name="inputs" type="Inputs" minOccurs="0"/> | |
78 <xs:element name="tests" type="Tests" minOccurs="0"/> | |
79 <xs:element name="stdio" type="Stdio" minOccurs="0"/> | |
80 <xs:element name="help" type="xs:string" minOccurs="0"> | |
81 <xs:annotation gxdocs:best_practices="help-tag"> | |
82 <xs:documentation xml:lang="en"><![CDATA[This tag set includes all of the necessary details of how to use the tool. This tag set should be included as the next to the last tag set, before citations, in the tool config. Tool help is written in reStructuredText. Included here is only an overview of a subset of features. For more information see [here](https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html). | |
83 | |
84 tag | details | |
85 --- | ------- | |
86 ``.. class:: warningmark`` | a yellow warning symbol | |
87 ``.. class:: infomark`` | a blue information symbol | |
88 ``.. image:: path-of-the-file.png :height: 500 :width: 600`` | insert a png file of height 500 and width 600 at this position | | |
89 ``**bold**`` | bold | |
90 ``*italic*`` | italic | |
91 ``*`` | list | |
92 ``-`` | list | |
93 ``::`` | paragraph | |
94 ``-----`` | a horizontal line | |
95 | |
96 ### Examples | |
97 | |
98 Show a warning sign to remind users that this tool accept fasta format files only, followed by an example of the query sequence and a figure. | |
99 | |
100 ```xml | |
101 <help> | |
102 | |
103 .. class:: warningmark | |
104 | |
105 '''TIP''' This tool requires *fasta* format. | |
106 | |
107 ---- | |
108 | |
109 '''Example''' | |
110 | |
111 Query sequence:: | |
112 >seq1 | |
113 ATCG... | |
114 | |
115 .. image:: my_figure.png | |
116 :height: 500 | |
117 :width: 600 | |
118 | |
119 </help> | |
120 ``` | |
121 | |
122 ]]></xs:documentation> | |
123 </xs:annotation> | |
124 </xs:element> | |
125 <xs:element name="code" type="Code" minOccurs="0"/> | |
126 <xs:element name="uihints" type="UIhints" minOccurs="0"/> | |
127 <xs:element name="options" type="Options" minOccurs="0"/> | |
128 <xs:element name="trackster_conf" type="TracksterConf" minOccurs="0"/> | |
129 <xs:element name="citations" type="Citations" minOccurs="0"/> | |
130 </xs:all> | |
131 <xs:attribute name="id" type="xs:string" use="required"> | |
132 <xs:annotation gxdocs:best_practices="tool-ids"> | |
133 <xs:documentation xml:lang="en">Must be unique across all tools; | |
134 should be lowercase and contain only letters, numbers, and underscores. | |
135 It allows for tool versioning and metrics of the number of times a tool is used, | |
136 among other things.</xs:documentation> | |
137 </xs:annotation> | |
138 </xs:attribute> | |
139 <xs:attribute name="name" type="xs:string" use="required"> | |
140 <xs:annotation gxdocs:best_practices="tool-names"> | |
141 <xs:documentation xml:lang="en">This string is what is displayed as a | |
142 hyperlink in the tool menu.</xs:documentation> | |
143 </xs:annotation> | |
144 </xs:attribute> | |
145 <xs:attribute name="version" type="xs:string" default="1.0.0"> | |
146 <xs:annotation gxdocs:best_practices="tool-versions"> | |
147 <xs:documentation xml:lang="en">This string allows for tool versioning | |
148 and should be increased with each new version of the tool. The value should | |
149 follow the [PEP 440](https://www.python.org/dev/peps/pep-0440/) specification. | |
150 It defaults to ``1.0.0`` if it is not included in the tag.</xs:documentation> | |
151 </xs:annotation> | |
152 </xs:attribute> | |
153 <xs:attribute name="hidden" type="PermissiveBoolean" default="false"> | |
154 <xs:annotation> | |
155 <xs:documentation xml:lang="en">Allows for tools to be loaded upon | |
156 server startup, but not displayed in the tool menu. This attribute should be | |
157 applied in the toolbox configuration instead and so should be considered | |
158 deprecated. | |
159 </xs:documentation> | |
160 </xs:annotation> | |
161 </xs:attribute> | |
162 <xs:attribute name="display_interface" type="PermissiveBoolean"> | |
163 <xs:annotation> | |
164 <xs:documentation xml:lang="en">Disable the display the tool's | |
165 graphical tool form by setting this to ``false``.</xs:documentation> | |
166 </xs:annotation> | |
167 </xs:attribute> | |
168 <xs:attribute name="tool_type" type="ToolTypeType"> | |
169 <xs:annotation> | |
170 <xs:documentation xml:lang="en">Allows for certain framework | |
171 functionality to be performed on certain types of tools. Normal tools that execute | |
172 typical command-line jobs do not need to specify this, special kinds of tools such | |
173 as [Data Source](https://galaxyproject.org/admin/internals/data-sources/) and | |
174 [Data Manager](https://galaxyproject.org/admin/tools/data-managers/) tools should | |
175 set this to have values such as ``data_source`` or ``manage_data``.</xs:documentation> | |
176 </xs:annotation> | |
177 </xs:attribute> | |
178 <xs:attribute name="profile" type="xs:string"> | |
179 <xs:annotation> | |
180 <xs:documentation xml:lang="en">This string specifies the minimum Galaxy | |
181 version that should be required to run this tool. Certain legacy behaviors such | |
182 as using standard error content to detect errors instead of exit code are disabled | |
183 automatically if profile is set to any version newer than ``16.01``, such as | |
184 ``16.04``.</xs:documentation> | |
185 </xs:annotation> | |
186 </xs:attribute> | |
187 <xs:attribute name="python_template_version" type="xs:float"> | |
188 <xs:annotation> | |
189 <xs:documentation xml:lang="en">This string specifies the minimum Python | |
190 version that is able to fill the Cheetah sections of the tool. If unset defaults | |
191 to 2.7 if the profile is older than 19.01, otherwise defaults to 3.5. Galaxy will | |
192 attempt to convert Python statements in Cheetah sections using [future](http://python-future.org/) | |
193 if Galaxy is run on Python 3 and ``python_template_version`` is below 3.</xs:documentation> | |
194 </xs:annotation> | |
195 </xs:attribute> | |
196 <xs:attribute name="workflow_compatible" type="xs:boolean" default="true"> | |
197 <xs:annotation> | |
198 <xs:documentation xml:lang="en">This attribute indicates if | |
199 this tool is usable within a workflow (defaults to ``true`` for normal tools and | |
200 ``false`` for data sources).</xs:documentation> | |
201 </xs:annotation> | |
202 </xs:attribute> | |
203 <xs:attribute name="URL_method" type="URLmethodType"> | |
204 <xs:annotation> | |
205 <xs:documentation xml:lang="en">Only used if ``tool_type`` attribute value | |
206 is ``data_source`` - this attribute defines the HTTP request method to use when | |
207 communicating with an external data source application (the default is ``get``).</xs:documentation> | |
208 </xs:annotation> | |
209 </xs:attribute> | |
210 </xs:complexType> | |
211 </xs:element> | |
212 | |
213 <xs:complexType name="Macros"> | |
214 <xs:annotation> | |
215 <xs:documentation xml:lang="en">Frequently, tools may require the same XML | |
216 fragments be repeated in a file (for instance similar conditional branches, | |
217 repeated options, etc...) or among tools in the same repository. Galaxy tools | |
218 have a macro system to address this problem. | |
219 | |
220 For more information, see [planemo documentation](https://planemo.readthedocs.io/en/latest/writing_advanced.html#macros-reusable-elements)</xs:documentation> | |
221 </xs:annotation> | |
222 <xs:sequence> | |
223 <xs:element name="import" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> | |
224 <xs:element name="token" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/> | |
225 <xs:element name="xml" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/> | |
226 </xs:sequence> | |
227 </xs:complexType> | |
228 | |
229 <xs:complexType name="EntryPoints"> | |
230 <xs:annotation> | |
231 <xs:documentation xml:lang="en"><![CDATA[ | |
232 | |
233 This is a container tag set for the ``entry_point`` tag that contains ``port`` and ``url`` tags | |
234 described in greater detail below. ``entry_point``s describe InteractiveTool entry points | |
235 to a tool. | |
236 | |
237 ]]></xs:documentation> | |
238 </xs:annotation> | |
239 <xs:sequence> | |
240 <xs:element name="entry_point" type="EntryPoint" minOccurs="0" maxOccurs="unbounded"/> | |
241 </xs:sequence> | |
242 </xs:complexType> | |
243 | |
244 <xs:complexType name="EntryPoint" mixed="true"> | |
245 <xs:annotation> | |
246 <xs:documentation xml:lang="en"><![CDATA[ | |
247 | |
248 This tag set is contained within the ``<entry_point>`` tag set. Access to entry point | |
249 ports and urls are included in this tag set. These are used by InteractiveTools | |
250 to provide access to graphical tools in real-time. | |
251 | |
252 ```xml | |
253 <entry_points> | |
254 <entry_point name="Example name"> | |
255 <port>80</port> | |
256 <url>landing/${template_enabled}/index.html</url> | |
257 </entry_point> | |
258 </entry_points> | |
259 ``` | |
260 | |
261 ]]></xs:documentation> | |
262 </xs:annotation> | |
263 <xs:sequence> | |
264 <xs:element name="port" type="EntryPointPort" minOccurs="1" maxOccurs="1"/> | |
265 <xs:element name="url" type="EntryPointURL" minOccurs="0" maxOccurs="1"/> | |
266 </xs:sequence> | |
267 <xs:attribute name="name" type="xs:string" use="required"> | |
268 <xs:annotation> | |
269 <xs:documentation xml:lang="en">This value defines the name of the entry point.</xs:documentation> | |
270 </xs:annotation> | |
271 </xs:attribute> | |
272 <xs:attribute name="requires_domain" type="PermissiveBoolean" default="false"> | |
273 <xs:annotation> | |
274 <xs:documentation xml:lang="en">This value declares if domain-based proxying is required. Default is False. Currently only works when True.</xs:documentation> | |
275 </xs:annotation> | |
276 </xs:attribute> | |
277 </xs:complexType> | |
278 <xs:complexType name="EntryPointPort" mixed="true"> | |
279 <xs:annotation> | |
280 <xs:documentation xml:lang="en"><![CDATA[ | |
281 | |
282 This tag set is contained within the ``<entry_point>`` tag set. It contains the entry port. | |
283 | |
284 ]]></xs:documentation> | |
285 </xs:annotation> | |
286 </xs:complexType> | |
287 <xs:complexType name="EntryPointURL" mixed="true"> | |
288 <xs:annotation> | |
289 <xs:documentation xml:lang="en"><![CDATA[ | |
290 | |
291 This tag set is contained within the ``<entry_point>`` tag set. It contains the entry URL. | |
292 | |
293 ]]></xs:documentation> | |
294 </xs:annotation> | |
295 </xs:complexType> | |
296 | |
297 <xs:complexType name="ToolAction"> | |
298 <xs:annotation> | |
299 <xs:documentation xml:lang="en">Describe the backend Python action to execute for this Galaxy tool.</xs:documentation> | |
300 </xs:annotation> | |
301 <xs:sequence> | |
302 </xs:sequence> | |
303 <xs:attribute name="module" type="xs:string" use="required"> | |
304 </xs:attribute> | |
305 <xs:attribute name="class" type="xs:string" use="required"> | |
306 </xs:attribute> | |
307 </xs:complexType> | |
308 | |
309 <xs:complexType name="Requirements"> | |
310 <xs:annotation> | |
311 <xs:documentation xml:lang="en"><![CDATA[ | |
312 | |
313 This is a container tag set for the ``requirement`` and ``container`` tags | |
314 described in greater detail below. ``requirement``s describe software packages | |
315 and other individual computing requirements required to execute a tool, while | |
316 ``container``s describe Docker or Singularity containers that should be able to | |
317 serve as complete descriptions of the runtime of a tool. | |
318 | |
319 ]]></xs:documentation> | |
320 </xs:annotation> | |
321 <xs:sequence> | |
322 <xs:element name="requirement" type="Requirement" minOccurs="0" maxOccurs="unbounded"/> | |
323 <xs:element name="container" type="Container" minOccurs="0" maxOccurs="unbounded"/> | |
324 </xs:sequence> | |
325 </xs:complexType> | |
326 | |
327 <xs:complexType name="Requirement"> | |
328 <xs:annotation> | |
329 <xs:documentation xml:lang="en"><![CDATA[ | |
330 | |
331 This tag set is contained within the ``<requirements>`` tag set. Third party | |
332 programs or modules that the tool depends upon are included in this tag set. | |
333 | |
334 When a tool runs, Galaxy attempts to *resolve* these requirements (also called | |
335 dependencies). ``requirement``s are meant to be abstract and resolvable by | |
336 multiple different systems (e.g. [conda](https://conda.io/), the | |
337 [Galaxy Tool Shed dependency management system](https://galaxyproject.org/toolshed/tool-features/#Automatic_third-party_tool_dependency_installation_and_compilation_with_installed_repositories), | |
338 or [environment modules](http://modules.sourceforge.net/)). | |
339 | |
340 Read more about dependency resolvers in Galaxy on | |
341 [docs.galaxyproject.org](https://docs.galaxyproject.org/en/master/admin/dependency_resolvers.html). | |
342 The current best practice for tool dependencies is to target Conda, this is | |
343 discussed in greater detail | |
344 [here](https://docs.galaxyproject.org/en/master/admin/conda_faq.html). | |
345 | |
346 ### Examples | |
347 | |
348 This example shows a tool that requires the samtools 0.0.18 package. | |
349 | |
350 This package is available via the Tool Shed (see | |
351 [Tool Shed dependency management](https://galaxyproject.org/toolshed/tool-features/#Automatic_third-party_tool_dependency_installation_and_compilation_with_installed_repositories) | |
352 ) as well as [Conda](https://docs.galaxyproject.org/en/master/admin/conda_faq.html) | |
353 and can be configured locally to adapt to any other package management system. | |
354 | |
355 ```xml | |
356 <requirements> | |
357 <requirement type="package" version="0.1.18">samtools</requirement> | |
358 </requirements> | |
359 ``` | |
360 | |
361 This older example shows a tool that requires R version 2.15.1. The | |
362 ``tool_dependencies.xml`` should contain matching declarations for Galaxy to | |
363 actually install the R runtime. The ``set_envirornment`` type is only respected | |
364 by the tool shed and is ignored by the newer and preferred conda dependency | |
365 resolver. | |
366 | |
367 ```xml | |
368 <requirements> | |
369 <requirement type="set_environment">R_SCRIPT_PATH</requirement> | |
370 <requirement type="package" version="2.15.1">R</requirement> | |
371 </requirements> | |
372 ``` | |
373 | |
374 ]]></xs:documentation> | |
375 </xs:annotation> | |
376 <xs:simpleContent> | |
377 <xs:extension base="xs:string"> | |
378 <xs:attribute name="type" type="RequirementType" use="required"> | |
379 <xs:annotation> | |
380 <xs:documentation xml:lang="en">This value defines the type of the 3rd party module required by this tool.</xs:documentation> | |
381 </xs:annotation> | |
382 </xs:attribute> | |
383 <xs:attribute name="version" type="xs:string"> | |
384 <xs:annotation> | |
385 <xs:documentation xml:lang="en">For requirements of type ``package`` this value defines a specific version of the tool dependency.</xs:documentation> | |
386 </xs:annotation> | |
387 </xs:attribute> | |
388 </xs:extension> | |
389 </xs:simpleContent> | |
390 </xs:complexType> | |
391 <xs:complexType name="Container"> | |
392 <xs:annotation> | |
393 <xs:documentation xml:lang="en"><![CDATA[ | |
394 This tag set is contained within the 'requirements' tag set. Galaxy can be | |
395 configured to run tools within [Docker](https://www.docker.com/) or [Singularity](https://www.sylabs.io/singularity/) | |
396 containers - this tag allows the tool to suggest possible valid containers for this tool. The contents of the tag should | |
397 be a container image identifier appropriate for the particular container runtime being used, e.g. | |
398 ``quay.io/biocontainers/fastqc:0.11.2--1`` for Docker or ``docker://quay.io/biocontainers/fastqc:0.11.2--1`` | |
399 (or alternatively ``/opt/containers/fastqc.simg`` if your Galaxy installation will be loading the image from a filesystem path) | |
400 for Singularity. The ``requirements`` tag can contain multiple ``container`` tags describing suitable container options, in | |
401 which case the first container that is found by the Galaxy container resolver at runtime will be used. | |
402 | |
403 Example: | |
404 | |
405 ```xml | |
406 <requirements> | |
407 <container type="docker">quay.io/biocontainers/fastqc:0.11.2--1</container> | |
408 <requirements> | |
409 ``` | |
410 | |
411 Read more about configuring Galaxy to run Docker jobs | |
412 [here](https://galaxyproject.org/admin/tools/docker/). | |
413 ]]></xs:documentation> | |
414 </xs:annotation> | |
415 <xs:simpleContent> | |
416 <xs:extension base="xs:string"> | |
417 <xs:attribute name="type" type="ContainerType" use="required"> | |
418 <xs:annotation> | |
419 <xs:documentation xml:lang="en">This value describes the type of container that the tool may be executed in and currently may be ``docker`` or ``singularity``.</xs:documentation> | |
420 </xs:annotation> | |
421 </xs:attribute> | |
422 </xs:extension> | |
423 </xs:simpleContent> | |
424 </xs:complexType> | |
425 | |
426 <xs:complexType name="Parallelism"> | |
427 <xs:annotation> | |
428 <xs:documentation xml:lang="en">Documentation for Parallelism</xs:documentation> | |
429 </xs:annotation> | |
430 <xs:attribute name="method" type="MethodType"> | |
431 <xs:annotation> | |
432 <xs:documentation xml:lang="en">Documentation for method</xs:documentation> | |
433 </xs:annotation> | |
434 </xs:attribute> | |
435 <xs:attribute name="merge_outputs" type="xs:string"> | |
436 <xs:annotation> | |
437 <xs:documentation xml:lang="en">Documentation for merge_outputs</xs:documentation> | |
438 </xs:annotation> | |
439 </xs:attribute> | |
440 <xs:attribute name="split_inputs" type="xs:string"> | |
441 <xs:annotation> | |
442 <xs:documentation xml:lang="en">A comma-separated list of data inputs to split for job parallelization.</xs:documentation> | |
443 </xs:annotation> | |
444 </xs:attribute> | |
445 <xs:attribute name="split_size" type="xs:string"> | |
446 <xs:annotation> | |
447 <xs:documentation xml:lang="en">Documentation for split_size</xs:documentation> | |
448 </xs:annotation> | |
449 </xs:attribute> | |
450 <xs:attribute name="split_mode" type="xs:string"> | |
451 <xs:annotation> | |
452 <xs:documentation xml:lang="en">Documentation for split_mode</xs:documentation> | |
453 </xs:annotation> | |
454 </xs:attribute> | |
455 <xs:attribute name="shared_inputs" type="xs:string"> | |
456 <xs:annotation> | |
457 <xs:documentation xml:lang="en">A comma-separated list of data inputs that should not be split for this tool, Galaxy will infer this if not present and so this potentially never needs to be set.</xs:documentation> | |
458 </xs:annotation> | |
459 </xs:attribute> | |
460 </xs:complexType> | |
461 <xs:complexType name="Code"> | |
462 <xs:annotation> | |
463 <xs:documentation xml:lang="en"><![CDATA[ | |
464 *Deprecated*. Do not use this unless absolutely necessary. | |
465 | |
466 The extensions described here can cause problems using your tool with certain components | |
467 of Galaxy (like the workflow system). It is highly recommended to avoid these constructs | |
468 unless absolutely necessary. | |
469 | |
470 This tag set provides detailed control of the way the tool is executed. This | |
471 (optional) code can be deployed in a separate file in the same directory as the | |
472 tool's config file. These hooks are being replaced by new tool config features | |
473 and methods in the [/lib/galaxy/tools/\__init__.py](https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tools/__init__.py) code file. | |
474 | |
475 ### Examples | |
476 | |
477 #### Dynamic Options | |
478 | |
479 Use associated dynamic select lists where selecting an option in the first | |
480 select list dynamically re-renders the options in the second select list. In | |
481 this example, we are populating both dynamic select lists from metadata elements | |
482 associated with a tool's single input dataset. The 2 metadata elements we're | |
483 using look like this. | |
484 | |
485 ```python | |
486 MetadataElement(name="field_names", default=[], desc="Field names", readonly=True, optional=True, visible=True, no_value=[]) | |
487 # The keys in the field_components map to the list of field_names in the above element | |
488 # which ensures order for select list options that are built from it. | |
489 MetadataElement(name="field_components", default={}, desc="Field names and components", readonly=True, optional=True, visible=True, no_value={}) | |
490 ``` | |
491 | |
492 Our tool config includes a code file tag like this. | |
493 | |
494 ```xml | |
495 <code file="tool_form_utils.py" /> | |
496 ``` | |
497 | |
498 Here are the relevant input parameters in our tool config. The first parameter | |
499 is the input dataset that includes the above metadata elements. | |
500 | |
501 ```xml | |
502 <param name="input" type="data" format="vtkascii,vtkbinary" label="Shape with uncolored surface field"> | |
503 <validator type="expression" message="Shape must have an uncolored surface field.">value is not None and len(value.metadata.field_names) > 0</validator> | |
504 </param> | |
505 ``` | |
506 | |
507 The following parameter dynamically renders a select list consisting of the | |
508 elements in the ``field_names`` metadata element associated with the selected | |
509 input dataset. | |
510 | |
511 ```xml | |
512 <param name="field_name" type="select" label="Field name" refresh_on_change="true"> | |
513 <options> | |
514 <filter type="data_meta" ref="input" key="field_names"/> | |
515 <validator type="no_options" message="The selected shape has no uncolored surface fields." /> | |
516 </options> | |
517 </param> | |
518 ``` | |
519 | |
520 The following parameter calls the ``get_field_components_options()`` function in | |
521 the ``tool_form_utils.py`` code file discussed above. This function returns the | |
522 value of the input dataset's ``field_components`` metadata element dictionary | |
523 whose key is the currently selected ``field_name`` from the select list parameter | |
524 above. | |
525 | |
526 ```xml | |
527 <param name="field_component_index" type="select" label="Field component index" dynamic_options="get_field_components_options(input, field_name=field_name)" help="Color will be applied to the selected field's component associated with this index." /> | |
528 ``` | |
529 | |
530 Changing the selected option in the ``field_name`` select list will dynamically | |
531 re-render the options available in the associated ``field_component_index`` select | |
532 list, which is the behavior we want. | |
533 | |
534 The ``get_field_components_options()`` method looks like this. | |
535 | |
536 ```python | |
537 def get_field_components_options(dataset, field_name): | |
538 options = [] | |
539 if dataset.metadata is None: | |
540 return options | |
541 if not hasattr(dataset.metadata, 'field_names'): | |
542 return options | |
543 if dataset.metadata.field_names is None: | |
544 return options | |
545 if field_name is None: | |
546 # The expression validator that helps populate the select list of input | |
547 # datsets in the icqsol_color_surface_field tool does not filter out | |
548 # datasets with no field field_names, so we need this check. | |
549 if len(dataset.metadata.field_names) == 0: | |
550 return options | |
551 field_name = dataset.metadata.field_names[0] | |
552 field_components = dataset.metadata.field_components.get(field_name, []) | |
553 for i, field_component in enumerate(field_components): | |
554 options.append((field_component, field_component, i == 0)) | |
555 return options | |
556 ``` | |
557 | |
558 #### Parameter Validation | |
559 | |
560 This function is called before the tool is executed. If it raises any exceptions the tool execution will be aborted and the exception's value will be displayed in an error message box. Here is an example: | |
561 | |
562 ```python | |
563 def validate(incoming): | |
564 """Validator for the plotting program""" | |
565 | |
566 | |
567 bins = incoming.get("bins","") | |
568 col = incoming.get("col","") | |
569 | |
570 | |
571 if not bins or not col: | |
572 raise Exception, "You need to specify a number for bins and columns" | |
573 | |
574 | |
575 try: | |
576 bins = int(bins) | |
577 col = int(col) | |
578 except: | |
579 raise Exception, "Parameters are not integers, columns:%s, bins:%s" % (col, bins) | |
580 | |
581 | |
582 if not 1<bins<100: | |
583 raise Exception, "The number of bins %s must be a number between 1 and 100" % bins | |
584 ``` | |
585 | |
586 This code will intercept a number of parameter errors and return corresponding error messages. The parameter ``incoming`` contains a dictionary with all the parameters that were sent through the web. | |
587 | |
588 #### Pre-job and pre-process code | |
589 | |
590 The signature of both of these is the same: | |
591 | |
592 ```python | |
593 def exec_before_job(inp_data, out_data, param_dict, tool): | |
594 def exec_before_process(inp_data, out_data, param_dict, tool): | |
595 ``` | |
596 | |
597 The ``param_dict`` is a dictionary that contains all the values in the ``incoming`` parameter above plus a number of keys and values generated internally by galaxy. The ``inp_data`` and the ``out_data`` are dictionaries keyed by parameter name containing the classes that represent the data. | |
598 | |
599 Example: | |
600 | |
601 ```python | |
602 def exec_before_process(inp_data, out_data, param_dict, tool): | |
603 for name, data in out_data.items(): | |
604 data.name = 'New name' | |
605 ``` | |
606 | |
607 This custom code will change the name of the data that was created for this tool to **New name**. The difference between these two functions is that the ``exec_before_job`` executes before the page returns and the user will see the new name right away. If one were to use ``exec_before_process`` the new name would be set only once the job starts to execute. | |
608 | |
609 #### Post-process code | |
610 | |
611 This code executes after the background process running the tool finishes its run. The example below is more advanced one that replaces the type of the output data depending on the parameter named ``extension``: | |
612 | |
613 ```python | |
614 from galaxy import datatypes | |
615 def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): | |
616 ext = param_dict.get('extension', 'text') | |
617 items = out_data.items() | |
618 for name, data in items: | |
619 newdata = datatypes.factory(ext)(id=data.id) | |
620 for key, value in data. __dict__.items(): | |
621 setattr(newdata, key, value) | |
622 newdata.ext = ext | |
623 out_data[name] = newdata | |
624 ``` | |
625 | |
626 The content of ``stdout`` and ``stderr`` are strings containing the output of the process. | |
627 | |
628 ]]></xs:documentation> | |
629 | |
630 </xs:annotation> | |
631 <xs:sequence> | |
632 <xs:element name="hook" type="CodeHook" minOccurs="0" maxOccurs="unbounded"/> | |
633 </xs:sequence> | |
634 <xs:attribute name="file" type="xs:string" use="required"> | |
635 <xs:annotation> | |
636 <xs:documentation xml:lang="en">This value is the name of the executable code file, and is called in the ``exec_before_process()``, ``exec_before_job()``, ``exec_after_process()`` and ``exec_after_job()`` methods.</xs:documentation> | |
637 </xs:annotation> | |
638 </xs:attribute> | |
639 </xs:complexType> | |
640 <xs:complexType name="CodeHook"> | |
641 <xs:annotation> | |
642 <xs:documentation xml:lang="en">*Deprecated*. Map a hook to a function defined in the code file.</xs:documentation> | |
643 </xs:annotation> | |
644 <xs:attribute name="exec_after_process" type="xs:string"> | |
645 <xs:annotation> | |
646 <xs:documentation xml:lang="en">Function defined in the code file to which the ``exec_after_process`` hook should be mapped</xs:documentation> | |
647 </xs:annotation> | |
648 </xs:attribute> | |
649 </xs:complexType> | |
650 <xs:complexType name="UIhints"> | |
651 <xs:annotation> | |
652 <xs:documentation xml:lang="en">Used only for data source tools, this directive contains UI options (currently only ``minwidth`` is valid).</xs:documentation> | |
653 </xs:annotation> | |
654 <xs:attribute name="minwidth" type="xs:integer"> | |
655 <xs:annotation> | |
656 <xs:documentation xml:lang="en">Documentation for minwidth</xs:documentation> | |
657 </xs:annotation> | |
658 </xs:attribute> | |
659 </xs:complexType> | |
660 | |
661 <xs:complexType name="Options"> | |
662 <xs:annotation> | |
663 <xs:documentation xml:lang="en">This directive is used to specify some rarely modified options.</xs:documentation> | |
664 </xs:annotation> | |
665 <xs:attribute name="refresh" type="PermissiveBoolean" gxdocs:deprecated="true"> | |
666 <xs:annotation> | |
667 <xs:documentation xml:lang="en">*Deprecated*. Unused attribute.</xs:documentation> | |
668 </xs:annotation> | |
669 </xs:attribute> | |
670 <xs:attribute name="sanitize" type="PermissiveBoolean" default="true"> | |
671 <xs:annotation> | |
672 <xs:documentation xml:lang="en">This attribute can be used to turn off all input sanitization for a tool.</xs:documentation> | |
673 </xs:annotation> | |
674 </xs:attribute> | |
675 </xs:complexType> | |
676 | |
677 <xs:complexType name="TracksterConf"> | |
678 <xs:annotation> | |
679 <xs:documentation xml:lang="en">This directive is used to specify some rarely modified trackster options.</xs:documentation> | |
680 </xs:annotation> | |
681 <xs:sequence> | |
682 <xs:element name="action" type="TracksterAction" minOccurs="0" maxOccurs="unbounded" /> | |
683 </xs:sequence> | |
684 </xs:complexType> | |
685 | |
686 <xs:complexType name="TracksterAction"> | |
687 <xs:annotation> | |
688 <xs:documentation xml:lang="en"></xs:documentation> | |
689 </xs:annotation> | |
690 <xs:attribute name="name" type="xs:string"> | |
691 <xs:annotation> | |
692 <xs:documentation xml:lang="en"></xs:documentation> | |
693 </xs:annotation> | |
694 </xs:attribute> | |
695 <xs:attribute name="output_name" type="xs:string"> | |
696 <xs:annotation> | |
697 <xs:documentation xml:lang="en"></xs:documentation> | |
698 </xs:annotation> | |
699 </xs:attribute> | |
700 </xs:complexType> | |
701 | |
702 <xs:complexType name="Tests"> | |
703 <xs:annotation gxdocs:best_practices="tests"> | |
704 <xs:documentation xml:lang="en"><![CDATA[ | |
705 | |
706 Container tag set to specify tests via the ``<test>`` tag sets. Any number of tests can be included, | |
707 and each test is wrapped within separate ``<test>`` tag sets. Functional tests are | |
708 executed via [Planemo](https://planemo.readthedocs.io/) or the | |
709 [run_tests.sh](https://github.com/galaxyproject/galaxy/blob/dev/run_tests.sh) | |
710 shell script distributed with Galaxy. | |
711 | |
712 The documentation contained here is mostly reference documentation, for | |
713 tutorials on writing tool tests please check out Planemo's | |
714 [Test-Driven Development](https://planemo.readthedocs.io/en/latest/writing_advanced.html#test-driven-development) | |
715 documentation or the much older wiki content for | |
716 [WritingTests](https://galaxyproject.org/admin/tools/writing-tests/). | |
717 | |
718 ]]></xs:documentation> | |
719 </xs:annotation> | |
720 <xs:sequence> | |
721 <xs:element name="test" type="Test" minOccurs="0" maxOccurs="unbounded"/> | |
722 </xs:sequence> | |
723 </xs:complexType> | |
724 | |
725 <xs:complexType name="Test"> | |
726 <xs:annotation> | |
727 <xs:documentation xml:lang="en"><![CDATA[ | |
728 | |
729 This tag set contains the necessary parameter values for executing the tool via | |
730 the functional test framework. | |
731 | |
732 ### Example | |
733 | |
734 The following two tests will execute the | |
735 [/tools/filters/sorter.xml](https://github.com/galaxyproject/galaxy/blob/dev/tools/filters/sorter.xml) | |
736 tool. Notice the way that the tool's inputs and outputs are defined. | |
737 | |
738 ```xml | |
739 <tests> | |
740 <test> | |
741 <param name="input" value="1.bed" ftype="bed" /> | |
742 <param name="column" value="1"/> | |
743 <param name="order" value="ASC"/> | |
744 <param name="style" value="num"/> | |
745 <output name="out_file1" file="sort1_num.bed" ftype="bed" /> | |
746 </test> | |
747 <test> | |
748 <param name="input" value="7.bed" ftype="bed" /> | |
749 <param name="column" value="1"/> | |
750 <param name="order" value="ASC"/> | |
751 <param name="style" value="alpha"/> | |
752 <output name="out_file1" file="sort1_alpha.bed" ftype="bed" /> | |
753 </test> | |
754 </tests> | |
755 ``` | |
756 | |
757 The following example, tests the execution of the MAF-to-FASTA converter | |
758 ([/tools/maf/maf_to_fasta.xml](https://github.com/galaxyproject/galaxy/blob/master/tools/maf/maf_to_fasta.xml)). | |
759 | |
760 ```xml | |
761 <tests> | |
762 <test> | |
763 <param name="input1" value="3.maf" ftype="maf"/> | |
764 <param name="species" value="canFam1"/> | |
765 <param name="fasta_type" value="concatenated"/> | |
766 <output name="out_file1" file="cf_maf2fasta_concat.dat" ftype="fasta"/> | |
767 </test> | |
768 </tests> | |
769 ``` | |
770 | |
771 This test demonstrates verifying specific properties about a test output instead | |
772 of directly comparing it to another file. Here the file attribute is not | |
773 specified and instead a series of assertions is made about the output. | |
774 | |
775 ```xml | |
776 <test> | |
777 <param name="input" value="maf_stats_interval_in.dat" /> | |
778 <param name="lineNum" value="99999"/> | |
779 <output name="out_file1"> | |
780 <assert_contents> | |
781 <has_text text="chr7" /> | |
782 <not_has_text text="chr8" /> | |
783 <has_text_matching expression="1274\d+53" /> | |
784 <has_line_matching expression=".*\s+127489808\s+127494553" /> | |
785 <!-- 	 is XML escape code for tab --> | |
786 <has_line line="chr7	127471195	127489808" /> | |
787 <has_n_columns n="3" /> | |
788 <has_n_lines n="3" /> | |
789 </assert_contents> | |
790 </output> | |
791 </test> | |
792 ``` | |
793 | |
794 ]]></xs:documentation> | |
795 </xs:annotation> | |
796 <xs:sequence> | |
797 <xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded"/> | |
798 </xs:sequence> | |
799 <xs:attribute name="expect_exit_code" type="xs:integer"> | |
800 <xs:annotation> | |
801 <xs:documentation xml:lang="en">Describe the job's expected exit code.</xs:documentation> | |
802 </xs:annotation> | |
803 </xs:attribute> | |
804 <xs:attribute name="expect_num_outputs" type="xs:integer"> | |
805 <xs:annotation> | |
806 <xs:documentation xml:lang="en">Assert the number of outputs this test | |
807 should produce, this is useful to ensure ``filter`` directives are implemented correctly.</xs:documentation> | |
808 </xs:annotation> | |
809 </xs:attribute> | |
810 <xs:attribute name="expect_failure" type="PermissiveBoolean" default="false"> | |
811 <xs:annotation> | |
812 <xs:documentation xml:lang="en">Setting this to ``true`` indicates | |
813 the expectation is for the job fail. If set to ``true`` no job output checks may | |
814 be present in ``test`` definition.</xs:documentation> | |
815 </xs:annotation> | |
816 </xs:attribute> | |
817 <xs:attribute name="maxseconds" type="xs:integer"> | |
818 <xs:annotation> | |
819 <xs:documentation xml:lang="en">Maximum amount of time to let test run.</xs:documentation> | |
820 </xs:annotation> | |
821 </xs:attribute> | |
822 </xs:complexType> | |
823 <xs:group name="TestParamElement"> | |
824 <xs:choice> | |
825 <xs:element name="param" type="TestParam" /> | |
826 <xs:element name="repeat" type="TestRepeat" /> | |
827 <xs:element name="conditional" type="TestConditional" /> | |
828 <xs:element name="section" type="TestSection" /> | |
829 <xs:element name="output" type="TestOutput" minOccurs="0" maxOccurs="unbounded"/> | |
830 <xs:element name="output_collection" type="TestOutputCollection"/> | |
831 <xs:element name="assert_command" type="TestAssertions"> | |
832 <xs:annotation> | |
833 <xs:documentation xml:lang="en">Describe assertions about the job's | |
834 generated command-line. | |
835 | |
836 $assertions | |
837 </xs:documentation> | |
838 </xs:annotation> | |
839 </xs:element> | |
840 <xs:element name="assert_stdout" type="TestAssertions"> | |
841 <xs:annotation> | |
842 <xs:documentation xml:lang="en">Describe assertions about the job's | |
843 standard output. | |
844 | |
845 $assertions | |
846 </xs:documentation> | |
847 </xs:annotation> | |
848 </xs:element> | |
849 <xs:element name="assert_stderr" type="TestAssertions"> | |
850 <xs:annotation> | |
851 <xs:documentation xml:lang="en">Describe assertions about the job's | |
852 standard error. | |
853 | |
854 $assertions | |
855 </xs:documentation> | |
856 </xs:annotation> | |
857 </xs:element> | |
858 <xs:element name="assert_command_version" type="TestAssertions"> | |
859 <xs:annotation> | |
860 <xs:documentation xml:lang="en">Describe assertions about the job's | |
861 command version. | |
862 | |
863 $assertions | |
864 </xs:documentation> | |
865 </xs:annotation> | |
866 </xs:element> | |
867 </xs:choice> | |
868 </xs:group> | |
869 <xs:complexType name="TestSection"> | |
870 <xs:annotation> | |
871 <xs:documentation xml:lang="en"><![CDATA[ | |
872 | |
873 Specify test parameters below a named of a ``section`` block matching | |
874 one in ``inputs`` with this element. | |
875 | |
876 ``param`` elements in a ``test`` block can be arranged into nested ``repeat``, | |
877 ``conditional``, and ``select`` structures to match the inputs. While this might | |
878 be overkill for simple tests, it helps prevent ambiguous definitions and keeps | |
879 things organized in large test cases. A future ``profile`` version of Galaxy | |
880 tools may require ``section`` blocks be explicitly defined with this | |
881 directive. | |
882 | |
883 ### Examples | |
884 | |
885 The test tool demonstrating sections | |
886 ([section.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/section.xml)) | |
887 contains a test case demonstrating this block. This test case appears below: | |
888 | |
889 ```xml | |
890 <test> | |
891 <section name="int"> | |
892 <param name="inttest" value="12456" /> | |
893 </section> | |
894 <section name="float"> | |
895 <param name="floattest" value="6.789" /> | |
896 </section> | |
897 <output name="out_file1"> | |
898 <assert_contents> | |
899 <has_line line="12456" /> | |
900 <has_line line="6.789" /> | |
901 </assert_contents> | |
902 </output> | |
903 </test> | |
904 ``` | |
905 | |
906 ]]> | |
907 </xs:documentation> | |
908 </xs:annotation> | |
909 <xs:sequence> | |
910 <xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" /> | |
911 </xs:sequence> | |
912 <xs:attribute name="name" type="xs:string" use="required"> | |
913 <xs:annotation> | |
914 <xs:documentation xml:lang="en">This value must match the name of the | |
915 associated input ``section``.</xs:documentation> | |
916 </xs:annotation> | |
917 </xs:attribute> | |
918 </xs:complexType> | |
919 <xs:complexType name="TestConditional"> | |
920 <xs:annotation> | |
921 <xs:documentation xml:lang="en"><![CDATA[ | |
922 | |
923 Specify test parameters below a named of a ``conditional`` block matching | |
924 one in ``inputs`` with this element. | |
925 | |
926 ``param`` elements in a ``test`` block can be arranged into nested ``repeat``, | |
927 ``conditional``, and ``select`` structures to match the inputs. While this might | |
928 be overkill for simple tests, it helps prevent ambiguous definitions and keeps | |
929 things organized in large test cases. A future ``profile`` version of Galaxy | |
930 tools may require ``conditional`` blocks be explicitly defined with this | |
931 directive. | |
932 | |
933 ### Examples | |
934 | |
935 The following example demonstrates disambiguation of a parameter (named ``use``) | |
936 which appears in multiple ``param`` names in ``conditional``s in the ``inputs`` | |
937 definition of the [disambiguate_cond.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/disambiguate_cond.xml) | |
938 tool. | |
939 | |
940 ```xml | |
941 <!-- Can use nested conditional blocks as shown below to disambiguate | |
942 various nested parameters. --> | |
943 <test> | |
944 <conditional name="p1"> | |
945 <param name="use" value="False"/> | |
946 </conditional> | |
947 <conditional name="p2"> | |
948 <param name="use" value="True"/> | |
949 </conditional> | |
950 <conditional name="p3"> | |
951 <param name="use" value="False"/> | |
952 </conditional> | |
953 <conditional name="files"> | |
954 <param name="attach_files" value="True" /> | |
955 <conditional name="p4"> | |
956 <param name="use" value="True"/> | |
957 <param name="file" value="simple_line_alternative.txt" /> | |
958 </conditional> | |
959 </conditional> | |
960 <output name="out_file1"> | |
961 <assert_contents> | |
962 <has_line line="7 4 7" /> | |
963 <has_line line="This is a different line of text." /> | |
964 </assert_contents> | |
965 </output> | |
966 </test> | |
967 ``` | |
968 | |
969 The [tophat2](https://github.com/galaxyproject/tools-devteam/blob/master/tools/tophat2/tophat2_wrapper.xml) | |
970 tool demonstrates a real tool that benefits from more structured test cases | |
971 using the ``conditional`` test directive. One such test case from that tool is | |
972 shown below. | |
973 | |
974 ```xml | |
975 <!-- Test base-space paired-end reads with user-supplied reference fasta and full parameters --> | |
976 <test> | |
977 <!-- TopHat commands: | |
978 tophat2 -o tmp_dir -r 20 -p 1 -a 8 -m 0 -i 70 -I 500000 -g 40 +coverage-search +min-coverage-intron 50 +max-coverage-intro 20000 +segment-mismatches 2 +segment-length 25 +microexon-search +report_discordant_pairs tophat_in1 test-data/tophat_in2.fastqsanger test-data/tophat_in3.fastqsanger | |
979 Replace the + with double-dash | |
980 Rename the files in tmp_dir appropriately | |
981 --> | |
982 <conditional name="singlePaired"> | |
983 <param name="sPaired" value="paired"/> | |
984 <param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger"/> | |
985 <param name="input2" ftype="fastqsanger" value="tophat_in3.fastqsanger"/> | |
986 <param name="mate_inner_distance" value="20"/> | |
987 <param name="report_discordant_pairs" value="Yes" /> | |
988 </conditional> | |
989 <param name="genomeSource" value="indexed"/> | |
990 <param name="index" value="tophat_test"/> | |
991 <conditional name="params"> | |
992 <param name="settingsType" value="full"/> | |
993 <param name="library_type" value="FR Unstranded"/> | |
994 <param name="read_mismatches" value="5"/> | |
995 <!-- Error: the read mismatches (5) and the read gap length (2) should be less than or equal to the read edit dist (2) --> | |
996 <param name="read_edit_dist" value="5" /> | |
997 <param name="bowtie_n" value="Yes"/> | |
998 <param name="mate_std_dev" value="20"/> | |
999 <param name="anchor_length" value="8"/> | |
1000 <param name="splice_mismatches" value="0"/> | |
1001 <param name="min_intron_length" value="70"/> | |
1002 <param name="max_intron_length" value="500000"/> | |
1003 <param name="max_multihits" value="40"/> | |
1004 <param name="min_segment_intron" value="50" /> | |
1005 <param name="max_segment_intron" value="500000" /> | |
1006 <param name="seg_mismatches" value="2"/> | |
1007 <param name="seg_length" value="25"/> | |
1008 <conditional name="indel_search"> | |
1009 <param name="allow_indel_search" value="No"/> | |
1010 </conditional> | |
1011 <conditional name="own_junctions"> | |
1012 <param name="use_junctions" value="Yes" /> | |
1013 <conditional name="gene_model_ann"> | |
1014 <param name="use_annotations" value="No" /> | |
1015 </conditional> | |
1016 <conditional name="raw_juncs"> | |
1017 <param name="use_juncs" value="No" /> | |
1018 </conditional> | |
1019 <conditional name="no_novel_juncs"> | |
1020 <param name="no_novel_juncs" value="No" /> | |
1021 </conditional> | |
1022 </conditional> | |
1023 <conditional name="coverage_search"> | |
1024 <param name="use_search" value="No" /> | |
1025 </conditional> | |
1026 <param name="microexon_search" value="Yes" /> | |
1027 <conditional name="bowtie2_settings"> | |
1028 <param name="b2_settings" value="No" /> | |
1029 </conditional> | |
1030 <!-- Fusion search params --> | |
1031 <conditional name="fusion_search"> | |
1032 <param name="do_search" value="Yes" /> | |
1033 <param name="anchor_len" value="21" /> | |
1034 <param name="min_dist" value="10000021" /> | |
1035 <param name="read_mismatches" value="3" /> | |
1036 <param name="multireads" value="4" /> | |
1037 <param name="multipairs" value="5" /> | |
1038 <param name="ignore_chromosomes" value="chrM"/> | |
1039 </conditional> | |
1040 </conditional> | |
1041 <conditional name="readGroup"> | |
1042 <param name="specReadGroup" value="no" /> | |
1043 </conditional> | |
1044 <output name="junctions" file="tophat2_out4j.bed" /> | |
1045 <output name="accepted_hits" file="tophat_out4h.bam" compare="sim_size" /> | |
1046 </test> | |
1047 ``` | |
1048 | |
1049 ]]></xs:documentation> | |
1050 </xs:annotation> | |
1051 <xs:sequence> | |
1052 <xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" /> | |
1053 </xs:sequence> | |
1054 <xs:attribute name="name" type="xs:string" use="required"> | |
1055 <xs:annotation> | |
1056 <xs:documentation xml:lang="en">This value must match the name of the | |
1057 associated input ``conditional``.</xs:documentation> | |
1058 </xs:annotation> | |
1059 </xs:attribute> | |
1060 </xs:complexType> | |
1061 <xs:complexType name="TestRepeat"> | |
1062 <xs:annotation> | |
1063 <xs:documentation xml:lang="en"><![CDATA[ | |
1064 | |
1065 Specify test parameters below an iteration of a ``repeat`` block with this | |
1066 element. | |
1067 | |
1068 ``param`` elements in a ``test`` block can be arranged into nested ``repeat``, | |
1069 ``conditional``, and ``select`` structures to match the inputs. While this might | |
1070 be overkill for simple tests, it helps prevent ambiguous definitions and keeps | |
1071 things organized in large test cases. A future ``profile`` version of Galaxy | |
1072 tools may require ``repeat`` blocks be explicitly defined with this directive. | |
1073 | |
1074 ### Examples | |
1075 | |
1076 The test tool [disambiguate_repeats.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/disambiguate_repeats.xml) | |
1077 demonstrates the use of this directive. | |
1078 | |
1079 This first test case demonstrates that this block allows different values for | |
1080 the ``param`` named ``input`` to be tested even though this parameter name | |
1081 appears in two different ``<repeat>`` elements in the ``<inputs>`` definition. | |
1082 | |
1083 ```xml | |
1084 <!-- Can disambiguate repeats and specify multiple blocks using, | |
1085 nested structure. --> | |
1086 <test> | |
1087 <repeat name="queries"> | |
1088 <param name="input" value="simple_line.txt"/> | |
1089 </repeat> | |
1090 <repeat name="more_queries"> | |
1091 <param name="input" value="simple_line_alternative.txt"/> | |
1092 </repeat> | |
1093 <output name="out_file1"> | |
1094 <assert_contents> | |
1095 <has_line line="This is a line of text." /> | |
1096 <has_line line="This is a different line of text." /> | |
1097 </assert_contents> | |
1098 </output> | |
1099 </test> | |
1100 ``` | |
1101 | |
1102 The second definition in that file demonstrates repeated ``<repeat>`` blocks | |
1103 allowing multiple instances of a single repeat to be specified. | |
1104 | |
1105 ```xml | |
1106 <!-- Multiple such blocks can be specified but only with newer API | |
1107 driven tests. --> | |
1108 <test> | |
1109 <repeat name="queries"> | |
1110 <param name="input" value="simple_line.txt"/> | |
1111 </repeat> | |
1112 <repeat name="queries"> | |
1113 <param name="input" value="simple_line_alternative.txt"/> | |
1114 </repeat> | |
1115 <repeat name="more_queries"> | |
1116 <param name="input" value="simple_line.txt"/> | |
1117 </repeat> | |
1118 <repeat name="more_queries"> | |
1119 <param name="input" value="simple_line_alternative.txt"/> | |
1120 </repeat> | |
1121 <output name="out_file1" file="simple_lines_interleaved.txt"/> | |
1122 </test> | |
1123 ``` | |
1124 | |
1125 ]]></xs:documentation> | |
1126 </xs:annotation> | |
1127 <xs:sequence> | |
1128 <xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" /> | |
1129 </xs:sequence> | |
1130 <xs:attribute name="name" type="xs:string" use="required"> | |
1131 <xs:annotation> | |
1132 <xs:documentation xml:lang="en">This value must match the name of the | |
1133 associated input ``repeat``.</xs:documentation> | |
1134 </xs:annotation> | |
1135 </xs:attribute> | |
1136 </xs:complexType> | |
1137 <xs:complexType name="TestParam"> | |
1138 <xs:annotation> | |
1139 <xs:documentation xml:lang="en"><![CDATA[ | |
1140 | |
1141 This tag set defines the tool's input parameters for executing the tool via the | |
1142 functional test framework. See [test](#tool-tests-test) documentation for | |
1143 some simple examples of parameters. | |
1144 | |
1145 ]]></xs:documentation> | |
1146 </xs:annotation> | |
1147 <xs:sequence> | |
1148 <xs:element name="collection" type="TestCollection" minOccurs="0" maxOccurs="1" /> | |
1149 <xs:element name="composite_data" type="TestCompositeData" minOccurs="0" maxOccurs="unbounded" /> | |
1150 <xs:element name="metadata" type="TestParamMetadata" minOccurs="0" maxOccurs="unbounded" /> | |
1151 </xs:sequence> | |
1152 <xs:attribute name="name" type="xs:string" use="required"> | |
1153 <xs:annotation> | |
1154 <xs:documentation xml:lang="en">This value must match the name of the | |
1155 associated input parameter (``param``).</xs:documentation> | |
1156 </xs:annotation> | |
1157 </xs:attribute> | |
1158 <xs:attribute name="value" type="xs:string"> | |
1159 <xs:annotation> | |
1160 <xs:documentation xml:lang="en">This value must be one of the legal | |
1161 values that can be assigned to an input parameter.</xs:documentation> | |
1162 </xs:annotation> | |
1163 </xs:attribute> | |
1164 <xs:attribute name="ftype" type="xs:string"> | |
1165 <xs:annotation> | |
1166 <xs:documentation xml:lang="en">This attribute name should be included | |
1167 only with parameters of ``type`` ``data`` for the tool. If this | |
1168 attribute name is not included, the functional test framework will attempt to | |
1169 determine the data type for the input dataset using the data type sniffers.</xs:documentation> | |
1170 </xs:annotation> | |
1171 </xs:attribute> | |
1172 <xs:attribute name="dbkey" type="xs:string"> | |
1173 <xs:annotation> | |
1174 <xs:documentation xml:lang="en">Specifies a ``dbkey`` value for the | |
1175 referenced input dataset. This is only valid if the corresponding parameter is | |
1176 of ``type`` ``data``.</xs:documentation> | |
1177 </xs:annotation> | |
1178 </xs:attribute> | |
1179 <xs:attribute name="tags" type="xs:string"> | |
1180 <xs:annotation> | |
1181 <xs:documentation xml:lang="en">Comma separated list of tags to apply to the dataset (only works for elements of collections - e.g. ``element`` XML tags).</xs:documentation> | |
1182 </xs:annotation> | |
1183 </xs:attribute> | |
1184 </xs:complexType> | |
1185 <xs:complexType name="TestCompositeData"> | |
1186 <xs:annotation> | |
1187 <xs:documentation xml:lang="en">Define extra composite input files for test | |
1188 input. The specified ``ftype`` on the parent ``param`` should specify a composite | |
1189 datatype with defined static composite files. The order of the defined composite | |
1190 files on the datatype must match the order specified with these elements and All | |
1191 non-optional composite inputs must be specified as part of the ``param``. | |
1192 </xs:documentation> | |
1193 </xs:annotation> | |
1194 <xs:attribute name="value" type="xs:string" use="required"> | |
1195 <xs:annotation> | |
1196 <xs:documentation xml:lang="en">Path relative to test-data of composite file.</xs:documentation> | |
1197 </xs:annotation> | |
1198 </xs:attribute> | |
1199 </xs:complexType> | |
1200 <xs:complexType name="TestCollection"> | |
1201 <xs:annotation> | |
1202 <xs:documentation xml:lang="en">Definition of a collection for test input.</xs:documentation> | |
1203 </xs:annotation> | |
1204 <xs:sequence> | |
1205 <xs:element name="element" type="TestParam" minOccurs="0" maxOccurs="unbounded"/> | |
1206 </xs:sequence> | |
1207 <xs:attribute name="type" type="xs:string" use="required"> | |
1208 <xs:annotation> | |
1209 <xs:documentation xml:lang="en">Type of collection to create.</xs:documentation> | |
1210 </xs:annotation> | |
1211 </xs:attribute> | |
1212 <xs:attribute name="tags" type="xs:string"> | |
1213 <xs:annotation> | |
1214 <xs:documentation xml:lang="en">Comma separated list of tags to apply to the dataset (only works for elements of collections - e.g. ``element`` XML tags).</xs:documentation> | |
1215 </xs:annotation> | |
1216 </xs:attribute> | |
1217 </xs:complexType> | |
1218 <xs:complexType name="TestOutput"> | |
1219 <xs:annotation> | |
1220 <xs:documentation xml:lang="en"><![CDATA[ | |
1221 | |
1222 This tag set defines the variable that names the output dataset for the | |
1223 functional test framework. The functional test framework will execute the tool | |
1224 using the parameters defined in the ``<param>`` tag sets and generate a | |
1225 temporary file, which will either be compared with the file named in the | |
1226 ``file`` attribute value or checked against assertions made by a child | |
1227 ``assert_contents`` tag to verify that the tool is functionally correct. | |
1228 | |
1229 ]]></xs:documentation> | |
1230 </xs:annotation> | |
1231 <xs:sequence> | |
1232 <xs:group ref="TestOutputElement" minOccurs="0" maxOccurs="unbounded" /> | |
1233 </xs:sequence> | |
1234 <!-- TODO: This would be more percise if this was required if at the top-level. --> | |
1235 <xs:attribute name="name" type="xs:string"> | |
1236 <xs:annotation> | |
1237 <xs:documentation xml:lang="en"><![CDATA[ | |
1238 | |
1239 This value is the same as the value of the ``name`` attribute of the ``<data>`` | |
1240 tag set contained within the tool's ``<outputs>`` tag set. | |
1241 | |
1242 ]]></xs:documentation> | |
1243 </xs:annotation> | |
1244 </xs:attribute> | |
1245 <xs:attribute name="file" type="xs:string"> | |
1246 <xs:annotation> | |
1247 <xs:documentation xml:lang="en"><![CDATA[ | |
1248 | |
1249 If specified, this value is the name of the output file stored in the target | |
1250 ``test-data`` directory which will be used to compare the results of executing | |
1251 the tool via the functional test framework. | |
1252 | |
1253 ]]></xs:documentation> | |
1254 </xs:annotation> | |
1255 </xs:attribute> | |
1256 <xs:attribute name="ftype" type="xs:string"> | |
1257 <xs:annotation> | |
1258 <xs:documentation xml:lang="en"><![CDATA[ | |
1259 | |
1260 If specified, this value will be checked against the corresponding output's | |
1261 data type. If these do not match, the test will fail. | |
1262 | |
1263 ]]></xs:documentation> | |
1264 </xs:annotation> | |
1265 </xs:attribute> | |
1266 <xs:attribute name="sort" type="PermissiveBoolean"> | |
1267 <xs:annotation> | |
1268 <xs:documentation xml:lang="en">This flag causes the lines of the output | |
1269 to be sorted before they are compared to the expected output. This could be | |
1270 useful for non-deterministic output.</xs:documentation> | |
1271 </xs:annotation> | |
1272 </xs:attribute> | |
1273 <xs:attribute name="value" type="xs:string"> | |
1274 <xs:annotation> | |
1275 <xs:documentation xml:lang="en">An alias for ``file``.</xs:documentation> | |
1276 </xs:annotation> | |
1277 </xs:attribute> | |
1278 <xs:attribute name="md5" type="xs:string"> | |
1279 <xs:annotation> | |
1280 <xs:documentation xml:lang="en"><![CDATA[ | |
1281 | |
1282 If specified, the target output's MD5 hash should match the value specified | |
1283 here. For large static files it may be inconvenient to upload the entiry file | |
1284 and this can be used instead. | |
1285 | |
1286 ]]></xs:documentation> | |
1287 </xs:annotation> | |
1288 </xs:attribute> | |
1289 <xs:attribute name="checksum" type="xs:string"> | |
1290 <xs:annotation> | |
1291 <xs:documentation xml:lang="en"><![CDATA[ | |
1292 | |
1293 If specified, the target output's checksum should match the value specified | |
1294 here. This value should have the form ``hash_type$hash_value`` | |
1295 (e.g. ``sha1$8156d7ca0f46ed7abac98f82e36cfaddb2aca041``). For large static files | |
1296 it may be inconvenient to upload the entiry file and this can be used instead. | |
1297 | |
1298 ]]></xs:documentation> | |
1299 </xs:annotation> | |
1300 </xs:attribute> | |
1301 <xs:attribute name="compare" type="TestOutputCompareType"> | |
1302 </xs:attribute> | |
1303 <xs:attribute name="lines_diff" type="xs:integer"> | |
1304 <xs:annotation> | |
1305 <xs:documentation xml:lang="en">If ``compare`` is set to ``diff``, the number of lines of difference to allow (each line with a modification is a line added and a line removed so this counts as two lines).</xs:documentation> | |
1306 </xs:annotation> | |
1307 </xs:attribute> | |
1308 <xs:attribute name="decompress" type="PermissiveBoolean"> | |
1309 <xs:annotation> | |
1310 <xs:documentation xml:lang="en"><![CDATA[ | |
1311 When this attribute is true and ``compare`` is set to ``diff``, try to decompress files if needed. This flag is useful for testing compressed outputs that are non-deterministic despite having deterministic decompressed contents. By default, only files compressed with bz2, gzip and zip will be automatically decompressed. This is available in Galaxy since release 17.05 and was introduced in [pull request #3550](https://github.com/galaxyproject/galaxy/pull/3550). | |
1312 ]]></xs:documentation> | |
1313 </xs:annotation> | |
1314 </xs:attribute> | |
1315 <xs:attribute name="delta" type="xs:integer" default="10000"> | |
1316 <xs:annotation> | |
1317 <xs:documentation xml:lang="en">If ``compare`` is set to ``sim_size``, this is the maximum allowed absolute size difference (in bytes) between the data set that is generated in the test and the file in ``test-data/`` that is referenced by the ``file`` attribute. Can be combined with ``delta_frac``.</xs:documentation> | |
1318 </xs:annotation> | |
1319 </xs:attribute> | |
1320 <xs:attribute name="delta_frac" type="xs:float"> | |
1321 <xs:annotation> | |
1322 <xs:documentation xml:lang="en">If ``compare`` is set to ``sim_size``, this is the maximum allowed relative size difference between the data set that is generated in the test and the file in ``test-data/`` that is referenced by the ``file`` attribute. A value of 0.1 means that the file that is generated in the test can differ by at most 10% of the file in ``test-data``. The default is not to check for relative size difference. Can be combined with ``delta``.</xs:documentation> | |
1323 </xs:annotation> | |
1324 </xs:attribute> | |
1325 </xs:complexType> | |
1326 <xs:group name="TestOutputElement"> | |
1327 <xs:choice> | |
1328 <xs:element name="element" type="TestOutput"/> | |
1329 <!-- TODO: This would be more percise if this was only allowed at the top-level. --> | |
1330 <xs:element name="discovered_dataset" type="TestDiscoveredDataset"/> | |
1331 <!-- TODO: To be more percise only one assert_contents is allowed - this should not be in here. --> | |
1332 <xs:element name="assert_contents" type="TestAssertions"> | |
1333 <xs:annotation> | |
1334 <xs:documentation><![CDATA[ | |
1335 $assertions | |
1336 | |
1337 ### Examples | |
1338 | |
1339 The following demonstrates a wide variety of text-based and tabular | |
1340 assertion statements. | |
1341 | |
1342 ```xml | |
1343 <output name="out_file1"> | |
1344 <assert_contents> | |
1345 <has_text text="chr7" /> | |
1346 <not_has_text text="chr8" /> | |
1347 <has_text_matching expression="1274\d+53" /> | |
1348 <has_line_matching expression=".*\s+127489808\s+127494553" /> | |
1349 <!-- 	 is XML escape code for tab --> | |
1350 <has_line line="chr7	127471195	127489808" /> | |
1351 <has_n_columns n="3" /> | |
1352 </assert_contents> | |
1353 </output> | |
1354 ``` | |
1355 | |
1356 The following demonstrates a wide variety of XML assertion statements. | |
1357 | |
1358 ```xml | |
1359 <output name="out_file1"> | |
1360 <assert_contents> | |
1361 <is_valid_xml /> | |
1362 <has_element_with_path path="BlastOutput_param/Parameters/Parameters_matrix" /> | |
1363 <has_n_elements_with_path n="9" path="BlastOutput_iterations/Iteration/Iteration_hits/Hit/Hit_num" /> | |
1364 <element_text_matches path="BlastOutput_version" expression="BLASTP\s+2\.2.*" /> | |
1365 <element_text_is path="BlastOutput_program" text="blastp" /> | |
1366 <element_text path="BlastOutput_iterations/Iteration/Iteration_hits/Hit/Hit_def"> | |
1367 <not_has_text text="EDK72998.1" /> | |
1368 <has_text_matching expression="ABK[\d\.]+" /> | |
1369 </element_text> | |
1370 </assert_contents> | |
1371 </output> | |
1372 ``` | |
1373 | |
1374 The following demonstrates verifying XML content with XPath-like expressions. | |
1375 | |
1376 ```xml | |
1377 <output name="out_file1"> | |
1378 <assert_contents> | |
1379 <attribute_is path="outerElement/innerElement1" attribute="foo" text="bar" /> | |
1380 <attribute_matches path="outerElement/innerElement2" attribute="foo2" expression="bar\d+" /> | |
1381 </assert_contents> | |
1382 </output> | |
1383 ``` | |
1384 | |
1385 ]]></xs:documentation> | |
1386 </xs:annotation> | |
1387 </xs:element> | |
1388 <!-- TODO: This would be more percise if this was only allowed at the top-level. --> | |
1389 <xs:element name="extra_files" type="TestExtraFile" /> | |
1390 <xs:element name="metadata" type="TestOutputMetadata"/> | |
1391 </xs:choice> | |
1392 </xs:group> | |
1393 <xs:complexType name="TestParamMetadata"> | |
1394 <xs:attribute name="name" type="xs:string" use="required"> | |
1395 <xs:annotation> | |
1396 <xs:documentation xml:lang="en">Documentation for name</xs:documentation> | |
1397 </xs:annotation> | |
1398 </xs:attribute> | |
1399 <xs:attribute name="value" type="xs:string" use="required"> | |
1400 <xs:annotation> | |
1401 <xs:documentation xml:lang="en">Documentation for value</xs:documentation> | |
1402 </xs:annotation> | |
1403 </xs:attribute> | |
1404 </xs:complexType> | |
1405 <xs:complexType name="TestOutputMetadata"> | |
1406 <xs:annotation> | |
1407 <xs:documentation xml:lang="en"><![CDATA[ | |
1408 | |
1409 This directive specifies a test for an output's metadata as an expected key-value pair. | |
1410 | |
1411 ### Example | |
1412 | |
1413 The functional test tool | |
1414 [tool_provided_metadata_1.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/tool_provided_metadata_1.xml) | |
1415 provides a demonstration of using this tag. | |
1416 | |
1417 ```xml | |
1418 <test> | |
1419 <param name="input1" value="simple_line.txt" /> | |
1420 <output name="out1" file="simple_line.txt" ftype="txt"> | |
1421 <metadata name="name" value="my dynamic name" /> | |
1422 <metadata name="info" value="my dynamic info" /> | |
1423 <metadata name="dbkey" value="cust1" /> | |
1424 </output> | |
1425 </test> | |
1426 ``` | |
1427 | |
1428 ]]></xs:documentation> | |
1429 </xs:annotation> | |
1430 <xs:attribute name="name" type="xs:string" use="required"> | |
1431 <xs:annotation> | |
1432 <xs:documentation xml:lang="en">Name of the metadata element to check.</xs:documentation> | |
1433 </xs:annotation> | |
1434 </xs:attribute> | |
1435 <xs:attribute name="value" type="xs:string" use="required"> | |
1436 <xs:annotation> | |
1437 <xs:documentation xml:lang="en">Expected value (as a string) of metadata value.</xs:documentation> | |
1438 </xs:annotation> | |
1439 </xs:attribute> | |
1440 </xs:complexType> | |
1441 <xs:complexType name="TestDiscoveredDataset"> | |
1442 <xs:annotation> | |
1443 <xs:documentation><![CDATA[ | |
1444 | |
1445 This directive specifies a test for an output's discovered dataset. It acts as an | |
1446 ``output`` test tag in many ways and can define any tests of that tag (e.g. | |
1447 ``assert_contents``, ``value``, ``compare``, ``md5``, ``checksum``, ``metadata``, etc...). | |
1448 | |
1449 ### Example | |
1450 | |
1451 The functional test tool | |
1452 [multi_output_assign_primary.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/multi_output_assign_primary.xml) | |
1453 provides a demonstration of using this tag. | |
1454 | |
1455 ```xml | |
1456 <outputs> | |
1457 <data format="tabular" name="sample"> | |
1458 <discover_datasets pattern="(?P<designation>.+)\.report\.tsv" ext="tabular" visible="true" assign_primary_output="true" /> | |
1459 </data> | |
1460 </outputs> | |
1461 <test> | |
1462 <param name="num_param" value="7" /> | |
1463 <param name="input" ftype="txt" value="simple_line.txt"/> | |
1464 <output name="sample"> | |
1465 <assert_contents> | |
1466 <has_line line="1" /> | |
1467 </assert_contents> | |
1468 <!-- no sample1 it was consumed by named output "sample" --> | |
1469 <discovered_dataset designation="sample2" ftype="tabular"> | |
1470 <assert_contents><has_line line="2" /></assert_contents> | |
1471 </discovered_dataset> | |
1472 <discovered_dataset designation="sample3" ftype="tabular"> | |
1473 <assert_contents><has_line line="3" /></assert_contents> | |
1474 </discovered_dataset> | |
1475 </output> | |
1476 </test> | |
1477 ``` | |
1478 | |
1479 Note that this tool uses ``assign_primary_output="true"`` for ``<discover_data_sets>``. Hence, the content of the first discovered dataset (which is the first in the alphabetically sorted list of discovered designations) is checked directly in the ``<output>`` tag of the test. | |
1480 ]]></xs:documentation> | |
1481 </xs:annotation> | |
1482 <xs:complexContent> | |
1483 <xs:extension base="TestOutput"> | |
1484 <xs:attribute type="xs:string" name="designation"> | |
1485 <xs:annotation> | |
1486 <xs:documentation xml:lang="en">The designation of the discovered dataset.</xs:documentation> | |
1487 </xs:annotation> | |
1488 </xs:attribute> | |
1489 </xs:extension> | |
1490 </xs:complexContent> | |
1491 </xs:complexType> | |
1492 <xs:complexType name="TestExtraFile"> | |
1493 <xs:annotation> | |
1494 <xs:documentation xml:lang="en">Define test for extra files on corresponding output.</xs:documentation> | |
1495 </xs:annotation> | |
1496 <xs:complexContent> | |
1497 <xs:extension base="TestOutput"> | |
1498 <xs:attribute type="xs:string" name="type"> | |
1499 <xs:annotation> | |
1500 <xs:documentation xml:lang="en">Extra file type (either ``file`` or ``directory``).</xs:documentation> | |
1501 </xs:annotation> | |
1502 </xs:attribute> | |
1503 </xs:extension> | |
1504 </xs:complexContent> | |
1505 </xs:complexType> | |
1506 <xs:complexType name="TestOutputCollection"> | |
1507 <xs:annotation> | |
1508 <xs:documentation xml:lang="en"><![CDATA[ | |
1509 | |
1510 Define tests for extra files corresponding to an output collection. | |
1511 | |
1512 ``output_collection`` directives should specify a ``name`` and ``type`` | |
1513 attribute to describe the expected output collection as a whole. | |
1514 | |
1515 Expectations about collection contents are described using child ``element`` | |
1516 directives. For nested collections, these child ``element`` directives may | |
1517 themselves contain children. | |
1518 | |
1519 ### Examples | |
1520 | |
1521 The [genetrack](https://github.com/galaxyproject/tools-iuc/blob/master/tools/genetrack/genetrack.xml) | |
1522 tool demonstrates basic usage of an ``output_collection`` test expectation. | |
1523 | |
1524 ```xml | |
1525 <test> | |
1526 <param name="input" value="genetrack_input2.gff" ftype="gff" /> | |
1527 <param name="input_format" value="gff" /> | |
1528 <param name="sigma" value="5" /> | |
1529 <param name="exclusion" value="20" /> | |
1530 <param name="up_width" value="10" /> | |
1531 <param name="down_width" value="10" /> | |
1532 <param name="filter" value="3" /> | |
1533 <output_collection name="genetrack_output" type="list"> | |
1534 <element name="s5e20u10d10F3_on_data_1" file="genetrack_output2.gff" ftype="gff" /> | |
1535 </output_collection> | |
1536 </test> | |
1537 ``` | |
1538 | |
1539 The [CWPair2](https://github.com/galaxyproject/tools-iuc/blob/master/tools/cwpair2/cwpair2.xml) | |
1540 tool demonstrates that ``element``s can specify a ``compare`` attribute just | |
1541 like [output](#tool-tests-test-output). | |
1542 | |
1543 ```xml | |
1544 <test> | |
1545 <param name="input" value="cwpair2_input1.gff" /> | |
1546 <param name="up_distance" value="25" /> | |
1547 <param name="down_distance" value="100" /> | |
1548 <param name="method" value="all" /> | |
1549 <param name="binsize" value="1" /> | |
1550 <param name="threshold_format" value="relative_threshold" /> | |
1551 <param name="relative_threshold" value="0.0" /> | |
1552 <param name="output_files" value="matched_pair" /> | |
1553 <output name="statistics_output" file="statistics1.tabular" ftype="tabular" /> | |
1554 <output_collection name="MP" type="list"> | |
1555 <element name="data_MP_closest_f0u25d100_on_data_1.gff" file="closest_mp_output1.gff" ftype="gff" compare="contains"/> | |
1556 <element name="data_MP_largest_f0u25d100_on_data_1.gff" file="largest_mp_output1.gff" ftype="gff" compare="contains"/> | |
1557 <element name="data_MP_mode_f0u25d100_on_data_1.gff" file="mode_mp_output1.gff" ftype="gff" compare="contains"/> | |
1558 </output_collection> | |
1559 </test> | |
1560 ``` | |
1561 | |
1562 The | |
1563 [collection_creates_dynamic_nested](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/collection_creates_dynamic_nested.xml) | |
1564 test tool demonstrates the use of nested ``element`` directives as described | |
1565 above. Notice also that it tests the output with ``assert_contents`` instead of | |
1566 supplying a ``file`` attribute. Like hinted at with with ``compare`` attribute | |
1567 above, the ``element`` tag can specify any of the test attributes that apply to | |
1568 the [output](#tool-tests-test-output) (e.g. ``md5``, ``compare``, ``diff``, | |
1569 etc...). | |
1570 | |
1571 ```xml | |
1572 <test> | |
1573 <param name="foo" value="bar" /> | |
1574 <output_collection name="list_output" type="list:list"> | |
1575 <element name="oe1"> | |
1576 <element name="ie1"> | |
1577 <assert_contents> | |
1578 <has_text_matching expression="^A\n$" /> | |
1579 </assert_contents> | |
1580 </element> | |
1581 <element name="ie2"> | |
1582 <assert_contents> | |
1583 <has_text_matching expression="^B\n$" /> | |
1584 </assert_contents> | |
1585 </element> | |
1586 </element> | |
1587 <element name="oe2"> | |
1588 <element name="ie1"> | |
1589 <assert_contents> | |
1590 <has_text_matching expression="^C\n$" /> | |
1591 </assert_contents> | |
1592 </element> | |
1593 <element name="ie2"> | |
1594 <assert_contents> | |
1595 <has_text_matching expression="^D\n$" /> | |
1596 </assert_contents> | |
1597 </element> | |
1598 </element> | |
1599 <element name="oe3"> | |
1600 <element name="ie1"> | |
1601 <assert_contents> | |
1602 <has_text_matching expression="^E\n$" /> | |
1603 </assert_contents> | |
1604 </element> | |
1605 <element name="ie2"> | |
1606 <assert_contents> | |
1607 <has_text_matching expression="^F\n$" /> | |
1608 </assert_contents> | |
1609 </element> | |
1610 </element> | |
1611 </output_collection> | |
1612 </test> | |
1613 ``` | |
1614 | |
1615 ]]></xs:documentation> | |
1616 </xs:annotation> | |
1617 <xs:sequence> | |
1618 <xs:element name="element" type="TestOutput" minOccurs="0" maxOccurs="unbounded"/> | |
1619 </xs:sequence> | |
1620 <xs:attribute name="name" type="xs:string" use="required"> | |
1621 <xs:annotation> | |
1622 <xs:documentation xml:lang="en"><![CDATA[ | |
1623 | |
1624 This value is the same as the value of the ``name`` attribute of the | |
1625 ``<collection>`` tag set contained within the tool's ``<outputs>`` tag set. | |
1626 | |
1627 ]]></xs:documentation> | |
1628 </xs:annotation> | |
1629 </xs:attribute> | |
1630 <xs:attribute name="type" type="xs:string"> | |
1631 <xs:annotation> | |
1632 <xs:documentation xml:lang="en">Expected collection type (e.g. ``list``, ``paired``, | |
1633 or ``list:paired``).</xs:documentation> | |
1634 </xs:annotation> | |
1635 </xs:attribute> | |
1636 <xs:attribute name="count" type="xs:integer"> | |
1637 <xs:annotation> | |
1638 <xs:documentation xml:lang="en">Number of elements in output collection.</xs:documentation> | |
1639 </xs:annotation> | |
1640 </xs:attribute> | |
1641 </xs:complexType> | |
1642 | |
1643 <xs:complexType name="TestAssertions"> | |
1644 <xs:annotation> | |
1645 <xs:documentation><![CDATA[ | |
1646 This tag set defines a sequence of checks or assertions to run against the | |
1647 target output. This tag requires no attributes, but child tags should be used to | |
1648 define the assertions to make about the output. The functional test framework | |
1649 makes it easy to extend Galaxy with such tags, the following table summarizes | |
1650 many of the default assertion tags that come with Galaxy and examples of each | |
1651 can be found below. | |
1652 | |
1653 The implementation of these tags are simply Python functions defined in the | |
1654 [/lib/galaxy/tool_util/verify/asserts](https://github.com/galaxyproject/galaxy/tree/dev/lib/galaxy/tool_util/verify/asserts) | |
1655 module. | |
1656 ]]> | |
1657 </xs:documentation> | |
1658 </xs:annotation> | |
1659 <xs:sequence> | |
1660 <xs:group ref="TestAssertion" minOccurs="0" maxOccurs="unbounded"/> | |
1661 </xs:sequence> | |
1662 </xs:complexType> | |
1663 <xs:group name="TestAssertion"> | |
1664 <xs:choice> | |
1665 <xs:element name="has_text" type="xs:anyType"> | |
1666 <xs:annotation> | |
1667 <xs:documentation><![CDATA[Asserts the specified ``text`` appears in the output (e.g. ``<has_text text="chr7">``). If the ``text`` is expected to occur a particular number of times, this value can be specified using ``n``.]]> | |
1668 </xs:documentation> | |
1669 </xs:annotation> | |
1670 </xs:element> | |
1671 <xs:element name="not_has_text" type="xs:anyType"> | |
1672 <xs:annotation> | |
1673 <xs:documentation><![CDATA[Asserts the specified ``text`` does not appear in the output (e.g. ``<not_has_text text="chr8" />``).]]> | |
1674 </xs:documentation> | |
1675 </xs:annotation> | |
1676 </xs:element> | |
1677 <xs:element name="has_text_matching" type="xs:anyType"> | |
1678 <xs:annotation> | |
1679 <xs:documentation><![CDATA[Asserts text matching the specified regular expression (``expression``) appears in the output (e.g. ``<has_text_matching expression="1274\d+53" />`` ).]]> | |
1680 </xs:documentation> | |
1681 </xs:annotation> | |
1682 </xs:element> | |
1683 <xs:element name="has_line" type="xs:anyType"> | |
1684 <xs:annotation> | |
1685 <xs:documentation><![CDATA[Asserts a line matching the specified string (``line``) appears in the output (e.g. ``<has_line line="A full example line." />``). If the ``line`` is expected to occur a particular number of times, this value can be specified using ``n``.]]> | |
1686 </xs:documentation> | |
1687 </xs:annotation> | |
1688 </xs:element> | |
1689 <xs:element name="has_n_lines" type="xs:anyType"> | |
1690 <xs:annotation> | |
1691 <xs:documentation><![CDATA[Asserts that an output contains ``n`` lines, e.g. ``<has_n_lines n="3" />``.]]> | |
1692 </xs:documentation> | |
1693 </xs:annotation> | |
1694 </xs:element> | |
1695 <xs:element name="has_line_matching" type="xs:anyType"> | |
1696 <xs:annotation> | |
1697 <xs:documentation><![CDATA[Asserts a line matching the specified regular expression (``expression``) appears in the output (e.g. ``<has_line_matching expression=".*\s+127489808\s+127494553" />``).]]> | |
1698 </xs:documentation> | |
1699 </xs:annotation> | |
1700 </xs:element> | |
1701 <xs:element name="has_n_columns" type="xs:anyType"> | |
1702 <xs:annotation> | |
1703 <xs:documentation><![CDATA[Asserts tabular output contains the specified number (``n``) of columns (e.g. ``<has_n_columns n="3" />``).]]> | |
1704 </xs:documentation> | |
1705 </xs:annotation> | |
1706 </xs:element> | |
1707 <xs:element name="is_valid_xml" type="xs:anyType"> | |
1708 <xs:annotation> | |
1709 <xs:documentation><![CDATA[Asserts the output is a valid XML file (e.g. ``<is_valid_xml />``).]]> | |
1710 </xs:documentation> | |
1711 </xs:annotation> | |
1712 </xs:element> | |
1713 <xs:element name="has_element_with_path" type="xs:anyType"> | |
1714 <xs:annotation> | |
1715 <xs:documentation><![CDATA[Asserts the XML output contains at least one element (or tag) with the specified XPath-like ``path`` (e.g. ``<has_element_with_path path="BlastOutput_param/Parameters/Parameters_matrix" />``).]]> | |
1716 </xs:documentation> | |
1717 </xs:annotation> | |
1718 </xs:element> | |
1719 <xs:element name="has_n_elements_with_path" type="xs:anyType"> | |
1720 <xs:annotation> | |
1721 <xs:documentation><![CDATA[Asserts the XML output contains the specified number (``n``) of elements (or tags) with the specified XPath-like ``path`` (e.g. ``<has_n_elements_with_path n="9" path="BlastOutput_iterations/Iteration/Iteration_hits/Hit/Hit_num" />``).]]> | |
1722 </xs:documentation> | |
1723 </xs:annotation> | |
1724 </xs:element> | |
1725 <xs:element name="element_text_is" type="xs:anyType"> | |
1726 <xs:annotation> | |
1727 <xs:documentation><![CDATA[Asserts the text of the XML element with the specified XPath-like ``path`` is the specified ``text`` (e.g. ``<element_text_is path="BlastOutput_program" text="blastp" />``).]]> | |
1728 </xs:documentation> | |
1729 </xs:annotation> | |
1730 </xs:element> | |
1731 <xs:element name="element_text_matches"> | |
1732 <xs:annotation> | |
1733 <xs:documentation><![CDATA[Asserts the text of the XML element with the specified XPath-like ``path`` matches the regular expression defined by ``expression`` (e.g. ``<element_text_matches path="BlastOutput_version" expression="BLASTP\s+2\.2.*" />``).]]> | |
1734 </xs:documentation> | |
1735 </xs:annotation> | |
1736 </xs:element> | |
1737 <xs:element name="attribute_is" type="xs:anyType"> | |
1738 <xs:annotation> | |
1739 <xs:documentation><![CDATA[Asserts the XML ``attribute`` for the element (or tag) with the specified XPath-like ``path`` is the specified ``text`` (e.g. ``<attribute_is path="outerElement/innerElement1" attribute="foo" text="bar" />`` ).]]> | |
1740 </xs:documentation> | |
1741 </xs:annotation> | |
1742 </xs:element> | |
1743 <xs:element name="attribute_matches" type="xs:anyType"> | |
1744 <xs:annotation> | |
1745 <xs:documentation><![CDATA[Asserts the XML ``attribute`` for the element (or tag) with the specified XPath-like ``path`` matches the regular expression specified by ``expression`` (e.g. ``<attribute_matches path="outerElement/innerElement2" attribute="foo2" expression="bar\d+" />``).]]></xs:documentation> | |
1746 </xs:annotation> | |
1747 </xs:element> | |
1748 <xs:element name="element_text" type="xs:anyType"> | |
1749 <xs:annotation> | |
1750 <xs:documentation><![CDATA[This tag allows the developer to recurisively specify additional assertions as child elements about just the text contained in the element specified by the XPath-like ``path`` (e.g. ``<element_text path="BlastOutput_iterations/Iteration/Iteration_hits/Hit/Hit_def"><not_has_text text="EDK72998.1" /></element_text>``).]]></xs:documentation> | |
1751 </xs:annotation> | |
1752 </xs:element> | |
1753 <xs:element name="has_h5_keys" type="AssertHasH5Keys"> | |
1754 </xs:element> | |
1755 <xs:element name="has_h5_attribute" type="AssertHasH5Attribute"> | |
1756 </xs:element> | |
1757 <xs:element name="has_archive_member" type="AssertHasArchiveMember"> | |
1758 </xs:element> | |
1759 <xs:element name="has_size" type="xs:anyType"> | |
1760 <xs:annotation> | |
1761 <xs:documentation><![CDATA[Asserts the output has a size (in bytes) of the specified ``value``; if the size is allowed to deviate from this value, the maximum difference can be optionally specified with ``delta`` (e.g. ``<has_size value="10000" delta="100">``).]]> | |
1762 </xs:documentation> | |
1763 </xs:annotation> | |
1764 </xs:element> | |
1765 </xs:choice> | |
1766 </xs:group> | |
1767 <xs:complexType name="AssertHasH5Keys"> | |
1768 <xs:annotation> | |
1769 <xs:documentation xml:lang="en"><![CDATA[Asserts HDF5 output has a set of attributes (``keys``), specified as a comma-separated list (e.g. ``<has_h5_keys keys="bins,chroms,indexes,pixels,chroms/lengths" />``).]]></xs:documentation> | |
1770 </xs:annotation> | |
1771 <xs:attribute name="keys" type="xs:string"> | |
1772 <xs:annotation> | |
1773 <xs:documentation xml:lang="en">Comma-separated list of HDF5 attributes to check for.</xs:documentation> | |
1774 </xs:annotation> | |
1775 </xs:attribute> | |
1776 </xs:complexType> | |
1777 <xs:complexType name="AssertHasH5Attribute"> | |
1778 <xs:annotation> | |
1779 <xs:documentation xml:lang="en"><![CDATA[Asserts HDF5 output contains the specified ``value`` for an attribute (``key``) (e.g. ``<has_attr key="nchroms" value="15" />``).]]></xs:documentation> | |
1780 </xs:annotation> | |
1781 <xs:attribute name="key" type="xs:string"> | |
1782 <xs:annotation> | |
1783 <xs:documentation xml:lang="en">HDF5 attribute to check value of.</xs:documentation> | |
1784 </xs:annotation> | |
1785 </xs:attribute> | |
1786 <xs:attribute name="value" type="xs:string"> | |
1787 <xs:annotation> | |
1788 <xs:documentation xml:lang="en">Expected value of HDF5 attribute to check.</xs:documentation> | |
1789 </xs:annotation> | |
1790 </xs:attribute> | |
1791 </xs:complexType> | |
1792 <xs:complexType name="AssertHasArchiveMember"> | |
1793 <xs:annotation> | |
1794 <xs:documentation xml:lang="en"><![CDATA[This tag allows the developer to recursively specify additional assertions as child elements about just the member contained in the archive specified by the regular expression ``path`` (e.g. ``<has_archive_member path=".*/my-file.txt"><not_has_text text="EDK72998.1" /></has_archive_member>``). Valid archive formats include ``.zip``, ``.tar``, and ``.tar.gz``.]]></xs:documentation> | |
1795 </xs:annotation> | |
1796 <xs:sequence> | |
1797 <xs:group ref="TestAssertion" minOccurs="0" maxOccurs="unbounded"/> | |
1798 </xs:sequence> | |
1799 <xs:attribute name="path" type="xs:string"> | |
1800 <xs:annotation> | |
1801 <xs:documentation xml:lang="en">The regular expression specifying the archive member.</xs:documentation> | |
1802 </xs:annotation> | |
1803 </xs:attribute> | |
1804 </xs:complexType> | |
1805 <xs:complexType name="Inputs"> | |
1806 <xs:annotation> | |
1807 <xs:documentation xml:lang="en"><![CDATA[Consists of all elements that define the | |
1808 tool's input parameters. Each [param](#tool-inputs-param) element contained in this element | |
1809 can be used as a command line parameter within the [command](#tool-command) text content. Most | |
1810 tools will not need to specify any attributes on this tag itself.]]> | |
1811 </xs:documentation> | |
1812 </xs:annotation> | |
1813 <xs:sequence> | |
1814 <xs:group ref="InputElement" minOccurs="0" maxOccurs="unbounded"/> | |
1815 </xs:sequence> | |
1816 <xs:attribute name="action" type="xs:string"> | |
1817 <xs:annotation> | |
1818 <xs:documentation xml:lang="en">URL used by data source tools.</xs:documentation> | |
1819 </xs:annotation> | |
1820 </xs:attribute> | |
1821 <xs:attribute name="check_values" type="PermissiveBoolean" default="true"> | |
1822 <xs:annotation> | |
1823 <xs:documentation xml:lang="en">Set to ``false`` to disable parameter checking in data source tools.</xs:documentation> | |
1824 </xs:annotation> | |
1825 </xs:attribute> | |
1826 <xs:attribute name="method" type="URLmethodType"> | |
1827 <xs:annotation> | |
1828 <xs:documentation xml:lang="en">Data source HTTP action (e.g. ``get`` or ``put``) to use.</xs:documentation> | |
1829 </xs:annotation> | |
1830 </xs:attribute> | |
1831 <xs:attribute name="target" type="TargetType"> | |
1832 <xs:annotation> | |
1833 <xs:documentation xml:lang="en">UI link target to use for data source tools (e.g. ``_top``).</xs:documentation> | |
1834 </xs:annotation> | |
1835 </xs:attribute> | |
1836 <xs:attribute name="nginx_upload" type="PermissiveBoolean" default="false"> | |
1837 <xs:annotation> | |
1838 <xs:documentation xml:lang="en">This boolean indicates if this is an upload tool or not.</xs:documentation> | |
1839 </xs:annotation> | |
1840 </xs:attribute> | |
1841 </xs:complexType> | |
1842 | |
1843 | |
1844 <xs:group name="InputElement"> | |
1845 <xs:choice> | |
1846 <xs:element name="param" type="Param"/> | |
1847 <xs:element name="repeat" type="Repeat"/> | |
1848 <xs:element name="conditional" type="Conditional"/> | |
1849 <xs:element name="section" type="Section"/> | |
1850 <xs:element name="upload_dataset" type="xs:anyType"> | |
1851 <xs:annotation> | |
1852 <xs:documentation xml:lang="en">Internal, intentionally undocumented feature.</xs:documentation> | |
1853 </xs:annotation> | |
1854 </xs:element> | |
1855 <xs:element name="display" type="xs:string"> | |
1856 <xs:annotation> | |
1857 <xs:documentation xml:lang="en">Documentation for display</xs:documentation> | |
1858 </xs:annotation> | |
1859 </xs:element> | |
1860 </xs:choice> | |
1861 </xs:group> | |
1862 <xs:complexType name="InputType" abstract="true"> | |
1863 <xs:annotation> | |
1864 <xs:documentation xml:lang="en">Documentation for InputType</xs:documentation> | |
1865 </xs:annotation> | |
1866 <xs:sequence/> | |
1867 </xs:complexType> | |
1868 | |
1869 | |
1870 <xs:complexType name="Conditional"> | |
1871 <xs:annotation> | |
1872 <xs:documentation xml:lang="en"><![CDATA[ | |
1873 | |
1874 This is a container for conditional parameters in the tool (must contain 'when' | |
1875 tag sets) - the command line (or portions thereof) are then wrapped in an if-else | |
1876 statement. A good example tool that demonstrates many conditional parameters is | |
1877 [biom_convert.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/biom_format/biom_convert.xml). | |
1878 | |
1879 ```xml | |
1880 <conditional name="input_type"> | |
1881 <param name="input_type_selector" type="select" label="Choose the source BIOM format"> | |
1882 <option value="tsv" selected="true">Tabular File</option> | |
1883 <option value="biom">BIOM File</option> | |
1884 </param> | |
1885 <when value="tsv"> | |
1886 <param name="input_table" type="data" format="tabular" label="Tabular File" argument="--input-fp"/> | |
1887 <param argument="--process-obs-metadata" type="select" label="Process metadata associated with observations when converting"> | |
1888 <option value="" selected="true">Do Not process metadata</option> | |
1889 <option value="taxonomy">taxonomy</option> | |
1890 <option value="naive">naive</option> | |
1891 <option value="sc_separated">sc_separated</option> | |
1892 </param> | |
1893 </when> | |
1894 <when value="biom"> | |
1895 <param name="input_table" type="data" format="biom1" label="Tabular File" argument="--input-fp"/> | |
1896 </when> | |
1897 </conditional> | |
1898 ``` | |
1899 | |
1900 The first directive following the conditional is a [param](#tool-inputs-param), | |
1901 this param must be of type ``select`` or ``boolean``. Depending on the value a | |
1902 user selects for this "test" parameter - different UI elements will be shown. | |
1903 These different paths are described by the following the ``when`` blocks shown | |
1904 above. | |
1905 | |
1906 The following Cheetah block demonstrates the use of the ``conditional`` | |
1907 shown above: | |
1908 | |
1909 ``` | |
1910 biom convert -i "${input_type.input_table}" -o "${output_table}" | |
1911 #if str($input_type.input_type_selector) == "tsv": | |
1912 #if $input_type.process_obs_metadata: | |
1913 --process-obs-metadata "${input_type.process_obs_metadata}" | |
1914 #end if | |
1915 #end if | |
1916 ``` | |
1917 | |
1918 Notice that the parameter ``input_table`` appears down both ``when`` clauses | |
1919 so ``${input_type.input_table}`` appears unconditionally but we need to | |
1920 conditionally reference ``${input_type.process_obs_metadata}`` with a Cheetah | |
1921 ``if`` statement. | |
1922 | |
1923 A common use of the conditional wrapper is to select between reference data | |
1924 managed by the Galaxy admins (for instance via | |
1925 [data managers](https://galaxyproject.org/admin/tools/data-managers/) | |
1926 ) and | |
1927 history files. A good example tool that demonstrates this is | |
1928 the [Bowtie 2](https://github.com/galaxyproject/tools-iuc/blob/master/tools/bowtie2/bowtie2_wrapper.xml) wrapper. | |
1929 | |
1930 ```xml | |
1931 <conditional name="reference_genome"> | |
1932 <param name="source" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options. See `Indexes` section of help below"> | |
1933 <option value="indexed">Use a built-in genome index</option> | |
1934 <option value="history">Use a genome from the history and build index</option> | |
1935 </param> | |
1936 <when value="indexed"> | |
1937 <param name="index" type="select" label="Select reference genome" help="If your genome of interest is not listed, contact the Galaxy team"> | |
1938 <options from_data_table="bowtie2_indexes"> | |
1939 <filter type="sort_by" column="2"/> | |
1940 <validator type="no_options" message="No indexes are available for the selected input dataset"/> | |
1941 </options> | |
1942 </param> | |
1943 </when> | |
1944 <when value="history"> | |
1945 <param name="own_file" type="data" format="fasta" label="Select reference genome" /> | |
1946 </when> | |
1947 </conditional> | |
1948 ``` | |
1949 | |
1950 The Bowtie 2 wrapper also demonstrates other conditional paths - such as choosing | |
1951 between paired inputs of single stranded inputs. | |
1952 ]]></xs:documentation> | |
1953 </xs:annotation> | |
1954 <xs:complexContent> | |
1955 <xs:extension base="InputType"> | |
1956 <xs:sequence> | |
1957 <xs:group ref="InputElement" minOccurs="0" maxOccurs="1" /> | |
1958 <xs:element name="when" type="ConditionalWhen" minOccurs="0" maxOccurs="unbounded"/> | |
1959 </xs:sequence> | |
1960 <xs:attribute name="name" type="xs:string"> | |
1961 <xs:annotation> | |
1962 <xs:documentation xml:lang="en">Name for this element</xs:documentation> | |
1963 </xs:annotation> | |
1964 </xs:attribute> | |
1965 <xs:attribute name="value_from" type="xs:string"> | |
1966 <xs:annotation> | |
1967 <xs:documentation><![CDATA[Infrequently used option to dynamically access Galaxy internals, this should be avoided. | |
1968 | |
1969 Galaxy method to execute.]]></xs:documentation> | |
1970 </xs:annotation> | |
1971 </xs:attribute> | |
1972 <xs:attribute name="value_ref" type="xs:string"> | |
1973 <xs:annotation> | |
1974 <xs:documentation><![CDATA[Infrequently used option to dynamically access Galaxy internals, this should be avoided. | |
1975 | |
1976 Referenced parameter to pass method.]]></xs:documentation> | |
1977 </xs:annotation> | |
1978 </xs:attribute> | |
1979 <xs:attribute name="value_ref_in_group" type="PermissiveBoolean"> | |
1980 <xs:annotation> | |
1981 <xs:documentation><![CDATA[Infrequently used option to dynamically access Galaxy internals, this should be avoided. | |
1982 | |
1983 Is referenced parameter is the same group.]]></xs:documentation> | |
1984 </xs:annotation> | |
1985 </xs:attribute> | |
1986 | |
1987 <xs:attribute name="label" type="xs:string"> | |
1988 <xs:annotation> | |
1989 <xs:documentation xml:lang="en">Human readable description for the conditional, unused in the Galaxy UI currently.</xs:documentation> | |
1990 </xs:annotation> | |
1991 </xs:attribute> | |
1992 | |
1993 </xs:extension> | |
1994 </xs:complexContent> | |
1995 </xs:complexType> | |
1996 | |
1997 | |
1998 | |
1999 <xs:complexType name="ConditionalWhen"> | |
2000 <xs:annotation> | |
2001 <xs:documentation xml:lang="en">This directive describes one potential | |
2002 set of input for the tool at this depth. See documentation for the | |
2003 [conditional](#tool-inputs-conditional) block for more details and examples (XML | |
2004 and corresponding Cheetah conditionals).</xs:documentation> | |
2005 </xs:annotation> | |
2006 <xs:sequence> | |
2007 <xs:group ref="InputElement" minOccurs="0" maxOccurs="unbounded"/> | |
2008 </xs:sequence> | |
2009 <xs:attribute name="value" type="xs:string" use="required"> | |
2010 <xs:annotation> | |
2011 <xs:documentation xml:lang="en">Value for the tool form test parameter | |
2012 corresponding to this ``when`` block.</xs:documentation> | |
2013 </xs:annotation> | |
2014 </xs:attribute> | |
2015 </xs:complexType> | |
2016 | |
2017 | |
2018 | |
2019 <xs:complexType name="Repeat"> | |
2020 <xs:annotation> | |
2021 <xs:documentation xml:lang="en"><![CDATA[ | |
2022 See | |
2023 [xy_plot.xml](https://github.com/galaxyproject/tools-devteam/blob/master/tools/xy_plot/xy_plot.xml) | |
2024 for an example of how to use this tag set. This is a container for any tag sets | |
2025 that can be contained within the ``<inputs>`` tag set. When this is used, the | |
2026 tool will allow the user to add any number of additional sets of the contained | |
2027 parameters (an option to add new iterations will be displayed on the tool form). | |
2028 All input parameters contained within the ``<repeat>`` tag can be retrieved by | |
2029 enumerating over ``$<name_of_repeat_tag_set>`` in the relevant Cheetah code. | |
2030 This returns the rank and the parameter objects of the repeat container. See the | |
2031 Cheetah code below. | |
2032 | |
2033 ### Example | |
2034 | |
2035 This part is contained in the ``<inputs>`` tag set. | |
2036 | |
2037 ```xml | |
2038 <repeat name="series" title="Series"> | |
2039 <param name="input" type="data" format="tabular" label="Dataset"/> | |
2040 <param name="xcol" type="data_column" data_ref="input" label="Column for x axis"/> | |
2041 <param name="ycol" type="data_column" data_ref="input" label="Column for y axis"/> | |
2042 </repeat> | |
2043 ``` | |
2044 | |
2045 This Cheetah code can be used in the ``<command>`` tag set or the | |
2046 ``<configfile>`` tag set. | |
2047 | |
2048 ``` | |
2049 #for $i, $s in enumerate($series) | |
2050 rank_of_series=$i | |
2051 input_path='${s.input}' | |
2052 x_colom=${s.xcol} | |
2053 y_colom=${s.ycol} | |
2054 #end for | |
2055 ``` | |
2056 | |
2057 ### Testing | |
2058 | |
2059 This is an example test case with multiple repeat elements for the example above. | |
2060 | |
2061 ```xml | |
2062 <test> | |
2063 <repeat name="series"> | |
2064 <param name="input" value="tabular1.tsv" ftype="tabular"/> | |
2065 <param name="xcol" value="1"/> | |
2066 <param name="ycol" value="2"/> | |
2067 </repeat> | |
2068 <repeat name="series"> | |
2069 <param name="input" value="tabular2.tsv" ftype="tabular"/> | |
2070 <param name="xcol" value="4"/> | |
2071 <param name="ycol" value="2"/> | |
2072 </repeat> | |
2073 <output name="out_file1" file="cool.pdf" ftype="pdf" /> | |
2074 </test> | |
2075 ``` | |
2076 | |
2077 See the documentation on the [repeat test directive](#tool-tests-test-repeat). | |
2078 | |
2079 An older way to specify repeats in a test is by instances that are created by referring to names with a special format: ``<repeat name>_<repeat index>|<param name>`` | |
2080 | |
2081 ```xml | |
2082 <test> | |
2083 <param name="series_0|input" value="tabular1.tsv" ftype="tabular"/> | |
2084 <param name="series_0|xcol" value="1"/> | |
2085 <param name="series_0|ycol" value="2"/> | |
2086 <param name="series_1|input" value="tabular2.tsv" ftype="tabular"/> | |
2087 <param name="series_1|xcol" value="4"/> | |
2088 <param name="series_1|ycol" value="2"/> | |
2089 <output name="out_file1" file="cool.pdf" ftype="pdf" /> | |
2090 </test> | |
2091 ``` | |
2092 | |
2093 The test tool [disambiguate_repeats.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/disambiguate_repeats.xml) | |
2094 demonstrates both testing strategies. | |
2095 | |
2096 ]]></xs:documentation> | |
2097 </xs:annotation> | |
2098 <xs:complexContent> | |
2099 <xs:extension base="InputType"> | |
2100 <xs:sequence> | |
2101 <xs:group ref="InputElement" minOccurs="0" maxOccurs="unbounded"/> | |
2102 </xs:sequence> | |
2103 <xs:attribute name="name" type="xs:string"> | |
2104 <xs:annotation> | |
2105 <xs:documentation xml:lang="en">Name for this element</xs:documentation> | |
2106 </xs:annotation> | |
2107 </xs:attribute> | |
2108 <xs:attribute name="title" type="xs:string" use="required"> | |
2109 <xs:annotation> | |
2110 <xs:documentation xml:lang="en">The title of the repeat section, which will be displayed on the tool form.</xs:documentation> | |
2111 </xs:annotation> | |
2112 </xs:attribute> | |
2113 <xs:attribute name="min" type="xs:integer"> | |
2114 <xs:annotation> | |
2115 <xs:documentation xml:lang="en">The minimum number of repeat units.</xs:documentation> | |
2116 </xs:annotation> | |
2117 </xs:attribute> | |
2118 <xs:attribute name="max" type="xs:integer"> | |
2119 <xs:annotation> | |
2120 <xs:documentation xml:lang="en">The maximum number of repeat units.</xs:documentation> | |
2121 </xs:annotation> | |
2122 </xs:attribute> | |
2123 <xs:attribute name="default" type="xs:integer" default="1"> | |
2124 <xs:annotation> | |
2125 <xs:documentation xml:lang="en">The default number of repeat units.</xs:documentation> | |
2126 </xs:annotation> | |
2127 </xs:attribute> | |
2128 <xs:attribute name="help" type="xs:string"> | |
2129 <xs:annotation> | |
2130 <xs:documentation xml:lang="en">Short help description for repeat element.</xs:documentation> | |
2131 </xs:annotation> | |
2132 </xs:attribute> | |
2133 </xs:extension> | |
2134 </xs:complexContent> | |
2135 </xs:complexType> | |
2136 | |
2137 <xs:complexType name="Section"> | |
2138 <xs:annotation> | |
2139 <xs:documentation xml:lang="en"><![CDATA[ | |
2140 This tag is used to group parameters into sections of the interface. Sections | |
2141 are implemented to replace the commonly used tactic of hiding advanced options | |
2142 behind a conditional, with sections you can easily visually group a related set | |
2143 of options. | |
2144 | |
2145 ### Example | |
2146 | |
2147 The XML configuration is relatively trivial for sections: | |
2148 | |
2149 ```xml | |
2150 <inputs> | |
2151 <section name="adv" title="Advanced Options" expanded="false"> | |
2152 <param name="plot_color" type="color" label="Track color" /> | |
2153 </section> | |
2154 </inputs> | |
2155 ``` | |
2156 | |
2157 In your command template, you'll need to include the section name to access the | |
2158 variable: | |
2159 | |
2160 ``` | |
2161 --color $adv.plot_color | |
2162 ``` | |
2163 | |
2164 Further examples can be found in the [test case](https://github.com/galaxyproject/galaxy/blob/master/test/functional/tools/section.xml) from [pull request #35](https://github.com/galaxyproject/galaxy/pull/35). | |
2165 ]]></xs:documentation> | |
2166 </xs:annotation> | |
2167 <xs:sequence> | |
2168 <xs:group ref="InputElement" minOccurs="0" maxOccurs="unbounded"/> | |
2169 </xs:sequence> | |
2170 <xs:attribute name="name" type="xs:string" use="required"> | |
2171 <xs:annotation> | |
2172 <xs:documentation xml:lang="en">The internal key used for the section.</xs:documentation> | |
2173 </xs:annotation> | |
2174 </xs:attribute> | |
2175 <xs:attribute name="title" type="xs:string" use="required"> | |
2176 <xs:annotation> | |
2177 <xs:documentation xml:lang="en">Human readable label for the section.</xs:documentation> | |
2178 </xs:annotation> | |
2179 </xs:attribute> | |
2180 <xs:attribute name="expanded" type="PermissiveBoolean" default="false"> | |
2181 <xs:annotation> | |
2182 <xs:documentation xml:lang="en">Whether the section should be expanded by default or not. If not, the default set values are used.</xs:documentation> | |
2183 </xs:annotation> | |
2184 </xs:attribute> | |
2185 <xs:attribute name="help" type="xs:string"> | |
2186 <xs:annotation> | |
2187 <xs:documentation xml:lang="en">Short help description for section, rendered just below the section.</xs:documentation> | |
2188 </xs:annotation> | |
2189 </xs:attribute> | |
2190 </xs:complexType> | |
2191 | |
2192 <xs:complexType name="Param"> | |
2193 <xs:annotation> | |
2194 <xs:documentation xml:lang="en"><![CDATA[ | |
2195 | |
2196 Contained within the ``<inputs>`` tag set - each of these specifies a field that | |
2197 will be displayed on the tool form. Ultimately, the values of these form fields | |
2198 will be passed as the command line parameters to the tool's executable. | |
2199 | |
2200 ### Common Attributes | |
2201 | |
2202 The attributes valid for this tag vary wildly based on the ``type`` of the | |
2203 parameter being described. All the attributes for the ``param`` element are | |
2204 documented below for completeness, but here are the common ones for each | |
2205 type are as follows: | |
2206 | |
2207 $attribute_list:name,type,optional,label,help,argument,load_contents,refresh_on_change:4 | |
2208 | |
2209 ### Parameter Types | |
2210 | |
2211 #### ``text`` | |
2212 | |
2213 When ``type="text"``, the parameter is free form text and appears as a text box | |
2214 in the tool form. | |
2215 | |
2216 ##### Examples | |
2217 | |
2218 Sometimes you need labels for data or graph axes, chart titles, etc. This can be | |
2219 done using a text field. The following will create a text box with the default | |
2220 value of "V1". | |
2221 | |
2222 ```xml | |
2223 <param name="xlab" type="text" value="V1" label="Label for x axis" /> | |
2224 ``` | |
2225 | |
2226 The ``area`` boolean attribute can be used to change the ``text`` parameter to a | |
2227 two-dimensional text area instead of a single line text box. | |
2228 | |
2229 ```xml | |
2230 <param name="foo" type="text" area="true" /> | |
2231 ``` | |
2232 | |
2233 Since release 17.01, ``text`` parameters can also supply a static list of preset | |
2234 defaults options. The user **may** be presented with the option to select one of | |
2235 these but will be allowed to supply an arbitrary text value. | |
2236 | |
2237 ```xml | |
2238 <param name="foo" type="text" value="foo 1"> | |
2239 <option value="foo 1">Foo 1 Display</option> | |
2240 <option value="foo 2">Foo 2 Display</option> | |
2241 </param> | |
2242 ``` | |
2243 | |
2244 See [param_text_option.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/param_text_option.xml) | |
2245 for a demonstration of this. | |
2246 | |
2247 $attribute_list:value,size,area:5 | |
2248 | |
2249 #### ``integer`` and ``float`` | |
2250 | |
2251 These parameters represent whole number and real numbers, respectively. | |
2252 | |
2253 ##### Example | |
2254 | |
2255 ```xml | |
2256 <param name="region_size" type="integer" value="1" label="Size of the flanking regions" /> | |
2257 ``` | |
2258 | |
2259 $attribute_list:value,min,max:5 | |
2260 | |
2261 #### ``boolean`` | |
2262 | |
2263 This represents a binary true or false value. | |
2264 | |
2265 $attribute_list:checked,truevalue,falsevalue:5 | |
2266 | |
2267 #### ``data`` | |
2268 | |
2269 A dataset from the current history. Multiple types might be used for the param form. | |
2270 | |
2271 #### ``group_tag`` | |
2272 | |
2273 $attribute_list:multiple,date_ref:5 | |
2274 | |
2275 | |
2276 ##### Examples | |
2277 | |
2278 The following will find all "coordinate interval files" contained within the | |
2279 current history and dynamically populate a select list with them. If they are | |
2280 selected, their destination and internal file name will be passed to the | |
2281 appropriate command line variable. | |
2282 | |
2283 ```xml | |
2284 <param name="interval_file" type="data" format="interval" label="near intervals in"/> | |
2285 ``` | |
2286 | |
2287 The following demonstrates a ``param`` which may accept multiple files and | |
2288 multiple formats. | |
2289 | |
2290 ```xml | |
2291 <param format="sam,bam" multiple="true" name="bamOrSamFile" type="data" | |
2292 label="Alignments in BAM or SAM format" | |
2293 help="The set of aligned reads." /> | |
2294 ``` | |
2295 | |
2296 Perhaps counter-intuitively, a ``multiple="true"`` data parameter requires at least one | |
2297 data input. If ``optional="true"`` is specified, this condition is relaxed and the user | |
2298 is allowed to select 0 datasets. Unfortunately, if 0 datasets are selected the resulting | |
2299 value for the parameter during Cheetah templating (such as in a ``command`` block) will | |
2300 effectively be a list with one ``None``-like entity in it. | |
2301 | |
2302 The following idiom can be used to iterate over such a list and build a hypothetical ``-B`` | |
2303 parameter for each file - the ``if`` block is used to handle the case where a ``None``-like | |
2304 entity appears in the list because no files were selected: | |
2305 | |
2306 ``` | |
2307 #for $input in $input1 | |
2308 #if $input | |
2309 -B "$input" | |
2310 #end if | |
2311 #end for | |
2312 ``` | |
2313 | |
2314 Some example tools using ``multiple="true"`` data parameters include: | |
2315 | |
2316 - [multi_data_param.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/multi_data_param.xml) | |
2317 - [multi_data_optional.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/multi_data_optional.xml) | |
2318 | |
2319 Additionally, a detailed discussion of handling multiple homogenous files can be found in the | |
2320 the [Planemo Documentation](https://planemo.readthedocs.io/en/latest/writing_advanced.html#consuming-collections) | |
2321 on this topic. | |
2322 | |
2323 $attribute_list:format,multiple:5 | |
2324 | |
2325 #### ``select`` | |
2326 | |
2327 The following will create a select list containing the options "Downstream" and | |
2328 "Upstream". Depending on the selection, a ``d`` or ``u`` value will be passed to | |
2329 the ``$upstream_or_down`` variable on the command line. | |
2330 | |
2331 ```xml | |
2332 <param name="upstream_or_down" type="select" label="Get"> | |
2333 <option value="u">Upstream</option> | |
2334 <option value="d">Downstream</option> | |
2335 </param> | |
2336 ``` | |
2337 | |
2338 The following will create a checkbox list allowing the user to select | |
2339 "Downstream", "Upstream", both, or neither. Depending on the selection, the | |
2340 value of ``$upstream_or_down`` will be ``d``, ``u``, ``u,d``, or "". | |
2341 | |
2342 ```xml | |
2343 <param name="upstream_or_down" type="select" label="Get" multiple="true" display="checkboxes"> | |
2344 <option value="u">Upstream</option> | |
2345 <option value="d">Downstream</option> | |
2346 </param> | |
2347 ``` | |
2348 | |
2349 $attribute_list:data_ref,dynamic_options,display,multiple:5 | |
2350 | |
2351 #### ``data_column`` | |
2352 | |
2353 This parameter type is used to select columns from a parameter. | |
2354 | |
2355 $attribute_list:force_select,numerical,use_header_name:5 | |
2356 | |
2357 #### ``drill_down`` | |
2358 | |
2359 $attribute_list:hierarchy:5 | |
2360 | |
2361 #### ``data_collection`` | |
2362 | |
2363 The following will create a parameter that only accepts paired FASTQ files grouped into a collection. | |
2364 | |
2365 ##### Examples | |
2366 | |
2367 ```xml | |
2368 <param name="inputs" type="data_collection" collection_type="paired" label="Input FASTQs" format="fastq"> | |
2369 </param> | |
2370 ``` | |
2371 | |
2372 More detailed information on writing tools that consume collections can be found | |
2373 in the [planemo documentation](https://planemo.readthedocs.io/en/latest/writing_advanced.html#collections). | |
2374 | |
2375 $attribute_list:format,collection_type:5 | |
2376 | |
2377 #### ``color`` | |
2378 | |
2379 ##### Examples | |
2380 | |
2381 The following example will create a color selector parameter. | |
2382 | |
2383 ```xml | |
2384 <param name="feature_color" type="color" label="Default feature color" value="#ff00ff"> | |
2385 </param> | |
2386 ``` | |
2387 | |
2388 Given that the output includes a pound sign, it is often convenient to use a | |
2389 sanitizer to prevent Galaxy from escaping the result. | |
2390 | |
2391 ```xml | |
2392 <param name="feature_color" type="color" label="Default feature color" value="#ff00ff"> | |
2393 <sanitizer> | |
2394 <valid initial="string.ascii_letters,string.digits"> | |
2395 <add value="#" /> | |
2396 </valid> | |
2397 </sanitizer> | |
2398 </param> | |
2399 ``` | |
2400 | |
2401 $attribute_list:value,rgb:5 | |
2402 | |
2403 This covers examples of the most common parameter types, the remaining parameter | |
2404 types are more obsecure and less likely to be useful for most tool authors. | |
2405 | |
2406 ]]></xs:documentation> | |
2407 </xs:annotation> | |
2408 <xs:complexContent> | |
2409 <xs:extension base="InputType"> | |
2410 <xs:sequence> | |
2411 <xs:group ref="ParamElement" minOccurs="0" maxOccurs="unbounded" /> | |
2412 </xs:sequence> | |
2413 <xs:attribute name="type" type="ParamType" use="required"> | |
2414 <xs:annotation> | |
2415 <xs:documentation xml:lang="en"><![CDATA[ | |
2416 | |
2417 Describes the parameter type - each different type as different semantics and | |
2418 the tool form widget is different. Currently valid parameter types are: | |
2419 ``text``, ``integer``, ``float``, ``boolean``, ``genomebuild``, ``select``, | |
2420 ``color``, ``data_column``, ``hidden``, ``hidden_data``, ``baseurl``, | |
2421 ``file``, ``ftpfile``, ``data``, ``data_collection``, ``library_data``, | |
2422 ``drill_down``. The definition of supported parameter types as defined in the | |
2423 ``parameter_types`` dictionary in | |
2424 [/lib/galaxy/tools/parameters/basic.py](https://github.com/galaxyproject/galaxy/blob/master/lib/galaxy/tools/parameters/basic.py). | |
2425 | |
2426 ]]></xs:documentation> | |
2427 </xs:annotation> | |
2428 </xs:attribute> | |
2429 <xs:attribute name="name" type="xs:string"> | |
2430 <xs:annotation> | |
2431 <xs:documentation xml:lang="en"><![CDATA[Name for this element. This ``name`` | |
2432 is used as the Cheetah variable containing the user-supplied parameter name in | |
2433 ``command`` and ``configfile`` elements. The name should not contain pipes or | |
2434 periods (e.g. ``.``). Some "reserved" names are ``REDIRECT_URL``, | |
2435 ``DATA_URL``, ``GALAXY_URL``.]]></xs:documentation> | |
2436 </xs:annotation> | |
2437 </xs:attribute> | |
2438 <!-- TODO: add unique constraints... --> | |
2439 <xs:attribute name="area" type="PermissiveBoolean"> | |
2440 <xs:annotation> | |
2441 <xs:documentation xml:lang="en">Boolean indicating if this should be | |
2442 rendered as a one line text box (if ``false``, the default) or a multi-line text | |
2443 area (if ``true``).</xs:documentation> | |
2444 </xs:annotation> | |
2445 </xs:attribute> | |
2446 <xs:attribute name="argument" type="xs:string"> | |
2447 <xs:annotation> | |
2448 <xs:documentation xml:lang="en"><![CDATA[ | |
2449 | |
2450 If the parameter reflects just one command line argument of a certain tool, this | |
2451 tag should be set to that particular argument. It is rendered in parenthesis | |
2452 after the help section, and it will create the name attribute (if not given explicitly) | |
2453 from the argument attribute by stripping leading dashes and replacing all remaining | |
2454 dashes by underscores (e.g. if ``argument="--long-parameter"`` then | |
2455 ``name="long_parameter"`` is implicit). | |
2456 | |
2457 ]]></xs:documentation> | |
2458 </xs:annotation> | |
2459 </xs:attribute> | |
2460 <xs:attribute name="label" type="xs:string"> | |
2461 <xs:annotation> | |
2462 <xs:documentation xml:lang="en">The attribute value will be | |
2463 displayed on the tool page as the label of the form field | |
2464 (``label="Sort Query"``).</xs:documentation> | |
2465 </xs:annotation> | |
2466 </xs:attribute> | |
2467 <xs:attribute name="help" type="xs:string"> | |
2468 <xs:annotation gxdocs:best_practices="parameter-help"> | |
2469 <xs:documentation xml:lang="en">Short bit of text, rendered on the | |
2470 tool form just below the associated field to provide information about the | |
2471 field.</xs:documentation> | |
2472 </xs:annotation> | |
2473 </xs:attribute> | |
2474 <xs:attribute name="load_contents" type="xs:integer"> | |
2475 <xs:annotation> | |
2476 <xs:documentation xml:lang="en">Number of bytes that should be | |
2477 loaded into the `contents` attribute of the jobs dictionary provided to Expression | |
2478 Tools. Applies only to type="data" inputs.</xs:documentation> | |
2479 </xs:annotation> | |
2480 </xs:attribute> | |
2481 <xs:attribute name="value" type="xs:string"> | |
2482 <xs:annotation> | |
2483 <xs:documentation xml:lang="en">The default value for this | |
2484 parameter.</xs:documentation> | |
2485 </xs:annotation> | |
2486 </xs:attribute> | |
2487 <xs:attribute name="default_value" type="xs:string" gxdocs:deprecated="true"> | |
2488 <xs:annotation> | |
2489 <xs:documentation xml:lang="en">*Deprecated*. Specify default value for column parameters (use ``value`` instead).</xs:documentation> | |
2490 </xs:annotation> | |
2491 </xs:attribute> | |
2492 <xs:attribute name="optional" type="xs:string" default="false"> | |
2493 <xs:annotation> | |
2494 <xs:documentation xml:lang="en">If ``false``, parameter must have a | |
2495 value. Defaults to "false".</xs:documentation> | |
2496 </xs:annotation> | |
2497 </xs:attribute> | |
2498 <xs:attribute name="rgb" type="xs:string" default="false"> | |
2499 <xs:annotation> | |
2500 <xs:documentation xml:lang="en">If ``false``, the returned value will be in Hex color code. If ``true`` | |
2501 it will be a RGB value e.g. 0,0,255. This attribute is only valid when ``type`` is ``color``.</xs:documentation> | |
2502 </xs:annotation> | |
2503 </xs:attribute> | |
2504 <xs:attribute name="min" type="xs:float"> | |
2505 <xs:annotation> | |
2506 <xs:documentation xml:lang="en">Minimum valid parameter value - only | |
2507 valid when ``type`` is ``integer`` or ``float``.</xs:documentation> | |
2508 </xs:annotation> | |
2509 </xs:attribute> | |
2510 <xs:attribute name="max" type="xs:float"> | |
2511 <xs:annotation> | |
2512 <xs:documentation xml:lang="en">Maximum valid parameter value - only | |
2513 valid when ``type`` is ``integer`` or ``float``.</xs:documentation> | |
2514 </xs:annotation> | |
2515 </xs:attribute> | |
2516 <xs:attribute name="format" type="xs:string"> | |
2517 <xs:annotation> | |
2518 <xs:documentation xml:lang="en">Only if ``type`` attribute value is | |
2519 ``data`` or ``data_collection`` - the list of supported data formats is | |
2520 contained in the | |
2521 [/config/datatypes_conf.xml.sample](https://github.com/galaxyproject/galaxy/blob/dev/config/datatypes_conf.xml.sample) | |
2522 file. Use the file extension.</xs:documentation> | |
2523 </xs:annotation> | |
2524 </xs:attribute> | |
2525 <xs:attribute name="collection_type" type="xs:string"> | |
2526 <xs:annotation> | |
2527 <xs:documentation xml:lang="en"><![CDATA[ | |
2528 | |
2529 This is only valid if ``type`` is ``data_collection``. Restrict the kind of | |
2530 collection that can be consumed by this parameter (e.g. ``paired``, | |
2531 ``list:paired``, ``list``). Multiple such collection types can be specified here | |
2532 as a comma-separated list. | |
2533 | |
2534 ]]></xs:documentation> | |
2535 </xs:annotation> | |
2536 </xs:attribute> | |
2537 <xs:attribute name="data_ref" type="xs:string"> | |
2538 <xs:annotation> | |
2539 <xs:documentation xml:lang="en"><![CDATA[ | |
2540 | |
2541 Only valid if ``type`` attribute value is ``select``, ``data_column``, or | |
2542 ``group_tag``. Used with select lists whose options are dynamically generated | |
2543 based on certain metadata attributes of the dataset or collection upon which | |
2544 this parameter depends (usually but not always the tool's input dataset). | |
2545 | |
2546 ]]></xs:documentation> | |
2547 </xs:annotation> | |
2548 </xs:attribute> | |
2549 <xs:attribute name="accept_default" type="PermissiveBoolean"> | |
2550 <xs:annotation> | |
2551 <xs:documentation xml:lang="en"></xs:documentation> | |
2552 </xs:annotation> | |
2553 </xs:attribute> | |
2554 <xs:attribute name="refresh_on_change" type="PermissiveBoolean"> | |
2555 <xs:annotation> | |
2556 <xs:documentation xml:lang="en">Force a reload of the tool panel when the value of this parameter changes to allow ``code`` file processing. See deprecation-like notice for ``code`` blocks.</xs:documentation> | |
2557 </xs:annotation> | |
2558 </xs:attribute> | |
2559 <xs:attribute name="force_select" type="PermissiveBoolean" gxdocs:deprecated="true"> | |
2560 <xs:annotation> | |
2561 <xs:documentation xml:lang="en">*Deprecated*. Used only if the ``type`` attribute | |
2562 value is ``data_column``, this is deprecated and the inverse of ``optional``. | |
2563 Set to ``false`` to not force user to select an option in the list.</xs:documentation> | |
2564 </xs:annotation> | |
2565 </xs:attribute> | |
2566 <xs:attribute name="use_header_names" type="PermissiveBoolean"> | |
2567 <xs:annotation> | |
2568 <xs:documentation xml:lang="en">Used only if the ``type`` attribute | |
2569 value is ``data_column``. If ``true``, Galaxy assumes the first row of ``data_ref`` | |
2570 is a header and builds the select list with these values rather than the more | |
2571 generic ``c1`` ... ``cN`` (i.e. it will be ``c1: head1`` ... ``cN: headN``). | |
2572 Note that the content of the Cheetah variable is still | |
2573 the column index. | |
2574 </xs:documentation> | |
2575 </xs:annotation> | |
2576 </xs:attribute> | |
2577 <xs:attribute name="display" type="DisplayType"> | |
2578 <xs:annotation> | |
2579 <xs:documentation xml:lang="en">This attribute is used only if | |
2580 ``type`` attribute value is ``select`` - render a select list as a set of check | |
2581 boxes or radio buttons. Defaults to a drop-down menu select list.</xs:documentation> | |
2582 </xs:annotation> | |
2583 </xs:attribute> | |
2584 <xs:attribute name="multiple" type="PermissiveBoolean"> | |
2585 <xs:annotation> | |
2586 <xs:documentation xml:lang="en">Allow multiple valus to be selected. | |
2587 Valid with ``data`` and ``select`` parameters.</xs:documentation> | |
2588 </xs:annotation> | |
2589 </xs:attribute> | |
2590 <xs:attribute name="numerical" type="PermissiveBoolean"> | |
2591 <xs:annotation> | |
2592 <xs:documentation xml:lang="en">Used only if the ``type`` attribute | |
2593 value is ``data_column``, if ``true`` the column will be treated as numerical | |
2594 when filtering columns based on metadata.</xs:documentation> | |
2595 </xs:annotation> | |
2596 </xs:attribute> | |
2597 <xs:attribute name="hierarchy" type="HierarchyType"> | |
2598 <xs:annotation> | |
2599 <xs:documentation xml:lang="en">Used only if the ``type`` attribute | |
2600 value is ``drill_down``, this attribute determines the drill down is | |
2601 ``recursive`` or ``exact``.</xs:documentation> | |
2602 </xs:annotation> | |
2603 </xs:attribute> | |
2604 <xs:attribute name="checked" type="PermissiveBoolean" default="false"> | |
2605 <xs:annotation> | |
2606 <xs:documentation xml:lang="en">Set to ``true`` if the ``boolean`` | |
2607 parameter should be checked (or ``true``) by default.</xs:documentation> | |
2608 </xs:annotation> | |
2609 </xs:attribute> | |
2610 <xs:attribute name="truevalue" type="xs:string"> | |
2611 <xs:annotation> | |
2612 <xs:documentation xml:lang="en">The parameter value in the Cheetah | |
2613 template if the parameter is ``true`` or checked by the user. Only valid if | |
2614 ``type`` is ``boolean``.</xs:documentation> | |
2615 </xs:annotation> | |
2616 </xs:attribute> | |
2617 <xs:attribute name="falsevalue" type="xs:string"> | |
2618 <xs:annotation> | |
2619 <xs:documentation xml:lang="en">The parameter value in the Cheetah | |
2620 template if the parameter is ``false`` or not checked by the user. Only valid if | |
2621 ``type`` is ``boolean``.</xs:documentation> | |
2622 </xs:annotation> | |
2623 </xs:attribute> | |
2624 <xs:attribute name="size" type="xs:string" gxdocs:deprecated="true"> | |
2625 <!-- TODO: can be integer or integerxinteger --> | |
2626 <xs:annotation> | |
2627 <xs:documentation xml:lang="en">*Deprecated*. Used only if ``type`` attribute | |
2628 value is ``text``. Completely ignored since release 16.10.</xs:documentation> | |
2629 </xs:annotation> | |
2630 </xs:attribute> | |
2631 <!-- metadata_name appears in some wrappers but I think this is a copy | |
2632 and paste problem and doesn't reflect something actually used by | |
2633 Galaxy. | |
2634 --> | |
2635 <!-- | |
2636 <xs:attribute name="metadata_name" type="xs:string"> | |
2637 <xs:annotation> | |
2638 <xs:documentation xml:lang="en">Documentation for metadata_name</xs:documentation> | |
2639 </xs:annotation> | |
2640 </xs:attribute> | |
2641 --> | |
2642 <xs:attribute name="dynamic_options" type="xs:string"> | |
2643 <xs:annotation> | |
2644 <xs:documentation xml:lang="en">Deprecated/discouraged method to | |
2645 allow access to Python code to generate options for a select list. See | |
2646 ``code``'s documentation for an example. | |
2647 </xs:documentation> | |
2648 </xs:annotation> | |
2649 </xs:attribute> | |
2650 </xs:extension> | |
2651 </xs:complexContent> | |
2652 </xs:complexType> | |
2653 | |
2654 <xs:group name="ParamElement"> | |
2655 <xs:choice> | |
2656 <xs:element name="label" type="xs:string"> | |
2657 <xs:annotation> | |
2658 <xs:documentation xml:lang="en">Documentation for label</xs:documentation> | |
2659 </xs:annotation> | |
2660 </xs:element> | |
2661 <xs:element name="conversion" type="ParamConversion" /> | |
2662 <xs:element name="option" type="ParamOption" /> | |
2663 <xs:element name="options" type="ParamOptions"/> | |
2664 <xs:element name="validator" type="Validator" /> | |
2665 <xs:element name="sanitizer" type="Sanitizer"/> | |
2666 <xs:element name="help" type="xs:string"> | |
2667 <xs:annotation> | |
2668 <xs:documentation xml:lang="en">Documentation for help</xs:documentation> | |
2669 </xs:annotation> | |
2670 </xs:element> | |
2671 </xs:choice> | |
2672 </xs:group> | |
2673 | |
2674 <xs:simpleType name="ParamType"> | |
2675 <xs:annotation> | |
2676 <xs:documentation xml:lang="en">Documentation for ParamType</xs:documentation> | |
2677 </xs:annotation> | |
2678 <xs:restriction base="xs:string"> | |
2679 <xs:enumeration value="text"/> | |
2680 <xs:enumeration value="integer"/> | |
2681 <xs:enumeration value="float"/> | |
2682 <xs:enumeration value="color"/> | |
2683 <xs:enumeration value="boolean"/> | |
2684 <xs:enumeration value="genomebuild"/> | |
2685 <xs:enumeration value="library_data"/> | |
2686 <xs:enumeration value="select"/> | |
2687 <xs:enumeration value="data_column"/> | |
2688 <xs:enumeration value="hidden"/> | |
2689 <xs:enumeration value="hidden_data"/> | |
2690 <xs:enumeration value="baseurl"/> | |
2691 <xs:enumeration value="file"/> | |
2692 <xs:enumeration value="data"/> | |
2693 <xs:enumeration value="drill_down"/> | |
2694 <xs:enumeration value="group_tag"/> | |
2695 <xs:enumeration value="data_collection"/> | |
2696 </xs:restriction> | |
2697 </xs:simpleType> | |
2698 | |
2699 | |
2700 <xs:complexType name="Command"> | |
2701 <xs:annotation gxdocs:best_practices="command-tag"> | |
2702 <xs:documentation xml:lang="en"><![CDATA[ | |
2703 This tag specifies how Galaxy should invoke the tool's executable, passing its | |
2704 required input parameter values (the command line specification links the | |
2705 parameters supplied in the form with the actual tool executable). Any word | |
2706 inside it starting with a dollar sign (``$``) will be treated as a variable whose | |
2707 values can be acquired from one of three sources: parameters, metadata, or | |
2708 output files. After the substitution of variables with their values, the content | |
2709 is interpreted with [Cheetah](https://pythonhosted.org/Cheetah/) and finally given | |
2710 to the interpreter specified in the corresponding attribute (if any). | |
2711 | |
2712 ### Examples | |
2713 | |
2714 The following uses a compiled executable ([bedtools](https://bedtools.readthedocs.io/en/latest/)). | |
2715 | |
2716 ```xml | |
2717 <command><![CDATA[ | |
2718 bed12ToBed6 -i '$input' > '$output' | |
2719 ]]]]><![CDATA[></command> | |
2720 ``` | |
2721 | |
2722 A few things to note about even this simple example: | |
2723 | |
2724 * Input and output variables (boringly named ``input`` and ``output``) | |
2725 are expanded into paths using the ``$`` Cheetah directive. | |
2726 * Paths should be quoted so that the Galaxy database files may contain spaces. | |
2727 * We are building up a shell script - so special characters like ``>`` can be used | |
2728 (in this case the standard output of the bedtools call is written to the path | |
2729 specified by ``'$output'``). | |
2730 | |
2731 The bed12ToBed6 tool can be found [here](https://github.com/galaxyproject/tools-iuc/blob/master/tools/bedtools/bed12ToBed6.xml). | |
2732 | |
2733 A more sophisticated bedtools example demonstrates the use of loops, conditionals, | |
2734 and uses whitespace to make a complex command very readable can be found in | |
2735 [annotateBed](https://github.com/galaxyproject/tools-iuc/blob/master/tools/bedtools/annotateBed.xml) | |
2736 tool. | |
2737 | |
2738 ```xml | |
2739 <command><![CDATA[ | |
2740 bedtools annotate | |
2741 -i '${inputA}' | |
2742 #if $names.names_select == 'yes': | |
2743 -files | |
2744 #for $bed in $names.beds: | |
2745 '${bed.input}' | |
2746 #end for | |
2747 -names | |
2748 #for $bed in $names.beds: | |
2749 '${bed.inputName}' | |
2750 #end for | |
2751 #else: | |
2752 #set files = '" "'.join([str($file) for $file in $names.beds]) | |
2753 -files '${files}' | |
2754 #set names = '" "'.join([str($name.display_name) for $name in $names.beds]) | |
2755 -names '${names}' | |
2756 #end if | |
2757 $strand | |
2758 $counts | |
2759 $both | |
2760 > '${output}' | |
2761 ]]]]><![CDATA[></command> | |
2762 ``` | |
2763 | |
2764 The following example (taken from [xpath](https://github.com/galaxyproject/tools-iuc/blob/master/tools/xpath/xpath.xml) tool) | |
2765 uses an interpreted executable. In this case a Perl script is shipped with the | |
2766 tool and the directory of the tool itself is referenced with ``$__tool_directory__``. | |
2767 | |
2768 ```xml | |
2769 <command><![CDATA[ | |
2770 perl '$__tool_directory__/xpath' -q -e '$expression' '$input' > '$output' | |
2771 ]]]]><![CDATA[></command> | |
2772 ``` | |
2773 | |
2774 The following example demonstrates accessing metadata from datasets. Metadata values | |
2775 (e.g., ``${input.metadata.chromCol}``) are acquired from the ``Metadata`` model associated | |
2776 with the objects selected as the values of each of the relative form field | |
2777 parameters in the tool form. Accessing this information is generally enabled using | |
2778 the following feature components. | |
2779 | |
2780 A set of "metadata information" is defined for each supported data type (see the | |
2781 ``MetadataElement`` objects in the various data types classes in | |
2782 [/lib/galaxy/datatypes](https://github.com/galaxyproject/galaxy/tree/dev/lib/galaxy/datatypes). | |
2783 The ``DatasetFilenameWrapper`` class in the | |
2784 [/lib/galaxy/tools/wrappers.py](https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tools/wrappers.py) | |
2785 code file wraps a metadata collection to return metadata parameters wrapped | |
2786 according to the Metadata spec. | |
2787 | |
2788 ```xml | |
2789 <command><![CDATA[ | |
2790 #set genome = $input.metadata.dbkey | |
2791 #set datatype = $input.datatype | |
2792 mkdir -p output_dir && | |
2793 python '$__tool_directory__/extract_genomic_dna.py' | |
2794 --input '$input' | |
2795 --genome '$genome' | |
2796 #if $input.is_of_type("gff"): | |
2797 --input_format "gff" | |
2798 --columns "1,4,5,7" | |
2799 --interpret_features $interpret_features | |
2800 #else: | |
2801 --input_format "interval" | |
2802 --columns "${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol},${input.metadata.nameCol}" | |
2803 #end if | |
2804 --reference_genome_source $reference_genome_cond.reference_genome_source | |
2805 #if str($reference_genome_cond.reference_genome_source) == "cached" | |
2806 --reference_genome $reference_genome_cond.reference_genome.fields.path | |
2807 #else: | |
2808 --reference_genome $reference_genome_cond.reference_genome | |
2809 #end if | |
2810 --output_format $output_format_cond.output_format | |
2811 #if str($output_format_cond.output_format) == "fasta": | |
2812 --fasta_header_type $output_format_cond.fasta_header_type_cond.fasta_header_type | |
2813 #if str($output_format_cond.fasta_header_type_cond.fasta_header_type) == "char_delimited": | |
2814 --fasta_header_delimiter $output_format_cond.fasta_header_type_cond.fasta_header_delimiter | |
2815 #end if | |
2816 #end if | |
2817 --output '$output' | |
2818 ]]]]><![CDATA[></command> | |
2819 ``` | |
2820 | |
2821 In additon to demonstrating accessing metadata, this example demonstrates: | |
2822 | |
2823 * ``$input.is_of_type("gff")`` which can be used to check if an input is of a | |
2824 given datatype. | |
2825 * ``#set datatype = $input.datatype`` which is the syntax for defining variables | |
2826 in Cheetah. | |
2827 | |
2828 ### Reserved Variables | |
2829 | |
2830 Galaxy provides a few pre-defined variables which can be used in your command line, | |
2831 even though they don't appear in your tool's parameters. | |
2832 | |
2833 Name | Description | |
2834 ---- | ----------- | |
2835 ``$__tool_directory__`` | The directory the tool description (XML file) currently resides in (new in 15.03) | |
2836 ``$__new_file_path__`` | ``config/galaxy.ini``'s ``new_file_path`` value | |
2837 ``$__tool_data_path__`` | ``config/galaxy.ini``'s tool_data_path value | |
2838 ``$__root_dir__`` | Top-level Galaxy source directory made absolute via ``os.path.abspath()`` | |
2839 ``$__datatypes_config__`` | ``config/galaxy.ini``'s datatypes_config value | |
2840 ``$__user_id__`` | Email's numeric ID (id column of ``galaxy_user`` table in the database) | |
2841 ``$__user_email__`` | User's email address | |
2842 ``$__app__`` | The ``galaxy.app.UniverseApplication`` instance, gives access to all other configuration file variables (e.g. $__app__.config.output_size_limit). Should be used as a last resort, may go away in future releases. | |
2843 | |
2844 Additional runtime properties are available as environment variables. Since these | |
2845 are not Cheetah variables (the values aren't available until runtime) these should likely | |
2846 be escaped with a backslash (``\``) when appearing in ``command`` or ``configfile`` elements. | |
2847 | |
2848 Name | Description | |
2849 ---- | ----------- | |
2850 ``\${GALAXY_SLOTS:-4}`` | Number of cores/threads allocated by the job runner or resource manager to the tool for the given job (here 4 is the default number of threads to use if running via custom runner that does not configure GALAXY_SLOTS or in an older Galaxy runtime). | |
2851 ``\$GALAXY_MEMORY_MB`` | Total amount of memory in megabytes (1024^2 bytes) allocated by the administrator (via the resource manager) to the tool for the given job. If unset, tools should not attempt to limit memory usage. | |
2852 ``\$GALAXY_MEMORY_MB_PER_SLOT`` | Amount of memory per slot in megabytes (1024^2 bytes) allocated by the administrator (via the resource manager) to the tool for the given job. If unset, tools should not attempt to limit memory usage. | |
2853 | |
2854 See the [Planemo docs](https://planemo.readthedocs.io/en/latest/writing_advanced.html#cluster-usage) | |
2855 on the topic of ``GALAXY_SLOTS`` for more information and examples. | |
2856 | |
2857 ### Error detection | |
2858 | |
2859 The ``detect_errors`` attribute of ``command``, if present, loads a preset of error detection checks (for exit codes and content of stdio to indicate fatal tool errors or fatal out of memory errors). It can be one of: | |
2860 | |
2861 * ``default``: for non-legacy tools with absent stdio block non-zero exit codes are added. For legacy tools or if a stdio block is present nothing is added. | |
2862 * ``exit_code``: adds checks for non zero exit codes (The @jmchilton recommendation). The ``oom_exit_code`` parameter can be used to add an additional out of memory indicating exit code. | |
2863 * ``aggressive``: adds checks for non zero exit codes, and checks for ``Exception:``, ``Error:`` in the standard error. Additionally checks for messages in the standard error that indicate an out of memory error (``MemoryError``, ``std::bad_alloc``, ``java.lang.OutOfMemoryError``, ``Out of memory``). (The @bgruening recommendation). | |
2864 | |
2865 Prior to Galaxy release 19.01 the stdio block has only been used for non-legacy tools using ``default``. From release 19.01 checks defined in the stdio tag are prepended to the checks defined by the presets loaded in the command block. | |
2866 ]]></xs:documentation> | |
2867 </xs:annotation> | |
2868 <xs:simpleContent> | |
2869 <xs:extension base="xs:string"> | |
2870 <xs:attribute name="detect_errors" type="xs:string"> | |
2871 <xs:annotation> | |
2872 <xs:documentation>One of ``default``, ``exit_code``, ``aggressive``. See "Error detection" above for details.</xs:documentation> | |
2873 </xs:annotation> | |
2874 </xs:attribute> | |
2875 <xs:attribute name="oom_exit_code" type="xs:integer"> | |
2876 <xs:annotation> | |
2877 <xs:documentation>Only used if ``detect_errors="exit_code"``, tells Galaxy the specified exit code indicates an out of memory error. Galaxy instances may be configured to retry such jobs on resources with more memory.</xs:documentation> | |
2878 </xs:annotation> | |
2879 </xs:attribute> | |
2880 <xs:attribute name="use_shared_home" type="xs:string"> | |
2881 <xs:annotation> | |
2882 <xs:documentation>When running a job for this tool, do not isolate its ``$HOME`` directory within the job's directory - use either the ``shared_home_dir`` setting in Galaxy or the default ``$HOME`` specified in the job's default environment.</xs:documentation> | |
2883 </xs:annotation> | |
2884 </xs:attribute> | |
2885 <xs:attribute name="interpreter" type="xs:string" gxdocs:deprecated="true"> | |
2886 <xs:annotation> | |
2887 <xs:documentation xml:lang="en"><![CDATA[*Deprecated*. This will prefix the command with the value of this attribute (e.g. ``python`` or ``perl``) and the tool directory, in order to run an executable file shipped with the tool. It is recommended to instead use ``<interpreter> '$__tool_directory__/<executable_name>'`` in the tag content. If this attribute is not specified, the tag should contain a Bash command calling executable(s) available in the ``$PATH``, as modified after loading the requirements.]]></xs:documentation> | |
2888 </xs:annotation> | |
2889 </xs:attribute> | |
2890 <xs:attribute name="strict" type="xs:boolean"> | |
2891 <xs:annotation> | |
2892 <xs:documentation xml:lang="en">This boolean forces the ``#set -e`` directive on in shell scripts - so that in a multi-part command if any part fails the job exits with a non-zero exit code. This is enabled by default for tools with ``profile>=20.09`` and disabled on legacy tools.</xs:documentation> | |
2893 </xs:annotation> | |
2894 </xs:attribute> | |
2895 </xs:extension> | |
2896 </xs:simpleContent> | |
2897 </xs:complexType> | |
2898 | |
2899 <xs:complexType name="Expression"> | |
2900 <xs:annotation> | |
2901 <xs:documentation xml:lang="en"><![CDATA[ | |
2902 For "Expression Tools" (tools with ``tool_type="expression``) this block describes the expression | |
2903 used to evaluate inputs and produce outputs. The semantics are going to vary based on the value | |
2904 of "type" specified for this expression block. | |
2905 ]]></xs:documentation> | |
2906 </xs:annotation> | |
2907 <xs:simpleContent> | |
2908 <xs:extension base="xs:string"> | |
2909 <xs:attribute name="type" type="ExpressionType"> | |
2910 <xs:annotation> | |
2911 <xs:documentation>Type of expression defined by this expression block. The only current valid option is ecma5.1 - which will evaluate the expression in a sandbox using node. The option still must be specified to allow a different default in the future.</xs:documentation> | |
2912 </xs:annotation> | |
2913 </xs:attribute> | |
2914 </xs:extension> | |
2915 </xs:simpleContent> | |
2916 </xs:complexType> | |
2917 | |
2918 <xs:simpleType name="ExpressionType"> | |
2919 <xs:annotation> | |
2920 <xs:documentation xml:lang="en"></xs:documentation> | |
2921 </xs:annotation> | |
2922 <xs:restriction base="xs:string"> | |
2923 <xs:enumeration value="ecma5.1" /> | |
2924 </xs:restriction> | |
2925 </xs:simpleType> | |
2926 | |
2927 <xs:complexType name="ParamOption"> | |
2928 <xs:annotation> | |
2929 <xs:documentation xml:lang="en"><![CDATA[ | |
2930 | |
2931 See [/tools/filters/sorter.xml](https://github.com/galaxyproject/galaxy/blob/master/tools/filters/sorter.xml) | |
2932 for typical examples of how to use this tag set. This directive is used to described | |
2933 static lists of options and is contained | |
2934 within the [param](#tool-inputs-param) directive when the ``type`` attribute | |
2935 value is ``select`` (i.e. ``<param type="select" ...>``). | |
2936 | |
2937 ### Example | |
2938 | |
2939 ```xml | |
2940 <param name="style" type="select" label="with flavor"> | |
2941 <option value="num">Numerical sort</option> | |
2942 <option value="gennum">General numeric sort</option> | |
2943 <option value="alpha">Alphabetical sort</option> | |
2944 </param> | |
2945 ``` | |
2946 | |
2947 An option can also be annotated with ``selected="true"`` to specify a | |
2948 default option. | |
2949 | |
2950 ```xml | |
2951 <param name="col" type="select" label="From"> | |
2952 <option value="0" selected="true">Column 1 / Sequence name</option> | |
2953 <option value="1">Column 2 / Source</option> | |
2954 <option value="2">Column 3 / Feature</option> | |
2955 <option value="6">Column 7 / Strand</option> | |
2956 <option value="7">Column 8 / Frame</option> | |
2957 </param> | |
2958 ``` | |
2959 ]]> | |
2960 </xs:documentation> | |
2961 </xs:annotation> | |
2962 <xs:simpleContent> | |
2963 <xs:extension base="xs:string"> | |
2964 <xs:attribute name="value" type="xs:string"> | |
2965 <xs:annotation> | |
2966 <xs:documentation xml:lang="en"><![CDATA[The value of the | |
2967 corresponding variable when used the Cheetah template. Also the value that | |
2968 should be used in building test cases and used when building requests for the | |
2969 API.]]></xs:documentation> | |
2970 </xs:annotation> | |
2971 </xs:attribute> | |
2972 <xs:attribute name="selected" type="PermissiveBoolean" default="false"> | |
2973 <xs:annotation> | |
2974 <xs:documentation xml:lang="en">A boolean parameter indicating | |
2975 if the corresponding option is selected by default (the default is ``false``). | |
2976 </xs:documentation> | |
2977 </xs:annotation> | |
2978 </xs:attribute> | |
2979 </xs:extension> | |
2980 </xs:simpleContent> | |
2981 </xs:complexType> | |
2982 | |
2983 <xs:complexType name="ParamConversion"> | |
2984 <xs:annotation> | |
2985 <xs:documentation xml:lang="en"><![CDATA[ | |
2986 | |
2987 A contrived example of a tool that uses this is the test tool | |
2988 [explicit_conversion.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/explicit_conversion.xml). | |
2989 | |
2990 This directive is optionally contained within the ``<param>`` tag when the | |
2991 ``type`` attribute value is ``data`` and is used to dynamically generated a converted | |
2992 dataset for the contained input of the type specified using the ``type`` tag. | |
2993 | |
2994 ]]> | |
2995 </xs:documentation> | |
2996 </xs:annotation> | |
2997 <xs:attribute name="name" type="xs:string" use="required"> | |
2998 <xs:annotation> | |
2999 <xs:documentation xml:lang="en">Name of Cheetah variable to create for converted dataset.</xs:documentation> | |
3000 </xs:annotation> | |
3001 </xs:attribute> | |
3002 <xs:attribute name="type" type="xs:string" use="required"> | |
3003 <xs:annotation> | |
3004 <xs:documentation xml:lang="en">The short extension describing the datatype to convert to - Galaxy must have a datatype converter from the parent input's type to this.</xs:documentation> | |
3005 </xs:annotation> | |
3006 </xs:attribute> | |
3007 </xs:complexType> | |
3008 | |
3009 | |
3010 <xs:complexType name="ParamOptions"> | |
3011 <xs:annotation> | |
3012 <xs:documentation xml:lang="en"><![CDATA[ | |
3013 | |
3014 See [/tools/extract/liftOver_wrapper.xml](https://github.com/galaxyproject/galaxy/blob/master/tools/extract/liftOver_wrapper.xml) | |
3015 for an example of how to use this tag set. This tag set is optionally contained | |
3016 within the ``<param>`` tag when the ``type`` attribute value is ``select`` or | |
3017 ``data`` and used to dynamically generated lists of options. This tag set | |
3018 dynamically creates a list of options whose values can be | |
3019 obtained from a predefined file stored locally or a dataset selected from the | |
3020 current history. | |
3021 | |
3022 There are at least five basic ways to use this tag - four of these correspond to | |
3023 a ``from_XXX`` attribute on the ``options`` directive and the other is to | |
3024 exclusively use ``filter``s to populate options. | |
3025 | |
3026 * ``from_data_table`` - The options for the select list are dynamically obtained | |
3027 from a file specified in the Galaxy configuration file | |
3028 ``tool_data_table_conf.xml`` or from a Tool Shed installed data manager. | |
3029 * ``from_dataset`` - The options for the select list are dynamically obtained | |
3030 from input dataset selected for the tool from the current history. | |
3031 * ``from_file`` - The options for the select list are dynamically obtained from | |
3032 a file. This mechanis is discourage in favor of the more generic | |
3033 ``from_data_table``. | |
3034 * ``from_parameter`` - The options for the select list are dynamically obtained | |
3035 from a parameter. | |
3036 * Using ``filter``s - various filters can be used to populate options, see | |
3037 examples in the [filter](#tool-inputs-param-options-filter) documentation. | |
3038 | |
3039 ### ``from_data_table`` | |
3040 | |
3041 See Galaxy's | |
3042 [data tables documentation](https://galaxyproject.org/admin/tools/data-tables) | |
3043 for information on setting up data tables. | |
3044 | |
3045 Once a data table has been configured and populated, these can be easily | |
3046 leveraged via tools. | |
3047 | |
3048 This ``conditional`` block in the | |
3049 [bowtie2](https://github.com/galaxyproject/tools-devteam/blob/master/tools/bowtie2/bowtie2_wrapper.xml) | |
3050 wrapper demonstrates using ``from_data_table`` options as an | |
3051 alternative to local reference data. | |
3052 | |
3053 ```xml | |
3054 <conditional name="reference_genome"> | |
3055 <param name="source" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options. See `Indexes` section of help below"> | |
3056 <option value="indexed">Use a built-in genome index</option> | |
3057 <option value="history">Use a genome from the history and build index</option> | |
3058 </param> | |
3059 <when value="indexed"> | |
3060 <param name="index" type="select" label="Select reference genome" help="If your genome of interest is not listed, contact the Galaxy team"> | |
3061 <options from_data_table="bowtie2_indexes"> | |
3062 <filter type="sort_by" column="2"/> | |
3063 <validator type="no_options" message="No indexes are available for the selected input dataset"/> | |
3064 </options> | |
3065 </param> | |
3066 </when> | |
3067 <when value="history"> | |
3068 <param name="own_file" type="data" format="fasta" label="Select reference genome" /> | |
3069 </when> | |
3070 </conditional> | |
3071 ``` | |
3072 | |
3073 A minimal example wouldn't even need the ``filter`` or ``validator`` above, but | |
3074 they are frequently nice features to add to your wrapper and can improve the user | |
3075 experience of a tool. | |
3076 | |
3077 ### ``from_dataset`` | |
3078 | |
3079 The following example is taken from the Mothur tool | |
3080 [remove.lineage.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/mothur/remove.lineage.xml) | |
3081 and demonstrates generating options from a dataset directly. | |
3082 | |
3083 ```xml | |
3084 <param name="taxonomy" type="data" format="mothur.seq.taxonomy" label="taxonomy - Taxonomy" help="please make sure your file has no quotation marks in it"/> | |
3085 <param name="taxons" type="select" optional="true" multiple="true" label="Browse Taxons from Taxonomy"> | |
3086 <options from_dataset="taxonomy"> | |
3087 <column name="name" index="1"/> | |
3088 <column name="value" index="1"/> | |
3089 <filter type="unique_value" name="unique_taxon" column="1"/> | |
3090 <filter type="sort_by" name="sorted_taxon" column="1"/> | |
3091 </options> | |
3092 <sanitizer> | |
3093 <valid initial="default"> | |
3094 <add preset="string.printable"/> | |
3095 <add value=";"/> | |
3096 <remove value="""/> | |
3097 <remove value="'"/> | |
3098 </valid> | |
3099 </sanitizer> | |
3100 </param> | |
3101 ``` | |
3102 | |
3103 Filters can be used to generate options from dataset directly also as the | |
3104 example below demonstrates (many more examples are present in the | |
3105 [filter](#tool-inputs-param-options-filter) documentation). | |
3106 | |
3107 ```xml | |
3108 <param name="species1" type="select" label="When Species" multiple="false"> | |
3109 <options> | |
3110 <filter type="data_meta" ref="input1" key="species" /> | |
3111 </options> | |
3112 </param> | |
3113 ``` | |
3114 | |
3115 ### ``from_file`` | |
3116 | |
3117 The following example is for Blast databases. In this example users maybe select | |
3118 a database that is pre-formatted and cached in Galaxy clusters. When a new | |
3119 dataset is available, admins must add the database to the local file named | |
3120 "blastdb.loc". All such databases in that file are included in the options of | |
3121 the select list. For a local instance, the file (e.g. ``blastdb.loc`` or | |
3122 ``alignseq.loc``) must be stored in the configured | |
3123 [tool_data_path](https://github.com/galaxyproject/galaxy/tree/master/tool-data) | |
3124 directory. In this example, the option names and values are taken from column 0 | |
3125 of the file. | |
3126 | |
3127 ```xml | |
3128 <param name="source_select" type="select" display="radio" label="Choose target database"> | |
3129 <options from_file="blastdb.loc"> | |
3130 <column name="name" index="0"/> | |
3131 <column name="value" index="0"/> | |
3132 </options> | |
3133 </param> | |
3134 ``` | |
3135 | |
3136 In general, ``from_file`` should be considered deprecated and ``from_data_table`` | |
3137 should be prefered. | |
3138 | |
3139 ### ``from_parameter`` | |
3140 | |
3141 This variant of the ``options`` directive is discouraged because it exposes | |
3142 internal Galaxy structures. See the older | |
3143 [bowtie](https://github.com/galaxyproject/tools-devteam/blob/master/tools/bowtie_wrappers/bowtie_wrapper.xml) | |
3144 wrappers for an example of these. | |
3145 | |
3146 ### Other Ways to Dynamically Generate Options | |
3147 | |
3148 Though deprecated and discouraged, [code](#tool-code) blocks can also be | |
3149 used to generate dynamic options. | |
3150 | |
3151 ]]> | |
3152 </xs:documentation> | |
3153 </xs:annotation> | |
3154 <xs:sequence> | |
3155 <xs:group ref="OptionsElement" minOccurs="0" maxOccurs="unbounded"/> | |
3156 </xs:sequence> | |
3157 <xs:attribute name="from_dataset" type="xs:string"> | |
3158 <xs:annotation> | |
3159 <xs:documentation xml:lang="en">Documentation for from_dataset</xs:documentation> | |
3160 </xs:annotation> | |
3161 </xs:attribute> | |
3162 <xs:attribute name="from_file" type="xs:string"> | |
3163 <xs:annotation> | |
3164 <xs:documentation xml:lang="en">Documentation for from_file</xs:documentation> | |
3165 </xs:annotation> | |
3166 </xs:attribute> | |
3167 <xs:attribute name="from_data_table" type="xs:string"> | |
3168 <xs:annotation> | |
3169 <xs:documentation xml:lang="en">Documentation for from_data_table</xs:documentation> | |
3170 </xs:annotation> | |
3171 </xs:attribute> | |
3172 <xs:attribute name="from_parameter" type="xs:string"> | |
3173 <xs:annotation> | |
3174 <xs:documentation xml:lang="en">Documentation for from_parameter</xs:documentation> | |
3175 </xs:annotation> | |
3176 </xs:attribute> | |
3177 <xs:attribute name="options_filter_attribute" type="xs:string"> | |
3178 <xs:annotation> | |
3179 <xs:documentation xml:lang="en">Documentation for options_filter_attribute</xs:documentation> | |
3180 </xs:annotation> | |
3181 </xs:attribute> | |
3182 <xs:attribute name="transform_lines" type="xs:string"> | |
3183 <xs:annotation> | |
3184 <xs:documentation xml:lang="en">Documentation for transform_lines</xs:documentation> | |
3185 </xs:annotation> | |
3186 </xs:attribute> | |
3187 <xs:attribute name="startswith" type="xs:string"> | |
3188 <xs:annotation> | |
3189 <xs:documentation xml:lang="en">Documentation for startswith</xs:documentation> | |
3190 </xs:annotation> | |
3191 </xs:attribute> | |
3192 </xs:complexType> | |
3193 <xs:group name="OptionsElement"> | |
3194 <xs:choice> | |
3195 <xs:element name="filter" type="Filter" minOccurs="0" maxOccurs="unbounded"/> | |
3196 <xs:element name="column" type="Column" minOccurs="0" maxOccurs="unbounded"/> | |
3197 <xs:element name="validator" type="Validator" minOccurs="0" maxOccurs="1"/> | |
3198 <xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"> | |
3199 <xs:annotation> | |
3200 <xs:documentation xml:lang="en">Documentation for file</xs:documentation> | |
3201 </xs:annotation> | |
3202 </xs:element> | |
3203 </xs:choice> | |
3204 </xs:group> | |
3205 <xs:complexType name="Column"> | |
3206 <xs:annotation> | |
3207 <xs:documentation xml:lang="en"><![CDATA[Optionally contained within an | |
3208 ``<options>`` tag set - specifies columns used in building select options from a | |
3209 file stored locally (i.e. index or tool data) or a dataset in the | |
3210 current history. | |
3211 | |
3212 Any number of columns may be described, but at least one must be given the name | |
3213 ``value`` and it will serve as the value of this parameter in the Cheetah | |
3214 template and elsewhwere (e.g. in API for instance). | |
3215 | |
3216 If a column named ``name`` is defined, this too has special meaning and it will | |
3217 be the value the tool form user sees for each option. If no ``name`` column | |
3218 appears, ``value`` will serve as the name. | |
3219 | |
3220 ### Examples | |
3221 | |
3222 The following fragment shows options from the dataset in the current history | |
3223 that has been selected as the value of the parameter named ``input1``. | |
3224 | |
3225 ```xml | |
3226 <options from_dataset="input1"> | |
3227 <column name="name" index="0"/> | |
3228 <column name="value" index="0"/> | |
3229 </options> | |
3230 ``` | |
3231 | |
3232 The [interval2maf](https://github.com/galaxyproject/galaxy/blob/dev/tools/maf/interval2maf.xml) | |
3233 tool makes use of this tag with files from a history, and the | |
3234 [star_fusion](https://github.com/galaxyproject/tools-iuc/blob/master/tools/star_fusion/star_fusion.xml) | |
3235 tool makes use of this to reference a data table. | |
3236 ]]></xs:documentation> | |
3237 </xs:annotation> | |
3238 <xs:attribute name="name" type="xs:string" use="required"> | |
3239 <xs:annotation> | |
3240 <xs:documentation xml:lang="en">Name given to the column with index | |
3241 ``index``, the names ``name`` and ``value`` have special meaning as described | |
3242 above.</xs:documentation> | |
3243 </xs:annotation> | |
3244 </xs:attribute> | |
3245 <xs:attribute name="index" type="xs:decimal" use="required"> | |
3246 <xs:annotation> | |
3247 <xs:documentation xml:lang="en">0-based index of the column in the | |
3248 target file.</xs:documentation> | |
3249 </xs:annotation> | |
3250 </xs:attribute> | |
3251 </xs:complexType> | |
3252 <xs:complexType name="Validator"> | |
3253 <xs:annotation> | |
3254 | |
3255 <xs:documentation xml:lang="en"><![CDATA[ | |
3256 | |
3257 See the | |
3258 [annotation_profiler](https://github.com/galaxyproject/tools-devteam/blob/master/tools/annotation_profiler/annotation_profiler.xml) | |
3259 tool for an example of how to use this tag set. This tag set is contained within | |
3260 the ``<param>`` tag set - it applies a validator to the containing parameter. | |
3261 | |
3262 ### Examples | |
3263 | |
3264 The following demonstrates a simple validator ``unspecified_build`` ensuring | |
3265 that a dbkey is present on the selected dataset. This example is taken from the | |
3266 [extract_genomic_dna](https://github.com/galaxyproject/tools-iuc/blob/master/tools/extract_genomic_dna/extract_genomic_dna.xml#L42) | |
3267 tool. | |
3268 | |
3269 ```xml | |
3270 <param name="input" type="data" format="gff,interval" label="Fetch sequences for intervals in"> | |
3271 <validator type="unspecified_build" /> | |
3272 </param> | |
3273 ``` | |
3274 | |
3275 Along the same line, the following example taken from | |
3276 [samtools_mpileup](https://github.com/galaxyproject/tools-devteam/blob/master/tool_collections/samtools/samtools_mpileup/samtools_mpileup.xml) | |
3277 ensures that a dbkey is present and that FASTA indices in the ``fasta_indexes`` | |
3278 tool data table are present. | |
3279 | |
3280 ```xml | |
3281 <param format="bam" label="BAM file(s)" name="input_bam" type="data" min="1" multiple="true"> | |
3282 <validator type="unspecified_build" /> | |
3283 <validator type="dataset_metadata_in_data_table" metadata_name="dbkey" table_name="fasta_indexes" metadata_column="1" | |
3284 message="Sequences are not currently available for the specified build." /> | |
3285 </param> | |
3286 ``` | |
3287 | |
3288 In this older, somewhat deprecated example - a genome build of the dataset must | |
3289 be stored in Galaxy clusters and the name of the genome (``dbkey``) must be one | |
3290 of the values in the first column of file ``alignseq.loc`` - that could be | |
3291 expressed with the validator. In general, ``dataset_metadata_in_file`` should be | |
3292 considered deprecated in favor of | |
3293 | |
3294 ```xml | |
3295 <validator type="dataset_metadata_in_data_table" | |
3296 metadata_name="dbkey" | |
3297 metadata_column="1" | |
3298 message="Sequences are not currently available for the specified build." /> | |
3299 ``` | |
3300 | |
3301 A very common validator is simply ensure a Python expression is valid for a | |
3302 specified value. In the following example - paths/names that downstream tools | |
3303 use in filenames may not contain ``..``. | |
3304 | |
3305 ```xml | |
3306 <validator type="expression" message="No two dots (..) allowed">'..' not in value</validator> | |
3307 ``` | |
3308 ]]></xs:documentation> | |
3309 </xs:annotation> | |
3310 <xs:simpleContent> | |
3311 <xs:extension base="xs:string"> | |
3312 <xs:attribute name="type" type="ValidatorType" use="required"> | |
3313 <xs:annotation> | |
3314 <xs:documentation xml:lang="en"><![CDATA[The list of supported | |
3315 validators is in the ``validator_types`` dictionary in | |
3316 [/lib/galaxy/tools/parameters/validation.py](https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tools/parameters/validation.py). | |
3317 Valid values include: ``expression``, ``regex``, ``in_range``, ``length``, | |
3318 ``metadata``, ``unspecified_build``, ``no_options``, ``empty_field``, | |
3319 ``dataset_metadata_in_file``, | |
3320 ``dataset_metadata_in_data_table``, ``dataset_metadata_not_in_data_table``, | |
3321 ``value_in_data_table``, ``value_not_in_data_table``, | |
3322 ``dataset_ok_validator``, ``dataset_metadata_in_range``]]></xs:documentation> | |
3323 </xs:annotation> | |
3324 </xs:attribute> | |
3325 <xs:attribute name="message" type="xs:string"> | |
3326 <xs:annotation> | |
3327 <xs:documentation xml:lang="en"> | |
3328 The error message displayed on the tool form if validation fails.</xs:documentation> | |
3329 </xs:annotation> | |
3330 </xs:attribute> | |
3331 <xs:attribute name="check" type="xs:string"> | |
3332 <xs:annotation> | |
3333 <xs:documentation xml:lang="en">Comma-seperated list of metadata | |
3334 fields to check for if type is ``metadata``. If not specified, all non-optional | |
3335 metadata fields will be checked unless they appear in the list of fields | |
3336 specified by the ``skip`` attribute.</xs:documentation> | |
3337 </xs:annotation> | |
3338 </xs:attribute> | |
3339 <xs:attribute name="table_name" type="xs:string"> | |
3340 <xs:annotation> | |
3341 <xs:documentation xml:lang="en">Tool data table name to check against | |
3342 if ``type`` is ``dataset_metadata_in_tool_data``, ``dataset_metadata_not_in_tool_data``, ``value_in_tool_data``, or ``value_not_in_tool_data``. See the documentation for | |
3343 [tool data tables](https://galaxyproject.org/admin/tools/data-tables) | |
3344 and [data managers](https://galaxyproject.org/admin/tools/data-managers/) for | |
3345 more information.</xs:documentation> | |
3346 </xs:annotation> | |
3347 </xs:attribute> | |
3348 <xs:attribute name="filename" type="xs:string"> | |
3349 <xs:annotation> | |
3350 <xs:documentation xml:lang="en">Tool data filename to check against | |
3351 if ``type`` is ``dataset_metadata_in_file``. File should be present Galaxy's | |
3352 ``tool-data`` directory.</xs:documentation> | |
3353 </xs:annotation> | |
3354 </xs:attribute> | |
3355 <xs:attribute name="metadata_name" type="xs:string"> | |
3356 <xs:annotation> | |
3357 <xs:documentation xml:lang="en">Target metadata attribute name for | |
3358 ``dataset_metadata_in_data_table``, ``dataset_metadata_not_in_data_table`` and ``dataset_metadata_in_file`` options.</xs:documentation> | |
3359 </xs:annotation> | |
3360 </xs:attribute> | |
3361 <xs:attribute name="metadata_column" type="xs:string"> | |
3362 <xs:annotation> | |
3363 <xs:documentation xml:lang="en">Target column for metadata attribute | |
3364 in ``dataset_metadata_in_data_table``, ``dataset_metadata_not_in_data_table``, ``value_in_data_table``, ``value__not_in_data_table``, and ``dataset_metadata_in_file`` options. | |
3365 This can be an integer index to the column or a column name.</xs:documentation> | |
3366 </xs:annotation> | |
3367 </xs:attribute> | |
3368 <xs:attribute name="line_startswith" type="xs:string"> | |
3369 <xs:annotation> | |
3370 <xs:documentation xml:lang="en">Used to indicate lines in the file | |
3371 being used for validation start with a this attribute value.</xs:documentation> | |
3372 </xs:annotation> | |
3373 </xs:attribute> | |
3374 <xs:attribute name="min" type="xs:decimal"> | |
3375 <xs:annotation> | |
3376 <xs:documentation xml:lang="en">When the ``type`` attribute value is | |
3377 ``in_range`` - this is the minimum number allowed.</xs:documentation> | |
3378 </xs:annotation> | |
3379 </xs:attribute> | |
3380 <xs:attribute name="max" type="xs:decimal"> | |
3381 <xs:annotation> | |
3382 <xs:documentation xml:lang="en">When the ``type`` attribute value is | |
3383 ``in_range`` - this is the maximum number allowed.</xs:documentation> | |
3384 </xs:annotation> | |
3385 </xs:attribute> | |
3386 <xs:attribute name="exclude_min" type="xs:boolean" default="false"> | |
3387 <xs:annotation> | |
3388 <xs:documentation xml:lang="en">When the ``type`` attribute value is | |
3389 ``in_range`` - this boolean indicates if the ``min`` value is allowed.</xs:documentation> | |
3390 </xs:annotation> | |
3391 </xs:attribute> | |
3392 <xs:attribute name="exclude_max" type="xs:boolean" default="false"> | |
3393 <xs:annotation> | |
3394 <xs:documentation xml:lang="en">When the ``type`` attribute value is | |
3395 ``in_range`` - this boolean indicates if the ``max`` value is allowed.</xs:documentation> | |
3396 </xs:annotation> | |
3397 </xs:attribute> | |
3398 <xs:attribute name="split" type="xs:string"> | |
3399 <xs:annotation> | |
3400 <xs:documentation xml:lang="en">If ``type`` is `dataset_metadata_in_file``, | |
3401 this attribute is the column separator to use for values in the specified file. | |
3402 This default is ``\t`` and due to a bug in older versions of Galaxy, should | |
3403 not be modified.</xs:documentation> | |
3404 </xs:annotation> | |
3405 </xs:attribute> | |
3406 <xs:attribute name="skip" type="xs:string"> | |
3407 <xs:annotation> | |
3408 <xs:documentation xml:lang="en">Comma-seperated list of metadata | |
3409 fields to skip if type is ``metadata``. If not specified, all non-optional | |
3410 metadata fields will be checked unless ``check`` attribute is specified.</xs:documentation> | |
3411 </xs:annotation> | |
3412 </xs:attribute> | |
3413 </xs:extension> | |
3414 </xs:simpleContent> | |
3415 </xs:complexType> | |
3416 <xs:complexType name="Sanitizer"> | |
3417 <xs:annotation> | |
3418 <xs:documentation xml:lang="en"><![CDATA[ | |
3419 | |
3420 See | |
3421 [/tools/filters/grep.xml](https://github.com/galaxyproject/galaxy/blob/dev/tools/filters/grep.xml) | |
3422 for a typical example of how to use this tag set. This tag set is used to | |
3423 replace the basic parameter sanitization with custom directives. This tag set is | |
3424 contained within the ``<param>`` tag set - it contains a set of ``<valid>`` and | |
3425 ``<mapping>`` tags. | |
3426 | |
3427 ### Character presets | |
3428 | |
3429 The following presets can be used when specifying the valid characters: the | |
3430 [constants](https://docs.python.org/3/library/string.html#string-constants) from the ``string`` Python3 module, | |
3431 plus ``default`` (equal to ``string.ascii_letters + string.digits + " -=_.()/+*^,:?!"``) | |
3432 and ``none`` (empty set). | |
3433 The ``string.letters``, ``string.lowercase`` and ``string.uppercase`` Python2 | |
3434 constants are accepted for backward compatibility, but are aliased to the | |
3435 corresponding not locale-dependent constant (i.e. ``string.ascii_letters``, | |
3436 ``string.ascii_lowercase`` and ``string.ascii_uppercase`` respectively). | |
3437 | |
3438 ### Examples | |
3439 | |
3440 This example specifies to use the empty string as the invalid character (instead | |
3441 of the default ``X``, so invalid characters are effectively dropped instead of | |
3442 replaced with ``X``) and indicates that the only valid characters for this input | |
3443 are ASCII letters, digits, and ``_``. | |
3444 | |
3445 ```xml | |
3446 <param name="mystring" type="text" label="Say something interesting"> | |
3447 <sanitizer invalid_char=""> | |
3448 <valid initial="string.ascii_letters,string.digits"> | |
3449 <add value="_" /> | |
3450 </valid> | |
3451 </sanitizer> | |
3452 </param> | |
3453 ``` | |
3454 | |
3455 This example allows many more valid characters and specifies that ``&`` will just | |
3456 be dropped from the input. | |
3457 | |
3458 ```xml | |
3459 <sanitizer> | |
3460 <valid initial="string.printable"> | |
3461 <remove value="&"/> | |
3462 </valid> | |
3463 <mapping initial="none"> | |
3464 <add source="&" target=""/> | |
3465 </mapping> | |
3466 </sanitizer> | |
3467 ``` | |
3468 ]]></xs:documentation> | |
3469 </xs:annotation> | |
3470 <xs:sequence> | |
3471 <xs:group ref="SanitizerElement" minOccurs="0" maxOccurs="unbounded"/> | |
3472 </xs:sequence> | |
3473 <xs:attribute name="sanitize" type="PermissiveBoolean" default="true"> | |
3474 <xs:annotation> | |
3475 <xs:documentation xml:lang="en">This boolean parameter determines if the | |
3476 input is sanitized at all (the default is ``true``).</xs:documentation> | |
3477 </xs:annotation> | |
3478 </xs:attribute> | |
3479 <xs:attribute name="invalid_char" type="xs:string" default="X"> | |
3480 <xs:annotation> | |
3481 <xs:documentation xml:lang="en">The attribute specifies the character | |
3482 used as a replacement for invalid characters (the default is ``X``).</xs:documentation> | |
3483 </xs:annotation> | |
3484 </xs:attribute> | |
3485 </xs:complexType> | |
3486 <xs:group name="SanitizerElement"> | |
3487 <xs:choice> | |
3488 <xs:element name="valid" type="SanitizerValid"/> | |
3489 <xs:element name="mapping" type="SanitizerMapping"/> | |
3490 </xs:choice> | |
3491 </xs:group> | |
3492 <xs:complexType name="SanitizerValid"> | |
3493 <xs:annotation> | |
3494 <xs:documentation xml:lang="en"><![CDATA[Contained within the | |
3495 ``<sanitizer>`` tag set, these are used to specify a list of allowed characters. | |
3496 Contains ``<add>`` and ``<remove>`` tags.]]></xs:documentation> | |
3497 </xs:annotation> | |
3498 <xs:sequence> | |
3499 <xs:group ref="SanitizerValidElement" minOccurs="0" maxOccurs="unbounded"/> | |
3500 </xs:sequence> | |
3501 <xs:attribute name="initial" type="xs:string"> | |
3502 <xs:annotation> | |
3503 <xs:documentation xml:lang="en">This describes the initial characters to | |
3504 allow as valid, specified as a character preset (as defined above). The default | |
3505 is the ``default`` preset.</xs:documentation> | |
3506 </xs:annotation> | |
3507 </xs:attribute> | |
3508 </xs:complexType> | |
3509 <xs:complexType name="SanitizerValidAdd"> | |
3510 <xs:annotation> | |
3511 <xs:documentation xml:lang="en">This directive is used to add individual | |
3512 characters or preset lists of characters. Character must not be allowed as a | |
3513 valid input for the mapping to occur.</xs:documentation> | |
3514 </xs:annotation> | |
3515 <xs:attribute name="preset" type="xs:string"> | |
3516 <xs:annotation> | |
3517 <xs:documentation xml:lang="en">Add the characters contained in the specified character preset (as defined above) to the list of valid characters. The default | |
3518 is the ``none`` preset.</xs:documentation> | |
3519 </xs:annotation> | |
3520 </xs:attribute> | |
3521 <xs:attribute name="value" type="xs:string"> | |
3522 <xs:annotation> | |
3523 <xs:documentation xml:lang="en">Add a character to the list of valid characters.</xs:documentation> | |
3524 </xs:annotation> | |
3525 </xs:attribute> | |
3526 </xs:complexType> | |
3527 <xs:complexType name="SanitizerValidRemove"> | |
3528 <xs:annotation> | |
3529 <xs:documentation xml:lang="en">This directive is used to remove | |
3530 individual characters or preset lists of characters. | |
3531 Character must not be allowed as a valid input for the mapping to occur.</xs:documentation> | |
3532 </xs:annotation> | |
3533 <xs:attribute name="preset" type="xs:string"> | |
3534 <xs:annotation> | |
3535 <xs:documentation xml:lang="en">Remove the characters contained in the specified character preset (as defined above) from the list of valid characters. The default | |
3536 is the ``none`` preset.</xs:documentation> | |
3537 </xs:annotation> | |
3538 </xs:attribute> | |
3539 <xs:attribute name="value" type="xs:string"> | |
3540 <xs:annotation> | |
3541 <xs:documentation xml:lang="en">A character to remove from the list of valid characters.</xs:documentation> | |
3542 </xs:annotation> | |
3543 </xs:attribute> | |
3544 </xs:complexType> | |
3545 <xs:group name="SanitizerValidElement"> | |
3546 <xs:choice> | |
3547 <xs:element name="add" type="SanitizerValidAdd"/> | |
3548 <xs:element name="remove" type="SanitizerValidRemove"/> | |
3549 </xs:choice> | |
3550 </xs:group> | |
3551 <xs:complexType name="SanitizerMapping"> | |
3552 <xs:annotation> | |
3553 <xs:documentation xml:lang="en"><![CDATA[Contained within the ``<sanitizer>`` tag set. Used to specify a mapping of disallowed character to replacement string. Contains ``<add>`` and ``<remove>`` tags.]]></xs:documentation> | |
3554 </xs:annotation> | |
3555 <xs:sequence> | |
3556 <xs:group ref="SanitizerMappingElement" minOccurs="0" maxOccurs="unbounded"/> | |
3557 </xs:sequence> | |
3558 <xs:attribute name="initial" type="xs:string"> | |
3559 <xs:annotation> | |
3560 <xs:documentation xml:lang="en">Initial character mapping (default is ``galaxy.util.mapped_chars``)</xs:documentation> | |
3561 </xs:annotation> | |
3562 </xs:attribute> | |
3563 </xs:complexType> | |
3564 <xs:complexType name="SanitizerMappingAdd"> | |
3565 <xs:annotation> | |
3566 <xs:documentation xml:lang="en"><![CDATA[Use to add character mapping during sanitization. Character must not be allowed as a valid input for the mapping to occur.]]></xs:documentation> | |
3567 </xs:annotation> | |
3568 <xs:attribute name="source" type="xs:string"> | |
3569 <xs:annotation> | |
3570 <xs:documentation xml:lang="en">Replace all occurrences of this character with the string of ``target``.</xs:documentation> | |
3571 </xs:annotation> | |
3572 </xs:attribute> | |
3573 <xs:attribute name="target" type="xs:string"> | |
3574 <xs:annotation> | |
3575 <xs:documentation xml:lang="en">Replace all occurrences of ``source`` with this string</xs:documentation> | |
3576 </xs:annotation> | |
3577 </xs:attribute> | |
3578 </xs:complexType> | |
3579 <xs:complexType name="SanitizerMappingRemove"> | |
3580 <xs:annotation> | |
3581 <xs:documentation xml:lang="en"><![CDATA[Use to remove character mapping during sanitization.]]></xs:documentation> | |
3582 </xs:annotation> | |
3583 <xs:attribute name="source" type="xs:string"> | |
3584 <xs:annotation> | |
3585 <xs:documentation xml:lang="en">Character to remove from mapping.</xs:documentation> | |
3586 </xs:annotation> | |
3587 </xs:attribute> | |
3588 </xs:complexType> | |
3589 <xs:group name="SanitizerMappingElement"> | |
3590 <xs:choice> | |
3591 <xs:element name="add" type="SanitizerMappingAdd" minOccurs="0" maxOccurs="unbounded"/> | |
3592 <xs:element name="remove" type="SanitizerMappingRemove" minOccurs="0" maxOccurs="unbounded"/> | |
3593 </xs:choice> | |
3594 </xs:group> | |
3595 <xs:complexType name="Filter"> | |
3596 <xs:annotation> | |
3597 <xs:documentation xml:lang="en"><![CDATA[Optionally contained within an | |
3598 ``<options>`` tag set - modify (e.g. remove, add, sort, ...) the list of values obtained from a locally stored file (e.g. | |
3599 a tool data table) or a dataset in the current history. | |
3600 | |
3601 ### Examples | |
3602 | |
3603 The following example from Mothur's | |
3604 [remove.groups.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/mothur/remove.groups.xml) | |
3605 tool demonstrates filtering a select list based on the metadata of an input to | |
3606 to the tool. | |
3607 | |
3608 ```xml | |
3609 <param name="group_in" type="data" format="mothur.groups,mothur.count_table" label="group or count table - Groups"/> | |
3610 <param name="groups" type="select" label="groups - Pick groups to remove" multiple="true" optional="false"> | |
3611 <options> | |
3612 <filter type="data_meta" ref="group_in" key="groups"/> | |
3613 </options> | |
3614 </param> | |
3615 ``` | |
3616 | |
3617 This more advanced example, taken from Mothur's | |
3618 [remove.lineage.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/mothur/remove.lineage.xml) | |
3619 tool demonstrates using filters to sort a list and remove duplicate entries. | |
3620 | |
3621 ```xml | |
3622 <param name="taxonomy" type="data" format="mothur.cons.taxonomy" label="constaxonomy - Constaxonomy file. Provide either a constaxonomy file or a taxonomy file" help="please make sure your file has no quotation marks in it"/> | |
3623 <param name="taxons" type="select" optional="true" multiple="true" label="Browse Taxons from Taxonomy"> | |
3624 <options from_dataset="taxonomy"> | |
3625 <column name="name" index="2"/> | |
3626 <column name="value" index="2"/> | |
3627 <filter type="unique_value" name="unique_taxon" column="2"/> | |
3628 <filter type="sort_by" name="sorted_taxon" column="2"/> | |
3629 </options> | |
3630 <sanitizer> | |
3631 <valid initial="default"> | |
3632 <add preset="string.printable"/> | |
3633 <add value=";"/> | |
3634 <remove value="""/> | |
3635 <remove value="'"/> | |
3636 </valid> | |
3637 </sanitizer> | |
3638 </param> | |
3639 ``` | |
3640 | |
3641 This example taken from the | |
3642 [hisat2](https://github.com/galaxyproject/tools-iuc/blob/master/tools/hisat2/hisat2.xml) | |
3643 tool demonstrates filtering values from a tool data table. | |
3644 | |
3645 ```xml | |
3646 <param help="If your genome of interest is not listed, contact the Galaxy team" label="Select a reference genome" name="index" type="select"> | |
3647 <options from_data_table="hisat2_indexes"> | |
3648 <filter column="2" type="sort_by" /> | |
3649 <validator message="No genomes are available for the selected input dataset" type="no_options" /> | |
3650 </options> | |
3651 </param> | |
3652 ``` | |
3653 | |
3654 The | |
3655 [gemini_load.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/gemini/gemini_load.xml) | |
3656 tool demonstrates adding values to an option list using ``filter``s. | |
3657 | |
3658 ```xml | |
3659 <param name="infile" type="data" format="vcf" label="VCF file to be loaded in the GEMINI database" help="Only build 37 (aka hg19) of the human genome is supported."> | |
3660 <options> | |
3661 <filter type="add_value" value="hg19" /> | |
3662 <filter type="add_value" value="Homo_sapiens_nuHg19_mtrCRS" /> | |
3663 <filter type="add_value" value="hg_g1k_v37" /> | |
3664 </options> | |
3665 </param> | |
3666 ``` | |
3667 | |
3668 While this fragment from [maf_to_interval.xml](https://github.com/galaxyproject/galaxy/blob/dev/tools/maf/maf_to_interval.xml) demonstrates removing items. | |
3669 | |
3670 ```xml | |
3671 <param name="species" type="select" label="Select additional species" | |
3672 display="checkboxes" multiple="true" | |
3673 help="The species matching the dbkey of the alignment is always included. | |
3674 A separate history item will be created for each species."> | |
3675 <options> | |
3676 <filter type="data_meta" ref="input1" key="species" /> | |
3677 <filter type="remove_value" meta_ref="input1" key="dbkey" /> | |
3678 </options> | |
3679 </param> | |
3680 ``` | |
3681 | |
3682 This example taken from | |
3683 [snpSift_dbnsfp.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tool_collections/snpsift/snpsift_dbnsfp/snpSift_dbnsfp.xml) | |
3684 demonstrates splitting up strings into multiple values. | |
3685 | |
3686 ```xml | |
3687 <param name="annotations" type="select" multiple="true" display="checkboxes" label="Annotate with"> | |
3688 <options from_data_table="snpsift_dbnsfps"> | |
3689 <column name="name" index="4"/> | |
3690 <column name="value" index="4"/> | |
3691 <filter type="param_value" ref="dbnsfp" column="3" /> | |
3692 <filter type="multiple_splitter" column="4" separator=","/> | |
3693 </options> | |
3694 </param> | |
3695 ``` | |
3696 ]]></xs:documentation> | |
3697 </xs:annotation> | |
3698 <xs:attribute name="type" type="FilterType" use="required"> | |
3699 <xs:annotation> | |
3700 <xs:documentation xml:lang="en"><![CDATA[ | |
3701 Currently the following filters are defined: | |
3702 | |
3703 * ``static_value`` filter options for which the entry in a given ``column`` of the referenced file based on equality to the ``value`` attribute of the filter. | |
3704 * ``regexp`` similar to the ``static_value`` filter, but checks if the regular expression given by ``value`` matches the entry. | |
3705 * ``param_value`` filter options for which the entry in a given ``column`` of the referenced file based on properties of another input parameter specified by ``ref``. This property is by default the value of the parameter, but also the values of another attribute (``ref_attribute``) of the parameter can be used, e.g. the extension of a data input. | |
3706 * ``data_meta`` If a ``column`` is given options are filtered for which the entry in this column ``column`` is equal to metadata of another input parameter specified by ``ref``. | |
3707 If no ``column`` is given the metadata value of the referenced input is added to the options list (in this case the corresponding ``options`` tag must not have the ``from_data_table`` or ``from_dataset`` attributes). | |
3708 In both cases the desired metadata is selected by ``key``. | |
3709 | |
3710 The above filters can be inverted by setting ``keep`` to true. | |
3711 | |
3712 * ``add_value``: add an option with a given ``name`` and ``value`` to the options. By default the new option is appended, with ``index`` the insertion position can be specified. | |
3713 * ``remove_value``: remove a value from the options. Either specified explicitly with ``value``, the value of another input specifified with ``ref``, or the metatdata ``key`` of another input ``meta_ref``. | |
3714 * ``unique_value``: remove options that have duplicate entries in the given ``column``. | |
3715 * ``sort_by``: sort options by the entries of a given ``column``. | |
3716 * ``multiple_splitter``: split the entries of the specified ``column``(s) in the referenced file using a ``separator``. Thereby the number of columns is increased. | |
3717 | |
3718 Note that filters that are applyed after one of the latter two filters must not refer to | |
3719 | |
3720 These values are defined in the module | |
3721 [/lib/galaxy/tools/parameters/dynamic_options.py](https://github.com/galaxyproject/galaxy/blob/master/lib/galaxy/tools/parameters/dynamic_options.py) | |
3722 in the ``filter_types`` dictionary. | |
3723 | |
3724 Deprecated filter types: | |
3725 | |
3726 * ``attribute_value_splitter`` | |
3727 ]]></xs:documentation> | |
3728 </xs:annotation> | |
3729 </xs:attribute> | |
3730 <xs:attribute name="column" type="xs:string"> | |
3731 <xs:annotation> | |
3732 <xs:documentation xml:lang="en">Column targeted by this filter given as column index or a column name. Invalid if ``type`` is ``add_value`` or ``remove_value``. | |
3733 </xs:documentation> | |
3734 </xs:annotation> | |
3735 </xs:attribute> | |
3736 <xs:attribute name="name" type="xs:string"> | |
3737 <xs:annotation> | |
3738 <xs:documentation xml:lang="en">Name displayed for value to add (only | |
3739 used with ``type`` of ``add_value``).</xs:documentation> | |
3740 </xs:annotation> | |
3741 </xs:attribute> | |
3742 <xs:attribute name="ref" type="xs:string"> | |
3743 <xs:annotation> | |
3744 <xs:documentation xml:lang="en">The attribute name of the reference file | |
3745 (tool data) or input dataset. Only used when ``type`` is | |
3746 ``data_meta`` (required), ``param_value`` (required), or ``remove_value`` | |
3747 (optional).</xs:documentation> | |
3748 </xs:annotation> | |
3749 </xs:attribute> | |
3750 <xs:attribute name="key" type="xs:string"> | |
3751 <xs:annotation> | |
3752 <xs:documentation xml:lang="en">When ``type`` is ``data_meta``, ``param_value``, | |
3753 or ``remove_value`` - this is the name of the metadata key to filter by.</xs:documentation> | |
3754 </xs:annotation> | |
3755 </xs:attribute> | |
3756 <xs:attribute name="multiple" type="PermissiveBoolean" default="false"> | |
3757 <xs:annotation> | |
3758 <xs:documentation xml:lang="en"><![CDATA[For types ``data_meta`` and | |
3759 ``remove_value``, whether option values are multiple. Columns will be split by | |
3760 separator. Defaults to ``false``.]]></xs:documentation> | |
3761 </xs:annotation> | |
3762 </xs:attribute> | |
3763 <xs:attribute name="separator" type="xs:string"> | |
3764 <xs:annotation> | |
3765 <xs:documentation xml:lang="en"><![CDATA[When ``type`` is ``data_meta``, | |
3766 ``multiple_splitter``, or ``remove_value`` - this is used to split one value | |
3767 into multiple parts. When ``type`` is ``data_meta`` or ``remove_value`` this is | |
3768 only used if ``multiple`` is set to ``true``.]]></xs:documentation> | |
3769 </xs:annotation> | |
3770 </xs:attribute> | |
3771 <xs:attribute name="keep" type="PermissiveBoolean" default="true"> | |
3772 <xs:annotation> | |
3773 <xs:documentation xml:lang="en">If ``true``, keep columns matching the | |
3774 value, if ``false`` discard columns matching the value. Used when ``type`` is | |
3775 either ``static_value``, ``regexp`` or ``param_value``.</xs:documentation> | |
3776 </xs:annotation> | |
3777 </xs:attribute> | |
3778 <xs:attribute name="value" type="xs:string"> | |
3779 <xs:annotation> | |
3780 <xs:documentation xml:lang="en">Target value of the operations - has | |
3781 slightly different meanings depending on ``type``. For instance when ``type`` is | |
3782 ``add_value`` it is the value to add to the list and when ``type`` is | |
3783 ``static_value`` or ``regexp`` it is the value compared against.</xs:documentation> | |
3784 </xs:annotation> | |
3785 </xs:attribute> | |
3786 <xs:attribute name="ref_attribute" type="xs:string"> | |
3787 <xs:annotation> | |
3788 <xs:documentation xml:lang="en">Only used when ``type`` is | |
3789 ``param_value``. Period (``.``) separated attribute chain of input (``ref``) | |
3790 attributes to use as value for filter.</xs:documentation> | |
3791 </xs:annotation> | |
3792 </xs:attribute> | |
3793 <xs:attribute name="index" type="xs:integer"> | |
3794 <xs:annotation> | |
3795 <xs:documentation xml:lang="en">Used when ``type`` is ``add_value``, it | |
3796 is the index into the list to add the option to. If not set, the option will be | |
3797 added to the end of the list.</xs:documentation> | |
3798 </xs:annotation> | |
3799 </xs:attribute> | |
3800 <xs:attribute name="meta_ref" type="xs:string"> | |
3801 <xs:annotation> | |
3802 <xs:documentation xml:lang="en">Only used when ``type`` is | |
3803 ``remove_value``. Dataset to look for the value of metadata ``key`` to remove | |
3804 from the list.</xs:documentation> | |
3805 </xs:annotation> | |
3806 </xs:attribute> | |
3807 </xs:complexType> | |
3808 <xs:complexType name="Outputs"> | |
3809 <xs:annotation> | |
3810 <xs:documentation xml:lang="en"><![CDATA[ | |
3811 Container tag set for the ``<data>`` and ``<collection>`` tag sets. | |
3812 The files and collections created by tools as a result of their execution are | |
3813 named by Galaxy. You specify the number and type of your output files using the | |
3814 contained ``<data>`` and ``<collection>`` tags. These may be passed to your tool | |
3815 executable through using line variables just like the parameters described in | |
3816 the ``<inputs>`` documentation. | |
3817 ]]></xs:documentation> | |
3818 </xs:annotation> | |
3819 <xs:sequence> | |
3820 <xs:group ref="OutputsElement" minOccurs="0" maxOccurs="unbounded"/> | |
3821 </xs:sequence> | |
3822 <xs:attribute name="provided_metadata_style" type="xs:string"> | |
3823 <xs:annotation> | |
3824 <xs:documentation xml:lang="en"><![CDATA[ | |
3825 Style used for tool provided metadata file (i.e. | |
3826 [galaxy.json](https://planemo.readthedocs.io/en/latest/writing_advanced.html#tool-provided-metadata)) | |
3827 - this can be either "legacy" or "default". The default of tools with a profile | |
3828 of 17.09 or newer are "default", and "legacy" for older and tools and tools | |
3829 without a specified profile. A discussion of the differences between the styles | |
3830 can be found [here](https://github.com/galaxyproject/galaxy/pull/4437). | |
3831 ]]></xs:documentation> | |
3832 </xs:annotation> | |
3833 </xs:attribute> | |
3834 <xs:attribute name="provided_metadata_file" type="xs:string" default="galaxy.json"> | |
3835 <xs:annotation> | |
3836 <xs:documentation xml:lang="en"><![CDATA[ | |
3837 Path relative to tool's working directory to load tool provided metadata from. | |
3838 This metadata can describe dynamic datasets to load, dynamic collection | |
3839 contents, as well as simple metadata (e.g. name, dbkey, etc...) and | |
3840 datatype-specific metadata for declared outputs. More information can be found | |
3841 [here](https://planemo.readthedocs.io/en/latest/writing_advanced.html#tool-provided-metadata). | |
3842 The default is ``galaxy.json``. | |
3843 ]]></xs:documentation> | |
3844 </xs:annotation> | |
3845 </xs:attribute> | |
3846 </xs:complexType> | |
3847 <xs:group name="OutputsElement"> | |
3848 <xs:choice> | |
3849 <xs:element name="output" type="Output" /> | |
3850 <xs:element name="data" type="OutputData"/> | |
3851 <xs:element name="collection" type="OutputCollection" /> | |
3852 </xs:choice> | |
3853 </xs:group> | |
3854 <xs:group name="OutputDataElement"> | |
3855 <xs:choice> | |
3856 <xs:element name="change_format" type="ChangeFormat"/> | |
3857 <xs:element name="filter" type="OutputFilter" /> | |
3858 <xs:element name="discover_datasets" type="OutputDiscoverDatasets" /> | |
3859 <xs:element name="actions" type="Actions"/> | |
3860 </xs:choice> | |
3861 </xs:group> | |
3862 | |
3863 <xs:attributeGroup name="OutputCommon"> | |
3864 <xs:attribute name="format_source" type="xs:string"> | |
3865 <xs:annotation> | |
3866 <xs:documentation xml:lang="en">This sets the data type of the output dataset(s) to be the same format as that of the specified tool input.</xs:documentation> | |
3867 </xs:annotation> | |
3868 </xs:attribute> | |
3869 <xs:attribute name="label" type="xs:string"> | |
3870 <xs:annotation> | |
3871 <xs:documentation xml:lang="en"><![CDATA[ | |
3872 | |
3873 This will be the name of the history item for the output data set. The string | |
3874 can include structure like ``${<some param name>.<some attribute>}``, as | |
3875 discussed for command line parameters in the ``<command>`` tag set section | |
3876 above. The default label is ``${tool.name} on ${on_string}``. | |
3877 | |
3878 ]]></xs:documentation> | |
3879 </xs:annotation> | |
3880 </xs:attribute> | |
3881 <xs:attribute name="name" type="xs:string" use="required"> | |
3882 <xs:annotation> | |
3883 <xs:documentation xml:lang="en"><![CDATA[Name for this output. This | |
3884 ``name`` is used as the Cheetah variable containing the Galaxy assigned output | |
3885 path in ``command`` and ``configfile`` elements. The name should not contain | |
3886 pipes or periods (e.g. ``.``).]]></xs:documentation> | |
3887 </xs:annotation> | |
3888 </xs:attribute> | |
3889 </xs:attributeGroup> | |
3890 | |
3891 <xs:attributeGroup name="OutputDataAttributes"> | |
3892 <xs:attribute name="auto_format" type="PermissiveBoolean"> | |
3893 <xs:annotation> | |
3894 <xs:documentation xml:lang="en"><![CDATA[ | |
3895 | |
3896 If ``true``, this output will sniffed and its format determined automatically by Galaxy. | |
3897 | |
3898 ]]></xs:documentation> | |
3899 </xs:annotation> | |
3900 </xs:attribute> | |
3901 <xs:attribute name="format" type="xs:string"> | |
3902 <xs:annotation> | |
3903 <xs:documentation xml:lang="en">The short name for the output datatype. | |
3904 The valid values for format can be found in | |
3905 [/config/datatypes_conf.xml.sample](https://github.com/galaxyproject/galaxy/blob/dev/config/datatypes_conf.xml.sample) | |
3906 (e.g. ``format="pdf"`` or ``format="fastqsanger"``).</xs:documentation> | |
3907 </xs:annotation> | |
3908 </xs:attribute> | |
3909 <xs:attribute name="default_identifier_source" type="xs:string"> | |
3910 <xs:annotation> | |
3911 <xs:documentation xml:lang="en">Sets the source of element identifier to the specified input. | |
3912 This only applies to collections that are mapped over a non-collection input and that have equivalent structures. If this references input elements in conditionals, this value should be qualified (e.g. ``cond|input`` instead of ``input`` if ``input`` is in a conditional with ``name="cond"``).</xs:documentation> | |
3913 </xs:annotation> | |
3914 </xs:attribute> | |
3915 <xs:attribute name="metadata_source" type="xs:string"> | |
3916 <xs:annotation> | |
3917 <xs:documentation xml:lang="en">This copies the metadata information | |
3918 from the tool's input dataset. This is particularly useful for interval data | |
3919 types where the order of the columns is not set.</xs:documentation> | |
3920 </xs:annotation> | |
3921 </xs:attribute> | |
3922 <xs:attribute name="from_work_dir" type="xs:string"> | |
3923 <xs:annotation> | |
3924 <xs:documentation xml:lang="en">Relative path to a file produced by the | |
3925 tool in its working directory. Output's contents are set to this file's | |
3926 contents.</xs:documentation> | |
3927 </xs:annotation> | |
3928 </xs:attribute> | |
3929 <xs:attribute name="hidden" type="xs:boolean" default="false"> | |
3930 <xs:annotation> | |
3931 <xs:documentation xml:lang="en">Boolean indicating whether to hide | |
3932 dataset in the history view. (Default is ``false``.)</xs:documentation> | |
3933 </xs:annotation> | |
3934 </xs:attribute> | |
3935 </xs:attributeGroup> | |
3936 | |
3937 <xs:attributeGroup name="OutputCollectionAttributes"> | |
3938 <xs:attribute name="structured_like" type="xs:string"> | |
3939 <xs:annotation> | |
3940 <xs:documentation xml:lang="en">This is the name of input collection or | |
3941 dataset to derive "structure" of the output from (output element count and | |
3942 identifiers). For instance, if the referenced input has three ordered items with | |
3943 identifiers ``sample1``, ``sample2``, and ``sample3``. If this references input | |
3944 elements in conditionals, this value should be qualified (e.g. ``cond|input`` instead | |
3945 of ``input`` if ``input`` is in a conditional with ``name="cond"``).</xs:documentation> | |
3946 </xs:annotation> | |
3947 </xs:attribute> | |
3948 <xs:attribute name="inherit_format" type="xs:boolean"> | |
3949 <xs:annotation> | |
3950 <xs:documentation xml:lang="en">If ``structured_like`` is set, inherit | |
3951 format of outputs from format of corresponding input.</xs:documentation> | |
3952 </xs:annotation> | |
3953 </xs:attribute> | |
3954 </xs:attributeGroup> | |
3955 | |
3956 <xs:complexType name="OutputData"> | |
3957 <xs:annotation> | |
3958 <xs:documentation xml:lang="en"><![CDATA[ | |
3959 | |
3960 This tag set is contained within the ``<outputs>`` tag set, and it defines the | |
3961 output data description for the files resulting from the tool's execution. The | |
3962 value of the attribute ``label`` can be acquired from input parameters or metadata | |
3963 in the same way that the command line parameters are (discussed in the | |
3964 ``<command>`` tag set section above). | |
3965 | |
3966 ### Examples | |
3967 | |
3968 The following will create a variable called ``$out_file1`` with data type | |
3969 ``pdf``. | |
3970 | |
3971 ```xml | |
3972 <outputs> | |
3973 <data format="pdf" name="out_file1" /> | |
3974 </outputs> | |
3975 ``` | |
3976 | |
3977 The valid values for format can be found in | |
3978 [/config/datatypes_conf.xml.sample](https://github.com/galaxyproject/galaxy/blob/dev/config/datatypes_conf.xml.sample). | |
3979 | |
3980 The following will create a dataset in the history panel whose data type is the | |
3981 same as that of the input dataset selected (and named ``input1``) for the tool. | |
3982 | |
3983 ```xml | |
3984 <outputs> | |
3985 <data format_source="input1" name="out_file1" metadata_source="input1"/> | |
3986 </outputs> | |
3987 ``` | |
3988 | |
3989 The following will create datasets in the history panel, setting the output data | |
3990 type to be the same as that of an input dataset named by the ``format_source`` | |
3991 attribute. Note that a conditional name is not included, so 2 separate | |
3992 conditional blocks should not contain parameters with the same name. | |
3993 | |
3994 ```xml | |
3995 <inputs> | |
3996 <!-- fasta may be an aligned fasta that subclasses Fasta --> | |
3997 <param name="fasta" type="data" format="fasta" label="fasta - Sequences"/> | |
3998 <conditional name="qual"> | |
3999 <param name="add" type="select" label="Trim based on a quality file?" help=""> | |
4000 <option value="no">no</option> | |
4001 <option value="yes">yes</option> | |
4002 </param> | |
4003 <when value="no"/> | |
4004 <when value="yes"> | |
4005 <!-- qual454, qualsolid, qualillumina --> | |
4006 <param name="qfile" type="data" format="qual" label="qfile - a quality file"/> | |
4007 </when> | |
4008 </conditional> | |
4009 </inputs> | |
4010 <outputs> | |
4011 <data format_source="fasta" name="trim_fasta" | |
4012 label="${tool.name} on ${on_string}: trim.fasta"/> | |
4013 <data format_source="qfile" name="trim_qual" | |
4014 label="${tool.name} on ${on_string}: trim.qual"> | |
4015 <filter>qual['add'] == 'yes'</filter> | |
4016 </data> | |
4017 </outputs> | |
4018 ``` | |
4019 | |
4020 Assume that the tool includes an input parameter named ``database`` which is a | |
4021 select list (as shown below). Also assume that the user selects the first option | |
4022 in the ``$database`` select list. Then the following will ensure that the tool | |
4023 produces a tabular data set whose associated history item has the label ``Blat | |
4024 on Human (hg18)``. | |
4025 | |
4026 ```xml | |
4027 <inputs> | |
4028 <param format="tabular" name="input" type="data" label="Input stuff"/> | |
4029 <param type="select" name="database" label="Database"> | |
4030 <option value="hg18">Human (hg18)</option> | |
4031 <option value="dm3">Fly (dm3)</option> | |
4032 </param> | |
4033 </inputs> | |
4034 <outputs> | |
4035 <data format="input" name="output" label="Blat on ${database.value_label}" /> | |
4036 </outputs> | |
4037 ``` | |
4038 | |
4039 ]]></xs:documentation> | |
4040 </xs:annotation> | |
4041 <xs:sequence> | |
4042 <xs:group ref="OutputDataElement" minOccurs="0" maxOccurs="unbounded" /> | |
4043 </xs:sequence> | |
4044 <!-- TODO: add a unique constraint for action. --> | |
4045 <xs:attributeGroup ref="OutputCommon"/> | |
4046 <xs:attributeGroup ref="OutputDataAttributes"/> | |
4047 </xs:complexType> | |
4048 | |
4049 <xs:group name="OutputCollectionElement"> | |
4050 <xs:choice> | |
4051 <xs:element name="data" type="OutputData" /> | |
4052 <xs:element name="discover_datasets" type="OutputCollectionDiscoverDatasets" /> | |
4053 <xs:element name="filter" type="OutputFilter" /> | |
4054 </xs:choice> | |
4055 </xs:group> | |
4056 | |
4057 <xs:complexType name="OutputCollection"> | |
4058 <xs:annotation> | |
4059 <xs:documentation xml:lang="en"><![CDATA[ | |
4060 | |
4061 This tag set is contained within the ``<outputs>`` tag set, and it defines the | |
4062 output dataset collection description resulting from the tool's execution. The | |
4063 value of the attribute ``label`` can be acquired from input parameters or | |
4064 metadata in the same way that the command line parameters are (discussed in the | |
4065 [command](#tool-command) directive). | |
4066 | |
4067 Creating collections in tools is covered in-depth in | |
4068 [Planemo's documentation](https://planemo.readthedocs.io/en/latest/writing_advanced.html#creating-collections). | |
4069 | |
4070 ]]></xs:documentation> | |
4071 </xs:annotation> | |
4072 <xs:sequence> | |
4073 <xs:group ref="OutputCollectionElement" minOccurs="0" maxOccurs="unbounded" /> | |
4074 </xs:sequence> | |
4075 <xs:attributeGroup ref="OutputCommon"/> | |
4076 <xs:attributeGroup ref="OutputCollectionAttributes"/> | |
4077 <xs:attribute name="type" type="xs:string"> | |
4078 <xs:annotation> | |
4079 <xs:documentation xml:lang="en">Collection type for output (e.g. ``paired``, ``list``, or ``list:list``).</xs:documentation> | |
4080 </xs:annotation> | |
4081 </xs:attribute> | |
4082 <xs:attribute name="type_source" type="xs:string"> | |
4083 <xs:annotation> | |
4084 <xs:documentation xml:lang="en">This is the name of input collection to | |
4085 derive collection's type (e.g. ``collection_type``) from.</xs:documentation> | |
4086 </xs:annotation> | |
4087 </xs:attribute> | |
4088 </xs:complexType> | |
4089 | |
4090 <xs:complexType name="Output"> | |
4091 <xs:annotation> | |
4092 <xs:documentation xml:lang="en"><![CDATA[ | |
4093 | |
4094 This tag describes an output to the tool. | |
4095 ]]></xs:documentation> | |
4096 </xs:annotation> | |
4097 <xs:sequence> | |
4098 <xs:group ref="OutputDataElement" minOccurs="0" maxOccurs="unbounded" /> | |
4099 <xs:group ref="OutputCollectionElement" minOccurs="0" maxOccurs="unbounded" /> | |
4100 </xs:sequence> | |
4101 <xs:attributeGroup ref="OutputCommon"/> | |
4102 <xs:attributeGroup ref="OutputCollectionAttributes"/> | |
4103 <xs:attribute name="type" type="xs:string"> | |
4104 <xs:annotation> | |
4105 <xs:documentation xml:lang="en">Output type. This could be older more established Galaxy types (e.g. data and collection) - in which case the semantics of this largely reflect the corresponding ``data`` and ``collection`` tags. This could also be newer non-data types such as ``integer`` or ``boolean``.</xs:documentation> | |
4106 </xs:annotation> | |
4107 </xs:attribute> | |
4108 <xs:attribute name="from" type="xs:string"> | |
4109 <xs:annotation> | |
4110 <xs:documentation xml:lang="en">In expression tools, use this to specify a dictionary value to populate this output from. The semantics may change for other expression types in the future.</xs:documentation> | |
4111 </xs:annotation> | |
4112 </xs:attribute> | |
4113 <xs:attribute name="collection_type" type="xs:string"> | |
4114 <xs:annotation> | |
4115 <xs:documentation xml:lang="en">Collection type for output (e.g. ``paired``, ``list``, or ``list:list``).</xs:documentation> | |
4116 </xs:annotation> | |
4117 </xs:attribute> | |
4118 <xs:attribute name="collection_type_source" type="xs:string"> | |
4119 <xs:annotation> | |
4120 <xs:documentation xml:lang="en">This is the name of input collection to | |
4121 derive collection's type (e.g. ``collection_type``) from.</xs:documentation> | |
4122 </xs:annotation> | |
4123 </xs:attribute> | |
4124 | |
4125 </xs:complexType> | |
4126 <xs:complexType name="OutputFilter"> | |
4127 <xs:annotation> | |
4128 <xs:documentation xml:lang="en"><![CDATA[ | |
4129 The ``<data>`` tag can contain a ``<filter>`` tag which includes a Python code | |
4130 block to be executed to test whether to include this output in the outputs the | |
4131 tool ultimately creates. If the code, when executed, returns ``True``, | |
4132 the output dataset is retained. In these code blocks the tool parameters appear | |
4133 as Python variables and are thus referred to without the $ used for the Cheetah | |
4134 template (used in the ``<command>`` tag). Variables that are part of | |
4135 conditionals are accessed using a dictionary named after the conditional. Boolean | |
4136 parameters appear as booleans, not the value of their ``truevalue`` and | |
4137 ``falsevalue`` attributes. In the example below, ``options["selection_mode"]`` would | |
4138 appear as ``$options.selection_mode`` in Cheetah. Similarly ``options["vcf_output"]`` | |
4139 would appear as ``$options.vcf_output`` having the values ``'--vcf'`` when true and | |
4140 ``''`` when false in Cheetah. | |
4141 | |
4142 ### Example | |
4143 | |
4144 ```xml | |
4145 <inputs> | |
4146 <param type="data" format="fasta" name="reference_genome" label="Reference genome" /> | |
4147 <param type="data" format="bam" name="input_bam" label="Aligned reads" /> | |
4148 <conditional name="options"> | |
4149 <param label="Use advanced options" name="selection_mode" type="select"> | |
4150 <option selected="true" value="defaults">Use default options</option> | |
4151 <option value="advanced">Use advanced options</option> | |
4152 </param> | |
4153 <when value="defaults" /> | |
4154 <when value="advanced"> | |
4155 <param name="vcf_output" type="boolean" checked="false" label="VCF output" | |
4156 truevalue="--vcf" falsevalue="" /> | |
4157 </when> | |
4158 </conditional> | |
4159 </inputs> | |
4160 <outputs> | |
4161 <data format="txt" label="Alignment report on ${on_string}" name="output_txt" /> | |
4162 <data format="vcf" label="Variant summary on ${on_string}" name="output_vcf"> | |
4163 <filter>options['selection_mode'] == 'advanced' and options['vcf_output']</filter> | |
4164 </data> | |
4165 </outputs> | |
4166 ``` | |
4167 ]]></xs:documentation> | |
4168 </xs:annotation> | |
4169 <xs:simpleContent> | |
4170 <xs:extension base="xs:string"> | |
4171 </xs:extension> | |
4172 </xs:simpleContent> | |
4173 </xs:complexType> | |
4174 | |
4175 <xs:complexType name="OutputDiscoverDatasets"> | |
4176 <xs:annotation> | |
4177 <xs:documentation xml:lang="en"><![CDATA[ | |
4178 | |
4179 Describe datasets to dynamically collect after the job complete. | |
4180 | |
4181 There are many simple tools with examples of this element distributed with | |
4182 Galaxy, including: | |
4183 | |
4184 * [multi_output.xml](https://github.com/galaxyproject/galaxy/tree/master/test/functional/tools/multi_output.xml) | |
4185 * [multi_output_assign_primary.xml](https://github.com/galaxyproject/galaxy/tree/master/test/functional/tools/multi_output_assign_primary.xml) | |
4186 * [multi_output_configured.xml](https://github.com/galaxyproject/galaxy/tree/master/test/functional/tools/multi_output_configured.xml) | |
4187 | |
4188 More information can be found on Planemo's documentation for | |
4189 [multiple output files](https://planemo.readthedocs.io/en/latest/writing_advanced.html#multiple-output-files). | |
4190 ]]></xs:documentation> | |
4191 </xs:annotation> | |
4192 <xs:attribute name="from_provided_metadata" type="xs:boolean" use="optional"> | |
4193 <xs:annotation> | |
4194 <xs:documentation xml:lang="en">Indicate that dataset filenames should simply be read from the provided metadata file (e.g. galaxy.json). If this is set - pattern and sort must not be set.</xs:documentation> | |
4195 </xs:annotation> | |
4196 </xs:attribute> | |
4197 <xs:attribute name="pattern" type="xs:string" use="optional"> | |
4198 <xs:annotation> | |
4199 <xs:documentation xml:lang="en">Regular expression used to find filenames and parse dynamic properties.</xs:documentation> | |
4200 </xs:annotation> | |
4201 </xs:attribute> | |
4202 <xs:attribute name="directory" type="xs:string" use="optional"> | |
4203 <xs:annotation> | |
4204 <xs:documentation xml:lang="en">Directory (relative to working directory) to search for files.</xs:documentation> | |
4205 </xs:annotation> | |
4206 </xs:attribute> | |
4207 <xs:attribute name="recurse" type="xs:boolean" use="optional"> | |
4208 <xs:annotation> | |
4209 <xs:documentation xml:lang="en">Indicates that the specified directory should be searched recursively for matching files.</xs:documentation> | |
4210 </xs:annotation> | |
4211 </xs:attribute> | |
4212 <xs:attribute name="format" type="xs:string" use="optional"> | |
4213 <xs:annotation> | |
4214 <xs:documentation xml:lang="en">Format (or datatype) of discovered datasets (an alias with ``ext``).</xs:documentation> | |
4215 </xs:annotation> | |
4216 </xs:attribute> | |
4217 <xs:attribute name="ext" type="xs:string" use="optional"> | |
4218 <xs:annotation> | |
4219 <xs:documentation xml:lang="en">Format (or datatype) of discovered datasets (an alias with ``format``).</xs:documentation> | |
4220 </xs:annotation> | |
4221 </xs:attribute> | |
4222 <xs:attribute name="visible" type="xs:boolean" use="optional"> | |
4223 <xs:annotation> | |
4224 <xs:documentation xml:lang="en">Indication if this dataset is visible in output history. This defaults to ``false``, but probably shouldn't - be sure to set to ``true`` if that is your intention.</xs:documentation> | |
4225 </xs:annotation> | |
4226 </xs:attribute> | |
4227 <xs:attribute name="assign_primary_output" type="xs:boolean" use="optional"> | |
4228 <xs:annotation> | |
4229 <xs:documentation xml:lang="en">Replace the primary dataset described by the parameter ``data`` parameter with the first output discovered.</xs:documentation> | |
4230 </xs:annotation> | |
4231 </xs:attribute> | |
4232 </xs:complexType> | |
4233 <xs:complexType name="OutputCollectionDiscoverDatasets"> | |
4234 <xs:annotation> | |
4235 <xs:documentation xml:lang="en"><![CDATA[ | |
4236 | |
4237 This tag allows one to describe the datasets contained within an output | |
4238 collection dynamically, such that the outputs are "discovered" based on regular | |
4239 expressions after the job is complete. | |
4240 | |
4241 There are many simple tools with examples of this element distributed with | |
4242 Galaxy, including: | |
4243 | |
4244 * [collection_split_on_column.xml](https://github.com/galaxyproject/galaxy/blob/master/test/functional/tools/collection_split_on_column.xml) | |
4245 * [collection_creates_dynamic_list_of_pairs.xml](https://github.com/galaxyproject/galaxy/blob/master/test/functional/tools/collection_creates_dynamic_list_of_pairs.xml) | |
4246 * [collection_creates_dynamic_nested.xml](https://github.com/galaxyproject/galaxy/blob/master/test/functional/tools/collection_creates_dynamic_nested.xml) | |
4247 | |
4248 ]]></xs:documentation> | |
4249 </xs:annotation> | |
4250 <xs:attribute name="from_provided_metadata" type="xs:boolean" use="optional"> | |
4251 <xs:annotation> | |
4252 <xs:documentation xml:lang="en">Indicate that dataset filenames should simply be read from the provided metadata file (e.g. galaxy.json). If this is set - pattern and sort_by must not be set.</xs:documentation> | |
4253 </xs:annotation> | |
4254 </xs:attribute> | |
4255 <xs:attribute name="pattern" type="xs:string" use="optional"> | |
4256 <xs:annotation> | |
4257 <xs:documentation xml:lang="en">Regular expression used to find filenames and parse dynamic properties.</xs:documentation> | |
4258 </xs:annotation> | |
4259 </xs:attribute> | |
4260 <xs:attribute name="directory" type="xs:string" use="optional"> | |
4261 <xs:annotation> | |
4262 <xs:documentation xml:lang="en">Directory (relative to working directory) to search for files.</xs:documentation> | |
4263 </xs:annotation> | |
4264 </xs:attribute> | |
4265 <xs:attribute name="format" type="xs:string" use="optional"> | |
4266 <xs:annotation> | |
4267 <xs:documentation xml:lang="en">Format (or datatype) of discovered datasets (an alias with ``ext``).</xs:documentation> | |
4268 </xs:annotation> | |
4269 </xs:attribute> | |
4270 <xs:attribute name="ext" type="xs:string" use="optional"> | |
4271 <xs:annotation> | |
4272 <xs:documentation xml:lang="en">Format (or datatype) of discovered datasets (an alias with ``format``).</xs:documentation> | |
4273 </xs:annotation> | |
4274 </xs:attribute> | |
4275 <xs:attribute name="sort_by" type="xs:string" use="optional"> | |
4276 <xs:annotation> | |
4277 <xs:documentation xml:lang="en">A string `[reverse_]SORTBY[_SORT_COMP]` describing the desired sort order of the collection elements. `SORTBY` can be `filename`, `name`, `designation`, `dbkey` and the optional `SORT_COMP` can be either `lexical` or `numeric`. Default is lexical sorting by filename.</xs:documentation> | |
4278 </xs:annotation> | |
4279 </xs:attribute> | |
4280 <xs:attribute name="visible" type="xs:boolean" use="optional"> | |
4281 <xs:annotation> | |
4282 <xs:documentation xml:lang="en">Indication if this dataset is visible in the history. This defaults to ``false``, but probably shouldn't - be sure to set to ``true`` if that is your intention.</xs:documentation> | |
4283 </xs:annotation> | |
4284 </xs:attribute> | |
4285 </xs:complexType> | |
4286 <xs:complexType name="Actions"> | |
4287 <xs:annotation> | |
4288 <xs:documentation xml:lang="en"><![CDATA[ | |
4289 | |
4290 The ``actions`` directive allows tools to dynamically take actions related to an | |
4291 ``output`` either unconditionally or conditionally based on inputs. These | |
4292 actions currently include setting metadata values and the output's data format. | |
4293 | |
4294 The examples below will demonstrate that the ``actions`` tag contains child | |
4295 ``conditional`` tags. The these conditionals are met, additional ``action`` | |
4296 directives below the conditional are apply to the ``data`` output. | |
4297 | |
4298 ### Metadata | |
4299 | |
4300 The ``<actions>`` in the Bowtie 2 wrapper is used in lieu of the deprecated | |
4301 ``<code>`` tag to set the ``dbkey`` of the output dataset. In | |
4302 [bowtie2_wrapper.xml](https://github.com/galaxyproject/tools-devteam/blob/master/tools/bowtie2/bowtie2_wrapper.xml) | |
4303 (see below), according to the first action block, if the | |
4304 ``reference_genome.source`` is ``indexed`` (not ``history``), then it will assign | |
4305 the ``dbkey`` of the output file to be the same as that of the reference file. It | |
4306 does this by looking at through the data table and finding the entry that has the | |
4307 value that's been selected in the index dropdown box as column 1 of the loc file | |
4308 entry and using the dbkey, in column 0 (ignoring comment lines (starting with #) | |
4309 along the way). | |
4310 | |
4311 If ``reference_genome.source`` is ``history``, it pulls the ``dbkey`` from the | |
4312 supplied file. | |
4313 | |
4314 ```xml | |
4315 <data format="bam" name="output" label="${tool.name} on ${on_string}: aligned reads (sorted BAM)"> | |
4316 <filter>analysis_type['analysis_type_selector'] == "simple" or analysis_type['sam_opt'] is False</filter> | |
4317 <actions> | |
4318 <conditional name="reference_genome.source"> | |
4319 <when value="indexed"> | |
4320 <action type="metadata" name="dbkey"> | |
4321 <option type="from_data_table" name="bowtie2_indexes" column="1" offset="0"> | |
4322 <filter type="param_value" column="0" value="#" compare="startswith" keep="false"/> | |
4323 <filter type="param_value" ref="reference_genome.index" column="0"/> | |
4324 </option> | |
4325 </action> | |
4326 </when> | |
4327 <when value="history"> | |
4328 <action type="metadata" name="dbkey"> | |
4329 <option type="from_param" name="reference_genome.own_file" param_attribute="dbkey" /> | |
4330 </action> | |
4331 </when> | |
4332 </conditional> | |
4333 </actions> | |
4334 </data> | |
4335 ``` | |
4336 | |
4337 ### Format | |
4338 | |
4339 The Bowtie 2 example also demonstrates conditionally setting an output format | |
4340 based on inputs, as shown below: | |
4341 | |
4342 ```xml | |
4343 <data format="fastqsanger" name="output_unaligned_reads_r" label="${tool.name} on ${on_string}: unaligned reads (R)"> | |
4344 <filter>(library['type'] == "paired" or library['type'] == "paired_collection") and library['unaligned_file'] is True</filter> | |
4345 <actions> | |
4346 <conditional name="library.type"> | |
4347 <when value="paired"> | |
4348 <action type="format"> | |
4349 <option type="from_param" name="library.input_2" param_attribute="ext" /> | |
4350 </action> | |
4351 </when> | |
4352 <when value="paired_collection"> | |
4353 <action type="format"> | |
4354 <option type="from_param" name="library.input_1" param_attribute="reverse.ext" /> | |
4355 </action> | |
4356 </when> | |
4357 </conditional> | |
4358 </actions> | |
4359 </data> | |
4360 ``` | |
4361 | |
4362 ### Unconditional Actions and Column Names | |
4363 | |
4364 For a static file that contains a fixed number of columns, it is straight forward: | |
4365 | |
4366 ```xml | |
4367 <outputs> | |
4368 <data format="tabular" name="table"> | |
4369 <actions> | |
4370 <action name="column_names" type="metadata" default="Firstname,Lastname,Age" /> | |
4371 </actions> | |
4372 </data> | |
4373 </outputs> | |
4374 ``` | |
4375 | |
4376 It may also be necessary to use column names based on a variable from another | |
4377 input file. This is implemented in the | |
4378 [htseq-count](https://github.com/galaxyproject/tools-iuc/blob/master/tools/htseq_count/htseq-count.xml) | |
4379 and | |
4380 [featureCounts](https://github.com/galaxyproject/tools-iuc/blob/master/tools/featurecounts/featurecounts.xml) | |
4381 wrappers: | |
4382 | |
4383 ```xml | |
4384 <inputs> | |
4385 <data name="input_file" type="data" multiple="false"> | |
4386 </inputs> | |
4387 <outputs> | |
4388 <data format="tabular" name="output_short"> | |
4389 <actions> | |
4390 <action name="column_names" type="metadata" default="Geneid,${input_file.name}" /> | |
4391 </actions> | |
4392 </data> | |
4393 </outputs> | |
4394 ``` | |
4395 | |
4396 Or in case of multiple files: | |
4397 | |
4398 ```xml | |
4399 <inputs> | |
4400 <data name="input_files" type="data" multiple="true"> | |
4401 </inputs> | |
4402 <outputs> | |
4403 <data format="tabular" name="output_short"> | |
4404 <actions> | |
4405 <action name="column_names" type="metadata" default="Geneid,${','.join([a.name for a in $input_files])}" /> | |
4406 </actions> | |
4407 </data> | |
4408 </outputs> | |
4409 ``` | |
4410 | |
4411 ### Unconditional Actions - An Older Example | |
4412 | |
4413 The first approach above to setting ``dbkey`` based on tool data tables is | |
4414 prefered, but an older example using so called "loc files" directly is found | |
4415 below. | |
4416 | |
4417 In addition to demonstrating this lower-level direct access of .loc files, it | |
4418 demonstrates an unconditional action. The second block would not be needed for | |
4419 most cases - it was required in this tool to handle the specific case of a small | |
4420 reference file used for functional testing. It says that if the dbkey has been | |
4421 set to ``equCab2chrM`` (which is what the ``<filter type="metadata_value"... | |
4422 column="1" />`` tag does), then it should be changed to ``equCab2`` (which is the | |
4423 ``<option type="from_param" ... column="0" ...>`` tag does). | |
4424 | |
4425 ```xml | |
4426 <actions> | |
4427 <conditional name="refGenomeSource.genomeSource"> | |
4428 <when value="indexed"> | |
4429 <action type="metadata" name="dbkey"> | |
4430 <option type="from_file" name="bowtie_indices.loc" column="0" offset="0"> | |
4431 <filter type="param_value" column="0" value="#" compare="startswith" keep="false"/> | |
4432 <filter type="param_value" ref="refGenomeSource.index" column="1"/> | |
4433 </option> | |
4434 </action> | |
4435 </when> | |
4436 </conditional> | |
4437 <!-- Special casing equCab2chrM to equCab2 --> | |
4438 <action type="metadata" name="dbkey"> | |
4439 <option type="from_param" name="refGenomeSource.genomeSource" column="0" offset="0"> | |
4440 <filter type="insert_column" column="0" value="equCab2chrM"/> | |
4441 <filter type="insert_column" column="0" value="equCab2"/> | |
4442 <filter type="metadata_value" ref="output" name="dbkey" column="1" /> | |
4443 </option> | |
4444 </action> | |
4445 </actions> | |
4446 ``` | |
4447 ]]> | |
4448 </xs:documentation> | |
4449 </xs:annotation> | |
4450 <xs:sequence> | |
4451 <xs:group ref="ActionsElement" minOccurs="0" maxOccurs="unbounded"/> | |
4452 </xs:sequence> | |
4453 </xs:complexType> | |
4454 <xs:group name="ActionsElement"> | |
4455 <xs:choice> | |
4456 <xs:element name="action" type="Action"/> | |
4457 <xs:element name="conditional" type="ActionsConditional"/> | |
4458 </xs:choice> | |
4459 </xs:group> | |
4460 <xs:complexType name="Action"> | |
4461 <xs:annotation> | |
4462 <xs:documentation xml:lang="en"><![CDATA[ | |
4463 | |
4464 This directive is contained within an output ``data``'s ``actions`` directive | |
4465 (either directly or beneath a parent ``conditional`` tag). This directive | |
4466 describes modifications to either the output's format or metadata (based on | |
4467 whether ``type`` is ``format`` or ``metadata``). | |
4468 | |
4469 See [actions](#tool-outputs-data-actions) documentation for examples | |
4470 of this directive. | |
4471 | |
4472 ]]></xs:documentation> | |
4473 </xs:annotation> | |
4474 <xs:sequence> | |
4475 <xs:element name="option" type="ActionsOption" minOccurs="0" maxOccurs="unbounded"/> | |
4476 </xs:sequence> | |
4477 <xs:attribute name="type" type="ActionType" use="required"> | |
4478 <xs:annotation> | |
4479 <xs:documentation xml:lang="en">Type of action (either ``format`` or | |
4480 ``metadata`` currently).</xs:documentation> | |
4481 </xs:annotation> | |
4482 </xs:attribute> | |
4483 <xs:attribute name="name" type="xs:string"> | |
4484 <xs:annotation> | |
4485 <xs:documentation xml:lang="en">If ``type="metadata"``, the name of the | |
4486 metadata element.</xs:documentation> | |
4487 </xs:annotation> | |
4488 </xs:attribute> | |
4489 <xs:attribute name="default" type="xs:string"> | |
4490 <xs:annotation> | |
4491 <xs:documentation xml:lang="en">If ``type="format"``, the default format | |
4492 if none of the nested options apply.</xs:documentation> | |
4493 </xs:annotation> | |
4494 </xs:attribute> | |
4495 </xs:complexType> | |
4496 <xs:complexType name="ActionsOption"> | |
4497 <xs:annotation> | |
4498 <xs:documentation xml:lang="en"></xs:documentation> | |
4499 </xs:annotation> | |
4500 <xs:sequence> | |
4501 <xs:element name="filter" type="ActionsConditionalFilter" minOccurs="0" maxOccurs="unbounded"/> | |
4502 </xs:sequence> | |
4503 <xs:attribute name="type" type="ActionsOptionType"> | |
4504 <xs:annotation> | |
4505 <xs:documentation xml:lang="en"></xs:documentation> | |
4506 </xs:annotation> | |
4507 </xs:attribute> | |
4508 <xs:attribute name="name" type="xs:string"> | |
4509 <xs:annotation> | |
4510 <xs:documentation xml:lang="en"></xs:documentation> | |
4511 </xs:annotation> | |
4512 </xs:attribute> | |
4513 <xs:attribute name="column" type="xs:integer"> | |
4514 <xs:annotation> | |
4515 <xs:documentation xml:lang="en"></xs:documentation> | |
4516 </xs:annotation> | |
4517 </xs:attribute> | |
4518 <xs:attribute name="offset" type="xs:integer"> | |
4519 <xs:annotation> | |
4520 <xs:documentation xml:lang="en"></xs:documentation> | |
4521 </xs:annotation> | |
4522 </xs:attribute> | |
4523 <xs:attribute name="param_attribute" type="xs:string"> | |
4524 <xs:annotation> | |
4525 <xs:documentation xml:lang="en"></xs:documentation> | |
4526 </xs:annotation> | |
4527 </xs:attribute> | |
4528 </xs:complexType> | |
4529 <xs:complexType name="ActionsConditional"> | |
4530 <xs:annotation> | |
4531 <xs:documentation xml:lang="en"><![CDATA[ | |
4532 | |
4533 This directive is contained within an output ``data``'s ``actions`` directive. | |
4534 This directive describes the state of the inputs required to apply an ``action`` | |
4535 (specified as children of the child ``when`` directives to this element) to an | |
4536 output. | |
4537 | |
4538 See [actions](#tool-outputs-data-actions) documentation for examples | |
4539 of this directive. | |
4540 | |
4541 ]]></xs:documentation> | |
4542 </xs:annotation> | |
4543 <xs:sequence> | |
4544 <xs:element name="when" type="ActionsConditionalWhen" minOccurs="0" maxOccurs="unbounded"/> | |
4545 </xs:sequence> | |
4546 <xs:attribute name="name" type="xs:string" use="required"> | |
4547 <xs:annotation> | |
4548 <xs:documentation xml:lang="en">Name of the input parameter to base | |
4549 conditional logic on. The value of this parameter will be matched against nested | |
4550 ``when`` directives.</xs:documentation> | |
4551 </xs:annotation> | |
4552 </xs:attribute> | |
4553 </xs:complexType> | |
4554 <xs:complexType name="ActionsConditionalWhen"> | |
4555 <xs:annotation> | |
4556 <xs:documentation xml:lang="en"><![CDATA[ | |
4557 | |
4558 See [actions](#tool-outputs-data-actions) documentation for examples | |
4559 of this directive. | |
4560 | |
4561 ]]></xs:documentation> | |
4562 </xs:annotation> | |
4563 <xs:sequence> | |
4564 <xs:element name="action" type="Action" minOccurs="1" maxOccurs="unbounded"/> | |
4565 </xs:sequence> | |
4566 <xs:attribute name="value" type="xs:string" use="optional"> | |
4567 <xs:annotation> | |
4568 <xs:documentation xml:lang="en">Value to match conditional input value | |
4569 against.</xs:documentation> | |
4570 </xs:annotation> | |
4571 </xs:attribute> | |
4572 <xs:attribute name="datatype_isinstance" type="xs:string" use="optional"> | |
4573 <xs:annotation> | |
4574 <xs:documentation xml:lang="en">Datatype to match against (if ``value`` is unspecified). This should be the short string describing the format (e.g. ``interval``).</xs:documentation> | |
4575 </xs:annotation> | |
4576 </xs:attribute> | |
4577 </xs:complexType> | |
4578 <xs:complexType name="ActionsConditionalFilter"> | |
4579 <xs:annotation> | |
4580 <xs:documentation xml:lang="en"></xs:documentation> | |
4581 </xs:annotation> | |
4582 <xs:attribute name="type" type="ActionsConditionalFilterType" use="required"> | |
4583 <xs:annotation> | |
4584 <xs:documentation xml:lang="en"><![CDATA[]]></xs:documentation> | |
4585 </xs:annotation> | |
4586 </xs:attribute> | |
4587 <xs:attribute name="compare" type="CompareType"> | |
4588 <xs:annotation> | |
4589 <xs:documentation xml:lang="en"></xs:documentation> | |
4590 </xs:annotation> | |
4591 </xs:attribute> | |
4592 <xs:attribute name="ref" type="xs:string"> | |
4593 <xs:annotation> | |
4594 <xs:documentation xml:lang="en"></xs:documentation> | |
4595 </xs:annotation> | |
4596 </xs:attribute> | |
4597 <xs:attribute name="value" type="xs:string"> | |
4598 <xs:annotation> | |
4599 <xs:documentation xml:lang="en"></xs:documentation> | |
4600 </xs:annotation> | |
4601 </xs:attribute> | |
4602 <xs:attribute name="column" type="xs:integer"> | |
4603 <xs:annotation> | |
4604 <xs:documentation xml:lang="en"></xs:documentation> | |
4605 </xs:annotation> | |
4606 </xs:attribute> | |
4607 <xs:attribute name="keep" type="PermissiveBoolean"> | |
4608 <xs:annotation> | |
4609 <xs:documentation xml:lang="en"></xs:documentation> | |
4610 </xs:annotation> | |
4611 </xs:attribute> | |
4612 <xs:attribute name="cast" type="xs:string"> | |
4613 <xs:annotation> | |
4614 <xs:documentation xml:lang="en"></xs:documentation> | |
4615 </xs:annotation> | |
4616 </xs:attribute> | |
4617 <xs:attribute name="param_attribute" type="xs:string"> | |
4618 <xs:annotation> | |
4619 <xs:documentation xml:lang="en"></xs:documentation> | |
4620 </xs:annotation> | |
4621 </xs:attribute> | |
4622 <xs:attribute name="separator" type="xs:string"> | |
4623 <xs:annotation> | |
4624 <xs:documentation xml:lang="en"></xs:documentation> | |
4625 </xs:annotation> | |
4626 </xs:attribute> | |
4627 <xs:attribute name="strip" type="PermissiveBoolean"> | |
4628 <xs:annotation> | |
4629 <xs:documentation xml:lang="en"></xs:documentation> | |
4630 </xs:annotation> | |
4631 </xs:attribute> | |
4632 <xs:attribute name="old_column" type="xs:string"> | |
4633 <xs:annotation> | |
4634 <xs:documentation xml:lang="en"></xs:documentation> | |
4635 </xs:annotation> | |
4636 </xs:attribute> | |
4637 <xs:attribute name="old_value" type="xs:string"> | |
4638 <xs:annotation> | |
4639 <xs:documentation xml:lang="en"></xs:documentation> | |
4640 </xs:annotation> | |
4641 </xs:attribute> | |
4642 <xs:attribute name="new_column" type="xs:string"> | |
4643 <xs:annotation> | |
4644 <xs:documentation xml:lang="en"></xs:documentation> | |
4645 </xs:annotation> | |
4646 </xs:attribute> | |
4647 <xs:attribute name="new_value" type="xs:string"> | |
4648 <xs:annotation> | |
4649 <xs:documentation xml:lang="en"></xs:documentation> | |
4650 </xs:annotation> | |
4651 </xs:attribute> | |
4652 </xs:complexType> | |
4653 <xs:complexType name="EnvironmentVariables"> | |
4654 <xs:annotation> | |
4655 <xs:documentation xml:lang="en"> | |
4656 This directive should contain one or more ``environment_variable`` definition. | |
4657 </xs:documentation> | |
4658 </xs:annotation> | |
4659 <xs:sequence> | |
4660 <xs:element name="environment_variable" type="EnvironmentVariable" minOccurs="0" maxOccurs="unbounded" /> | |
4661 </xs:sequence> | |
4662 </xs:complexType> | |
4663 | |
4664 <xs:complexType name="EnvironmentVariable"> | |
4665 <xs:annotation> | |
4666 <xs:documentation xml:lang="en"><![CDATA[ | |
4667 | |
4668 This directive defines an environment variable that will be available when the | |
4669 tool executes. The body should be a Cheetah template block that may reference | |
4670 the tool's inputs as demonstrated below. | |
4671 | |
4672 ### Example | |
4673 | |
4674 The following demonstrates a couple ``environment_variable`` definitions. | |
4675 | |
4676 ```xml | |
4677 <environment_variables> | |
4678 <environment_variable name="INTVAR">$inttest</environment_variable> | |
4679 <environment_variable name="IFTEST">#if int($inttest) == 3 | |
4680 ISTHREE | |
4681 #else# | |
4682 NOTTHREE | |
4683 #end if#</environment_variable> | |
4684 </environment_variables> | |
4685 </environment_variables> | |
4686 ``` | |
4687 | |
4688 If these environment variables are used in another Cheetah context, such as in | |
4689 the ``command`` block, the ``$`` used indicate shell expansion of a variable | |
4690 should be escaped with a ``\`` so prevent it from being evaluated as a Cheetah | |
4691 variable instead of shell variable. | |
4692 | |
4693 ```xml | |
4694 <command> | |
4695 echo "\$INTVAR" > $out_file1; | |
4696 echo "\$IFTEST" >> $out_file1; | |
4697 </command> | |
4698 ``` | |
4699 | |
4700 ### inject | |
4701 | |
4702 The Galaxy user's API key can be injected into an environment variable by setting ``inject`` | |
4703 attribute to ``api_key`` (e.g. ``inject="api_key"``). | |
4704 | |
4705 ```xml | |
4706 <environment_variables> | |
4707 <environment_variable name="GALAXY_API_KEY" inject="api_key" /> | |
4708 </environment_variables> | |
4709 ``` | |
4710 | |
4711 The framework allows setting this via environment variable and not via templating variables | |
4712 in order to discourage setting the actual values of these keys as command line arguments. | |
4713 On shared systems this provides some security by preventing a simple process listing command | |
4714 from exposing keys. | |
4715 ]]></xs:documentation> | |
4716 </xs:annotation> | |
4717 <xs:simpleContent> | |
4718 <xs:extension base="xs:string"> | |
4719 <xs:attribute name="name" type="xs:string"> | |
4720 <xs:annotation> | |
4721 <xs:documentation xml:lang="en">Name of the environment variable to | |
4722 define.</xs:documentation> | |
4723 </xs:annotation> | |
4724 </xs:attribute> | |
4725 <xs:attribute name="inject" type="EnvironmentVariableInject" gxdocs:added="19.09"> | |
4726 <xs:annotation> | |
4727 <xs:documentation xml:lang="en">Special variable to inject into the environment variable. Currently 'api_key' is the only option and will cause the user's API key to be injected via this environment variable.</xs:documentation> | |
4728 </xs:annotation> | |
4729 </xs:attribute> | |
4730 <xs:attribute name="strip" type="PermissiveBoolean" default="false"> | |
4731 <xs:annotation> | |
4732 <xs:documentation xml:lang="en">Whether to strip leading and trailing whitespace from the calculated value before exporting the environment variable.</xs:documentation> | |
4733 </xs:annotation> | |
4734 </xs:attribute> | |
4735 </xs:extension> | |
4736 </xs:simpleContent> | |
4737 </xs:complexType> | |
4738 <xs:simpleType name="EnvironmentVariableInject"> | |
4739 <xs:annotation> | |
4740 <xs:documentation xml:lang="en"></xs:documentation> | |
4741 </xs:annotation> | |
4742 <xs:restriction base="xs:string"> | |
4743 <xs:enumeration value="api_key" /> | |
4744 </xs:restriction> | |
4745 </xs:simpleType> | |
4746 <xs:complexType name="ConfigFiles"> | |
4747 <xs:annotation> | |
4748 <xs:documentation xml:lang="en"><![CDATA[See | |
4749 [xy_plot.xml](https://github.com/galaxyproject/tools-devteam/blob/master/tools/xy_plot/xy_plot.xml) | |
4750 for an example of how this tag set is used in a tool. This tag set is a | |
4751 container for ``<configfile>`` and ``<inputs>`` tag sets - which can be used | |
4752 to setup configuration files for use by tools.]]></xs:documentation> | |
4753 </xs:annotation> | |
4754 <xs:sequence> | |
4755 <xs:group ref="ConfigFilesElement" minOccurs="0" maxOccurs="unbounded" /> | |
4756 </xs:sequence> | |
4757 </xs:complexType> | |
4758 | |
4759 <xs:group name="ConfigFilesElement"> | |
4760 <xs:choice> | |
4761 <xs:element name="inputs" type="ConfigInputs"/> | |
4762 <xs:element name="configfile" type="ConfigFile"/> | |
4763 </xs:choice> | |
4764 </xs:group> | |
4765 | |
4766 <xs:complexType name="ConfigFile"> | |
4767 <xs:annotation> | |
4768 <xs:documentation xml:lang="en"><![CDATA[ | |
4769 | |
4770 This tag set is contained within the ``<configfiles>`` tag set. It allows for | |
4771 the creation of a temporary file for file-based parameter transfer. | |
4772 | |
4773 *Example* | |
4774 | |
4775 The following is taken from the [xy_plot.xml](https://github.com/galaxyproject/tools-devteam/blob/master/tools/xy_plot/xy_plot.xml) | |
4776 tool config. | |
4777 | |
4778 ```xml | |
4779 <configfiles> | |
4780 <configfile name="script_file"> | |
4781 ## Setup R error handling to go to stderr | |
4782 options(show.error.messages=F, error = function () { cat(geterrmessage(), file=stderr()); q("no", 1, F) }) | |
4783 ## Determine range of all series in the plot | |
4784 xrange = c(NULL, NULL) | |
4785 yrange = c(NULL, NULL) | |
4786 #for $i, $s in enumerate($series) | |
4787 s${i} = read.table("${s.input.file_name}") | |
4788 x${i} = s${i}[,${s.xcol}] | |
4789 y${i} = s${i}[,${s.ycol}] | |
4790 xrange = range(x${i}, xrange) | |
4791 yrange = range(y${i}, yrange) | |
4792 #end for | |
4793 ## Open output PDF file | |
4794 pdf("${out_file1}") | |
4795 ## Dummy plot for axis / labels | |
4796 plot(NULL, type="n", xlim=xrange, ylim=yrange, main="${main}", xlab="${xlab}", ylab="${ylab}") | |
4797 ## Plot each series | |
4798 #for $i, $s in enumerate($series) | |
4799 #if $s.series_type['type'] == "line" | |
4800 lines(x${i}, y${i}, lty=${s.series_type.lty}, lwd=${s.series_type.lwd}, col=${s.series_type.col}) | |
4801 #elif $s.series_type.type == "points" | |
4802 points(x${i}, y${i}, pch=${s.series_type.pch}, cex=${s.series_type.cex}, col=${s.series_type.col}) | |
4803 #end if | |
4804 #end for | |
4805 ## Close the PDF file | |
4806 devname = dev.off() | |
4807 </configfile> | |
4808 </configfiles> | |
4809 ``` | |
4810 | |
4811 This file is then used in the ``command`` block of the tool as follows: | |
4812 | |
4813 ```xml | |
4814 <command>bash '$__tool_directory__/r_wrapper.sh' '$script_file'</command> | |
4815 ``` | |
4816 | |
4817 ]]></xs:documentation> | |
4818 </xs:annotation> | |
4819 <xs:simpleContent> | |
4820 <xs:extension base="xs:string"> | |
4821 <xs:attribute name="name" type="xs:string"> | |
4822 <xs:annotation> | |
4823 <xs:documentation xml:lang="en">Cheetah variable used to reference | |
4824 the path to the file created with this directive.</xs:documentation> | |
4825 </xs:annotation> | |
4826 </xs:attribute> | |
4827 <xs:attribute name="filename" type="xs:string"> | |
4828 <xs:annotation> | |
4829 <xs:documentation xml:lang="en">Path relative to the working directory of the tool for the configfile created in response to this directive.</xs:documentation> | |
4830 </xs:annotation> | |
4831 </xs:attribute> | |
4832 </xs:extension> | |
4833 </xs:simpleContent> | |
4834 </xs:complexType> | |
4835 | |
4836 <xs:complexType name="ConfigInputs"> | |
4837 <xs:annotation> | |
4838 <xs:documentation xml:lang="en"><![CDATA[ | |
4839 | |
4840 This tag set is contained within the ``<configfiles>`` tag set. It tells Galaxy to | |
4841 write out a JSON representation of the tool parameters. | |
4842 | |
4843 *Example* | |
4844 | |
4845 The following will create a Cheetah variable that can be evaluated as ``$inputs`` that | |
4846 will contain the tool parameter inputs. | |
4847 | |
4848 ```xml | |
4849 <configfiles> | |
4850 <inputs name="inputs" /> | |
4851 <configfiles> | |
4852 ``` | |
4853 | |
4854 The following will instead write the inputs to the tool's working directory with | |
4855 the specified name (i.e. ``inputs.json``). | |
4856 | |
4857 ```xml | |
4858 <configfiles> | |
4859 <inputs name="inputs" filename="inputs.json" /> | |
4860 <configfiles> | |
4861 ``` | |
4862 | |
4863 A contrived example of a tool that uses this is the test tool | |
4864 [inputs_as_json.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/inputs_as_json.xml). | |
4865 | |
4866 By default this file will not contain paths for data or collection inputs. To include simple | |
4867 paths for data parameters set the ``data_style`` attribute to ``paths`` (see [inputs_as_json_with_paths.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/inputs_as_json_with_paths.xml) for an example). | |
4868 | |
4869 For tools with profile >= 20.05 a select with ``multiple="true"`` is rendered as an array which is empty if nothing is selected. For older profile versions select lists are rendered as comma separated strings or a literal ``null`` in case nothing is selected. | |
4870 ]]></xs:documentation> | |
4871 </xs:annotation> | |
4872 <xs:simpleContent> | |
4873 <xs:extension base="xs:string"> | |
4874 <xs:attribute name="name" type="xs:string"> | |
4875 <xs:annotation> | |
4876 <xs:documentation xml:lang="en"><![CDATA[ | |
4877 Cheetah variable to populate the path to the inputs JSON file created in | |
4878 response to this directive. | |
4879 ]]></xs:documentation> | |
4880 </xs:annotation> | |
4881 </xs:attribute> | |
4882 <xs:attribute name="filename" type="xs:string"> | |
4883 <xs:annotation> | |
4884 <xs:documentation xml:lang="en">Path relative to the working directory of the tool for the inputs JSON file created in response to this directive.</xs:documentation> | |
4885 </xs:annotation> | |
4886 </xs:attribute> | |
4887 <xs:attribute name="data_style" type="xs:string"> | |
4888 <xs:annotation> | |
4889 <xs:documentation xml:lang="en">Set to 'paths' to include dataset paths in the resulting file.</xs:documentation> | |
4890 </xs:annotation> | |
4891 </xs:attribute> | |
4892 </xs:extension> | |
4893 </xs:simpleContent> | |
4894 </xs:complexType> | |
4895 | |
4896 <xs:complexType name="VersionCommand"> | |
4897 <xs:annotation> | |
4898 <xs:documentation xml:lang="en"><![CDATA[Specifies the command to be run in | |
4899 order to get the tool's version string. The resulting value will be found in the | |
4900 "Info" field of the history dataset. | |
4901 | |
4902 Unlike the [command](#tool-command) tag, with the exception of the string | |
4903 ``$__tool_directory__`` this value is taken as a literal and so there is no | |
4904 need to escape values like ``$`` and command inputs are not available for variable | |
4905 substitution. | |
4906 | |
4907 ### Examples | |
4908 | |
4909 A simple example for a [TopHat](https://ccb.jhu.edu/software/tophat/index.shtml) | |
4910 tool definition might just be: | |
4911 | |
4912 ```xml | |
4913 <version_command>tophat -version</version_command> | |
4914 ``` | |
4915 | |
4916 An example that leverages a Python script (e.g. ``count_reads.py``) shipped with | |
4917 the tool might be: | |
4918 | |
4919 ```xml | |
4920 <version_command>python '$__tool_directory__/count_reads.py'</version_command> | |
4921 ``` | |
4922 | |
4923 Examples are included in the test tools directory including: | |
4924 | |
4925 - [version_command_plain.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/version_command_plain.xml) | |
4926 - [version_command_tool_dir.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/version_command_tool_dir.xml) | |
4927 - [version_command_interpreter.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/version_command_interpreter.xml) (*deprecated*) | |
4928 | |
4929 ]]></xs:documentation> | |
4930 </xs:annotation> | |
4931 <xs:simpleContent> | |
4932 <xs:extension base="xs:string"> | |
4933 <xs:attribute name="interpreter" type="xs:string"> | |
4934 <xs:annotation> | |
4935 <xs:documentation xml:lang="en"><![CDATA[*Deprecated*. This will prefix the version command with the value of this attribute (e.g. ``python`` or ``perl``) and the tool directory, in order to to run an executable file shipped with the tool. It is recommended to instead use ``<interpreter> '$__tool_directory__/<executable_name>'`` in the tag content. If this attribute is not specified, the tag should contain a Bash command calling executable(s) available in the ``$PATH``, as modified after loading the requirements.]]></xs:documentation> | |
4936 </xs:annotation> | |
4937 </xs:attribute> | |
4938 </xs:extension> | |
4939 </xs:simpleContent> | |
4940 </xs:complexType> | |
4941 | |
4942 <xs:complexType name="RequestParameterTranslation"> | |
4943 <xs:annotation> | |
4944 <xs:documentation xml:lang="en"><![CDATA[See [/tools/data_source/ucsc_tablebrowser.xml](https://github.com/galaxyproject/galaxy/blob/dev/tools/data_source/ucsc_tablebrowser.xml) for an example of how to use this tag set. This tag set is used only in "data_source" tools (i.e. whose ``tool_type`` attribute is ``data_source``). This tag set contains a set of [request_param](#tool-request-param-translation-request-param) elements.]]></xs:documentation> | |
4945 </xs:annotation> | |
4946 <xs:sequence> | |
4947 <xs:element name="request_param" minOccurs="0" maxOccurs="unbounded" type="RequestParameter"/> | |
4948 </xs:sequence> | |
4949 </xs:complexType> | |
4950 | |
4951 <xs:complexType name="RequestParameter"> | |
4952 <xs:annotation> | |
4953 <xs:documentation xml:lang="en"><![CDATA[Contained within the [request_param_translation](#tool-request-param-translation) tag set (used only in "data_source" tools). The external data source application may send back parameter names like "GENOME" which must be translated to "dbkey" in Galaxy.]]></xs:documentation> | |
4954 </xs:annotation> | |
4955 <xs:sequence> | |
4956 <xs:group ref="RequestParameterElement" minOccurs="0" maxOccurs="unbounded"/> | |
4957 </xs:sequence> | |
4958 <xs:attribute name="galaxy_name" type="RequestParameterGalaxyNameType" use="required"> | |
4959 <xs:annotation> | |
4960 <xs:documentation xml:lang="en"> | |
4961 Each of these maps directly to a ``remote_name`` value | |
4962 </xs:documentation> | |
4963 </xs:annotation> | |
4964 </xs:attribute> | |
4965 <xs:attribute name="remote_name" type="xs:string" use="required"> | |
4966 <xs:annotation> | |
4967 <xs:documentation xml:lang="en"> | |
4968 The string representing the name of the parameter in the remote data source | |
4969 </xs:documentation> | |
4970 </xs:annotation> | |
4971 </xs:attribute> | |
4972 <xs:attribute name="missing" type="xs:string"> | |
4973 <xs:annotation> | |
4974 <xs:documentation xml:lang="en"> | |
4975 The default value to use for ``galaxy_name`` if the ``remote_name`` parameter is not included in the request | |
4976 </xs:documentation> | |
4977 </xs:annotation> | |
4978 </xs:attribute> | |
4979 </xs:complexType> | |
4980 | |
4981 <xs:simpleType name="RequestParameterGalaxyNameType"> | |
4982 <xs:annotation> | |
4983 <xs:documentation xml:lang="en"></xs:documentation> | |
4984 </xs:annotation> | |
4985 <xs:restriction base="xs:string"> | |
4986 <xs:enumeration value="URL" /> | |
4987 <xs:enumeration value="URL_method" /> | |
4988 <xs:enumeration value="dbkey" /> | |
4989 <xs:enumeration value="organism" /> | |
4990 <xs:enumeration value="table" /> | |
4991 <xs:enumeration value="description" /> | |
4992 <xs:enumeration value="name" /> | |
4993 <xs:enumeration value="info" /> | |
4994 <xs:enumeration value="data_type" /> | |
4995 </xs:restriction> | |
4996 </xs:simpleType> | |
4997 | |
4998 <xs:group name="RequestParameterElement"> | |
4999 <xs:choice> | |
5000 <xs:element name="append_param" type="RequestParameterAppend" /> | |
5001 <xs:element name="value_translation" type="RequestParameterValueTranslation" /> | |
5002 </xs:choice> | |
5003 </xs:group> | |
5004 | |
5005 <xs:complexType name="RequestParameterAppend"> | |
5006 <xs:annotation> | |
5007 <xs:documentation xml:lang="en"><![CDATA[Optionally contained within the [request_param](#tool-request-param-translation-request-param) element if ``galaxy_name="URL"``. Some remote data sources (e.g., Gbrowse, Biomart) send parameters back to Galaxy in the initial response that must be added to the value of "URL" prior to Galaxy sending the secondary request to the remote data source via URL.]]></xs:documentation> | |
5008 </xs:annotation> | |
5009 <xs:sequence> | |
5010 <xs:element name="value" minOccurs="0" maxOccurs="unbounded" type="RequestParameterAppendValue"/> | |
5011 </xs:sequence> | |
5012 <xs:attribute name="separator" type="xs:string" use="required"> | |
5013 <xs:annotation> | |
5014 <xs:documentation xml:lang="en"><![CDATA[ | |
5015 The text to use to join the requested parameters together (example ``separator="&"``). | |
5016 ]]></xs:documentation> | |
5017 </xs:annotation> | |
5018 </xs:attribute> | |
5019 <xs:attribute name="first_separator" type="xs:string"> | |
5020 <xs:annotation> | |
5021 <xs:documentation xml:lang="en"><![CDATA[ | |
5022 The text to use to join the ``request_param`` parameters to the first requested parameter (example ``first_separator="?"``). | |
5023 ]]></xs:documentation> | |
5024 </xs:annotation> | |
5025 </xs:attribute> | |
5026 <xs:attribute name="join" type="xs:string" use="required"> | |
5027 <xs:annotation> | |
5028 <xs:documentation xml:lang="en"><![CDATA[ | |
5029 The text to use to join the param name to its value (example ``join="="``). | |
5030 ]]></xs:documentation> | |
5031 </xs:annotation> | |
5032 </xs:attribute> | |
5033 </xs:complexType> | |
5034 | |
5035 <xs:complexType name="RequestParameterAppendValue"> | |
5036 <xs:annotation> | |
5037 <xs:documentation xml:lang="en"><![CDATA[Contained within the [append_param](#tool-request-param-translation-request-param-append-param) tag set. Allows for appending a param name / value pair to the value of URL. | |
5038 | |
5039 Example: | |
5040 | |
5041 ```xml | |
5042 <request_param_translation> | |
5043 <request_param galaxy_name="URL" remote_name="URL" missing=""> | |
5044 <append_param separator="&" first_separator="?" join="="> | |
5045 <value name="_export" missing="1" /> | |
5046 </append_param> | |
5047 </request_param> | |
5048 </request_param_tranlsation> | |
5049 ``` | |
5050 ]]></xs:documentation> | |
5051 </xs:annotation> | |
5052 <xs:attribute name="name" type="xs:string" use="required"> | |
5053 <xs:annotation> | |
5054 <xs:documentation xml:lang="en"><![CDATA[ | |
5055 Any valid HTTP request parameter name. The name / value pair must be received from the remote data source and will be appended to the value of URL as something like ``"&_export=1"`` (e.g. ``name="_export"``). | |
5056 ]]></xs:documentation> | |
5057 </xs:annotation> | |
5058 </xs:attribute> | |
5059 <xs:attribute name="missing" type="xs:string" use="required"> | |
5060 <xs:annotation> | |
5061 <xs:documentation xml:lang="en"><![CDATA[Must be a valid HTTP request parameter value (e.g. ``missing="1"``).]]></xs:documentation> | |
5062 </xs:annotation> | |
5063 </xs:attribute> | |
5064 </xs:complexType> | |
5065 | |
5066 <xs:complexType name="RequestParameterValueTranslation"> | |
5067 <xs:annotation> | |
5068 <xs:documentation xml:lang="en"><![CDATA[Optionally contained within the [request_param](#tool-request-param-translation-request-param) tag set. The parameter value received from a remote data source may be named differently in Galaxy, and this tag set allows for the value to be appropriately translated.]]></xs:documentation> | |
5069 </xs:annotation> | |
5070 <xs:sequence> | |
5071 <xs:element name="value" minOccurs="0" maxOccurs="unbounded" type="RequestParameterValueTranslationValue"/> | |
5072 </xs:sequence> | |
5073 </xs:complexType> | |
5074 | |
5075 <xs:complexType name="RequestParameterValueTranslationValue"> | |
5076 <xs:annotation> | |
5077 <xs:documentation xml:lang="en"><![CDATA[Contained within the [value_translation](#tool-request-param-translation-request-param-value-translation) tag set - allows for changing the data type value to something supported by Galaxy. | |
5078 | |
5079 Example: | |
5080 | |
5081 ```xml | |
5082 <request_param_translation> | |
5083 <request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" > | |
5084 <value_translation> | |
5085 <value galaxy_value="tabular" remote_value="primaryTable" /> | |
5086 </value_translation> | |
5087 </request_param> | |
5088 </request_param_tranlsation> | |
5089 ``` | |
5090 ]]></xs:documentation> | |
5091 </xs:annotation> | |
5092 <xs:attribute name="galaxy_value" type="xs:string" use="required"> | |
5093 <xs:annotation> | |
5094 <xs:documentation xml:lang="en"><![CDATA[ | |
5095 The target value (e.g. for setting data format: the list of supported data formats is contained in the | |
5096 [/config/datatypes_conf.xml.sample](https://github.com/galaxyproject/galaxy/blob/dev/config/datatypes_conf.xml.sample). | |
5097 ]]></xs:documentation> | |
5098 </xs:annotation> | |
5099 </xs:attribute> | |
5100 <xs:attribute name="remote_value" type="xs:string" use="required"> | |
5101 <xs:annotation> | |
5102 <xs:documentation xml:lang="en"><![CDATA[The value supplied by the remote data source application]]></xs:documentation> | |
5103 </xs:annotation> | |
5104 </xs:attribute> | |
5105 </xs:complexType> | |
5106 | |
5107 <xs:complexType name="Stdio"> | |
5108 <xs:annotation> | |
5109 <xs:documentation xml:lang="en"><![CDATA[Tools write the bulk of useful data to datasets, but they can also write messages to standard I/O (stdio) channels known as standard output (stdout) and standard error (stderr). Both stdout and stderr are typically written to the executing program's console or terminal. Previous versions of Galaxy checked stderr for execution errors - if any text showed up on stderr, then the tool's execution was marked as failed. However, many tools write messages to stderr that are not errors, and using stderr allows programs to redirect other interesting messages to a separate file. Programs may also exit with codes that indicate success or failure. One convention is for programs to return 0 on success and a non-zero exit code on failure. | |
5110 | |
5111 Legacy tools (ones with ``profile`` unspecified or a ``profile`` of less than | |
5112 16.04) will default to checking stderr for errors as described above. Newer | |
5113 tools will instead treat an exit code other than 0 as an error. The | |
5114 ``detect_errors`` on ``command`` can swap between these behaviors but the | |
5115 ``stdio`` directive allows more options in defining error conditions (though | |
5116 these aren't always intuitive). | |
5117 | |
5118 With ``stdio`` directive, Galaxy can use regular expressions to scan stdout and | |
5119 stderr, and it also allows exit codes to be scanned for ranges. The ``<stdio>`` | |
5120 tag has two subtags, ``<regex>`` and ``<exit_code>``, to define regular | |
5121 expressions and exit code processing, respectively. They are defined below. If a | |
5122 tool does not have any valid ``<regex>`` or ``<exit_code>`` tags, then Galaxy | |
5123 will use the previous technique for finding errors. | |
5124 | |
5125 A note should be made on the order in which exit codes and regular expressions | |
5126 are applied and how the processing stops. Exit code rules are applied before | |
5127 regular expression rules. The rationale is that exit codes are more clearly | |
5128 defined and are easier to check computationally, so they are applied first. Exit | |
5129 code rules are applied in the order in which they appear in the tool's | |
5130 configuration file, and regular expressions are also applied in the order in | |
5131 which they appear in the tool's configuration file. However, once a rule is | |
5132 triggered that causes a fatal error, no further rules are | |
5133 checked.]]></xs:documentation> | |
5134 | |
5135 </xs:annotation> | |
5136 <xs:sequence> | |
5137 <xs:group ref="StdioElement" minOccurs="0" maxOccurs="unbounded" /> | |
5138 </xs:sequence> | |
5139 </xs:complexType> | |
5140 | |
5141 <xs:group name="StdioElement"> | |
5142 <xs:choice> | |
5143 <xs:element name="regex" type="Regex"/> | |
5144 <xs:element name="exit_code" type="ExitCode"/> | |
5145 </xs:choice> | |
5146 </xs:group> | |
5147 | |
5148 <xs:complexType name="ExitCode"> | |
5149 <xs:annotation> | |
5150 <xs:documentation xml:lang="en"><![CDATA[ | |
5151 Tools may use exit codes to indicate specific execution errors. Many programs use 0 to indicate success and non-zero exit codes to indicate errors. Galaxy allows each tool to specify exit codes that indicate errors. Each ``<exit_code>`` tag defines a range of exit codes, and each range can be associated with a description of the error (e.g., "Out of Memory", "Invalid Sequence File") and an error level. The description just describes the condition and can be anything. The error level is either log, warning, fatal error, or fatal_oom. A warning means that stderr will be updated with the error's description. A fatal error means that the tool's execution will be marked as having an error and the workflow will stop. A fatal_oom indicates an out of memory condition and the job might be resubmitted if Galaxy is configured appropriately. Note that, if the error level is not supplied, then a fatal error is assumed to have occurred. | |
5152 | |
5153 The exit code's range can be any consecutive group of integers. More advanced ranges, such as noncontiguous ranges, are currently not supported. Ranges can be specified in the form "m:n", where m is the start integer and n is the end integer. If ":n" is specified, then the exit code will be compared against all integers less than or equal to n. If "m:" is used, then the exit code will be compared against all integers greater than or equal to m. If the exit code matches, then the error level is applied and the error's description is added to stderr. If a tool's exit code does not match any of the supplied ``<exit_code>`` tags' ranges, then no errors are applied to the tool's execution. | |
5154 | |
5155 Note that most Unix and Linux variants only support positive integers 0 to 255 for exit codes. If an exit code falls outside of this range, the usual convention is to only use the lower 8 bits for the exit code. The only known exception is if a job is broken into subtasks using the tasks runner and one of those tasks is stopped with a POSIX signal. (Note that signals should be used as a last resort for terminating processes.) In those cases, the task will receive -1 times the signal number. For example, suppose that a job uses the tasks runner and 8 tasks are created for the job. If one of the tasks hangs, then a sysadmin may choose to send the "kill" signal, SIGKILL, to the process. In that case, the task (and its job) will exit with an exit code of -9. More on POSIX signals can be found on [Wikipedia](https://en.wikipedia.org/wiki/Signal_(IPC)) as well as on the man page for "signal" (``man 7 signal``). | |
5156 | |
5157 The ``<exit_code>`` tag's supported attributes are as follows: | |
5158 | |
5159 * ``range``: This indicates the range of exit codes to check. The range can be one of the following: | |
5160 * ``n``: the exit code will only be compared to n; | |
5161 * ``[m:n]``: the exit code must be greater than or equal to m and less than or equal to n; | |
5162 * ``[m:]``: the exit code must be greater than or equal to m; | |
5163 * ``[:n]``: the exit code must be less than or equal to n. | |
5164 * ``level``: This indicates the error level of the exit code. If no level is specified, then the fatal error level will be assumed to have occurred. The level can have one of following values: | |
5165 * ``log`` and ``warning``: If an exit code falls in the given range, then a description of the error will be added to the beginning of the source, prepended with either 'Log:' or 'Warning:'. A log-level/warning-level error will not cause the tool to fail. | |
5166 * ``fatal``: If an exit code falls in the given range, then a description of the error will be added to the beginning of stderr. A fatal-level error will cause the tool to fail. | |
5167 * ``fatal_oom``: If an exit code falls in the given range, then a description of the error will be added to the beginning of stderr. Depending on the job configuration, a fatal_oom-level error will cause the tool to be resubmitted or fail. | |
5168 * ``description``: This is an optional description of the error that corresponds to the exit code. | |
5169 | |
5170 The following is an example of the ``<exit_code>`` tag: | |
5171 | |
5172 ```xml | |
5173 <stdio> | |
5174 <exit_code range="3:5" level="warning" description="Low disk space" /> | |
5175 <exit_code range="6:" level="fatal" description="Bad input dataset" /> | |
5176 <!-- Catching fatal_oom allows the job runner to potentially resubmit to a resource with more | |
5177 memory if Galaxy is configured to do this. --> | |
5178 <exit_code range="2" level="fatal_oom" description="Out of Memory" /> | |
5179 </stdio> | |
5180 ``` | |
5181 | |
5182 If the tool returns 0 or 1, then the tool will not be marked as having an error. | |
5183 If the exit code is 2, then the tool will fail with the description ``Out of | |
5184 Memory`` added to stderr. If the tool returns 3, 4, or 5, then the tool will not | |
5185 be marked as having failed, but ``Low disk space`` will be added to stderr. | |
5186 Finally, if the tool returns any number greater than or equal to 6, then the | |
5187 description ``Bad input dataset`` will be added to stderr and the tool will be | |
5188 marked as having failed. | |
5189 | |
5190 ]]></xs:documentation> | |
5191 </xs:annotation> | |
5192 <xs:attribute name="range" type="RangeType"> | |
5193 <xs:annotation> | |
5194 <xs:documentation xml:lang="en"></xs:documentation> | |
5195 </xs:annotation> | |
5196 </xs:attribute> | |
5197 <xs:attribute name="level" type="LevelType"> | |
5198 <xs:annotation> | |
5199 <xs:documentation xml:lang="en"></xs:documentation> | |
5200 </xs:annotation> | |
5201 </xs:attribute> | |
5202 <xs:attribute name="description" type="xs:string"> | |
5203 <xs:annotation> | |
5204 <xs:documentation xml:lang="en"></xs:documentation> | |
5205 </xs:annotation> | |
5206 </xs:attribute> | |
5207 </xs:complexType> | |
5208 | |
5209 | |
5210 <xs:complexType name="Regex"> | |
5211 <xs:annotation> | |
5212 <xs:documentation xml:lang="en"><![CDATA[ | |
5213 A regular expression defines a pattern of characters. The patterns include the following: | |
5214 | |
5215 * ``GCTA``, which matches on the fixed string "GCTA"; | |
5216 * ``[abcd]``, which matches on the characters a, b, c, or d; | |
5217 * ``[CG]{12}``, which matches on 12 consecutive characters that are C or G; | |
5218 * ``a.*z``, which matches on the character "a", followed by 0 or more characters of any type, followed by a "z"; | |
5219 * ``^X``, which matches the letter X at the beginning of a string; | |
5220 * ``Y$``, which matches the letter Y at the end of a string. | |
5221 | |
5222 There are many more possible regular expressions. A reference to all supported | |
5223 regular expressions can be found under | |
5224 [Python Regular Expression Syntax](https://docs.python.org/3/library/re.html#regular-expression-syntax). | |
5225 | |
5226 A regular expression includes the following attributes: | |
5227 | |
5228 * ``source``: This tells whether the regular expression should be matched against stdout, stderr, or both. If this attribute is missing or is incorrect, then both stdout and stderr will be checked. The source can be one of the following values: | |
5229 * ``stdout``: the regular expression will be applied to stdout; | |
5230 * ``stderr``: the regular expression will be applied to stderr; | |
5231 * ``both``: the regular expression will be applied to both stderr and stdout (which is the default case). | |
5232 * ``match``: This is the regular expression that will be used to match against stdout and/or stderr. If the ``<regex>`` tag does not contain the match attribute, then the ``<regex>`` tag will be ignored. The regular expression can be any valid Python regular expression. All regular expressions are performed case insensitively. For example, if match contains the regular expression "actg", then the regular expression will match against "actg", "ACTG", "AcTg", and so on. Also note that, if double quotes (") are to be used in the match attribute, then the value " can be used in place of double quotes. Likewise, if single quotes (') are to be used in the match attribute, then the value ' can be used if necessary. | |
5233 * ``level``: This works very similarly to the ``<exit_code>`` tag, except that, when a regular expression matches against its source, the description is added to the beginning of the source. For example, if stdout matches on a regular expression, then the regular expression's description is added to the beginning of stdout (instead of stderr). If no level is specified, then the fatal error level will be assumed to have occurred. The level can have one of following values: | |
5234 * ``log`` and ``warning``: If the regular expression matches against its source input (i.e., stdout and/or stderr), then a description of the error will be added to the beginning of the source, prepended with either 'Log:' or 'Warning:'. A log-level/warning-level error will not cause the tool to fail. | |
5235 * ``fatal``: If the regular expression matches against its source input, then a description of the error will be added to the beginning of the source. A fatal-level error will cause the tool to fail. | |
5236 * ``fatal_oom``: In contrast to fatal the job might be resubmitted if possible according to the job configuration. | |
5237 * ``description``: Just like its ``exit_code`` counterpart, this is an optional description of the regular expression that has matched. | |
5238 | |
5239 The following is an example of regular expressions that may be used: | |
5240 | |
5241 ```xml | |
5242 <stdio> | |
5243 <regex match="low space" | |
5244 source="both" | |
5245 level="warning" | |
5246 description="Low space on device" /> | |
5247 <regex match="error" | |
5248 source="stdout" | |
5249 level="fatal" | |
5250 description="Unknown error encountered" /> | |
5251 <!-- Catching fatal_oom allows the job runner to potentially resubmit to a resource with more | |
5252 memory if Galaxy is configured to do this. --> | |
5253 <regex match="out of memory" | |
5254 source="stdout" | |
5255 level="fatal_oom" | |
5256 description="Out of memory error occurred" /> | |
5257 <regex match="[CG]{12}" | |
5258 description="Fatal error - CG island 12 nts long found" /> | |
5259 <regex match="^Branch A" | |
5260 level="warning" | |
5261 description="Branch A was taken in execution" /> | |
5262 </stdio> | |
5263 ``` | |
5264 | |
5265 The regular expression matching proceeds as follows. First, if either stdout or | |
5266 stderr match on ``low space``, then a warning is registered. If stdout contained | |
5267 the string ``---LOW SPACE---``, then stdout has the string ``Warning: Low space | |
5268 on device`` added to its beginning. The same goes for if stderr had contained the | |
5269 string ``low space``. Since only a warning could have occurred, the processing | |
5270 continues. | |
5271 | |
5272 Next, the regular expression ``error`` is matched only against stdout. If stdout | |
5273 contains the string ``error`` regardless of its capitalization, then a fatal | |
5274 error has occurred and the processing stops. In that case, stdout would be | |
5275 prepended with the string ``Fatal: Unknown error encountered``. Note that, if | |
5276 stderr contained ``error``, ``ERROR``, or ``ErRor`` then it would not matter - | |
5277 stderr was not being scanned. | |
5278 | |
5279 If the second regular expression does not match, the regular expression "out of memory" | |
5280 is checked on stdout. If found, Galaxy tries to resubmit the job with more memory | |
5281 if configured correctly, otherwise the job fails. | |
5282 | |
5283 If the previous regular expressions does not match, then the fourth regular | |
5284 expression is checked. The fourth regular expression does not contain an error | |
5285 level, so an error level of ``fatal`` is assumed. The fourth regular expression | |
5286 also does not contain a source, so both stdout and stderr are checked. The fourth | |
5287 regular expression looks for 12 consecutive "C"s or "G"s in any order and in | |
5288 uppercase or lowercase. If stdout contained ``cgccGGCCcGGcG`` or stderr | |
5289 contained ``CCCCCCgggGGG``, then the regular expression would match, the tool | |
5290 would be marked with a fatal error, and the stream that contained the | |
5291 12-nucleotide CG island would be prepended with ``Fatal: Fatal error - CG island | |
5292 12 nts long found``. | |
5293 | |
5294 Finally, if the tool did not match any of the fatal errors, then the fifth | |
5295 regular expression is checked. Since no source is specified, both stdout and | |
5296 stderr are checked. If ``Branch A`` is at the beginning of stdout or stderr, then | |
5297 a warning will be registered and the source that contained ``Branch A`` will be | |
5298 prepended with the warning ``Warning: Branch A was taken in execution``. | |
5299 | |
5300 ]]></xs:documentation> | |
5301 </xs:annotation> | |
5302 <xs:attribute name="source" type="SourceType"> | |
5303 <xs:annotation> | |
5304 <xs:documentation xml:lang="en">This tells whether the regular expression should be matched against stdout, stderr, or both. If this attribute is missing or is incorrect, then both stdout and stderr will be checked. The source can be one of the following values:</xs:documentation> | |
5305 </xs:annotation> | |
5306 </xs:attribute> | |
5307 <xs:attribute name="match" type="xs:string"> | |
5308 <xs:annotation> | |
5309 <xs:documentation xml:lang="en">This is the regular expression that will be used to match against stdout and/or stderr.</xs:documentation> | |
5310 </xs:annotation> | |
5311 </xs:attribute> | |
5312 <xs:attribute name="level" type="LevelType"> | |
5313 <xs:annotation> | |
5314 <xs:documentation xml:lang="en">This works very similarly to the 'exit_code' tag, except that, when a regular expression matches against its source, the description is added to the beginning of the source.</xs:documentation> | |
5315 </xs:annotation> | |
5316 </xs:attribute> | |
5317 <xs:attribute name="description" type="xs:string"> | |
5318 <xs:annotation> | |
5319 <xs:documentation xml:lang="en">an optional description of the regular expression that has matched.</xs:documentation> | |
5320 </xs:annotation> | |
5321 </xs:attribute> | |
5322 </xs:complexType> | |
5323 | |
5324 <xs:complexType name="ChangeFormat"> | |
5325 <xs:annotation> | |
5326 <xs:documentation xml:lang="en"><![CDATA[See | |
5327 [extract_genomic_dna.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/extract_genomic_dna/extract_genomic_dna.xml) | |
5328 or the test tool | |
5329 [output_format.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/output_format.xml) | |
5330 for simple examples of how this tag set is used in a tool. This tag set is | |
5331 optionally contained within the ``<data>`` tag set and is the container tag set | |
5332 for the following ``<when>`` tag set.]]></xs:documentation> | |
5333 </xs:annotation> | |
5334 <xs:sequence> | |
5335 <xs:element name="when" type="ChangeFormatWhen" maxOccurs="unbounded"/> | |
5336 </xs:sequence> | |
5337 </xs:complexType> | |
5338 <xs:complexType name="ChangeFormatWhen"> | |
5339 <xs:annotation> | |
5340 <xs:documentation xml:lang="en"><![CDATA[ | |
5341 | |
5342 If the data type of the output dataset is the specified type, the data type is | |
5343 changed to the desired type. | |
5344 | |
5345 ### Examples | |
5346 | |
5347 Assume that your tool config includes the following select list parameter | |
5348 structure: | |
5349 | |
5350 ```xml | |
5351 <param name="out_format" type="select" label="Output data type"> | |
5352 <option value="fasta">FASTA</option> | |
5353 <option value="interval">Interval</option> | |
5354 </param> | |
5355 ``` | |
5356 | |
5357 Then whenever the user selects the ``interval`` option from the select list, the | |
5358 following structure in your tool config will override the ``format="fasta"`` setting | |
5359 in the ``<data>`` tag set with ``format="interval"``. | |
5360 | |
5361 ```xml | |
5362 <outputs> | |
5363 <data format="fasta" name="out_file1"> | |
5364 <change_format> | |
5365 <when input="out_format" value="interval" format="interval" /> | |
5366 </change_format> | |
5367 </data> | |
5368 </outputs> | |
5369 ``` | |
5370 | |
5371 See | |
5372 [extract_genomic_dna.xml](https://github.com/galaxyproject/tools-iuc/blob/master/tools/extract_genomic_dna/extract_genomic_dna.xml) | |
5373 or the test tool | |
5374 [output_format.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/output_format.xml) | |
5375 for more examples. | |
5376 | |
5377 ]]></xs:documentation> | |
5378 </xs:annotation> | |
5379 <xs:sequence/> | |
5380 <xs:attribute name="input" type="xs:string"> | |
5381 <xs:annotation> | |
5382 <xs:documentation xml:lang="en">This attribute should be the name of | |
5383 the desired input parameter (e.g. ``input="out_format"`` above).</xs:documentation> | |
5384 </xs:annotation> | |
5385 </xs:attribute> | |
5386 <xs:attribute name="value" type="xs:string" use="required"> | |
5387 <xs:annotation> | |
5388 <xs:documentation xml:lang="en">This must be a possible value of the ``input`` | |
5389 parameter (e.g. ``value="interval"`` above), or of the deprecated ``input_dataset``'s | |
5390 attribute.</xs:documentation> | |
5391 </xs:annotation> | |
5392 </xs:attribute> | |
5393 <xs:attribute name="format" type="xs:string" use="required"> | |
5394 <xs:annotation> | |
5395 <xs:documentation xml:lang="en">This value must be a supported data type | |
5396 (e.g. ``format="interval"``). See | |
5397 [/config/datatypes_conf.xml.sample](https://github.com/galaxyproject/galaxy/blob/dev/config/datatypes_conf.xml.sample) | |
5398 for a list of supported formats.</xs:documentation> | |
5399 </xs:annotation> | |
5400 </xs:attribute> | |
5401 <xs:attribute name="input_dataset" type="xs:string" gxdocs:deprecated="true"> | |
5402 <xs:annotation> | |
5403 <xs:documentation xml:lang="en">*Deprecated*.</xs:documentation> | |
5404 </xs:annotation> | |
5405 </xs:attribute> | |
5406 <xs:attribute name="attribute" type="xs:string" gxdocs:deprecated="true"> | |
5407 <xs:annotation> | |
5408 <xs:documentation xml:lang="en">*Deprecated*.</xs:documentation> | |
5409 </xs:annotation> | |
5410 </xs:attribute> | |
5411 </xs:complexType> | |
5412 | |
5413 <xs:complexType name="Citations"> | |
5414 <xs:annotation> | |
5415 <xs:documentation xml:lang="en"><![CDATA[Tool files may declare one | |
5416 citations element. Each citations element can contain one or more citation tag | |
5417 elements - each of which specifies tool citation information using either a DOI | |
5418 or a BibTeX entry. | |
5419 | |
5420 These citations will appear at the bottom of the tool form in a formatted way | |
5421 but the user will have to option to select RAW BibTeX for copying and pasting as | |
5422 well. Likewise, the history menu includes an option allowing users to aggregate | |
5423 all such citations across an analysis in a list of citations. | |
5424 | |
5425 BibTeX entries for citations annotated with DOIs will be fetched by Galaxy from | |
5426 https://doi.org/ and cached. | |
5427 | |
5428 ```xml | |
5429 <citations> | |
5430 <!-- Example of annotating a citation using a DOI. --> | |
5431 <citation type="doi">10.1093/bioinformatics/btq281</citation> | |
5432 | |
5433 <!-- Example of annotating a citation using a BibTex entry. --> | |
5434 <citation type="bibtex">@ARTICLE{Kim07aninterior-point, | |
5435 author = {Seung-jean Kim and Kwangmoo Koh and Michael Lustig and Stephen Boyd and Dimitry Gorinevsky}, | |
5436 title = {An interior-point method for large-scale l1-regularized logistic regression}, | |
5437 journal = {Journal of Machine Learning Research}, | |
5438 year = {2007}, | |
5439 volume = {8}, | |
5440 pages = {1519-1555} | |
5441 }</citation> | |
5442 </citations> | |
5443 ``` | |
5444 | |
5445 For more implementation information see the | |
5446 [pull request](https://bitbucket.org/galaxy/galaxy-central/pull-requests/440/initial-bibtex-doi-citation-support-in/diff) | |
5447 adding this feature. For more examples of how to add this to tools checkout the | |
5448 following commits adding this to the | |
5449 [NCBI BLAST+ suite](https://github.com/peterjc/galaxy_blast/commit/9d2e3906915895765ecc3f48421b91fabf2ccd8b), | |
5450 [phenotype association tools](https://bitbucket.org/galaxy/galaxy-central/commits/39c983151fe328ff5d415f6da81ce5b21a7e18a4), | |
5451 [MAF suite](https://bitbucket.org/galaxy/galaxy-central/commits/60f63d6d4cb7b73286f3c747e8acaa475e4b6fa8), | |
5452 and [MACS2 suite](https://github.com/jmchilton/galaxytools/commit/184971dea73e236f11e82b77adb5cab615b8391b). | |
5453 | |
5454 This feature was added to the August 2014 release of Galaxy, tools annotated | |
5455 with citations will work in older releases of Galaxy but no citation information | |
5456 will be available to the end user. | |
5457 ]]></xs:documentation> | |
5458 </xs:annotation> | |
5459 <xs:sequence> | |
5460 <xs:element name="citation" type="Citation" minOccurs="0" maxOccurs="unbounded"/> | |
5461 </xs:sequence> | |
5462 </xs:complexType> | |
5463 | |
5464 <xs:complexType name="Citation"> | |
5465 <xs:annotation> | |
5466 <xs:documentation xml:lang="en">Each citations element can contain one or | |
5467 more ``citation`` tag elements - each of which specifies tool citation | |
5468 information using either a DOI or a BibTeX entry.</xs:documentation> | |
5469 </xs:annotation> | |
5470 <xs:simpleContent> | |
5471 <xs:extension base="xs:string"> | |
5472 <xs:attribute name="type" type="CitationType" use="required"> | |
5473 <xs:annotation> | |
5474 <xs:documentation xml:lang="en">Type of citation - currently ``doi`` | |
5475 and ``bibtex`` are the only supported options.</xs:documentation> | |
5476 </xs:annotation> | |
5477 </xs:attribute> | |
5478 </xs:extension> | |
5479 </xs:simpleContent> | |
5480 </xs:complexType> | |
5481 | |
5482 <xs:simpleType name="CitationType"> | |
5483 <xs:annotation> | |
5484 <xs:documentation xml:lang="en">Type of citation represented.</xs:documentation> | |
5485 </xs:annotation> | |
5486 <xs:restriction base="xs:string"> | |
5487 <xs:enumeration value="bibtex"/> | |
5488 <xs:enumeration value="doi"/> | |
5489 </xs:restriction> | |
5490 </xs:simpleType> | |
5491 | |
5492 <xs:simpleType name="RequirementType"> | |
5493 <xs:annotation> | |
5494 <xs:documentation xml:lang="en">Documentation for RequirementType</xs:documentation> | |
5495 </xs:annotation> | |
5496 <xs:restriction base="xs:string"> | |
5497 <xs:enumeration value="python-module"/> | |
5498 <xs:enumeration value="binary"/> | |
5499 <xs:enumeration value="package"/> | |
5500 <xs:enumeration value="set_environment"/> | |
5501 </xs:restriction> | |
5502 </xs:simpleType> | |
5503 <xs:simpleType name="ContainerType"> | |
5504 <xs:annotation> | |
5505 <xs:documentation xml:lang="en">Type of container for tool execution.</xs:documentation> | |
5506 </xs:annotation> | |
5507 <xs:restriction base="xs:string"> | |
5508 <xs:enumeration value="docker"/> | |
5509 <xs:enumeration value="singularity"/> | |
5510 </xs:restriction> | |
5511 </xs:simpleType> | |
5512 <xs:simpleType name="ToolTypeType"> | |
5513 <xs:annotation> | |
5514 <xs:documentation xml:lang="en">Documentation for ToolTypeType</xs:documentation> | |
5515 </xs:annotation> | |
5516 <xs:restriction base="xs:string"> | |
5517 <xs:enumeration value="data_source"/> | |
5518 <xs:enumeration value="manage_data"/> | |
5519 <xs:enumeration value="interactive"/> | |
5520 <xs:enumeration value="expression"/> | |
5521 </xs:restriction> | |
5522 </xs:simpleType> | |
5523 <xs:simpleType name="URLmethodType"> | |
5524 <xs:annotation> | |
5525 <xs:documentation xml:lang="en">Documentation for URLmethodType</xs:documentation> | |
5526 </xs:annotation> | |
5527 <xs:restriction base="xs:string"> | |
5528 <xs:enumeration value="get"/> | |
5529 <xs:enumeration value="post"/> | |
5530 </xs:restriction> | |
5531 </xs:simpleType> | |
5532 <xs:simpleType name="TargetType"> | |
5533 <xs:annotation> | |
5534 <xs:documentation xml:lang="en">Documentation for TargetType</xs:documentation> | |
5535 </xs:annotation> | |
5536 <xs:restriction base="xs:string"> | |
5537 <xs:enumeration value="_top"/> | |
5538 <xs:enumeration value="_parent"/> | |
5539 </xs:restriction> | |
5540 </xs:simpleType> | |
5541 <xs:simpleType name="MethodType"> | |
5542 <xs:annotation> | |
5543 <xs:documentation xml:lang="en">Documentation for MethodType</xs:documentation> | |
5544 </xs:annotation> | |
5545 <xs:restriction base="xs:string"> | |
5546 <xs:enumeration value="basic"/> | |
5547 <xs:enumeration value="multi"/> | |
5548 </xs:restriction> | |
5549 </xs:simpleType> | |
5550 <xs:simpleType name="DisplayType"> | |
5551 <xs:annotation> | |
5552 <xs:documentation xml:lang="en">Documentation for DisplayType</xs:documentation> | |
5553 </xs:annotation> | |
5554 <xs:restriction base="xs:string"> | |
5555 <xs:enumeration value="checkboxes"/> | |
5556 <xs:enumeration value="radio"/> | |
5557 </xs:restriction> | |
5558 </xs:simpleType> | |
5559 <xs:simpleType name="HierarchyType"> | |
5560 <xs:annotation> | |
5561 <xs:documentation xml:lang="en">Documentation for HierarchyType</xs:documentation> | |
5562 </xs:annotation> | |
5563 <xs:restriction base="xs:string"> | |
5564 <xs:enumeration value="exact"/> | |
5565 <xs:enumeration value="recurse"/> | |
5566 </xs:restriction> | |
5567 </xs:simpleType> | |
5568 <xs:simpleType name="ValidatorType"> | |
5569 <xs:annotation> | |
5570 <xs:documentation xml:lang="en">Documentation for ValidatorType</xs:documentation> | |
5571 </xs:annotation> | |
5572 <xs:restriction base="xs:string"> | |
5573 <xs:enumeration value="empty_dataset"/> | |
5574 <xs:enumeration value="empty_extra_files_path"/> | |
5575 <xs:enumeration value="expression"/> | |
5576 <xs:enumeration value="regex"/> | |
5577 <xs:enumeration value="in_range"/> | |
5578 <xs:enumeration value="length"/> | |
5579 <xs:enumeration value="metadata"/> | |
5580 <xs:enumeration value="unspecified_build"/> | |
5581 <xs:enumeration value="no_options"/> | |
5582 <xs:enumeration value="empty_field"/> | |
5583 <xs:enumeration value="dataset_metadata_in_file"/> | |
5584 <xs:enumeration value="dataset_metadata_in_data_table"/> | |
5585 <xs:enumeration value="dataset_metadata_not_in_data_table"/> | |
5586 <xs:enumeration value="value_in_data_table"/> | |
5587 <xs:enumeration value="value_not_in_data_table"/> | |
5588 <xs:enumeration value="dataset_metadata_in_range"/> | |
5589 <xs:enumeration value="dataset_ok_validator"/> | |
5590 </xs:restriction> | |
5591 </xs:simpleType> | |
5592 <xs:simpleType name="FilterType"> | |
5593 <xs:annotation> | |
5594 <xs:documentation xml:lang="en"></xs:documentation> | |
5595 </xs:annotation> | |
5596 <xs:restriction base="xs:string"> | |
5597 <xs:enumeration value="data_meta"/> | |
5598 <xs:enumeration value="param_value"/> | |
5599 <xs:enumeration value="static_value"/> | |
5600 <xs:enumeration value="regexp"/> | |
5601 <xs:enumeration value="unique_value"/> | |
5602 <xs:enumeration value="multiple_splitter"/> | |
5603 <xs:enumeration value="add_value"/> | |
5604 <xs:enumeration value="remove_value"/> | |
5605 <xs:enumeration value="sort_by"/> | |
5606 </xs:restriction> | |
5607 </xs:simpleType> | |
5608 <xs:simpleType name="ActionsConditionalFilterType"> | |
5609 <xs:annotation> | |
5610 <xs:documentation xml:lang="en"></xs:documentation> | |
5611 </xs:annotation> | |
5612 <xs:restriction base="xs:string"> | |
5613 <xs:enumeration value="param_value"/> | |
5614 <xs:enumeration value="insert_column"/> | |
5615 <xs:enumeration value="column_strip"/> | |
5616 <xs:enumeration value="multiple_splitter"/> | |
5617 <xs:enumeration value="column_replace"/> | |
5618 <xs:enumeration value="metadata_value"/> | |
5619 <xs:enumeration value="boolean"/> | |
5620 <xs:enumeration value="string_function"/> | |
5621 </xs:restriction> | |
5622 </xs:simpleType> | |
5623 <xs:simpleType name="ActionType"> | |
5624 <xs:annotation> | |
5625 <xs:documentation xml:lang="en">Documentation for ActionType</xs:documentation> | |
5626 </xs:annotation> | |
5627 <xs:restriction base="xs:string"> | |
5628 <xs:enumeration value="format"/> | |
5629 <xs:enumeration value="metadata"/> | |
5630 </xs:restriction> | |
5631 </xs:simpleType> | |
5632 <xs:simpleType name="ActionsOptionType"> | |
5633 <xs:annotation> | |
5634 <xs:documentation xml:lang="en">Documentation for ActionsOptionType</xs:documentation> | |
5635 </xs:annotation> | |
5636 <xs:restriction base="xs:string"> | |
5637 <xs:enumeration value="from_data_table"/> | |
5638 <xs:enumeration value="from_param"/> | |
5639 <xs:enumeration value="from_file"/> | |
5640 </xs:restriction> | |
5641 </xs:simpleType> | |
5642 <xs:simpleType name="CompareType"> | |
5643 <xs:annotation> | |
5644 <xs:documentation xml:lang="en">Documentation for CompareType</xs:documentation> | |
5645 </xs:annotation> | |
5646 <xs:restriction base="xs:string"> | |
5647 <xs:enumeration value="startswith"/> | |
5648 <xs:enumeration value="re_search"/> | |
5649 </xs:restriction> | |
5650 </xs:simpleType> | |
5651 <xs:simpleType name="LevelType"> | |
5652 <xs:annotation> | |
5653 <xs:documentation xml:lang="en">Documentation for LevelType</xs:documentation> | |
5654 </xs:annotation> | |
5655 <xs:restriction base="xs:string"> | |
5656 <xs:enumeration value="fatal_oom"/> | |
5657 <xs:enumeration value="fatal"/> | |
5658 <xs:enumeration value="warning"/> | |
5659 <xs:enumeration value="log"/> | |
5660 <xs:enumeration value="qc"/> | |
5661 </xs:restriction> | |
5662 </xs:simpleType> | |
5663 <xs:simpleType name="RangeType"> | |
5664 <xs:annotation> | |
5665 <xs:documentation xml:lang="en">Documentation for RangeType</xs:documentation> | |
5666 </xs:annotation> | |
5667 <xs:restriction base="xs:string"> | |
5668 <xs:pattern value="\-?(\d)*:?\-?(\d)*"/> | |
5669 </xs:restriction> | |
5670 </xs:simpleType> | |
5671 <xs:simpleType name="SourceType"> | |
5672 <xs:annotation> | |
5673 <xs:documentation xml:lang="en">Documentation for SourceType</xs:documentation> | |
5674 </xs:annotation> | |
5675 <xs:restriction base="xs:string"> | |
5676 <xs:enumeration value="stdout"/> | |
5677 <xs:enumeration value="stderr"/> | |
5678 <xs:enumeration value="both"/> | |
5679 </xs:restriction> | |
5680 </xs:simpleType> | |
5681 <xs:simpleType name="TestOutputCompareType"> | |
5682 <xs:annotation> | |
5683 <xs:documentation xml:lang="en">Type of comparison to use when comparing | |
5684 test generated output files to expected output files. Currently valid value are | |
5685 ``diff`` (the default), ``re_match``, ``sim_size``, ``re_match_multiline``, | |
5686 and ``contains``.</xs:documentation> | |
5687 </xs:annotation> | |
5688 <xs:restriction base="xs:string"> | |
5689 <xs:enumeration value="diff"/> | |
5690 <xs:enumeration value="re_match"/> | |
5691 <xs:enumeration value="sim_size"/> | |
5692 <xs:enumeration value="re_match_multiline"/> | |
5693 <xs:enumeration value="contains"/> | |
5694 </xs:restriction> | |
5695 </xs:simpleType> | |
5696 <xs:simpleType name="PermissiveBoolean"> | |
5697 <xs:annotation> | |
5698 <xs:documentation xml:lang="en">Documentation for PermissiveBoolean</xs:documentation> | |
5699 </xs:annotation> | |
5700 <xs:restriction base="xs:string"> | |
5701 <xs:enumeration value="0"/> | |
5702 <xs:enumeration value="1"/> | |
5703 <xs:enumeration value="true"/> | |
5704 <xs:enumeration value="false"/> | |
5705 <xs:enumeration value="True"/> | |
5706 <xs:enumeration value="False"/> | |
5707 <xs:enumeration value="yes"/> | |
5708 <xs:enumeration value="no"/> | |
5709 </xs:restriction> | |
5710 </xs:simpleType> | |
5711 <xs:complexType name="EdamTopics"> | |
5712 <xs:annotation> | |
5713 <xs:documentation xml:lang="en"><![CDATA[ | |
5714 Container tag set for the ``<edam_topic>`` tags. | |
5715 A tool can have any number of EDAM topic references. | |
5716 | |
5717 ```xml | |
5718 <!-- Example: this tool is about 'Statistics and probability' (http://edamontology.org/topic_2269) --> | |
5719 <edam_topics> | |
5720 <edam_topic>topic_2269</edam_topic> | |
5721 </edam_topics> | |
5722 ``` | |
5723 ]]></xs:documentation> | |
5724 </xs:annotation> | |
5725 <xs:sequence> | |
5726 <xs:element name="edam_topic" minOccurs="0" maxOccurs="unbounded"> | |
5727 <xs:simpleType> | |
5728 <xs:restriction base="xs:string"> | |
5729 <xs:pattern value="topic_[0-9]{4}"></xs:pattern> | |
5730 </xs:restriction> | |
5731 </xs:simpleType> | |
5732 </xs:element> | |
5733 </xs:sequence> | |
5734 </xs:complexType> | |
5735 <xs:complexType name="EdamOperations"> | |
5736 <xs:annotation> | |
5737 <xs:documentation xml:lang="en"><![CDATA[ | |
5738 Container tag set for the ``<edam_operation>`` tags. | |
5739 A tool can have any number of EDAM operation references. | |
5740 | |
5741 ```xml | |
5742 <!-- Example: this tool performs a 'Conversion' operation (http://edamontology.org/operation_3434) --> | |
5743 <edam_operations> | |
5744 <edam_operation>operation_3434</edam_operation> | |
5745 </edam_operations> | |
5746 ``` | |
5747 | |
5748 ]]></xs:documentation> | |
5749 </xs:annotation> | |
5750 <xs:sequence> | |
5751 <xs:element name="edam_operation" minOccurs="0" maxOccurs="unbounded"> | |
5752 <xs:simpleType> | |
5753 <xs:restriction base="xs:string"> | |
5754 <xs:pattern value="operation_[0-9]{4}"></xs:pattern> | |
5755 </xs:restriction> | |
5756 </xs:simpleType> | |
5757 </xs:element> | |
5758 </xs:sequence> | |
5759 </xs:complexType> | |
5760 <xs:complexType name="xrefs"> | |
5761 <xs:annotation> | |
5762 <xs:documentation xml:lang="en"><![CDATA[ | |
5763 Container tag set for the ``<xref>`` tags. | |
5764 A tool can refer multiple reference IDs. | |
5765 | |
5766 ```xml | |
5767 <!-- Example: this tool is seqtk --> | |
5768 <xrefs> | |
5769 <xref type="bio.tools">seqtk</xref> | |
5770 </xrefs> | |
5771 <!-- https://bio.tools/seqtk --> | |
5772 ``` | |
5773 | |
5774 ]]></xs:documentation> | |
5775 </xs:annotation> | |
5776 <xs:sequence> | |
5777 <xs:element name="xref" type="xref" minOccurs="0" maxOccurs="unbounded"> | |
5778 </xs:element> | |
5779 </xs:sequence> | |
5780 </xs:complexType> | |
5781 <xs:complexType name="xref"> | |
5782 <xs:annotation> | |
5783 <xs:documentation xml:lang="en">The ``xref`` element specifies reference | |
5784 information according to a catalog.</xs:documentation> | |
5785 </xs:annotation> | |
5786 <xs:simpleContent> | |
5787 <xs:extension base="xs:string"> | |
5788 <xs:attribute name="type" type="xrefType" use="required"> | |
5789 <xs:annotation> | |
5790 <xs:documentation xml:lang="en">Type of reference - currently ``bio.tools`` | |
5791 is the only supported options.</xs:documentation> | |
5792 </xs:annotation> | |
5793 </xs:attribute> | |
5794 </xs:extension> | |
5795 </xs:simpleContent> | |
5796 </xs:complexType> | |
5797 <xs:simpleType name="xrefType"> | |
5798 <xs:annotation> | |
5799 <xs:documentation xml:lang="en">Type of Reference.</xs:documentation> | |
5800 </xs:annotation> | |
5801 <xs:restriction base="xs:string"> | |
5802 <xs:enumeration value="bio.tools"/> | |
5803 <!--xs:enumeration value="whatelse"/--> | |
5804 </xs:restriction> | |
5805 </xs:simpleType> | |
5806 | |
5807 </xs:schema> |