This repository was archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgalaxy.xsd
More file actions
5006 lines (4501 loc) · 208 KB
/
galaxy.xsd
File metadata and controls
5006 lines (4501 loc) · 208 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gxdocs="http://galaxyproject.org/xml/1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
>
<xs:annotation>
<xs:appinfo>Galaxy Schema</xs:appinfo>
<xs:documentation xml:lang="en">A Galaxy XML tool wrapper</xs:documentation>
</xs:annotation>
<xs:element name="tool">
<xs:annotation gxdocs:best_practices="tools">
<xs:documentation xml:lang="en"><![CDATA[
The outer-most tag set of tool XML files. Attributes on this tag apply to the
tool as a whole.
### Examples
A normal tool:
```xml
<tool id="seqtk_seq"
name="Convert FASTQ to FASTA"
version="1.0.0"
profile="16.04"
>
```
A ``data_source`` tool contains a few more relevant attributes.
```xml
<tool id="ucsc_table_direct1"
name="UCSC Main"
version="1.0.0"
hidden="false"
profile="16.01"
tool_type="data_source"
URL_method="post">
```
]]></xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<!-- TODO: Move the anyType further into macros def... -->
<xs:element name="macros" type="xs:anyType" minOccurs="0"/>
<xs:element name="requirements" type="Requirements" minOccurs="0"/>
<xs:element name="description" type="xs:string" minOccurs="0">
<xs:annotation gxdocs:best_practices="tool-descriptions">
<xs:documentation xml:lang="en"><![CDATA[The value is displayed in
the tool menu immediately following the hyperlink for the tool (based on the
``name`` attribute of the ``<tool>`` tag set described above).
### Example
```xml
<description>table browser</description>
```
]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="parallelism" type="Parallelism" minOccurs="0"/>
<xs:element name="version_command" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation xml:lang="en">< tag, this value is taken as a literal and so there is no
need to escape values like ``$`` and command inputs are not available for variable
substitution.
### Example
```xml
<version_command>tophat -version</version_command>
```
]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="action" type="ToolAction" minOccurs="0" maxOccurs="1" />
<xs:element name="environment_variables" type="EnvironmentVariables" minOccurs="0" maxOccurs="1"/>
<xs:element name="command" type="Command"/>
<xs:element name="request_parameter_translation" type="RequestParameterTranslation" minOccurs="0"/>
<xs:element name="configfiles" type="ConfigFiles" minOccurs="0"/>
<xs:element name="outputs" type="Outputs" minOccurs="0"/>
<xs:element name="inputs" type="Inputs" minOccurs="0"/>
<xs:element name="tests" type="Tests" minOccurs="0"/>
<xs:element name="stdio" type="Stdio" minOccurs="0"/>
<xs:element name="help" type="xs:string" minOccurs="0">
<xs:annotation gxdocs:best_practices="help-tag">
<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 http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html.
tag | details
--- | -------
``.. class:: warningmark`` | a yellow warning symbol
``.. class:: infomark`` | a blue information symbol
``.. image:: path-of-the-file.png :height: 500 :width: 600`` | insert a png file of height 500 and width 600 at this position |
``**bold**`` | bold
``*italic*`` | italic
``*`` | list
``-`` | list
``::`` | paragraph
``-----`` | a horizontal line
### Examples
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.
```xml
<help>
.. class:: warningmark
'''TIP''' This tool requires *fasta* format.
----
'''Example'''
Query sequence::
>seq1
ATCG...
.. image:: my_figure.png
:height: 500
:width: 600
</help>
```
]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="code" type="Code" minOccurs="0"/>
<xs:element name="uihints" type="UIhints" minOccurs="0"/>
<xs:element name="options" type="Options" minOccurs="0"/>
<xs:element name="trackster_conf" type="TracksterConf" minOccurs="0"/>
<xs:element name="citations" type="Citations" minOccurs="0"/>
</xs:all>
<xs:attribute name="id" type="xs:string" use="required">
<xs:annotation gxdocs:best_practices="tool-ids">
<xs:documentation xml:lang="en">Must be unique across all tools;
should be lowercase and contain only letters, numbers, and underscores.
It allows for tool versioning and metrics of the number of times a tool is used,
among other things.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation gxdocs:best_practices="tool-names">
<xs:documentation xml:lang="en">This string is what is displayed as a
hyperlink in the tool menu.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string" default="1.0.0">
<xs:annotation gxdocs:best_practices="tool-versions">
<xs:documentation xml:lang="en">This string defaults to ``1.0.0`` if it is not
included in the tag. It allows for tool versioning and should be increased with each new version
of the tool.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="hidden" type="PermissiveBoolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">Allows for tools to be loaded upon
server startup, but not displayed in the tool menu. This attribute should be
applied in the toolbox configuration instead and so should be considered
deprecated.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="display_interface" type="PermissiveBoolean">
<xs:annotation>
<xs:documentation xml:lang="en">Disable the display the tool's
graphical tool form by setting this to ``false``.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="tool_type" type="ToolTypeType">
<xs:annotation>
<xs:documentation xml:lang="en">Allows for certain framework
functionality to be performed on certain types of tools. Normal tools that execute
typical command-line jobs do not need to specify this, special kinds of tools such
as [Data Source](https://wiki.galaxyproject.org/Admin/Internals/DataSources) and
[Data Manager](https://wiki.galaxyproject.org/Admin/Tools/DataManagers) tools should
set this to have values such as ``data_source`` or ``manage_data``.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="profile" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">This string specified the minimum Galaxy
version that should be required to run this tool. Certain legacy behaviors such
as using standard error content to detect errors instead of exit code are disabled
automatically if profile is set to any version newer than ``16.01``, such as
``16.04``.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="workflow_compatible" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation xml:lang="en">This attribute indicates if
this tool is usable within a workflow (defaults to ``true`` for normal tools and
``false`` for data sources).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="URL_method" type="URLmethodType">
<xs:annotation>
<xs:documentation xml:lang="en">Only used if ``tool_type`` attribute value
is ``data_source`` - this attribute defines the HTTP request method to use when
communicating with an external data source application (the default is ``get``).</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:complexType name="ToolAction">
<xs:annotation>
<xs:documentation xml:lang="en">Describe the backend Python action to execute for this Galaxy tool.</xs:documentation>
</xs:annotation>
<xs:sequence>
</xs:sequence>
<xs:attribute name="module" type="xs:string" use="required">
</xs:attribute>
<xs:attribute name="class" type="xs:string" use="required">
</xs:attribute>
</xs:complexType>
<xs:complexType name="Requirements">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This is a container tag set for the ``requirement`` and ``container`` tags
described in greater detail below. ``requirement``s describe software packages
and other individual computing requirements required to execute a tool, while
``container``s describe Docker containers that should be able to serve as
complete descriptions of the runtime of a tool.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="requirement" type="Requirement" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="container" type="Container" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Requirement">
<xs:annotation>
<xs:documentation xml:lang="en"><, the
[Galaxy Tool Shed dependency management system](https://wiki.galaxyproject.org/ToolShedToolFeatures#Automatic_third-party_tool_dependency_installation_and_compilation_with_installed_repositories),
or [environment modules](http://modules.sourceforge.net/)).
Read more about dependency resolvers in Galaxy on
[docs.galaxyproject.org](https://docs.galaxyproject.org/en/master/admin/dependency_resolvers.html).
The current best practice for tool dependencies is to target Conda, this is
discussed in greater detail
[here](https://docs.galaxyproject.org/en/master/admin/conda_faq.html).
### Examples
This example shows a tool that requires the samtools 0.0.18 package.
This package is available via the Tool Shed (see
[Tool Shed dependency management](https://wiki.galaxyproject.org/ToolShedToolFeatures#Automatic_third-party_tool_dependency_installation_and_compilation_with_installed_repositories)
) as well as [Conda](https://docs.galaxyproject.org/en/master/admin/conda_faq.html)
and can be configured locally to adapt to any other package management system.
```xml
<requirements>
<requirement type="package" version="0.1.18">samtools</requirement>
</requirements>
```
This older example shows a tool that requires R version 2.15.1. The
``tool_depensencies.xml`` should contain matching declarations for Galaxy to
actually install the R runtime. The ``set_envirornment`` type is only respected
by the tool shed and is ignored by the newer and preferred conda dependency
resolver.
```xml
<requirements>
<requirement type="set_environment">R_SCRIPT_PATH</requirement>
<requirement type="package" version="2.15.1">R</requirement>
</requirements>
```
]]></xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="RequirementType" use="required">
<xs:annotation>
<xs:documentation xml:lang="en"> This value defines the which type of the 3rd party module required by this tool. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en"> For package type requirements this value defines a specific version of the tool dependency. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Container">
<xs:annotation>
<xs:documentation xml:lang="en"><.
]]></xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="ContainerType" use="required">
<xs:annotation>
<xs:documentation xml:lang="en"> This value describes the type of container that the tool may be executed in and currently must be 'docker'. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Parallelism">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for Parallelism</xs:documentation>
</xs:annotation>
<xs:attribute name="method" type="MethodType">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for method</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="merge_outputs" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for merge_outputs</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="split_inputs" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for split_inputs</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="split_size" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for split_size</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="split_mode" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for split_mode</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Code">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
**Deprecated** do not use this unless absolutely necessary.
This tag set provides detailed control of the way the tool is executed. This
(optional) code can be deployed in a separate file in the same directory as the
tool's config file. These hooks are being replaced by new tool config features
and methods in the ~/lib/galaxy/tools/__init__.py code file.
### Examples
#### Dynamic Options
Use associated dynamic select lists where selecting an option in the first
select list dynamically re-renders the options in the second select list. In
this example, we are populating both dynamic select lists from metadata elements
associated with a tool's single input dataset. The 2 metadata elements we're
using look like this.
```python
MetadataElement( name="field_names", default=[], desc="Field names", readonly=True, optional=True, visible=True, no_value=[] )
# The keys in the field_components map to the list of field_names in the above element
# which ensures order for select list options that are built from it.
MetadataElement( name="field_components", default={}, desc="Field names and components", readonly=True, optional=True, visible=True, no_value={} )
```
Our tool config includes a code file tag like this.
```xml
<code file="tool_form_utils.py" />
```
Here are the relevant input parameters in our tool config. The first parameter
is the input dataset that includes the above metadata elements.
```xml
<param name="input" type="data" format="vtkascii,vtkbinary" label="Shape with uncolored surface field">
<validator type="expression" message="Shape must have an uncolored surface field.">value is not None and len(value.metadata.field_names) > 0</validator>
</param>
```
The following parameter dynamically renders a select list consisting of the
elements in the ``field_names`` metadata element associated with the selected
input dataset.
```xml
<param name="field_name" type="select" label="Field name" refresh_on_change="True">
<options>
<filter type="data_meta" ref="input" key="field_names"/>
<validator type="no_options" message="The selected shape has no uncolored surface fields." />
</options>
</param>
```
The following parameter calls the ``get_field_components_options()`` function in
the ``tool_form_utils.py`` code file discussed above. This function returns the
value of the input dataset's ``field_components`` metadata element dictionary
whose key is the currently selected ``field_name`` from the select list parameter
above.
```xml
<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." />
```
Changing the selected option in the ``field_name`` select list will dynamically
re-render the options available in the associated ``field_component_index`` select
list, which is the behavior we want.
The ``get_field_components_options()`` method looks like this.
```python
def get_field_components_options( dataset, field_name ):
options = []
if dataset.metadata is None:
return options
if not hasattr( dataset.metadata, 'field_names' ):
return options
if dataset.metadata.field_names is None:
return options
if field_name is None:
# The expression validator that helps populate the select list of input
# datsets in the icqsol_color_surface_field tool does not filter out
# datasets with no field field_names, so we need this check.
if len( dataset.metadata.field_names ) == 0:
return options
field_name = dataset.metadata.field_names[0]
field_components = dataset.metadata.field_components.get( field_name, [] )
for i, field_component in enumerate( field_components ):
options.append( ( field_component, field_component, i == 0 ) )
return options
```
]]></xs:documentation>
</xs:annotation>
<xs:attribute name="file" type="xs:string" use="required">
<xs:annotation>
<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>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="UIhints">
<xs:annotation>
<xs:documentation xml:lang="en">Used only for data source tools, this directive contains UI options (currently only ``minwidth`` is valid).</xs:documentation>
</xs:annotation>
<xs:attribute name="minwidth" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation for minwidth</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Options">
<xs:annotation>
<xs:documentation xml:lang="en">This directive is used to specify some rarely modified options.</xs:documentation>
</xs:annotation>
<xs:attribute name="refresh" type="PermissiveBoolean">
<xs:annotation>
<xs:documentation xml:lang="en">Deprecated, likely unused attribute.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sanitize" type="PermissiveBoolean" default="true">
<xs:annotation>
<xs:documentation xml:lang="en">This attribute can be used to turn off all input sanitization for a tool.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TracksterConf">
<xs:annotation>
<xs:documentation xml:lang="en">This directive is used to specify some rarely modified trackster options.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="action" type="TracksterAction" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="TracksterAction">
<xs:annotation>
<xs:documentation xml:lang="en"></xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en"></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="output_name" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en"></xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Tests">
<xs:annotation gxdocs:best_practices="tests">
<xs:documentation xml:lang="en">< or the
[run_tests.sh](https://github.com/galaxyproject/galaxy/blob/dev/run_tests.sh)
shell script distributed with Galaxy.
The documentation contained here is mostly reference documentation, for
tutorials on writing tool tests please check out Planemo's
[Test-Driven Development](http://planemo.readthedocs.io/en/latest/writing_advanced.html#test-driven-development)
documentation or the much older wiki content for
[WritingTests](https://wiki.galaxyproject.org/Admin/Tools/WritingTests).
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="test" type="Test" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Test">
<xs:annotation>
<xs:documentation xml:lang="en"><
tool. Notice the way that the tool's inputs and outputs are defined.
```xml
<tests>
<test>
<param name="input" value="1.bed" ftype="bed" />
<param name="column" value="1"/>
<param name="order" value="ASC"/>
<param name="style" value="num"/>
<output name="out_file1" file="sort1_num.bed" ftype="bed" />
</test>
<test>
<param name="input" value="7.bed" ftype="bed" />
<param name="column" value="1"/>
<param name="order" value="ASC"/>
<param name="style" value="alpha"/>
<output name="out_file1" file="sort1_alpha.bed" ftype="bed" />
</test>
</tests>
```
The following example, tests the execution of the MAF-to-FASTA converter
([/tools/maf/maf_to_fasta.xml](https://github.com/galaxyproject/galaxy/blob/master/tools/maf/maf_to_fasta.xml)).
```xml
<tests>
<test>
<param name="input1" value="3.maf" ftype="maf"/>
<param name="species" value="canFam1"/>
<param name="fasta_type" value="concatenated"/>
<output name="out_file1" file="cf_maf2fasta_concat.dat" ftype="fasta"/>
</test>
</tests>
```
This test demonstrates verifying specific properties about a test output instead
of directly comparing it to another file. Here the file attribute is not
specified and instead a series of assertions is made about the output.
```xml
<test>
<param name="input" value="maf_stats_interval_in.dat" />
<param name="lineNum" value="99999"/>
<output name="out_file1">
<assert_contents>
<has_text text="chr7" />
<not_has_text text="chr8" />
<has_text_matching expression="1274\d+53" />
<has_line_matching expression=".*\s+127489808\s+127494553" />
<!-- 	 is XML escape code for tab -->
<has_line line="chr7	127471195	127489808" />
<has_n_columns n="3" />
</assert_contents>
</output>
</test>
```
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="expect_exit_code" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Describe the job's expected exit code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="expect_num_outputs" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Assert the number of outputs this test
should produce, this is useful to ensure ``filter`` directives are implemented correctly.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="expect_failure" type="PermissiveBoolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">Setting this to ``true`` indicates
the expectation is for the job fail. If set to ``true`` no job output checks may
be present in ``test`` definition.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maxseconds" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Maximum amount of time to let test run.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:group name="TestParamElement">
<xs:choice>
<xs:element name="param" type="TestParam" />
<xs:element name="repeat" type="TestRepeat" />
<xs:element name="conditional" type="TestConditional" />
<xs:element name="section" type="TestSection" />
<xs:element name="output" type="TestOutput" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="output_collection" type="TestOutputCollection"/>
<xs:element name="assert_command" type="TestAssertions">
<xs:annotation>
<xs:documentation xml:lang="en">Describe assertions about the job's
generated command-line.
$assertions
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="assert_stdout" type="TestAssertions">
<xs:annotation>
<xs:documentation xml:lang="en">Describe assertions about the job's
standard output.
$assertions
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="assert_stderr" type="TestAssertions">
<xs:annotation>
<xs:documentation xml:lang="en">Describe assertions about the job's
standard error.
$assertions
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:group>
<xs:complexType name="TestSection">
<xs:annotation>
<xs:documentation xml:lang="en"><)
contains a test case demonstrating this block. This test case appears below:
```xml
<test>
<section name="int">
<param name="inttest" value="12456" />
</section>
<section name="float">
<param name="floattest" value="6.789" />
</section>
<output name="out_file1">
<assert_contents>
<has_line line="12456" />
<has_line line="6.789" />
</assert_contents>
</output>
</test>
```
]]>
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">This value must match the name of the
associated input ``section``.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestConditional">
<xs:annotation>
<xs:documentation xml:lang="en"><
tool.
```xml
<!-- Can use nested conditional blocks as shown below to disambiguate
various nested parameters. -->
<test>
<conditional name="p1">
<param name="use" value="False"/>
</conditional>
<conditional name="p2">
<param name="use" value="True"/>
</conditional>
<conditional name="p3">
<param name="use" value="False"/>
</conditional>
<conditional name="files">
<param name="attach_files" value="True" />
<conditional name="p4">
<param name="use" value="True"/>
<param name="file" value="simple_line_alternative.txt" />
</conditional>
</conditional>
<output name="out_file1">
<assert_contents>
<has_line line="7 4 7" />
<has_line line="This is a different line of text." />
</assert_contents>
</output>
</test>
```
The [tophat2](https://github.com/galaxyproject/tools-devteam/blob/master/tools/tophat2/tophat2_wrapper.xml)
tool demonstrates a real tool that benefits from more structured test cases
using the ``conditional`` test directive. One such test case from that tool is
shown below.
```xml
<!-- Test base-space paired-end reads with user-supplied reference fasta and full parameters -->
<test>
<!-- TopHat commands:
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
Replace the + with double-dash
Rename the files in tmp_dir appropriately
-->
<conditional name="singlePaired">
<param name="sPaired" value="paired"/>
<param name="input1" ftype="fastqsanger" value="tophat_in2.fastqsanger"/>
<param name="input2" ftype="fastqsanger" value="tophat_in3.fastqsanger"/>
<param name="mate_inner_distance" value="20"/>
<param name="report_discordant_pairs" value="Yes" />
</conditional>
<param name="genomeSource" value="indexed"/>
<param name="index" value="tophat_test"/>
<conditional name="params">
<param name="settingsType" value="full"/>
<param name="library_type" value="FR Unstranded"/>
<param name="read_mismatches" value="5"/>
<!-- Error: the read mismatches (5) and the read gap length (2) should be less than or equal to the read edit dist (2) -->
<param name="read_edit_dist" value="5" />
<param name="bowtie_n" value="Yes"/>
<param name="mate_std_dev" value="20"/>
<param name="anchor_length" value="8"/>
<param name="splice_mismatches" value="0"/>
<param name="min_intron_length" value="70"/>
<param name="max_intron_length" value="500000"/>
<param name="max_multihits" value="40"/>
<param name="min_segment_intron" value="50" />
<param name="max_segment_intron" value="500000" />
<param name="seg_mismatches" value="2"/>
<param name="seg_length" value="25"/>
<conditional name="indel_search">
<param name="allow_indel_search" value="No"/>
</conditional>
<conditional name="own_junctions">
<param name="use_junctions" value="Yes" />
<conditional name="gene_model_ann">
<param name="use_annotations" value="No" />
</conditional>
<conditional name="raw_juncs">
<param name="use_juncs" value="No" />
</conditional>
<conditional name="no_novel_juncs">
<param name="no_novel_juncs" value="No" />
</conditional>
</conditional>
<conditional name="coverage_search">
<param name="use_search" value="No" />
</conditional>
<param name="microexon_search" value="Yes" />
<conditional name="bowtie2_settings">
<param name="b2_settings" value="No" />
</conditional>
<!-- Fusion search params -->
<conditional name="fusion_search">
<param name="do_search" value="Yes" />
<param name="anchor_len" value="21" />
<param name="min_dist" value="10000021" />
<param name="read_mismatches" value="3" />
<param name="multireads" value="4" />
<param name="multipairs" value="5" />
<param name="ignore_chromosomes" value="chrM"/>
</conditional>
</conditional>
<conditional name="readGroup">
<param name="specReadGroup" value="no" />
</conditional>
<output name="junctions" file="tophat2_out4j.bed" />
<output name="accepted_hits" file="tophat_out4h.bam" compare="sim_size" />
</test>
```
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">This value must match the name of the
associated input ``conditional``.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestRepeat">
<xs:annotation>
<xs:documentation xml:lang="en"><
demonstrates the use of this directive.
This first test case demonstrates that this block allows different values for
the ``param`` named ``input`` to be tested even though this parameter name
appears in two different ``<repeat>`` elements in the ``<inputs>`` definition.
```xml
<!-- Can disambiguate repeats and specify multiple blocks using,
nested structure. -->
<test>
<repeat name="queries">
<param name="input" value="simple_line.txt"/>
</repeat>
<repeat name="more_queries">
<param name="input" value="simple_line_alternative.txt"/>
</repeat>
<output name="out_file1">
<assert_contents>
<has_line line="This is a line of text." />
<has_line line="This is a different line of text." />
</assert_contents>
</output>
</test>
```
The second definition in that file demonstrates repeated ``<repeat>`` blocks
allowing multiple instances of a single repeat to be specified.
```xml
<!-- Multiple such blocks can be specified but only with newer API
driven tests. -->
<test>
<repeat name="queries">
<param name="input" value="simple_line.txt"/>
</repeat>
<repeat name="queries">
<param name="input" value="simple_line_alternative.txt"/>
</repeat>
<repeat name="more_queries">
<param name="input" value="simple_line.txt"/>
</repeat>
<repeat name="more_queries">
<param name="input" value="simple_line_alternative.txt"/>
</repeat>
<output name="out_file1" file="simple_lines_interleaved.txt"/>
</test>
```
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="TestParamElement" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">This value must match the name of the
associated input ``repeat``.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestParam">
<xs:annotation>
<xs:documentation xml:lang="en">< documentation for
some simple examples of parameters.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="collection" type="TestCollection" minOccurs="0" maxOccurs="1" />
<xs:element name="composite_data" type="TestCompositeData" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="metadata" type="TestParamMetadata" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">This value must match the name of the
associated input parameter (``param``).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">This value must be one of the legal
values that can be assigned to an input parameter.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ftype" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">This attribute name should be included
only with parameters of ``type`` ``data`` for the tool. If this
attribute name is not included, the functional test framework will attempt to
determine the data type for the input dataset using the data type sniffers.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbkey" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Specifies a ``dbkey`` value for the
referenced input dataset. This is only valid if the corresponding parameter is
of ``type`` ``data``.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestCompositeData">
<xs:annotation>
<xs:documentation xml:lang="en">Define extra composite input files for test input.</xs:documentation>
</xs:annotation>
<xs:attribute name="value" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">Path relative to test-data of composite file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ftype" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Optional datatype of composite file for test input.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestCollection">