Skip to content

Commit

Permalink
IMP: Add xrefs with bio.tools to XMLs (#54)
Browse files Browse the repository at this point in the history
* Add xrefs with bio.tools to XMLs
  • Loading branch information
bebatut authored Jun 13, 2024
1 parent 3f60e53 commit 324442b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
3 changes: 2 additions & 1 deletion q2galaxy/core/templaters/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from q2galaxy.core.util import XMLNode, galaxy_ui_var, rst_header
from q2galaxy.core.templaters.common import (
make_tool_id, make_tool_name, make_config, make_citations,
make_requirements)
make_requirements, make_xrefs)
from q2galaxy.core.templaters.helpers import signature_to_galaxy


Expand Down Expand Up @@ -76,6 +76,7 @@ def make_tool(conda_meta, plugin, action, test_dir):
tool.append(make_help(plugin, action, test_dir))
tool.append(make_citations(plugin, action))
tool.append(make_requirements(conda_meta, plugin.project_name))
tool.append(make_xrefs())
return tool


Expand Down
7 changes: 7 additions & 0 deletions q2galaxy/core/templaters/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ def make_formats_help(formats):
help_ += f' - {format_.__name__}\n'

return help_


def make_xrefs():
xrefs = XMLNode('xrefs')
xrefs.append(
XMLNode('xref', 'qiime2', type='bio.tools'))
return xrefs
3 changes: 2 additions & 1 deletion q2galaxy/core/templaters/export_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from q2galaxy.core.util import XMLNode, galaxy_esc, pretty_fmt_name, rst_header
from q2galaxy.core.templaters.common import (
make_builtin_version, make_requirements, make_tool_name_from_id,
make_config, make_citations, make_formats_help)
make_config, make_citations, make_formats_help, make_xrefs)


def make_builtin_export(meta, tool_id):
Expand Down Expand Up @@ -170,6 +170,7 @@ def make_builtin_export(meta, tool_id):
tool.append(make_citations())
tool.append(make_requirements(meta, *[p.project_name for p in plugins]))
tool.append(_make_help(known_formats))
tool.append(make_xrefs())

return tool

Expand Down
4 changes: 3 additions & 1 deletion q2galaxy/core/templaters/import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
make_tool_name_from_id,
make_requirements,
make_citations,
make_formats_help)
make_formats_help,
make_xrefs)


def make_builtin_import(meta, tool_id):
Expand Down Expand Up @@ -110,6 +111,7 @@ def make_builtin_import(meta, tool_id):
tool.append(make_citations())
tool.append(make_requirements(meta, *[p.project_name for p in plugins]))
tool.append(_make_help(known_formats))
tool.append(make_xrefs())
return tool


Expand Down
4 changes: 3 additions & 1 deletion q2galaxy/core/templaters/import_fastq_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from q2galaxy.core.templaters.common import (make_builtin_version,
make_tool_name_from_id,
make_requirements,
make_citations)
make_citations,
make_xrefs)


def make_builtin_import_fastq(meta, tool_id):
Expand All @@ -33,6 +34,7 @@ def make_builtin_import_fastq(meta, tool_id):
tool.append(_make_config())
tool.append(make_citations())
tool.append(make_requirements(meta, *[p.project_name for p in plugins]))
tool.append(make_xrefs())
return tool


Expand Down
8 changes: 4 additions & 4 deletions q2galaxy/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

class OrderedTool(collections.OrderedDict):
order = ["description", "macros", "edam_topics", "edam_operations",
"parallelism", "requirements", "code", "stdio", "version_command",
"command", "environment_variables", "configfiles", "inputs",
"request_param_translation", "outputs", "tests", "help",
"citations"]
"parallelism", "xrefs", "requirements", "code", "stdio",
"version_command", "command", "environment_variables",
"configfiles", "inputs", "request_param_translation",
"outputs", "tests", "help", "citations"]
order_attr = ['name', 'argument', 'type', 'format', 'min', 'truevalue',
'max', 'falsevalue', 'value', 'checked', 'optional', 'label',
'help']
Expand Down

0 comments on commit 324442b

Please sign in to comment.