Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 67 additions & 28 deletions planemo/xml/xsd/tool/galaxy.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ hyperlink in the tool menu.</xs:documentation>
</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: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">
Expand Down Expand Up @@ -471,8 +472,8 @@ This function is called before the tool is executed. If it raises any exceptions
```python
def validate(incoming):
"""Validator for the plotting program"""


bins = incoming.get("bins","")
col = incoming.get("col","")

Expand Down Expand Up @@ -523,8 +524,8 @@ This code executes after the background process running the tool finishes its ru
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:
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)
Expand Down Expand Up @@ -2120,7 +2121,7 @@ effectively be a list with one ``None``-like entity in it.

The following idiom can be used to iterate over such a list and build a hypothetical ``-B``
parameter for each file - the ``if`` block is used to handle the case where a ``None``-like
entity appears in the list because no files were selected:
entity appears in the list because no files were selected:

```
#for $input in $input1
Expand Down Expand Up @@ -2210,7 +2211,7 @@ sanitizer to prevent Galaxy from escaping the result.
```xml
<param name="feature_color" type="color" label="Default feature color" value="#ff00ff">
<sanitizer>
<valid initial="string.letters,string.digits">
<valid initial="string.ascii_letters,string.digits">
<add value="#" />
</valid>
</sanitizer>
Expand Down Expand Up @@ -2656,6 +2657,8 @@ be escaped with a backslash (``\``) when appearing in ``command`` or ``configfil
Name | Description
---- | -----------
``\${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).
``\$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.
``\$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.

See the [Planemo docs](https://planemo.readthedocs.io/en/latest/writing_advanced.html#cluster-usage)
on the topic of ``GALAXY_SLOTS`` for more information and examples.
Expand All @@ -2668,8 +2671,9 @@ If present on the ``command`` tag, this attribute can be one of:

* ``default`` no-op fallback to ``stdio`` tags and erroring on standard error output (for legacy tools).
* ``exit_code`` error if tool exit code is not 0. (The @jmchilton recommendation).
* ``aggressive`` error if tool exit code is not 0 or either ``Exception:`` or ``Error:``
appears in standard error/output. (The @bgruening recommendation).
* ``aggressive`` error if tool exit code is not 0 or ``Exception:``, ``Error:``, or
various messages related to being out of memory appear in the standard error or output.
(The @bgruening recommendation).

For newer tools with ``profile>=16.04``, the default behavior is ``exit_code``.
Legacy tools default to ``default`` behavior described above (erroring if the tool
Expand Down Expand Up @@ -2699,6 +2703,16 @@ deprecated and using the ``$__tool_directory__`` variable is superior.
<xs:documentation></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="oom_exit_code" type="xs:integer">
<xs:annotation>
<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>
</xs:annotation>
</xs:attribute>
<xs:attribute name="use_shared_home" type="xs:string">
<xs:annotation>
<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>
</xs:annotation>
</xs:attribute>
<xs:attribute name="interpreter" type="xs:string" gxdocs:deprecated="true">
<xs:annotation>
<xs:documentation xml:lang="en">This attribute defines the programming language in which the tool's executable file is written. Any language can be used (tools can be written in Python, C, Perl, Java, etc.). The executable file must be in the same directory of the XML file. If instead this attribute is not specified, the tag content should be a Bash command calling executable(s) available in the $PATH. </xs:documentation>
Expand Down Expand Up @@ -2829,7 +2843,7 @@ exclusively use ``filter``s to populate options.
### ``from_data_table``

See Galaxy's
[data tables documentation](https://wiki.galaxyproject.org/Admin/Tools/Data%20Tables)
[data tables documentation](https://galaxyproject.org/admin/tools/data-tables)
for information on setting up data tables.

Once a data table has been configured and populated, these can be easily
Expand Down Expand Up @@ -3131,7 +3145,7 @@ specified by the ``skip`` attribute.</xs:documentation>
<xs:annotation>
<xs:documentation xml:lang="en">Tool data table name to check against
if ``type`` is ``dataset_metadata_in_tool_data``. See the documentation for
[tool data tables](https://wiki.galaxyproject.org/Admin/Tools/Data%20Tables)
[tool data tables](https://galaxyproject.org/admin/tools/data-tables)
and [data managers](https://galaxyproject.org/admin/tools/data-managers/) for
more information.</xs:documentation>
</xs:annotation>
Expand Down Expand Up @@ -3215,17 +3229,28 @@ replace the basic parameter sanitization with custom directives. This tag set is
contained within the ``<param>`` tag set - it contains a set of ``<valid>`` and
``<mapping>`` tags.

### Character presets

The following presets can be used when specifying the valid characters: the
[constants from the ``string`` Python3 module](https://docs.python.org/3/library/string.html#string-constants),
plus ``default`` (equal to ``string.ascii_letters + string.digits + " -=_.()/+*^,:?!"``)
and ``none`` (empty set).
The ``string.letters``, ``string.lowercase`` and ``string.uppercase`` Python2
constants are accepted for backward compatibility, but are aliased to the
corresponding not locale-dependent constant (i.e. ``string.ascii_letters``,
``string.ascii_lowercase`` and ``string.ascii_uppercase`` respectively).

### Examples

This example replaces the invalid character default of ``X`` with the empty
string (so invalid characters are effectively dropped instead of replaced with
``X``) and indicates the only valid characters for this input are ASCII letters,
ASCII digits, and ``_``.
This example specifies to use the empty string as the invalid character (instead
of the default ``X``, so invalid characters are effectively dropped instead of
replaced with ``X``) and indicates that the only valid characters for this input
are ASCII letters, digits, and ``_``.

```
<param name="mystring" type="text" label="Say something interesting">
<sanitizer invalid_char="">
<valid initial="string.letters,string.digits"><add value="_" /> </valid>
<valid initial="string.ascii_letters,string.digits"><add value="_" /> </valid>
</sanitizer>
</param>
```
Expand Down Expand Up @@ -3257,7 +3282,7 @@ input is sanitized at all (the default is ``true``).</xs:documentation>
<xs:attribute name="invalid_char" type="xs:string" default="X">
<xs:annotation>
<xs:documentation xml:lang="en">The attribute specifies the character
used as a replacement for invalid characters.</xs:documentation>
used as a replacement for invalid characters (the default is ``X``).</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
Expand All @@ -3279,19 +3304,20 @@ Contains ``<add>`` and ``<remove>`` tags.]]></xs:documentation>
<xs:attribute name="initial" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">This describes the initial characters to
allow as valid, the default is ``string.letters + string.digits + " -=_.()/+*^,:?!"``</xs:documentation>
allow as valid, specified as a character preset (as defined above). The default
is the ``default`` preset.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="SanitizerValidAdd">
<xs:annotation>
<xs:documentation xml:lang="en">This directive is used to add individual
characters or preset lists of characters. Character must not be allowed as a
valid input for the mapping to occur. Preset lists include default and none as well as those available from string.* (e.g. ``string.printable``).</xs:documentation>
valid input for the mapping to occur.</xs:documentation>
</xs:annotation>
<xs:attribute name="preset" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Add target characters from the list of valid characters (e.g. ``string.printable``).</xs:documentation>
<xs:documentation xml:lang="en">Add the characters contained in the specified character preset (as defined above) to the list of valid characters.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string">
Expand All @@ -3309,7 +3335,7 @@ Preset lists include default and none as well as those available from string.* (
</xs:annotation>
<xs:attribute name="preset" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Remove characters from the list of valid characters (e.g. ``string.printable``).</xs:documentation>
<xs:documentation xml:lang="en">Remove the characters contained in the specified character preset (as defined above) from the list of valid characters.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string">
Expand All @@ -3333,7 +3359,7 @@ Preset lists include default and none as well as those available from string.* (
</xs:sequence>
<xs:attribute name="initial" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">initial character mapping (default is ``galaxy.util.mapped_chars``)</xs:documentation>
<xs:documentation xml:lang="en">Initial character mapping (default is ``galaxy.util.mapped_chars``)</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
Expand Down Expand Up @@ -3928,6 +3954,11 @@ More information can be found on Planemo's documentation for
<xs:documentation xml:lang="en">Directory (relative to working directory) to search for files.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="recurse" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Indicates that the specified directory should be searched recursively for matching files.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="format" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">Format (or datatype) of discovered datasets (an alias with ``ext``).</xs:documentation>
Expand Down Expand Up @@ -4837,9 +4868,11 @@ The following is an example of the <exit_code> tag:

```xml
<stdio>
<exit_code range="2" level="fatal" description="Out of Memory" />
<exit_code range="3:5" level="warning" description="Low disk space" />
<exit_code range="6:" level="fatal" description="Bad input dataset" />
<!-- Catching fatal_oom allows the job runner to potentially resubmit to a resource with more
memory if Galaxy is configured to do this. -->
<exit_code range="2" level="fatal_oom" description="Out of Memory" />
</stdio>
```

Expand Down Expand Up @@ -4889,14 +4922,14 @@ regular expressions can be found under

A regular expression includes the following attributes:

* ``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 follwing values:
* ``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:
* ``stdout``: the regular expression will be applied to stdout;
* ``stderr``: the regular expression will be applied to stderr;
* ``both``: the regular expression will be applied to both stderr and stdout (which is the default case).
* ``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.
* ``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). The level can be log, warning or fatal as described below.
* ``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.
* ``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. If no level is specified, then the fatal error level will be assumed to have occurred.
* ``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.
* ``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. If no level is specified, then the fatal error level will be assumed to have occurred.
* ``description``: Just like its ``exit_code`` counterpart, this is an optional description of the regular expression that has matched.

The following is an example of regular expressions that may be used:
Expand All @@ -4911,6 +4944,12 @@ The following is an example of regular expressions that may be used:
source="stdout"
level="fatal"
description="Unknown error encountered" />
<!-- Catching fatal_oom allows the job runner to potentially resubmit to a resource with more
memory if Galaxy is configured to do this. -->
<regex match="out of memory"
source="stdout"
level="fatal_oom"
description="Out of memory error occurred" />
<regex match="[CG]{12}"
description="Fatal error - CG island 12 nts long found" />
<regex match="^Branch A"
Expand Down