From d18d4019032921c6b6b632b37ccf8d4ccc112ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Fri, 17 May 2024 15:16:08 +0200 Subject: [PATCH] Add xrefs with bio.tools to XMLs --- q2galaxy/core/templaters/action.py | 3 ++- q2galaxy/core/templaters/common.py | 7 +++++++ q2galaxy/core/templaters/export_data.py | 3 ++- q2galaxy/core/templaters/import_data.py | 4 +++- q2galaxy/core/templaters/import_fastq_data.py | 4 +++- q2galaxy/core/util.py | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/q2galaxy/core/templaters/action.py b/q2galaxy/core/templaters/action.py index ec110fc..b79c01e 100644 --- a/q2galaxy/core/templaters/action.py +++ b/q2galaxy/core/templaters/action.py @@ -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 @@ -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 diff --git a/q2galaxy/core/templaters/common.py b/q2galaxy/core/templaters/common.py index e54b84c..c03750f 100644 --- a/q2galaxy/core/templaters/common.py +++ b/q2galaxy/core/templaters/common.py @@ -115,3 +115,10 @@ def make_formats_help(formats): help_ += f' - {format_.__name__}\n' return help_ + + +def make_xrefs(): + xefs = XMLNode('xefs') + xefs.append( + XMLNode('xref', 'qiime2', type='bio.tools')) + return xefs \ No newline at end of file diff --git a/q2galaxy/core/templaters/export_data.py b/q2galaxy/core/templaters/export_data.py index 781d25e..18f2fca 100644 --- a/q2galaxy/core/templaters/export_data.py +++ b/q2galaxy/core/templaters/export_data.py @@ -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): @@ -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 diff --git a/q2galaxy/core/templaters/import_data.py b/q2galaxy/core/templaters/import_data.py index fd06adb..67cc243 100644 --- a/q2galaxy/core/templaters/import_data.py +++ b/q2galaxy/core/templaters/import_data.py @@ -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): @@ -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 diff --git a/q2galaxy/core/templaters/import_fastq_data.py b/q2galaxy/core/templaters/import_fastq_data.py index c01ab55..da74f1b 100644 --- a/q2galaxy/core/templaters/import_fastq_data.py +++ b/q2galaxy/core/templaters/import_fastq_data.py @@ -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): @@ -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 diff --git a/q2galaxy/core/util.py b/q2galaxy/core/util.py index 3a74bd1..bd0b369 100644 --- a/q2galaxy/core/util.py +++ b/q2galaxy/core/util.py @@ -18,7 +18,7 @@ class OrderedTool(collections.OrderedDict): order = ["description", "macros", "edam_topics", "edam_operations", - "parallelism", "requirements", "code", "stdio", "version_command", + "parallelism", "xrefs", "requirements", "code", "stdio", "version_command", "command", "environment_variables", "configfiles", "inputs", "request_param_translation", "outputs", "tests", "help", "citations"]