-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathgalaxy.xsd
8247 lines (7516 loc) · 378 KB
/
galaxy.xsd
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.
### Tool profile
List of behavior changes associated with profile versions:
#### 16.04
- Disable implicit extra file collection. All dynamic extra file collection requires a `discover_datasets` tag.
- Disable `format="input"` and require explicit metadata targets (`metadata_source`, `format_source`).
- Disable `interpreter` use `$__tool_directory__`.
- Disable `$param_file` use `configfile`.
- Disable default tool version of 1.0.0.
- Use non zero exit code as default stdio error condition (before non-empty stderr).
#### 17.09
- Introduce `provided_metadata_style` with default `"default"`. Restore legacy behavior by setting
this to `"legacy"`.
#### 18.01
- Use a separate home directory for each job.
#### 18.09
- References to other inputs need to be fully qualified by using `|`.
- Do not allow provided but illegal default values.
- Do not use Galaxy python environment for `manage_data` tools.
#### 19.05
- Change default Python version from 2.7 to 3.5
#### 20.05
- json config files:
- unselected optional `select` and `data_column` parameters get `None` instead of `"None"`
- multiple `select` and `data_column` parameters are lists (before comma separated string)
#### 20.09
- Exit immediately if a command exits with a non-zero status (`set -e`).
- Assume sort order for collection elements.
### 21.09
- Do not strip leading and trailing whitespaces in `from_work_dir` attribute.
- Do not use Galaxy Python virtual environment for `data_source` tools. `data_source` tools should explicitly use the `galaxy-util` package.
### 23.0
- Text parameters that are inferred to be optional (i.e the `optional` tag is not set, but the tool parameter accepts an empty string)
are set to `None` for templating in Cheetah. Older tools receive the empty string `""` as the templated value.
### 24.0
- Do not use Galaxy python environment for `data_source_async` tools.
- Drop request parameters received by data source tools that are not declared in `<request_param_translation>` section.
### 24.2
- require a valid `data_ref` attribute for `data_column` parameters
### 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="Macros" minOccurs="0"/>
<xs:element name="edam_topics" type="EdamTopics" minOccurs="0"/>
<xs:element name="edam_operations" type="EdamOperations" minOccurs="0"/>
<xs:element name="xrefs" type="xrefs" minOccurs="0"/>
<xs:element name="creator" type="Creator" minOccurs="0"/>
<xs:element name="requirements" type="Requirements" minOccurs="0"/>
<xs:element name="required_files" type="RequiredFiles" minOccurs="0"/>
<xs:element name="entry_points" type="EntryPoints" minOccurs="0" maxOccurs="1"/>
<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="VersionCommand" minOccurs="0"/>
<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" minOccurs="0" maxOccurs="1"/>
<xs:element name="expression" type="Expression" minOccurs="0" maxOccurs="1"/>
<xs:element name="request_param_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="Help" minOccurs="0" maxOccurs="1"/>
<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 allows for tool versioning
and should be increased with each new version of the tool. The value should
follow the [PEP 440](https://www.python.org/dev/peps/pep-0440/) specification.
It defaults to ``1.0.0`` if it is not included in the tag.</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://docs.galaxyproject.org/en/latest/dev/data_source.html) and
[Data Manager](https://galaxyproject.org/admin/tools/data-managers/) tools should
set this to have values such as ``data_source``, ``data_source_async`` or
``manage_data``.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="profile" type="xs:string">
<xs:annotation gxdocs:best_practices="tool-profile">
<xs:documentation xml:lang="en">This string specifies 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``. See above
for the list of behavior changes associated with profile versions.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="license" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">This string specifies any full URI or a
a short [SPDX](https://spdx.org/licenses/) identifier for a license for this tool
wrapper. The tool wrapper version can be indepedent of the underlying tool. This
license covers the tool XML and associated scripts shipped with the tool.
This is interpreted as [schema.org/license](https://schema.org/license) property.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="python_template_version" type="xs:float">
<xs:annotation>
<xs:documentation xml:lang="en">This string specifies the minimum Python
version that is able to fill the Cheetah sections of the tool. If unset defaults
to 2.7 if the profile is older than 19.05, otherwise defaults to 3.5. Galaxy will
attempt to convert Python statements in Cheetah sections using [future](http://python-future.org/)
if Galaxy is run on Python 3 and ``python_template_version`` is below 3.</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">*Deprecated* and ignored,
use a [request_param](#tool-request-param-translation-request-param) element with ``galaxy_name="URL_method"`` instead.
Was only used if ``tool_type`` attribute value is ``data_source`` or ``data_source_async`` -
this attribute defined the HTTP request method to use when communicating with an external data source application
(default: ``get``).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="require_login" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">Documentation needed</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:complexType name="Macros">
<xs:annotation>
<xs:documentation xml:lang="en">Frequently, tools may require the same XML
fragments be repeated in a file (for instance similar conditional branches,
repeated options, etc...) or among tools in the same repository. Galaxy tools
have a macro system to address this problem.
For more information, see [planemo documentation](https://planemo.readthedocs.io/en/latest/writing_advanced.html#macros-reusable-elements)</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="import" type="MacroImportType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
The ``import`` element allows specifying an XML file containing shared macro definitions that can then
be reused by all the tools contained in the same directory/repository.
Example:
````
<macros>
<import>macros.xml</import>
</macros>
````]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="token" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
The ``token`` element defines a value, like a constant, that can then be replaced anywhere in any tool importing the token.
Definition example:
````
<macros>
<token name="@TOOL_VERSION@">1.0.0</token>
</macros>
````
Usage example:
````
<requirements>
<requirement type="package" version="@TOOL_VERSION@">mypackage</requirement>
</requirements>
````]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="xml" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
The ``xml`` element, inside macros, allows defining a named XML fragment that can be reused (expanded) anywhere in the tool or tools that use the macro.
Definition example:
````
<macros>
<xml name="citations">
<citations>
....
</citations>
</xml>
</macros>
````
Usage example:
````
<expand macro="citations" />
````
]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="macro" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
A generalisation for macro tokens, templates and xml macros, i.e.
`<macro name="an_xml_macro" type="xml">` is identical to `<xml name="an_xml_macro">`,
`<macro name="a_template" type="template">` is identical to `<template name="a_template">`, and
`<macro name="a_token" type="xml">` is identical to `<token name="a_token">`.
]]></xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EntryPoints">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This is a container tag set for the ``entry_point`` tag that contains ``port`` and ``url`` tags
described in greater detail below. ``entry_point``s describe InteractiveTool entry points
to a tool.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="entry_point" type="EntryPoint" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EntryPoint" mixed="true">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This tag set is contained within the ``<entry_point>`` tag set. Access to entry point
ports and urls are included in this tag set. These are used by InteractiveTools
to provide access to graphical tools in real-time.
```xml
<entry_points>
<entry_point name="Example name" label="example">
<port>80</port>
<url>landing/${template_enabled}/index.html</url>
</entry_point>
</entry_points>
```
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="port" type="EntryPointPort" minOccurs="1" maxOccurs="1"/>
<xs:element name="url" type="EntryPointURL" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">The name of the entry point.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="label" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">A unique label to identify the entry point. Used by interactive client tools to connect.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requires_domain" type="PermissiveBoolean" default="true">
<xs:annotation>
<xs:documentation xml:lang="en">Whether domain-based proxying is required for the entry point. Default is True.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requires_path_in_url" type="PermissiveBoolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
Whether the InteractiveTool proxy will add the entry point path to the URL provided to the interactive tool. Only
relevant when path-based proxying is configured (``requires_domain=False``). A value of False implies that the web service
for the interactive tool fully operates with relative links. A value of True implies that the unique entry point path,
which is autogenerated each run, must be somehow provided to the web service. This can be done by injecting the path
into an environment variable by setting the attribute ``inject="entry_point_path_for_label"`` in the tool XML.
Alternatively, the attribute ``requires_path_in_header_named`` can be set to provide the path in the specified HTTP header.
The entry point path should in any case be used to configure the web service in the interactive tool to serve the content
from the provided URL path. Default value of ``requires_path_in_url`` is False.
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requires_path_in_header_named" type="xs:string" default="">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
Whether the InteractiveTool proxy will add the entry point path to an HTTP header. An empty string as value (default) means
that the path will not be provided in an HTTP header. Any other string value will define the name of the HTTP header
where the path will be injected by the proxy. See the documentation of ``requires_path_in_url`` for more information.
Default value of ``requires_path_in_header_named`` is False.
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="EntryPointPort" mixed="true">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This tag set is contained within the ``<entry_point>`` tag set. It contains the entry port.
]]></xs:documentation>
</xs:annotation>
</xs:complexType>
<xs:complexType name="EntryPointURL" mixed="true">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This tag set is contained within the ``<entry_point>`` tag set. It contains the entry URL.
]]></xs:documentation>
</xs:annotation>
</xs:complexType>
<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:attributeGroup name="Thing">
<xs:attribute name="name" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/name](https://schema.org/name)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="url" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/url](https://schema.org/url)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="identifier" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/identifier](https://schema.org/identifier)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="image" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/image](https://schema.org/image)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="address" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/address](https://schema.org/address)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="email" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/email](https://schema.org/email)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="telephone" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/telephone](https://schema.org/telephone)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="faxNumber" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/faxNumber](https://schema.org/faxNumber)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="alternateName" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/alternateName](https://schema.org/alternateName)</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:complexType name="Person">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
Describes a person. Tries to stay close to [schema.org/Person](https://schema.org/Person).
]]></xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="Thing"/>
<xs:attribute name="givenName" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/givenName](https://schema.org/givenName)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="familyName" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/familyName](https://schema.org/familyName)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="honorificPrefix" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/honorificPrefix](https://schema.org/honorificPrefix)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="honorificSuffix" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/honorificSuffix](https://schema.org/honorificSuffix)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="jobTitle" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">[schema.org/jobTitle](https://schema.org/jobTitle)</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Organization">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
Describes an organization. Tries to stay close to [schema.org/Organization](https://schema.org/Organization).
]]></xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="Thing"/>
</xs:complexType>
<xs:group name="PersonOrOrganization">
<xs:choice>
<xs:element name="person" type="Person"/>
<xs:element name="organization" type="Organization"/>
</xs:choice>
</xs:group>
<xs:complexType name="Creator">
<xs:annotation>
<xs:documentation xml:lang="en">The creator(s) of this work. See [schema.org/creator](https://schema.org/creator).</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="PersonOrOrganization" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RequiredFiles">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This declaration is used to define files that must be shipped from the tool directory
for the tool to function properly in remote environments where the tool directory
is not available to the job.
All includes should be list before excludes. By default, the exclude list includes
the tool-data/**, test-data/**, and .hg/** glob patterns.
Pulsar hacks to implicitly find referenced files from the tool directory will be disabled
when this block is used. A future Galaxy tool profile version may disable these hacks
altogether and specifying this block for all referenced files should be considered a best
practice.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="include" type="RequiredFileInclude" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="exclude" type="RequiredFileExclude" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="extend_default_excludes" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation xml:lang="en">Set this to `false` to override the default excludes for mercurial, reference, and test data.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="RequiredFileReferenceType">
<xs:annotation>
<xs:documentation xml:lang="en">How are files referenced in RequiredFileIncludes and RequiredFileExcludes. Paths are matched relative to the tool directory. `literal` must match the filename exactly. `prefix` will match paths based on their start. `glob` and `regex` use patterns to match files.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="literal"/>
<xs:enumeration value="prefix"/>
<xs:enumeration value="glob"/>
<xs:enumeration value="regex"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="RequiredFileInclude">
<xs:annotation>
<xs:documentation xml:lang="en">Describe files to include when relocating tool directory for remote execution.</xs:documentation>
</xs:annotation>
<xs:attribute name="type" type="RequiredFileReferenceType">
<xs:annotation>
<xs:documentation xml:lang="en">Type of file reference `path` is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="path" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Path to referenced files - this should be relative to the tool's directory (this is the file the tool is located in not the repository directory if these conflict).</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="RequiredFileExclude">
<xs:annotation>
<xs:documentation xml:lang="en">Describe files to exclude when relocating tool directory for remote execution.</xs:documentation>
</xs:annotation>
<xs:attribute name="type" type="RequiredFileReferenceType">
<xs:annotation>
<xs:documentation xml:lang="en">Type of file reference `path` is.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="path" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Path to referenced files - this should be relative to the tool's directory (this is the file the tool is located in not the repository directory if these conflict).</xs:documentation>
</xs:annotation>
</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``, ``resource`` 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 or Singularity 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:element name="resource" type="Resource" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Requirement">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This tag set is contained within the ``<requirements>`` tag set. Third party
programs or modules that the tool depends upon are included in this tag set.
When a tool runs, Galaxy attempts to *resolve* these requirements (also called
dependencies). ``requirement``s are meant to be abstract and resolvable by
multiple different [dependency resolvers](../admin/dependency_resolvers) (e.g. [conda](https://conda.io/), the
[Galaxy Tool Shed dependency management system](https://galaxyproject.org/toolshed/tool-features/),
or [environment modules](https://modules.sourceforge.net/)).
The current best practice for tool dependencies is to [target Conda](../admin/conda_faq).
### 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://galaxyproject.org/toolshed/tool-features/)
) as well as [Conda](../admin/conda_faq)
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_dependencies.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">Valid values are ``package``, ``set_environment``, ``python-module`` (deprecated), ``binary`` (deprecated)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">For requirements of type ``package`` 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="Resource">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
Allows to describe a resource requirement of a tool. At the moment this tag is mostly descriptive,
It can be used by dynamic job rules and serves to guide Galaxy admins.
]]></xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="ResourceType" use="required">
<xs:annotation>
<xs:documentation xml:lang="en">This value describes the type of resource required by the tool at runtime. Not yet implemented in Galaxy.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Container">
<xs:annotation>
<xs:documentation xml:lang="en"><![CDATA[
This tag set is contained within the 'requirements' tag set. Galaxy can be
configured to run tools within [Docker](https://www.docker.com/) or [Singularity](https://www.sylabs.io/singularity/)
containers - this tag allows the tool to suggest possible valid containers for this tool. The contents of the tag should
be a container image identifier appropriate for the particular container runtime being used, e.g.
``quay.io/biocontainers/fastqc:0.11.2--1`` for Docker or ``docker://quay.io/biocontainers/fastqc:0.11.2--1``
(or alternatively ``/opt/containers/fastqc.simg`` if your Galaxy installation will be loading the image from a filesystem path)
for Singularity. The ``requirements`` tag can contain multiple ``container`` tags describing suitable container options, in
which case the first container that is found by the Galaxy container resolver at runtime will be used.
Example:
```xml
<requirements>
<container type="docker">quay.io/biocontainers/fastqc:0.11.2--1</container>
</requirements>
```
Read more about configuring Galaxy to run Docker jobs
[here](https://docs.galaxyproject.org/en/master/admin/container_resolvers.html).
]]></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 may be ``docker`` or ``singularity``.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="HelpFormatType">
<xs:annotation>
<xs:documentation xml:lang="en">Document type of tool help</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="restructuredtext"/>
<xs:enumeration value="markdown"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Help">
<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 [here](https://docutils.sourceforge.io/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:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="format" type="HelpFormatType">
<xs:annotation>
<xs:documentation xml:lang="en">Valid values are ``restructuredtext`` and ``markdown``</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">A comma-separated list of data inputs to split for job parallelization.</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:attribute name="shared_inputs" type="xs:string">
<xs:annotation>
<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>
</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.
The extensions described here can cause problems using your tool with certain components
of Galaxy (like the workflow system). It is highly recommended to avoid these constructs
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](https://github.com/galaxyproject/galaxy/blob/dev/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"/>
</options>
<validator type="no_options" message="The selected shape has no uncolored surface fields." />
</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
```
#### Parameter Validation
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:
```python
def validate(incoming):
"""Validator for the plotting program"""
bins = incoming.get("bins","")
col = incoming.get("col","")
if not bins or not col:
raise Exception, "You need to specify a number for bins and columns"
try:
bins = int(bins)
col = int(col)
except:
raise Exception, "Parameters are not integers, columns:%s, bins:%s" % (col, bins)
if not 1<bins<100:
raise Exception, "The number of bins %s must be a number between 1 and 100" % bins
```
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.
#### Pre-job and pre-process code
The signature of both of these is the same:
```python
def exec_before_job(inp_data, out_data, param_dict, tool):
def exec_before_process(inp_data, out_data, param_dict, tool):
```
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.
Example:
```python
def exec_before_process(inp_data, out_data, param_dict, tool):
for name, data in out_data.items():
data.name = 'New name'
```
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.
#### Post-process code
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``:
```python
from galaxy import datatypes
def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
ext = param_dict.get('extension', 'text')
items = out_data.items()
for name, data in items:
newdata = datatypes.factory(ext)(id=data.id)
for key, value in data. __dict__.items():
setattr(newdata, key, value)
newdata.ext = ext
out_data[name] = newdata
```
The content of ``stdout`` and ``stderr`` are strings containing the output of the process.
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="hook" type="CodeHook" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<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>